spacr.flowview.items

Optional Qt graphics items used by the live FlowView panel.

The module is safe to import when PySide6 is unavailable. Constructing a live item in that environment raises an actionable error while the headless model, tracing, and static exporters remain usable.

class spacr.flowview.items.EdgeItem(edge: spacr.flowview.model.Edge, source: spacr.flowview.layout.NodeLayout, target: spacr.flowview.layout.NodeLayout, *, source_running: bool = False)

Placeholder used when PySide6 is unavailable.

Construction raises ImportError with the pip install spacr[flowview] remediation.

With PySide6 available, EdgeItem paints a non-interactive edge.

Parameters:
  • edge – transfer whose volume controls logarithmic stroke width and whose optional label is painted on the curve.

  • source – layout geometry of the source node.

  • target – layout geometry of the target node.

  • source_running – whether to initially paint the dashed marker for an active source stage.

Create the scene item for one edge between stages.

Drawn behind the nodes and inert to the mouse: an edge is context for the stages, not something to select.

Parameters:
  • edge – the edge this item stands for.

  • source – layout of the stage it leaves.

  • target – layout of the stage it enters.

  • source_running – draw it as carrying live output.

spacr/flowview/items.py:75 spacr/flowview/items.py:261

EdgeItem.boundingRect() → PySide6.QtCore.QRectF

Include the complete antialiased stroke in scene updates.

spacr/flowview/items.py:331

EdgeItem.paint(painter: PySide6.QtGui.QPainter, option: object, widget: object = None) → None

Paint a cubic edge, label, and optional running dash pattern.

Parameters:
  • painter – the painter to draw with; its state is saved and restored around the drawing.

  • option – the style option Qt passes; not used.

  • widget – the widget being painted on; not used.

spacr/flowview/items.py:352

EdgeItem.set_source_running(running: bool) → bool

Update the non-colour running marker only when it changed.

Parameters:

running – whether the edge’s source node is running; a true value draws the edge dashed. Coerced to bool.

Returns:

True when the marker changed and a repaint was queued.

spacr/flowview/items.py:337

property EdgeItem.source_running

Whether the source stage is currently active.

spacr/flowview/items.py:326

class spacr.flowview.items.NodeItem(node: spacr.flowview.model.Node, box: spacr.flowview.layout.NodeLayout)

Placeholder used when PySide6 is unavailable.

Construction raises ImportError with the pip install spacr[flowview] remediation.

With PySide6 available, NodeItem paints a selectable node card.

Parameters:
  • node – run-graph node whose label, state, metrics, progress, and optional thumbnail the card displays.

  • box – layout coordinates and dimensions used to position and bound the card.

Create the scene item for one pipeline stage.

Parameters:
  • node – the stage this item stands for.

  • box – where it goes and how big it is.

spacr/flowview/items.py:68 spacr/flowview/items.py:125

NodeItem.boundingRect() → PySide6.QtCore.QRectF

Return the card-local paint bounds.

spacr/flowview/items.py:155

property NodeItem.node_id

Stable model identifier used by the inspector.

spacr/flowview/items.py:150

NodeItem.paint(painter: PySide6.QtGui.QPainter, option: object, widget: object = None) → None

Paint one restrained card using the shared FlowView visual tokens.

Parameters:
  • painter – the painter to draw with; its state is saved and restored around the drawing.

  • option – the style option Qt passes; not used.

  • widget – the widget being painted on; not used.

spacr/flowview/items.py:181

NodeItem.update_node(node: spacr.flowview.model.Node, box: spacr.flowview.layout.NodeLayout) → bool

Replace displayed data, returning whether any paint data changed.

Parameters:
  • node – the node’s new state, label, metrics, progress and thumbnail to display.

  • box – the node’s new layout; the card is moved to its x/y.

Returns:

False when both equal what is already shown, else True.

spacr/flowview/items.py:160

spacr.flowview.items.edge_width(volume: int | None) → float

Map transfer volume to the same restrained logarithmic scale as SVG.

Parameters:

volume – the edge’s transfer volume (objects, files or rows), or None. None or a value <= 0 gives the minimum width of 1.0; larger volumes grow logarithmically up to a cap of 6.0.

spacr/flowview/items.py:97