Class: SagaForge::Dashboard::SagaGraph
- Inherits:
-
Object
- Object
- SagaForge::Dashboard::SagaGraph
- Defined in:
- app/presenters/saga_forge/dashboard/saga_graph.rb
Overview
Turns a Definition#to_graph (structured nodes + typed chain/jump/stay edges) into Cytoscape.js "elements", optionally overlaying one saga instance's status onto the nodes. Rendering-only: no DB, no analysis.
Constant Summary collapse
- RANK =
{"failed" => 3, "stalled" => 2, "processed" => 1}.freeze
Instance Method Summary collapse
-
#initialize(graph, definition, state = nil) ⇒ SagaGraph
constructor
A new instance of SagaGraph.
- #to_h ⇒ Object
Constructor Details
#initialize(graph, definition, state = nil) ⇒ SagaGraph
Returns a new instance of SagaGraph.
9 10 11 12 13 |
# File 'app/presenters/saga_forge/dashboard/saga_graph.rb', line 9 def initialize(graph, definition, state = nil) @graph = graph # SagaForge::Dashboard::Graph @definition = definition @state = state end |
Instance Method Details
#to_h ⇒ Object
15 16 17 |
# File 'app/presenters/saga_forge/dashboard/saga_graph.rb', line 15 def to_h {nodes: node_elements, edges: edge_elements} end |