Skip to main content

Module yaml

Module yaml 

Source
Expand description

A reference GraphModel kept in a YAML file, for applications that have no graph model of their own (the graph-yaml feature).

YamlGraph reads a graph file and is the model the editor draws; YamlGraph::apply is its one mutation point: each Edit the editor hands back (or a graph.* step lets through) changes the file’s text where the edit lands, and nothing else. What the editor did not touch is written back as it was read: the order of keys, comments, blank lines, quoting, and keys egui-pop does not know.

$extensions:
  org.egui-pop.graph: {version: 1}
groups:
  detail: Detail
kinds:
  load:
    title: Load
    outputs: {image: image}
  blur:
    title: Blur
    inputs: {image: image}
    outputs: {image: image}
    params:
      radius: {label: Radius, value: 2, min: 0, max: 20, step: 0.1, unit: px}
nodes:
  - id: load
    kind: load
    pos: [0, 0]
  # Softens the source.
  - id: blur
    kind: blur
    pos: [240, 0]
    group: detail
    params:
      radius: 3.5
edges:
  - load.image -> blur.image

The format is described in docs/node-graph.md (“A graph file”).

Structs§

YamlGraph
A graph kept in a YAML file: the editor’s model, changed by apply, written back by text.
YamlGraphError
Why a graph file cannot be read: what is wrong, and where when that is known (a line and a column, from 1).

Constants§

FORMAT_EXTENSION
The key of the root $extensions that stamps a graph file with the version of its format: org.egui-pop.graph: {version: 1}, as token files carry org.egui-pop.format.
FORMAT_VERSION
The version of the graph format this egui-pop writes. A file without a stamp is read as this version.