SchematicGraph class

Schematic-specific graph that parallels the hierarchy API.

This holds ELK-ready data structures that can be:

  1. Serialized to JSON for ELK layout
  2. Passed directly to Dart ELK layout engine

The graph maintains both visible and hidden (collapsed) nodes/edges, supporting toggle/expand operations without re-parsing.

Constructors

SchematicGraph({required LayoutNode root, Map<String, LayoutNode>? nodeMap, HierarchyService? hierarchy})
Constructor for SchematicGraph.
SchematicGraph.fromJson(String jsonString, {HierarchyService? hierarchy})
Parse a SchematicGraph from JSON.
factory

Properties

expandedNodeIds Set<String>
Get all currently expanded node IDs (derived from tree state).
no setter
hashCode int
The hash code for this object.
no setterinherited
hierarchy HierarchyService?
Reference to the parallel hierarchy service (optional).
final
hyperedges List<LayoutHyperedge>
Collect all hyperedges from the entire node tree.
no setter
nodeMap Map<String, LayoutNode>
Map for fast lookup: node ID → LayoutNode.
final
root LayoutNode
Root node of the schematic graph.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
visibleNodes List<LayoutNode>
Get all currently visible nodes (flattened).
no setter
visiblePorts List<ElkPort>
Get all currently visible ports (flattened).
no setter

Methods

collapsePartialExpansion(String nodeId) bool
Collapse a partially expanded node back to fully collapsed.
collapsePortThrough(String nodeId, String portId) bool
Collapse the children and edges that expandPortThrough would reveal.
collapsePortThroughRecursive(String nodeId, String portId, {Set<(String, String)>? visited}) bool
Recursively collapse a port through trivial gates and across already-opened module boundaries.
collapsePortThroughWithRemoved(String nodeId, String portId) → (bool, Set<String>)
Collapse the children and edges that expandPortThrough would reveal.
convertToBlocksOnly(String nodeId) bool
Convert a fully expanded node to blocks-only mode.
convertToBlocksOnlyRecursive(String nodeId) bool
Recursively convert a fully expanded node to blocks-only mode, then do the same for every revealed non-primitive descendant.
copy() SchematicGraph
Create a deep copy of this graph.
directDriverSignalPath(String wireName, String scopePath) String?
Returns the directly connected port that drives wireName in scopePath.
expandChild(String nodeId, String childName) bool
Partially expand a specific hidden child by name.
expandNonPrimitives(String nodeId, {bool includeEdges = true}) bool
Expand all non-primitive (submodule) hidden children of a node.
expandNonPrimitivesRecursive(String nodeId) bool
Recursively expand non-primitive children of a node and their descendants in blocks-only mode (no edges).
expandPath(List<String> pathSegments, {String? targetWireName}) bool
the container of that wire: the container is revealed via expandChild, then expandWire is called on it. When null the last segment is treated as the final target itself (module search).
expandPort(String nodeId, String portId) bool
Incrementally expand a single port of a collapsed child module.
expandPortThrough(String nodeId, String portId) bool
Incrementally expand a port with pass-through traversal.
expandPortThroughRecursive(String nodeId, String portId, {Set<(String, String)>? visited}) bool
Recursively expand a port through trivial gates and across already-opened module boundaries.
expandWire(String nodeId, String wireName) bool
Partially expand a node to reveal a specific wire (hyperedge) by name.
expansionSnapshot() → ExpansionSnapshot
Capture a complete expansion snapshot including both fully-expanded nodes and partially-expanded (blocks-mode) nodes with their visible child/edge sets.
getNode(String id) LayoutNode?
Get a node by ID (O(1) hash lookup).
initNodeParents() → void
Set parent references for all nodes.
isExpanded(String nodeId) bool
Check if a node is currently expanded.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
occurrenceByAddress(OccurrenceAddress addr) LayoutNode?
Look up a node by its OccurrenceAddress.
resolvePathToNodeId(List<String> pathSegments) String?
Batch-expand an entire hierarchy path in a single pass.
restoreExpansionSnapshot(ExpansionSnapshot snapshot) → void
Restore a previously captured ExpansionSnapshot on this graph.
signalNameForPort(String nodeId, String portId) String?
Look up the signal (hyperedge) name that connects to portId at the parent scope of the node that owns the port.
toggleNode(String nodeId) bool
Toggle a node's expansion state.
toggleNodeRecursive(String nodeId) bool
Recursively toggle a node and all its descendant submodules.
toJsGraph() String
Convert to JSON string for ELK layout serialization.
toJson() Map<String, dynamic>
Convert to JSON map.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited