Directed Graph Editor
This interactive graph editor displays a directed node-link diagram built with D3 v3 and rendered as SVG. Users can add nodes by clicking empty space and create edges by dragging between nodes, with keyboard shortcuts for selecting, moving, and modifying edge direction or reflexivity. The force layout, initialized via `d3.layout.force`, continuously updates node positions and draws arrow markers for directed edges. The code uses D3's data joins (`path.data`, `circle.data`) to handle dynamic updates and applies CSS classes for visual states like selected edges.
AI-generated descriptionClick in the open space to add a node, drag from one node to another to add an edge.
Ctrl-drag a node to move the graph layout.
Click a node or an edge to select it.
When a node is selected: R toggles reflexivity, Delete removes the node.
When an edge is selected: L(eft), R(ight), B(oth) change direction, Delete removes the edge.
To see this example as part of a larger project, check out Modal Logic Playground!
forked from <a href='http://bl.ocks.org/meetamit/'>meetamit</a>'s block: <a href='http://bl.ocks.org/meetamit/e63d04bd79d929f9cbaf'></a>
forked from <a href='http://bl.ocks.org/Saminu/'>Saminu</a>'s block: <a href='http://bl.ocks.org/Saminu/8985b5f65f0b4d0b32d5cd65e804fed0'>Model Diagram</a>