spacr.qt.widgets.workflow_diagram¶
Interactive workflow diagrams built from the shared module and artifact map.
Solid arrows describe documented handoffs. Dashed arrows connect matching artifact types or pathway prerequisites; their explanations distinguish these from verified handoffs. Nodes and edges never start analysis. Hover or select one to read its description in the owning dialog’s fixed details area.
Classes¶
A diagram window with a rounded, 80-percent opaque background. |
|
Show every mapped module and directed input/output connection. |
|
Zoomable, pannable map whose selection emits explanatory HTML. |
Functions¶
|
Return documented handoffs and explicitly distinguished inferred links. |
|
Build a resizable, scrollable explanation area shared by diagrams. |
|
Build a vertical pane divider with a thin blue, draggable handle. |
|
Explain a connection and link both endpoint APIs. |
|
Describe a module, its API link and its input/output artifacts. |
|
Open or raise the window's single nonmodal spaCR workflow diagram. |
|
Read the bundled module map, or an explicitly supplied JSON path. |
Module Contents¶
- class spacr.qt.widgets.workflow_diagram.DiagramDialog(parent=None)[source]¶
Bases:
PySide6.QtWidgets.QDialogA diagram window with a rounded, 80-percent opaque background.
- Parameters:
parent – owning widget; defaults to None for a top-level window.
Keep the background translucent without reducing text opacity.
- class spacr.qt.widgets.workflow_diagram.SpacrFlowchartDialog(parent=None, data=None)[source]¶
Bases:
DiagramDialogShow every mapped module and directed input/output connection.
- Parameters:
parent – owning main window.
data – workflow map override; None reads the bundled map.
Build the network, keyboard selectors, view controls and details.
- class spacr.qt.widgets.workflow_diagram.WorkflowView(data, keys=None, steps=None, parent=None, *, compact=False)[source]¶
Bases:
PySide6.QtWidgets.QGraphicsViewZoomable, pannable map whose selection emits explanatory HTML.
- Parameters:
data – shared workflow map.
keys – optional subset of module keys for one pathway.
steps – optional pathway dependencies; no sequence links are invented.
parent – owning widget.
compact – show module titles only; full input/output descriptions remain in the emitted explanation. Suitable for the complete network.
Build nodes and directed connections once; hover changes only ink.
- describe_edge(edge, *, center=False)[source]¶
Describe a connection and highlight its two endpoint modules.
- Parameters:
edge – graphical edge item from this view’s edges list.
center – when True, fit the edge and both endpoint nodes into the viewport and disable automatic fitting; defaults to False.
- Returns:
None; emits explanation HTML and the activated signal.
- describe_node(key, *, center=False)[source]¶
Highlight a module and emit its explanation without running analysis.
- Parameters:
key – module key present in this view.
center – when True, reset the zoom and center the module, disabling automatic fitting; defaults to False.
- Returns:
None; emits explanation HTML and the activated signal.
- fit_diagram()[source]¶
Fit the complete diagram with preserved aspect ratio and resume auto-fit.
- Returns:
None; updates the view transform and automatic resize behavior.
- resizeEvent(event)[source]¶
Refit on resize while automatic fitting remains enabled.
Manual zoom or explicit centering disables automatic fitting until
fit_diagram()is called again.- Parameters:
event – Qt resize event forwarded to the base view.
- Returns:
None.
- showEvent(event)[source]¶
Fit once when a viewport first acquires a useful size.
- Parameters:
event – Qt show event forwarded to the base view.
- Returns:
None.
- spacr.qt.widgets.workflow_diagram.connections(data, keys=None, steps=None)[source]¶
Return documented handoffs and explicitly distinguished inferred links.
- Parameters:
data – shared workflow map.
keys – optional module subset; None includes every mapped module.
steps – pathway steps, whose
afterdependencies define its edges. None builds the full network, including matching artifact types.
- Returns:
dictionaries with
from,to,artifacts,handoffandkind(documented, compatible or prerequisite). Inferred compatibility describes matching types, not an automatic file import.
- spacr.qt.widgets.workflow_diagram.details_box(parent=None)[source]¶
Build a resizable, scrollable explanation area shared by diagrams.
- Parameters:
parent – owning widget; defaults to None.
- Returns:
QTextBrowser with external API links enabled and introductory text. Its minimum height is six body-font lines; the splitter sets its height.
- spacr.qt.widgets.workflow_diagram.diagram_splitter(parent=None)[source]¶
Build a vertical pane divider with a thin blue, draggable handle.
- Parameters:
parent – owning dialog or container.
- Returns:
non-collapsing QSplitter; callers add the diagram and details.
- spacr.qt.widgets.workflow_diagram.edge_description(data, edge)[source]¶
Explain a connection and link both endpoint APIs.
- Parameters:
data – shared workflow map containing both endpoint modules.
edge – connection record returned by
connections().
- Returns:
escaped, translated HTML describing artifact locations and whether the edge is a documented handoff, a matching data type or a pathway prerequisite. Inferred links do not establish file compatibility.
- spacr.qt.widgets.workflow_diagram.node_description(data, key)[source]¶
Describe a module, its API link and its input/output artifacts.
- Parameters:
data – shared workflow map.
key – module key present in the map.
- Returns:
escaped, translated HTML for the fixed details panel.
- spacr.qt.widgets.workflow_diagram.show_spacr_flowchart(window)[source]¶
Open or raise the window’s single nonmodal spaCR workflow diagram.
- Parameters:
window – owning main window, which retains the dialog for reuse.
- Returns:
the shown and activated
SpacrFlowchartDialog.
- spacr.qt.widgets.workflow_diagram.workflow_map(path=None)[source]¶
Read the bundled module map, or an explicitly supplied JSON path.
- Parameters:
path – JSON file; None selects the bundled module_workflows.json.
- Returns:
the parsed map; modules and artifacts must be dictionaries. The bundled map also supplies pathways and connections.
- Raises:
OSError – the file cannot be read.
ValueError – invalid JSON or missing module/artifact dictionaries.