config_choices¶
panel_flowdash.config_choices
¶
The values a node's config fields may take, offered as choices in the inspector.
A component offers choices two ways. A config param can declare that it names a column of one of the node's inputs::
field = param.String(metadata={"flowdash": {"choices": "columns", "of": "data"}})
and a @register(config_choices=hook) hook can compute choices for any
field from the node's config and live inputs, e.g. the tables of a wired
database source. The hook is called as hook(config, inputs), sync or
async, like check_config, and returns {field: choices} where choices
are a list of values, a {label: value} dict or a :class:Choices. Its
choices replace the declared ones of the same field. Choices under the name
of an input are offered for the literal value it takes while unconnected.
A config field edited as a spec (see :mod:panel_flowdash.spec_settings)
offers choices per setting, under the field's name and the setting's path,
e.g. "spec.encoding.x.field", declared on the setting or returned by the
hook.
Columns are read from DataFrames directly, and from other values through the
columns reader of their port type, see
:func:~panel_flowdash.register_port_type.
Code fields, see :mod:panel_flowdash.ui.code_field, are completed the same
way while typing: a @register(config_completions=hook) hook returns
{field: words}, and without one a code field completes the column names
of the node's tabular inputs.
CHECK_TIMEOUT = 10.0
module-attribute
¶
logger = logging.getLogger('panel_flowdash')
module-attribute
¶
Choices
dataclass
¶
The values one config field may take.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
options
|
list[Any] | dict[str, Any]
|
The values, or a |
list()
|
restrict
|
bool
|
Whether only these values are allowed. With |
True
|
types
|
dict[Any, str] | None
|
A short type name per value, e.g. |
None
|
options = field(default_factory=list)
class-attribute
instance-attribute
¶
restrict = True
class-attribute
instance-attribute
¶
types = None
class-attribute
instance-attribute
¶
labelled()
¶
Return the options as {label: value}, each label showing the value's type if known.
values()
¶
Return the values, without labels.
ComponentSpec
dataclass
¶
Full specification of a component's ports and metadata.
check_config = None
class-attribute
instance-attribute
¶
component_id
instance-attribute
¶
config = field(default_factory=list)
class-attribute
instance-attribute
¶
config_choices = None
class-attribute
instance-attribute
¶
config_completions = None
class-attribute
instance-attribute
¶
config_editor = None
class-attribute
instance-attribute
¶
config_state_class = None
class-attribute
instance-attribute
¶
contract = None
class-attribute
instance-attribute
¶
default_size
instance-attribute
¶
description
instance-attribute
¶
framed = None
class-attribute
instance-attribute
¶
icon
instance-attribute
¶
inputs
instance-attribute
¶
max_size = None
class-attribute
instance-attribute
¶
min_size = None
class-attribute
instance-attribute
¶
outputs
instance-attribute
¶
port_aliases = field(default_factory=dict)
class-attribute
instance-attribute
¶
tags
instance-attribute
¶
title
instance-attribute
¶
resolve_name(name)
¶
Return the current name of a port or config field that may have been renamed.
A name that is still a port or config field is never redirected, so an alias cannot shadow a live name.
FlowDash
¶
Bases: Viewer
A dataflow wiring canvas and dashboard layout editor over a set of components.
The editor pairs a ReactFlow canvas, where components are placed and their
typed ports wired together, with a tile grid that lays the same components
out as a dashboard. Everything to do with routing, pages and identity lives
in :class:~panel_flowdash.app.FlowDashApp instead, so this can be embedded
anywhere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
The components to offer. Accepts a decorated function, a |
None
|
|
settings_class
|
A subclass of :class: |
required |
Examples:
>>> editor = FlowDash(components=[ticker_select, price_chart])
>>> src = editor.add_component("Components/ticker_select")
>>> dst = editor.add_component("Components/price_chart")
>>> editor.connect(src, "ticker", dst, "ticker")
True
agent_state = param.ClassSelector(class_=RunState, default=None, allow_None=True, doc='\n The panel-agents ``RunState`` holding the agent\'s runs, which\n "How was this made?" shows. None uses the edit history\'s, which an\n assistant shares when history is on.')
class-attribute
instance-attribute
¶
ask = param.Boolean(default=False, doc="\n Whether Ask is open. In view mode it docks the Explore view's feed\n left of the dashboard or the report, resizable by its right edge;\n on a phone, which has no room for it, Ask is the Explore view\n itself. In edit mode it is the host's assistant, see `assistant`.\n Edit mode starts with Ask as view mode left it, and view mode gets\n back the Ask it had as edit mode ends, whatever happened to the\n assistant meanwhile; `set_ask_aside` closes it for something taking\n its place in view mode without changing what view mode gets back.")
class-attribute
instance-attribute
¶
ask_docked
property
¶
Whether Ask is docked left of the dashboard or the report: open, in view mode, on a wide screen.
assistant = param.Boolean(default=False, doc="\n Whether a host docks an assistant beside the editor that Ask opens in\n edit mode, as FlowDashApp does with its agent's drawer. Without one,\n Ask is offered in view mode only.")
class-attribute
instance-attribute
¶
authorize_admin = param.Callable(default=None, doc='\n Called with a keyword ``fresh`` to decide whether this session\n administers the project. Node actions registered as ``admin_only``\n (see :mod:`panel_flowdash.node_actions`) are offered while it says so\n with ``fresh=False``, which should be cheap as menus ask it on every\n edit, and run only if it says so with ``fresh=True``, which should\n check again, e.g. with the project file read afresh. `FlowDashApp`\n supplies one. None makes no one an admin.')
class-attribute
instance-attribute
¶
authorize_component = param.Callable(default=None, doc="\n Called with a component's `RegistryEntry` to decide whether this\n session may use it. Components it refuses are left out of the palette\n and `add_component` raises `PermissionError` for them; a loaded\n dashboard shows them as locked placeholders that are never created\n and are saved back unchanged. `FlowDashApp`\n supplies one that evaluates each component's ``allow_*``/``deny_*``\n rules and ``authorize`` callback against the signed-in user. None\n allows every component.")
class-attribute
instance-attribute
¶
authorize_dashboard = param.Callable(default=None, doc='\n Called with the stored `AssetModel` and the access it needs,\n ``"view"`` or ``"edit"``, to decide whether this session may still\n read or overwrite it. `save` asks for ``"edit"`` against the\n dashboard\'s current sharing rules, so edit rights revoked from another\n session take effect without reloading; reloading and discarding\n changes ask for ``"view"``. `FlowDashApp` supplies one that checks the\n signed-in user. None allows both.')
class-attribute
instance-attribute
¶
authorize_rename = param.Callable(default=None, doc="\n Called with the stored `AssetModel` to decide whether this session\n may rename it, as an administrator of the dashboard. `set_title` asks\n before renaming and `save` before storing a new title. `FlowDashApp`\n supplies one that checks the signed-in user. None lets only the\n dashboard's owner, the editor's `user`, rename it.")
class-attribute
instance-attribute
¶
breakpoints = param.List(default=[768, 1200], doc='Responsive breakpoints for the tile grid.')
class-attribute
instance-attribute
¶
can_redo
property
¶
Whether :meth:redo has an undone edit to redo.
can_undo
property
¶
Whether :meth:undo has an edit to undo.
code_drafts = param.Boolean(default=False, doc='\n Whether the code panel holds edits that have not been run. Managed by\n the editor; like ``dirty``, watch it to prompt before discarding work.')
class-attribute
instance-attribute
¶
code_panel
property
¶
The :class:~panel_flowdash.ui.code_panel.CodePanel docked under the canvas, made on first use.
code_panel_node = param.String(default=None, allow_None=True, constant=True, doc='The id of the node the code panel under the canvas shows, or None while it is closed.')
class-attribute
instance-attribute
¶
code_panel_open
property
¶
Whether the code panel shows a node, under the canvas or in the sidecar's Spec tab.
component_specs
property
¶
Specs for the available components, keyed by component id.
components = param.Parameter(default=None, doc='\n The components to offer in the editor. A decorated function, a Viewer\n subclass, a mapping of explicit component ids, a project directory, or a\n list mixing any of those. Read at construction time.')
class-attribute
instance-attribute
¶
context = copy_context(self.context)
class-attribute
instance-attribute
¶
controls_bar = param.Boolean(default=True, doc='\n Whether to show the views of components registered with\n ``sidebar=True`` beside the tiles (see `controls_position`), while\n the dashboard is viewed or laid out. Turn it off to render the\n `sidebar` views in a layout of your own instead. In full screen the\n editor shows them either way, since nothing around it is visible, so\n leave them out of your layout while `fullscreen` is on.')
class-attribute
instance-attribute
¶
controls_position = param.Selector(default='top', objects=['top', 'left'], doc='\n Default of the ``controls_position`` dashboard setting for dashboards\n that do not store one: where the views of components registered with\n ``sidebar=True`` go. "top" puts them in one slim row above the tiles,\n which suits the few filters most dashboards have; "left" stacks them\n in a collapsible panel left of the tiles, which suits many controls.')
class-attribute
instance-attribute
¶
dashboard = param.ClassSelector(class_=AssetModel, default=None, doc='\n The dashboard currently loaded. Updated by `load`, `load_model`,\n `new_dashboard` and `save`. May be passed at construction as either a\n AssetModel or, when a store is configured, a dashboard id or title.')
class-attribute
instance-attribute
¶
dirty = param.Boolean(default=False, doc='\n Whether the canvas has unsaved changes. Managed by the editor; watch it\n to prompt before discarding work.')
class-attribute
instance-attribute
¶
edit_history
property
¶
The versions of the open dashboard, one per edit; see :mod:panel_flowdash.history.
Its state is the panel-agents RunState they are published in,
to show them in an ArtifactView or share with an AgentRunner.
editable = param.Boolean(default=True, doc='\n Whether the dashboard can be edited. When False the side panel is hidden\n and the tile grid is shown locked, giving a pure view of the dashboard.')
class-attribute
instance-attribute
¶
edited = param.Event(doc='Triggered after each edit is recorded in its turn.')
class-attribute
instance-attribute
¶
explore = param.Boolean(default=False, doc="\n Whether the Explore view is shown in place of the workspace: the same\n as ``surface == 'explore'``. Setting it to False returns to the\n workspace. Ask (`ask`) docks the same feed beside it instead.")
class-attribute
instance-attribute
¶
explore_feed
property
¶
The :class:~panel_flowdash.explore.ExploreFeed the Explore view shows, made on first use.
feed_shown
property
¶
Whether the Explore view's feed is on screen, docked in Ask or as the Explore view.
filters
property
¶
The dashboard's global filters as a copy, the views they exclude by instance id.
See :mod:panel_flowdash.global_filters.
fullscreen = param.Boolean(default=False, doc="\n Whether the dashboard is presented on its own: the tiles and the\n controls bar fill the screen, without the dashboard bar or the page\n around the editor, and a small overlay shows the title, the health and\n an exit button while the pointer moves. Turning it on from a click\n also puts the editor into the browser's full screen; otherwise, e.g.\n when set at load time, the editor covers the browser window. Leaving\n the browser's full screen turns it off. Only available in view mode:\n switching to edit mode turns it off.")
class-attribute
instance-attribute
¶
graph
property
¶
The live dataflow graph wiring the placed components together.
groups
property
¶
The groups on the canvas by id, as copies, nodes by instance id.
See :mod:panel_flowdash.groups.
header_layout = param.Selector(default='compact', objects=['compact', 'full'], doc='\n Default of the ``header_layout`` dashboard setting for dashboards that\n do not store one: how the dashboard bar is laid out. "compact" keeps\n it to one line, which a FlowDashApp with the default navigation folds\n into its top bar; "full" gives it a row of its own with a large title\n over the description, the health chip and when the dashboard was last\n refreshed.')
class-attribute
instance-attribute
¶
history = param.Boolean(default=True, doc="\n Whether every edit becomes a version of the dashboard's edit history,\n which `undo` and `redo` move through and the store keeps across\n sessions (see `history_limit`). Read at each edit.")
class-attribute
instance-attribute
¶
history_coalesce = param.Number(default=BURST_SECONDS, bounds=(0, None), doc="\n Seconds without an edit that end a batch of the person's edits in\n the edit history, so a burst of edits, such as a drag, typing into\n a config field or a few quick changes, is one version. An edit of the\n agent, a save, undo and redo end a batch too, and each request to the\n agent is one version. Zero records each of the person's edits on its own.")
class-attribute
instance-attribute
¶
history_limit = param.Integer(default=500, bounds=(1, None), allow_None=True, doc="\n The most versions a dashboard's stored history keeps; older ones are\n dropped. None keeps them all.")
class-attribute
instance-attribute
¶
history_max_bytes = param.Integer(default=HISTORY_MAX_BYTES, bounds=(0, None), allow_None=True, doc="\n About how many bytes of dashboard YAML a dashboard's stored history\n keeps; the oldest versions are dropped past it, the latest is always\n kept. None keeps versions however large they are.")
class-attribute
instance-attribute
¶
history_max_days = param.Number(default=90, bounds=(0, None), allow_None=True, doc="\n How many days the store keeps a version of a dashboard's history.\n None keeps versions however old they are.")
class-attribute
instance-attribute
¶
import_unknown_components = param.Boolean(default=True, doc='\n Whether importing a file may add or change items whose component this\n editor does not offer. They are imported as they are, shown as\n unavailable and saved back unchanged, so a dashboard keeps them until\n the component is offered again. Set it to False when users are\n restricted by giving each a smaller set of components rather than\n through `authorize_component`: a component one user lacks may be one\n another has, so such an item is then treated like a restricted one,\n keeping its stored config and wiring or being left out of the import.\n `authorize_component` is the better mechanism, since it also shows a\n known but denied component as restricted rather than unavailable.')
class-attribute
instance-attribute
¶
include_builtin_components = param.Boolean(default=True, doc='Include Select, MultiChoice and Slider in the component palette.')
class-attribute
instance-attribute
¶
include_page_dialog = param.Boolean(default=True, doc="\n Whether the editor lays out the session's page dialog, the one\n `open_dialog` and `confirm` use. Set it to False when the surrounding\n page already places `page_dialog()` itself, as `FlowDashApp` does; the\n dialog must appear in only one layout. Read when the workspace is built,\n so it needs a served session to take effect.")
class-attribute
instance-attribute
¶
inspect_outputs = param.Boolean(default=False, doc="\n Whether each tile in the dashboard grid gets an Inspect action that\n opens a side sheet with the current value of every output the\n component publishes. The action is shown in the dashboard view and in\n preview, not while arranging tiles. It reveals outputs the tile itself\n may not display, so while the editor is ``read_only`` (in a\n ``FlowDashApp``, for anyone who may not edit the dashboard) it is only\n shown if the dashboard's ``viewers_can_inspect`` setting allows it. A\n component can add its own explanation per output by defining\n ``__flowdash_inspect__(self, port)``.")
class-attribute
instance-attribute
¶
is_chat
property
¶
Whether the loaded asset is a chat, which shows its own bar in place of the dashboard bar.
is_report
property
¶
Whether the loaded asset is a standalone report, which has no tile grid.
layout
property
¶
The current tile layout, whether or not the grid is on screen.
One entry per tile, keyed by the tile's instance_id.
mode = param.Selector(default='wiring', objects=['wiring', 'dashboard', 'split'], doc="\n Which workspace is shown: 'wiring' for the ReactFlow canvas, 'dashboard'\n for the tile grid and 'split' for both side by side, with the canvas\n on the left. Only meaningful while `editable`.")
class-attribute
instance-attribute
¶
node_previews = param.Boolean(default=False, doc='\n Default of the ``node_previews`` dashboard setting for dashboards that\n do not store one: whether each card on the wiring canvas previews its\n current value below its ports, e.g. the first rows of a table or a\n sparkline of a series, rather than summarizing it in one line.')
class-attribute
instance-attribute
¶
notifications = param.Boolean(default=True, doc='\n Whether to surface user-facing messages as Panel notifications. When\n disabled (or when no notification area exists) messages are logged.')
class-attribute
instance-attribute
¶
parameters
property
¶
The parameters of the open dashboard by name, as copies, nodes by instance id.
Parameters on nodes the user may not use are left out. See
:mod:panel_flowdash.parameters.
popup_hover_delay = param.Integer(default=500, bounds=(0, None), doc='Delay in milliseconds before a hover value preview opens.')
class-attribute
instance-attribute
¶
popup_trigger = param.ObjectSelector(default='click', objects=['click', 'hover', 'none'], doc='\n Whether live port values open on click, hover, or not automatically.\n On hover the popups cover the nodes the pointer passes over, so they\n open on click by default.')
class-attribute
instance-attribute
¶
preview = param.Boolean(default=False, doc="\n Lock the tile grid as an end user sees it without leaving edit mode.\n Only meaningful while `editable` and in 'dashboard' mode. The\n dashboard bar offers no control for it, since view mode is the preview.")
class-attribute
instance-attribute
¶
project = param.ClassSelector(class_=Project, default=None, allow_None=True, doc='\n The project file the app reads, which node actions get to save a\n section of it with ``Project.set``. `FlowDashApp` supplies its own.')
class-attribute
instance-attribute
¶
propagate_failures = param.Boolean(default=False, doc='\n Carry a failing output or edge transform downstream instead of leaving\n the connected inputs on their last value. An input declared in\n `handles_failures` receives the failure as a `param.ReactiveError`; the\n tile of a component with any other failed input is covered by a message\n naming the failure, and its outputs pass the failure on. Read at\n construction time.')
class-attribute
instance-attribute
¶
provenance = param.Boolean(default=True, doc='\n Whether a node an agent\'s request created offers "How was this\n made?", in its tile\'s More menu and in the inspector, opening a side\n sheet with that request: its question, model calls, tool calls and\n the versions it published, from the run the node\'s origin turn\n names. People who may not edit the dashboard see the request\'s\n shape without its content.')
class-attribute
instance-attribute
¶
provenance_labels = param.Boolean(default=False, doc='\n Whether the views of nodes that report their provenance (see\n :mod:`panel_flowdash.node_actions`), e.g. "Metric: capacity" or "Ad\n hoc", show it as a chip in view mode too. While the dashboard is\n edited the chip is always shown, and so is a warning (a provenance\n whose level is "warning", e.g. that a row limit cut the numbers).')
class-attribute
instance-attribute
¶
read_only = param.Boolean(default=False, doc='\n Whether saving is forbidden. The canvas can still be rearranged but\n `save` refuses. Set this from your own authorization logic.')
class-attribute
instance-attribute
¶
refresh = param.Event(doc='\n Triggered every ``settings.refresh_period`` seconds while a dashboard is\n shown, and whenever the user clicks the refresh button. Components that\n show live data subscribe to it, see `current_dashboard`.')
class-attribute
instance-attribute
¶
refuse_placement = param.Callable(default=None, doc='\n Called with a component id to ask whether this session may add new\n instances of it: None if it may, else why not, e.g. ``"turned off by\n an admin"``. A refused component is left out of the palette, the\n command palette and the agent\'s components, and `add_component`\n raises `PermissionError` for it. Unlike `authorize_component`, it\n leaves the instances a dashboard already places alone, and they keep\n working; editors are told once when a dashboard they edit has some.\n `FlowDashApp` supplies one from the project file\'s ``components``\n section.')
class-attribute
instance-attribute
¶
report
property
¶
The dashboard's report as a copy, nodes by instance id, or None if it has none.
Blocks referring to nodes, groups or turns the dashboard no longer has
are left out. A dashboard without a report reads as the one
:func:~panel_flowdash.report.report_blocks derives from its layout.
See :mod:panel_flowdash.report.
report_view
property
¶
The :class:~panel_flowdash.ui.report_view.ReportView the Report view shows, made on first use.
retitled = param.Event(doc="Triggered when the open dashboard's title changes in the editor, e.g. by set_title or undo.")
class-attribute
instance-attribute
¶
run_pending = param.Callable(default=None, allow_None=True, doc="\n Called with the id of a pending turn when an editor runs its question\n from the report, e.g. to ask the assistant, which then answers it\n through :meth:`answer_pending`. None, the default without an agent,\n leaves the report's Run buttons disabled.")
class-attribute
instance-attribute
¶
running_pending = param.List(default=[], item_type=str, doc='\n The ids of the pending turns whose question is being run, from the\n click on Run until the request answering it ends. Their Run buttons\n show that they are running and cannot be pressed again.')
class-attribute
instance-attribute
¶
saved = param.Event(doc='Triggered after a dashboard is successfully saved.')
class-attribute
instance-attribute
¶
settings = param.ClassSelector(class_=DashboardSettings, constant=True, doc="\n The dashboard-wide settings, an instance of `settings_class`. Filled\n from the loaded dashboard and written back on save. Edited in edit mode\n through the dashboard bar's Settings form.")
class-attribute
instance-attribute
¶
settings_class = param.ClassSelector(class_=DashboardSettings, default=DashboardSettings, is_instance=False, doc='\n The class of `settings`. Subclass `DashboardSettings` to add your own\n dashboard-wide parameters. Read at construction time.')
class-attribute
instance-attribute
¶
show_in_editor = param.Callable(default=None, allow_None=True, doc="\n Called with a tile's instance id when someone viewing the dashboard\n asks to see that component in the editor, from the tile's More menu or\n its failure message. The action is offered in view mode while this is\n set and `read_only` is False; the caller decides what showing a\n component in the editor means, e.g. switching to edit mode.")
class-attribute
instance-attribute
¶
sidebar = Children(default=[], doc='\n Views of placed components that declare `sidebar=True`, which are kept\n out of the tile grid. Managed by the editor; render these wherever your\n layout wants them.')
class-attribute
instance-attribute
¶
store = param.ClassSelector(class_=BaseAssetStore, default=None, doc='\n Dashboard persistence backend. Accepts a store instance or a path to a\n SQLite file. When None the editor is ephemeral and `save` merely returns\n the model for the caller to persist.')
class-attribute
instance-attribute
¶
surface = param.Selector(default='workspace', objects=list(SURFACES), doc="\n What the editor shows, in view and in edit mode: 'workspace' for the\n canvas or the tile grid (as `mode` and `editable` say), 'explore' for\n the Explore view, the dashboard's turns as a feed with the outputs\n each made (see :mod:`panel_flowdash.explore`), or 'report' for the\n Report view, the dashboard read as a document (see\n :mod:`panel_flowdash.report`). The views of the tiles move between\n them, so only one is ever on screen.")
class-attribute
instance-attribute
¶
tile_cards = param.Boolean(default=True, doc='\n Default of the ``tile_cards`` dashboard setting for dashboards that do\n not store one: whether tiles are drawn as framed cards. Each dashboard\n can change it in its settings.')
class-attribute
instance-attribute
¶
tile_titles = param.Boolean(default=False, doc="\n Default of the ``tile_titles`` dashboard setting for dashboards that do\n not store one: whether a tile's card shows its title.")
class-attribute
instance-attribute
¶
toolbar = param.Boolean(default=True, doc='\n Whether to render the dashboard bar above the workspace. In view mode\n it holds the title, Refresh and the View/Edit control; in edit mode\n the Dataflow/Layout tabs and the Settings, Discard, Save and Done\n actions. The component palette is shown regardless.')
class-attribute
instance-attribute
¶
toolbar_extra = Children(default=[], doc="\n Additional items placed in the dashboard bar's actions, before the\n View/Edit control in view mode and after Settings in edit mode.")
class-attribute
instance-attribute
¶
turns
property
¶
The turns of the open dashboard, oldest first, as copies.
A turn is one request to the agent, or one batch of the person's edits
made between requests; each node records the turn that created it as
its origin. The editor opens a turn at the first edit that needs one:
an edit made in an agent's tool call joins the turn of that agent run,
any other edit the person's open turn. See :mod:panel_flowdash.turns.
user = param.String(default='local', doc='Principal recorded as the owner of dashboards created here.')
class-attribute
instance-attribute
¶
value_repr = param.Callable(default=None, allow_None=True, doc='Optional callable converting a live port value to a Panel viewable or displayable value.')
class-attribute
instance-attribute
¶
add_component(component_id, config=None, position=None, instance_id=None, *, arrange=False)
¶
Place a component on the canvas and return its instance id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Id of a registered component. |
required |
config
|
dict | None
|
Design-time configuration overrides for this instance. |
None
|
position
|
dict | tuple | None
|
Canvas position as |
None
|
instance_id
|
str | None
|
Id for the new instance, which is also its node's name in the
dashboard YAML, as a node a YAML file names gets it. It must be a
valid node name without |
None
|
arrange
|
bool
|
Without a position, place the node by its dataflow, beside the
nodes it is connected to, and move it again as it is connected
until someone moves it by hand, and lay its tile out with the
tiles of its kind (see :mod: |
False
|
Returns:
| Type | Description |
|---|---|
str
|
The new instance's id, for use with |
Raises:
| Type | Description |
|---|---|
KeyError
|
If component_id is not a registered component. |
ValueError
|
If instance_id is not a valid node name or is taken. |
PermissionError
|
If |
answer_pending(turn_id, run_id=None)
¶
Make the pending turn turn_id the turn of the agent request run_id's next edits.
The request's edits so far stay in its own turn. Its next edit runs the pending turn: the turn records the request, and the nodes the request creates get it as their origin, so the question's block in the report shows them as its answer. Without an edit the turn stays pending. The turn is returned.
Raises:
| Type | Description |
|---|---|
ValueError
|
If no pending turn has the id turn_id. |
arrange_canvas()
¶
Lay out every node on the canvas by its dataflow, as one edit.
Sources go on the left and views on the right, in columns by their depth in the dataflow, ordered to reduce crossing edges. Positions set by hand are replaced too; that is what the request is for.
arrange_layout(order=None, style='grid', sizes=None)
¶
Lay out every visible tile by its kind, as one edit.
Controls go first, then KPIs, both at their default width, charts in two columns, tables at full width and the tiles of data sources and transforms last; text tiles stay in front of the tile they preceded. Hidden tiles stay hidden. Layouts made for narrower breakpoint bands are dropped, so those bands follow the arranged layout again.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
Sequence[str] | None
|
Instance ids of tiles to put first, in this order within their kind; the other tiles follow in their current order. |
None
|
style
|
str
|
|
'grid'
|
sizes
|
Mapping[str, Mapping[str, float]] | None
|
The |
None
|
ask_in_report(question, index=None)
¶
Add a question to the report, not run yet, before the block at index (last for None).
The question becomes a pending turn and a turn block showing it, in one undoable edit, and its id is returned. A dashboard without a report of its own gets the derived one first.
Raises:
| Type | Description |
|---|---|
ValueError
|
If question is empty or index is not a place in the report. |
bind_parameters(values, *, timeout=None)
¶
Write values into their parameters' fields, as one edit, after checking them.
Each value is read as its parameter's type, so text such as "10"
for a number parameter is accepted. Before anything changes, the
contract of each parameter's component checks the value against what
the parameter recorded, the node's config takes the value, and the
component's config check (register(check_config=...)) passes the
result. Values that change nothing record no edit. Returns the
warnings of the contracts.
Raises:
| Type | Description |
|---|---|
ParameterError
|
If a name is not a parameter the user can see, a value is not of its type or not one the field takes, or a config check refuses it; nothing is changed. |
ContractError
|
If a contract refuses a value; nothing is changed. Its problems name the nodes that would fail. |
check_parameters(values)
¶
Return what the contracts find wrong with binding values, without binding them.
Includes warnings, see :class:~panel_flowdash.parameters.ContractProblem.
Raises:
| Type | Description |
|---|---|
ParameterError
|
If a name is not a parameter or a value is not of its type. |
clear()
¶
Remove every component and edge from the canvas.
close_code_panel()
¶
Close the code panel, holding a draft it shows until the field is opened again.
collapse_group(group_id, collapsed=True)
¶
Draw a group as one node with its ports, or expand it again, as one edit.
Expanding pushes the nodes to its right and below aside by the room the expanded group needs, and collapsing moves back the nodes it pushed that have not been moved since.
connect(source_id, source_port, target_id, target_port, transform=None, *, adjust_target=False)
¶
Wire an output port to an input port.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transform
|
list[dict[str, Any]] | None
|
Steps applied to the values carried along the edge, see
:meth: |
None
|
adjust_target
|
bool
|
Let the target component adjust its config to the new edge
through its |
False
|
Returns:
| Type | Description |
|---|---|
bool or str
|
|
customize_report()
¶
Make the report derived from the dashboard its own, to be edited, and return whether it did.
The derived blocks are written into the report as one undoable edit; the title stays the dashboard's until it is changed. A dashboard that already has a report keeps it.
declare_parameter(name, node, field, type='value', description=None)
¶
Declare a parameter on a config field of a node, or redeclare one, and return it.
The parameter's expects is computed by the contract of the node's
component, if it has one (register(contract=...)).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The parameter's name. |
required |
node
|
str
|
The instance id of the node. |
required |
field
|
str
|
The config field, or a dotted path into one, e.g. |
required |
type
|
str
|
One of :data: |
'value'
|
description
|
str | None
|
What the parameter is, for whoever binds it. |
None
|
Raises:
| Type | Description |
|---|---|
ParameterError
|
If the name, field or type is malformed, the node does not exist, is one the user may not use, or the field is not one of its component's config fields, or the name is taken by a parameter the user may not see. |
delete_group(group_id)
¶
Remove a group and its nodes from the dashboard; returns the removed instance ids.
disconnect(source_id, source_port, target_id, target_port)
¶
Remove the edge between two ports.
disconnect_input(instance_id, port)
¶
Remove every edge into the input port of instance_id, as one edit.
dispose()
¶
Tear down the editor, disposing every placed component.
Empties the dataflow graph, the canvas and the tile grid, then calls the
dispose hook of each component that was placed, once. The editor is
left empty and consistent, so it can still be used afterwards.
An editor created inside a server session disposes its components automatically when that session ends. In a notebook, under pyodide or for an editor created outside a session, call this yourself.
drop_code_drafts()
¶
Forget the edits the code panel holds without running them, e.g. when leaving the dashboard.
edit_spec(instance_id, field=None)
¶
Open the spec of the node instance_id in the code panel, showing the canvas if needed.
Where the browser keeps the panel in the sidecar, or the window is too narrow for it under the canvas, the sidecar's Spec tab shows it in the tab already open. Returns False to viewers.
end_agent_turns(run_id=None)
¶
End the turns of the agent's requests, so the next request's edits start a new turn.
The dashboard tools call it when a request ends, whether it finished, failed or was cancelled. Each request's edits then become one version of the edit history. With run_id only that request's turn ends, so another agent's request running at the same time keeps its own.
end_ask_aside()
¶
Let view mode keep Ask as it shows now, once what set_ask_aside made room for is gone.
E.g. the host's assistant closed in view mode without editing: Ask stays off, and edit mode ending later does not bring it back.
end_turn()
¶
End the turn of the person's edits, so their next edit starts a new turn.
Call it when the person sends a request to an agent, which the FlowDash assistant does, so the edits made before and after the request form separate turns.
ensure_components_loaded(component_ids=None)
¶
Import component modules and build their specs, if not done already.
Called automatically whenever specs are needed. On a live server prefer
:meth:ensure_components_loaded_async, which imports off the event loop.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_ids
|
Iterable[str] | None
|
Import only these components. Defaults to the whole catalog, which is what the editor palette needs; viewing a dashboard passes just the components it places, so an unrelated component doing work at import time cannot slow it down. |
None
|
ensure_components_loaded_async(component_ids=None)
async
¶
Async :meth:ensure_components_loaded, importing off the event loop.
If the awaiting task is cancelled (e.g. by a newer navigation) the imports already running finish in their thread, but nothing is marked loaded and their import errors are not reported; the next call retries whatever is still unimported and reports its errors then.
exclude_from_filter(column, instance_id, excluded=True)
¶
Opt the view instance_id out of the global filter on column, or back in.
expand_group(group_id)
¶
Expand a collapsed group, see :meth:collapse_group.
export_dashboard(*, questions=True)
¶
Return the canvas as a JSON-serializable dict, as the Download button writes it.
The dashboard id, owner and sharing rules are omitted, so the file can
be loaded into any dashboard with :meth:import_dashboard. With
questions False its turns leave out what was asked of the agent,
see :func:export_model.
group_nodes(instance_ids, label=None, *, group_id=None, collapsed=False)
¶
Frame nodes together on the canvas as one group, as one edit, and return its id.
The nodes keep their place, config, connections and tiles. A group
can be collapsed into one node showing the ports its connections
cross, see :meth:collapse_group.
Raises:
| Type | Description |
|---|---|
ValueError
|
If there are no nodes, a node is not on the canvas or already in a group, or group_id is taken or not a valid name. |
group_of(instance_id)
¶
Return the id of the group a node is in, or None.
import_dashboard(data, *, keep_turns=False)
¶
Replace the canvas with an exported dashboard, as dropping its file does.
data is a downloaded dashboard file, as JSON text or a dict, or a
dashboard in the YAML format (see :mod:panel_flowdash.agent). The
loaded dashboard keeps its id, owner, title and sharing rules, so
saving writes the imported contents to it. Without a loaded dashboard
the file's title is used and saving creates a new one. The canvas is
marked dirty.
The import is an edit of its own, in the turn of whoever makes it (see
:attr:turns). By default the file's turns and node origins replace
the canvas's, and nodes the file gives no origin get the import's
turn. With keep_turns the file's turns and origins are ignored
instead: the canvas keeps its turns, nodes already on it keep their
origin and new nodes get the import's turn. That is how the agent's
changes are loaded, so it cannot rewrite who made what. Nodes are
matched by name: a node given another component under the same name
keeps its origin, and a renamed node is a new node with the import's
turn as its origin. A file that changes nothing opens no turn.
Raises:
| Type | Description |
|---|---|
ValueError
|
If data is neither a dashboard export nor a dashboard in the YAML format. |
input_values(instance_id)
¶
Return the literal values set on the unconnected inputs of a placed node, by port.
A connected input's literal is listed too; it applies once the connection is removed.
is_admin(*, fresh=False)
¶
Whether this session administers the project, as :attr:authorize_admin says.
With fresh the host checks again from its sources, e.g. the project file read afresh, as before an admin action runs.
keep_tile_placement(instance_id)
¶
Keep the tile of the node instance_id where it is when the agent's request ends.
While a request runs, tiles it adds are laid out only when it ends (all at once). A host that places the tile itself during the request calls this, so the layout at the end does not move it again.
later_turns(instance_id)
¶
Return copies of the turns after a node's origin whose summary says they changed it.
load(asset_id)
¶
Load a dashboard from the configured store, by id or title.
load_model(model)
¶
Hydrate the canvas from an :class:AssetModel.
Items and edges that cannot be restored, such as a component this editor does not offer or an edge whose port no longer exists, do not abort the load. They are shown as placeholders and saved back unchanged.
Only the components the model places are imported, so a component that
does work at import time cannot slow down dashboards that do not use it.
On a live server prefer :meth:load_model_async, which imports off the
event loop.
load_model_async(model)
async
¶
Async :meth:load_model, importing the model's components off the event loop.
made_by_agent(instance_id)
¶
Whether "How was this made?" applies: an agent's request created the node.
may_rename()
¶
Whether this session may rename the open dashboard, see :attr:authorize_rename.
A dashboard that is not stored yet may always be renamed.
new_dashboard(title)
¶
Start a new empty dashboard, persisting it if a store is configured.
node_actions(instance_id, *, admin=None)
¶
Return the registered node actions offered for a node to the person using the editor.
A restricted node or a placeholder gets none, nor does an action
outside the editor's mode (see NodeAction.modes); an
admin_only action needs :meth:is_admin, and an action whose
applies fails is left out. admin says whether the session is
an admin, which :meth:is_admin is asked otherwise.
node_component(instance_id)
¶
Return the live component of the node instance_id, or None.
None for a function component, which has no instance, and for an id
that is not on the canvas. The reverse of :meth:node_id.
node_id(component)
¶
Return the id of the node component was created for, or None if it is not one of this editor's.
Only components that are Viewer classes are known by instance;
a function component can call :func:current_node_id from its body.
node_inputs(instance_id, port=None)
¶
Return the edges into the node instance_id, or only those into its input port.
Each is a dict with the source node's instance id, its
source_port, the target (instance_id), the target_port
and the edge's transform steps, in the order they were connected.
Changing the dicts changes nothing on the canvas.
node_name(instance_id)
¶
Return the name the node instance_id has in the dashboard YAML, e.g. "sales_chart".
node_names()
¶
Return the YAML names of the canvas's nodes, by instance id.
They are worked out again only when the nodes change.
node_origin(instance_id)
¶
Return the id of the turn that created a node, or None if no turn is recorded.
node_provenance(instance_id)
¶
Return the provenance a node's numbers have, and the id of the node that reports it.
That is the node's own __flowdash_provenance__ or else the
nearest upstream node's, following its inputs breadth first, each
hook told the edges between it and this node (via), see
:mod:panel_flowdash.node_actions. None when no node reports one.
note_own_run(run_id)
¶
Record that the person using this editor asked for run run_id, so it is never redacted for them.
open_code_panel(instance_id, field=None, *, focus=True)
¶
Edit the spec field field of the node instance_id in the code panel.
field defaults to the node's first spec field, a code field or a spec dict; a node without one shows its result only. The panel opens under the canvas where it was last docked there and fits, otherwise in the sidecar's Spec tab, which then shows the node. Returns False, leaving the panel as it was, where it cannot be shown: to viewers, or for a node or field it cannot edit. Callers then fall back to the field's own editor.
open_spec_in_sidecar(instance_id)
¶
Move the code panel into the sidecar's Spec tab, remembered for the browser, showing instance_id.
origin_turn(instance_id)
¶
Return a copy of the turn that created a node, or None if no turn is recorded.
parameters_schema()
¶
Return the JSON Schema of a form binding the parameters, each defaulting to its field's value.
See :func:~panel_flowdash.parameters.parameters_schema.
provenance_warning(instance_id)
¶
Return the nearest warning about a node's numbers, which tiles, reports and exports show.
Unlike :meth:node_provenance it looks past nearer provenance that
is no warning, e.g. a capped analysis read through a node labelled
"Derived": a label says what the nearest source is, a warning holds
for everything computed from the numbers it is about. The walk
stops :data:_PROVENANCE_DEPTH (64) edges up, so a warning further
up than that is not found.
redo()
¶
Redo what the last :meth:undo undid, all of it, and return whether anything was redone.
Redo is available until the next edit.
Raises:
| Type | Description |
|---|---|
PermissionError
|
As for :meth: |
refresh_provenance(nodes=None)
¶
Offer anew the node actions and provenance labels of every node, or of nodes and those downstream.
After an edit the editor does this itself for the nodes the edit may
have changed. Call it when what a __flowdash_provenance__ hook
or an action's applies reads changes outside the dashboard, e.g.
a metric a project file defines being deleted. nodes are names as
in the dashboard YAML, or instance ids.
remove_component(instance_id)
¶
Remove a placed component along with its edges and its tile.
remove_parameter(name)
¶
Remove a parameter; the node keeps the value its field holds.
Returns whether it existed; a parameter the user may not see counts as missing.
rename_group(group_id, label)
¶
Change the label a group's header shows, as one edit.
report_shows(instance_id)
¶
Whether a block of the report shows node instance_id, itself or with its group.
run_node_action(instance_id, key)
¶
Run the node action key on a node, checking again that it is offered to this session.
An admin_only action asks :attr:authorize_admin afresh first.
Raises:
| Type | Description |
|---|---|
PermissionError
|
If the action is not offered for the node, e.g. outside its modes
or an |
run_redacted(run_id)
¶
Whether a request is shown to the person viewing without its content.
Their own requests are always shown in full. Anyone else's are redacted for people who may not edit the dashboard, and when the request created or changed a node whose component this person may not use.
save(title=None)
¶
Persist the current canvas and return the saved model.
With no store configured the model is still built and returned, so the caller can persist it themselves.
The owner, sharing rules and (unless title is given) title are taken
from the stored dashboard rather than from the copy loaded into the
editor, so saving never reverts a rename or sharing change made from
another session since the dashboard was opened. If the dashboard is no
longer stored (deleted from another session, or loaded from elsewhere),
saving creates it with this editor's :attr:user as the owner, so it
is never recreated under the previous owner's name.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If :attr: |
AssetConflictError
|
If the store holds a newer revision of the dashboard than the one
loaded into the editor, because another session saved it since.
Nothing is written; reload the dashboard or use :meth: |
save_as(title)
¶
Persist the current canvas as a new dashboard titled title and switch to it.
The new dashboard is owned by this editor's :attr:user and not
shared with anyone. With no store configured the model is still built
and returned.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If :attr: |
set_ask_aside()
¶
Close Ask in view mode for something taking its place, such as the host's assistant.
View mode still gets Ask back as edit mode ends, e.g. after the assistant's first edit, as it does after Ask is closed in edit mode.
set_default(instance_id, config)
¶
Give the node instance_id config values its component chose as a starting point.
A component calls it for a node :func:placement_context reports as
"new", from its __init__ or function body, or later, e.g. once
an input arrives. The values are saved with the dashboard like any
config, and are part of the edit that brought them about: the
placement, or the connection that delivered the input, so one undo
takes back both. Values set outside any edit, e.g. by an input that
arrives on its own, are recorded right away as a config edit of their
own, so undoing a later edit keeps them. Called from a thread other
than the session's event loop, they are set and recorded on the loop,
as an edit of their own, and before a save.
Only fields still at their declared default take a value, so a node that arrives configured, e.g. one the agent adds or a duplicate, keeps its config. Returns whether any field took one: False, changing nothing, also while a dashboard is loaded or a version restored, to viewers and in a preview, and for a node or a config field the node does not have.
set_edge_transform(source_id, source_port, target_id, target_port, transform)
¶
Replace the transform applied along an edge.
Each step is a dict naming an op from
:data:panel_flowdash.transforms.TRANSFORMS plus its arguments, for
example [{"op": "column", "column": "capacity"}, {"op": "aggregate",
"how": "sum"}]. Pass an empty list to remove the transform.
Returns:
| Type | Description |
|---|---|
bool or str
|
|
set_filter_value(column, value)
¶
Change what the global filter on column keeps for whoever is viewing, without an edit.
value is a list of values for a select filter, [start, end]
for a range, or None to keep every row.
set_filters(filters, *, label=None)
¶
Replace the dashboard's global filters, views they exclude by instance id, as one undoable edit.
Raises:
| Type | Description |
|---|---|
ValueError
|
If filters are malformed or exclude a node the dashboard does not have. |
set_input_value(instance_id, port, value)
¶
Give an input of a placed node a literal value, used while nothing is connected to it.
A connection always wins over the literal, which applies again once the connection is removed. None removes the literal, and the input goes back to its default. The change is recorded in the edit history.
Raises:
| Type | Description |
|---|---|
KeyError
|
If no component is placed under instance_id. |
ValueError
|
If the component has no such input, the input cannot hold a literal, e.g. a DataFrame, or it refuses value. |
set_input_values(instance_id, values)
¶
Set or remove (with None) the literal values of several inputs, as one edit.
Every value is checked before any is set, so a refused one changes
nothing; see :meth:set_input_value.
set_report(report, *, label=None, coalesce=True)
¶
Replace the dashboard's report, nodes by instance id, as one undoable edit.
None removes it, so the dashboard reads as its derived report again. label describes the edit in the history and the turn's summary, "Changed the report" by default, or a list of labels for an edit making several changes. A pending turn the report no longer refers to goes with its block, as it was only ever asked in the report. With coalesce False the edit is a version of its own, never batched with the quick edits before or after it, as for a structural change such as moving a block.
When the agent makes the edit, each block it adds or changes gets
its turn as origin, and the blocks it leaves as they were keep
theirs, whatever report gives.
Raises:
| Type | Description |
|---|---|
ValueError
|
If report is malformed or refers to a node, group or turn the dashboard does not have. |
set_title(title)
¶
Rename the open dashboard as an edit: undoable, and stored when the dashboard is saved.
Raises:
| Type | Description |
|---|---|
PermissionError
|
If the dashboard is read-only or this session may not rename it. |
show_ask()
¶
Bring the Explore view's feed on screen: Ask docked in view mode, the Explore view otherwise.
show_how_made(instance_id, turn_id=None)
¶
Show the agent request that created a node, or the later turn turn_id that changed it.
It shows the request's span (question, model calls, tool calls and
published versions) while :attr:agent_state holds the run's steps,
and what the turn records otherwise, followed by the turns that
changed the node later. In edit mode it opens the sidecar's History tab
for the node; in view mode it opens the side sheet. Requests are
redacted as :meth:run_redacted decides, and when the node's
component is one the person may not use.
show_in_report(instance_id, label=None)
¶
Append a block showing node instance_id to the report, unless a block shows it.
This is how a standalone report shows what is added to it, as a dashboard places a tile. Returns whether a block was added.
title_renamed(title)
¶
Note that the open dashboard was renamed to title in the store, e.g. by the Rename action.
Undo then keeps that name rather than bringing back the old one.
to_model(title=None)
¶
Serialize the current canvas into an :class:AssetModel.
The returned model is detached from the editor, so this is the seam to use when persisting to something other than the configured store.
toggle_palette()
¶
Fold the component palette beside the canvas, or open it and focus its search field.
toggle_split()
¶
Show the canvas and the tile grid side by side, or return to the previous tab.
trigger_refresh()
¶
Trigger refresh with every change it causes delivered as one propagation pass.
A node fed by two sources that both run again then runs once, with both new values, instead of once per source.
undo(*, whole_runs=True)
¶
Undo the last edit to the dashboard and return whether anything was undone.
A person's edits are undone one at a time, a gesture such as a drag
as one edit. The edits an agent made for one request are undone
together, back to the dashboard as it was before the request, unless
whole_runs is False. Undo reaches back into earlier sessions, as far
as the store keeps the dashboard's history (see :attr:history_limit).
Undoing restores the dashboard's turns and node origins as they were, and never brings back a node whose component the user may not use or that this editor does not offer.
Raises:
| Type | Description |
|---|---|
PermissionError
|
If undoing would bring back such a node; nothing changes. |
ungroup(group_id)
¶
Remove a group's frame, keeping its nodes where they are, as one edit.
Returns the instance ids of the nodes that were in it.
_dtype_name(dtype)
¶
_spec_settings(spec)
¶
Return the settings of each config field of spec edited as a spec, by field.
as_choices(value)
¶
Return value, a list, {label: value} dict or :class:Choices, as Choices, or None.
code_fields(spec)
¶
Return the names of the config fields of spec edited as code.
column_choices(value, port_type=None)
¶
Return the columns of value as :class:Choices, or None if it is not tabular.
column_reader(name)
¶
Return the columns callable registered for a port type or the nearest supertype.
columns_of(value, port_type=None)
¶
Return the (name, type) columns of value, or None if it is not tabular.
The columns reader of port_type is used when one is registered;
otherwise a DataFrame's columns are listed with their dtypes as type names
(integer, number, boolean, datetime, string).
compute_choices(spec, config, inputs, *, editor=None, timeout=CHECK_TIMEOUT, hook=True, declared=None)
async
¶
Return the choices of each config field of a node of spec with config and inputs.
With hook off only the declared choices are returned, which needs no
call of the component's config_choices. declared passes those
computed before, so they are not read again. A hook that fails, takes
longer than timeout or returns something else than a mapping is logged
and offers nothing; the declared choices stay.
compute_completions(spec, config, inputs, *, editor=None, timeout=CHECK_TIMEOUT)
async
¶
Return the words each code field of a node of spec completes while typing.
The component's config_completions hook is asked when it has one; its
words replace the default, the columns of the node's tabular inputs, for
the fields it names. A hook that fails, takes longer than timeout or
returns something else than a mapping is logged and the default stays.
declared_choices(spec, inputs)
¶
Return the choices the config fields of spec declare, for a node with inputs.
The choices of a setting of a spec field are keyed by the field and the
setting's path, e.g. "spec.encoding.x.field".
declared_settings(parameter)
¶
Return the settings a param's FlowDash metadata declares for a spec form, or None.
A param.Dict with metadata={"flowdash": {"widget": "spec", "settings": [...]}}
declares them.
has_choices(spec)
¶
Whether nodes of spec may offer choices for their config.
input_columns(spec, inputs)
¶
Return the columns of the tabular inputs of a node of spec, each once, as Choices.
node_choices(editor, instance_id, *, timeout=CHECK_TIMEOUT, hook=True, declared=None)
async
¶
Return the choices of each config field of a placed node, from its config and live inputs.
hook and declared are passed on to :func:compute_choices.
node_completions(editor, instance_id, *, timeout=CHECK_TIMEOUT)
async
¶
Return the words each code field of a placed node completes, from its config and live inputs.
node_config(editor, instance_id, spec)
¶
Return the effective config of a placed node.
node_inputs(editor, instance_id, spec)
¶
Return a placed node's input values, leaving out unset and failed ones.
run_hook(hook, config, inputs, *, editor=None, timeout=CHECK_TIMEOUT)
async
¶
Call a hook(config, inputs) of a component the way checks are called and return its result.
An async hook runs on the event loop, a sync one in a worker thread of
this module's pool. Either kind is given timeout seconds, raising
:class:TimeoutError if it takes longer or no worker is free in time.
While it runs :func:~panel_flowdash.current_dashboard returns editor.
spec_fields(spec)
¶
Return the names of the config fields of spec edited in the code panel, in order.
These are its code fields and the dicts declaring a spec form, see
:func:~panel_flowdash.spec_settings.declared_settings: what the node
does, e.g. a query or a chart spec, rather than a setting of it.
takes_literal(port)
¶
Whether port can hold a literal value.