Class: ChronoForge::Dashboard::CytoscapeGraph
- Inherits:
-
Object
- Object
- ChronoForge::Dashboard::CytoscapeGraph
- Defined in:
- app/presenters/chrono_forge/dashboard/cytoscape_graph.rb
Overview
Builds Cytoscape.js "elements" (nodes + edges) from overlay node hashes and Definition edges. Unlike a text-DSL renderer, this emits STRUCTURED data the client consumes directly (via JSON.parse), so node labels and guard text need no escaping — the whole class of Mermaid string-grammar bugs disappears. Rendering-only: no DB, no analysis.
Instance Method Summary collapse
-
#initialize(nodes, edges) ⇒ CytoscapeGraph
constructor
A new instance of CytoscapeGraph.
- #to_h ⇒ Object
Constructor Details
#initialize(nodes, edges) ⇒ CytoscapeGraph
Returns a new instance of CytoscapeGraph.
9 10 11 12 |
# File 'app/presenters/chrono_forge/dashboard/cytoscape_graph.rb', line 9 def initialize(nodes, edges) @nodes = nodes @edges = edges end |
Instance Method Details
#to_h ⇒ Object
14 15 16 |
# File 'app/presenters/chrono_forge/dashboard/cytoscape_graph.rb', line 14 def to_h {nodes: node_elements, edges: edge_elements} end |