spacr.flowview.panel

Optional, self-contained Qt live panel for a FlowView collector.

class spacr.flowview.panel.FlowGraphicsView(scene: PySide6.QtWidgets.QGraphicsScene, parent: PySide6.QtWidgets.QWidget | None = None)

Placeholder used when PySide6 is unavailable.

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

With PySide6, FlowGraphicsView provides panning and bounded zoom.

Parameters:
  • scene – graphics scene displayed by the view.

  • parent – optional Qt parent widget.

Create the graph view, transparent all the way down.

Three surfaces have to give way for the page to show through: the widget, its viewport’s auto-fill, and the background brush. Clearing only the scene’s brush left this one painting the near-black rectangle over it.

Parameters:
  • scene – the scene to show.

  • parent – parent widget, or None.

spacr/flowview/panel.py:67 spacr/flowview/panel.py:153

FlowGraphicsView.wheelEvent(event: PySide6.QtGui.QWheelEvent) → None

Translate vertical wheel movement into bounded zoom.

Parameters:

event – the wheel event; only its vertical angleDelta is read, and it is accepted when the zoom changed and ignored otherwise.

spacr/flowview/panel.py:216

property FlowGraphicsView.zoom

Current bounded zoom multiplier.

spacr/flowview/panel.py:190

FlowGraphicsView.zoom_by(wheel_delta: int) → bool

Apply one wheel zoom step and report whether the view changed.

Parameters:

wheel_delta – vertical wheel angle delta; only its sign is used (positive zooms in by ZOOM_STEP, negative zooms out, zero does nothing), with the zoom held within MIN_ZOOM to MAX_ZOOM.

spacr/flowview/panel.py:195

class spacr.flowview.panel.FlowViewPanel(collector: spacr.flowview.collector.Collector, parent: PySide6.QtWidgets.QWidget | None = None, *, refresh_interval_ms: int = 50, export_path_provider: Callable[[], str | pathlib.Path | None] | None = None, auto_start: bool = True, embedded: bool = False)

Placeholder used when PySide6 is unavailable.

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

With PySide6, FlowViewPanel renders and inspects live snapshots.

Parameters:
  • collector – event collector whose snapshots the panel renders.

  • parent – optional Qt parent widget.

  • refresh_interval_ms – positive timer interval, in milliseconds, between automatic refreshes.

  • export_path_provider – optional callback returning the export destination, or None to cancel. Without one, export opens a Qt file dialog.

  • auto_start – whether to start the refresh timer after the initial forced render.

  • embedded – whether to use a transparent, borderless surface and hide the panel title for embedding in another screen.

Build the FlowView panel: the graph over the inspector, split.

Parameters:
  • collector – the run collector this panel draws.

  • parent – parent widget, or None.

  • refresh_interval_ms – how often the graph is re-read.

  • export_path_provider – called for the export path instead of opening a file dialog; None asks the user.

  • auto_start – begin refreshing immediately.

  • embedded – drop the title and the panel’s own rounded surface, for use inside a section that already draws one.

Raises:

ValueError – if refresh_interval_ms is not positive – a zero-interval timer would refresh continuously.

spacr/flowview/panel.py:74 spacr/flowview/panel.py:302

FlowViewPanel.closeEvent(event: PySide6.QtGui.QCloseEvent) → None

Stop timers and release scene-owned graphics objects.

Parameters:

event – the close event; it is passed on unchanged to the base-class handler.

spacr/flowview/panel.py:634

property FlowViewPanel.graph

Most recent immutable snapshot displayed by the panel.

spacr/flowview/panel.py:447

FlowViewPanel.refresh(*, force: bool = False) → bool

Drain events and repaint after a change or whenever force=True.

Parameters:

force – repaint even when the collector revision is unchanged.

Returns:

whether the graph was repainted.

spacr/flowview/panel.py:468

FlowViewPanel.reset_user_height() → None

Give the height back to the content and the layout.

spacr/flowview/panel.py:595

FlowViewPanel.set_user_height(height: int) → None

Hold the panel at height pixels until it is given back.

Clamped at the floor the graph and inspector need between them, so a drag that runs off the top cannot squeeze the panel to nothing and leave no edge to drag back.

Parameters:

height – requested panel height in pixels; converted with int and raised to INSPECTOR_MIN_HEIGHT plus the grip height when smaller.

spacr/flowview/panel.py:580

FlowViewPanel.start() → bool

Start refreshing at the configured interval; report if started.

spacr/flowview/panel.py:452

FlowViewPanel.stop() → bool

Stop collection, returning whether a running timer was stopped.

spacr/flowview/panel.py:460

spacr.flowview.panel.inspector_text(node: spacr.flowview.model.Node) → str

Format complete, copyable details for the selected node.

Parameters:

node – the graph node to describe; its label, identifier, kind, state, timings, progress, parameters, metrics and error are written one field per line, with — for values not yet known.

spacr/flowview/panel.py:117