Expand description
The node graph editor in an application: each edit runs as a step, what the editor reports goes on the journal, and agents read and edit a graph through commands.
| Step | Arguments | Default |
|---|---|---|
graph.connect | graph, from, to ({node, port}), replaces ([{from, to}]), cause | hands the edit to the application |
graph.disconnect | graph, edges ([{from, to}]), cause | hands the edit to the application |
graph.move | graph, moves ([{node, from: [x, y], to: [x, y]}]), cause | hands the edit to the application |
graph.delete | graph, nodes, edges, cause | hands the edit to the application |
graph.add | graph, nodes ([{kind, at: [x, y], copy_of}]), cause | hands the edit to the application |
A before-hook vetoes the edit (the editor drops it) or redirects it (other arguments: another place, another kind); a run-hook’s result is the edit handed back. A parameter’s slider is not a step: its changes go through as they are.
Events on the journal: graph.selection_changed (graph, nodes),
graph.wire_selection_changed (graph, edges),
graph.level_changed (graph, level), graph.refused (graph,
from, to, reason).
Commands, for agents (graph names an editor shown with
show_graph; without it, the only one): graph.read (the graph
as drawn, the wires selected as selected_edges), graph.edit (an
edit, done at the editor’s next frame as the user’s: type-checked,
then its step; a connect whose replaces names a wire there moves
that wire’s end, one edit), graph.select (nodes and wires),
graph.view (fit, a level, a node to focus) and graph.export (the
graph as an SVG image, from the copy the editor kept at its last
frame; PNG and PDF, base64-encoded, behind the graph-png and
graph-pdf features).
Structs§
- Graphs
- The node editors shown with an application, by name: their last snapshot and the requests waiting for their next frame.
Constants§
- CMD_
GRAPH_ EDIT - CMD_
GRAPH_ EXPORT - CMD_
GRAPH_ READ - CMD_
GRAPH_ SELECT - CMD_
GRAPH_ VIEW - EVENT_
GRAPH_ LEVEL - EVENT_
GRAPH_ REFUSED - EVENT_
GRAPH_ SELECTION - Events published on the journal (not steps: nothing to veto).
- EVENT_
GRAPH_ WIRE_ SELECTION - EXPORT_
FORMATS - The formats
graph.exportwrites, as built:svg, thenpngandpdfwith thegraph-pngandgraph-pdffeatures. - GRAPHS
- The registry, a service of
ImagingPlugin. - STEP_
GRAPH_ ADD - STEP_
GRAPH_ CONNECT - STEP_
GRAPH_ DELETE - STEP_
GRAPH_ DISCONNECT - STEP_
GRAPH_ MOVE
Functions§
- graph
- A node editor hook (
GraphEditor::on_edit) running each edit as itsgraph.*step, the editor namedname. - show_
graph - Shows a node editor as part of the application: its edits run their
steps, its events go on the journal, agents’ requests reach it, and
graph.readandgraph.exportsee what it drew.namenames it to steps and commands. - specs
- The steps, as
ImagingPlugindeclares them. - step_of
- The step of an edit (
None: a parameter, not a step).