Skip to content

placeholders

panel_flowdash.placeholders

Stand-ins for the saved items and edges a dashboard cannot restore.

A dashboard may reference a component that is no longer installed, one that fails to build, or an edge whose ports no longer exist or no longer fit. Rather than dropping them, the editor keeps the saved data untouched, so it is written back unchanged on the next save, and shows a placeholder in their place.

PLACEHOLDER_NODE_TYPE = 'flowdash:placeholder' module-attribute

AssetEdge dataclass

A connection between two component ports, with the transform steps it applies.

source instance-attribute

source_port instance-attribute

target instance-attribute

target_port instance-attribute

transform = field(default_factory=list) class-attribute instance-attribute

from_dict(data) classmethod

to_dict()

Placeholder dataclass

Why a saved item is shown as a placeholder, and what the placeholder says.

Parameters:

Name Type Description Default
reason str

A short machine-readable cause, e.g. "missing" (the component is not offered) or "failed" (it raised while being placed).

required
title str

Label of the placeholder node and heading of its tile.

required
message str

Text shown on the node and the tile.

required
private bool

Whether the saved item must not be described at all. Its id, config and port names are then kept out of the page; edges touching it are only counted, never listed.

False

message instance-attribute

private = False class-attribute instance-attribute

reason instance-attribute

title instance-attribute

UnresolvedEdge dataclass

A saved edge that could not be wired, kept to be saved unchanged.

edge instance-attribute

reason instance-attribute

broken_edges_panel(lines, hidden, on_discard)

Build the listing of saved edges that could not be wired, with a discard action.

escape_markdown(text)

Escape text so a Markdown pane shows it verbatim, without HTML, formatting or math.

markdown_pane(object='', **params)

Return a Markdown pane for FlowDash's own markup, with MathJax turned off in the browser.

Interpolate user or data text into object only through :func:escape_markdown.

placeholder_view(placeholder)

Build what a placeholder node and tile display.

A component the viewer may not use reads as data they may not access does, without the warning a missing component gets.

restricted_placeholder(text=RESTRICTED_TEXT, **params)

Return the neutral message a tile shows in place of data the viewer may not access.

For a component that receives failures itself (handles_failures) and finds one :func:is_restricted, so it looks like the tiles FlowDash covers. FlowDash also shows it, with its own text, for a component the viewer may not use.

text_alert(text, **params)

Return a pmui.Alert whose message is text shown as literal text.

The message goes to the alert's own object: passed positionally a string becomes a child pane chosen by pn.panel, which renders a string ending in .png as a remote image and other strings as Markdown with math.

unresolved_summary(items, edges)

Phrase how many saved items and edges were kept unresolved, or None if none were.