Graaf
Target

Custom nodes

Each custom node is defined in the node DSL and joins the palette under its category; changes take effect when you Save. Pins and properties are referenced as {name}, template parameters as {T}. Several overload blocks make an overload set. cpp lines and out … = expr are the C++ version; py and js lines add the Python and JavaScript versions.

Preview

Syntax

node <Id> "<Title>" "<Category>" <kind>
  desc <text>
  include <header>
  color #hex
  prop <name> "<Label>" = <default>
  template T [: concept | {int|float}] [= default | = @prop]
  in  <name> : <type> [= default]
  out <name> : <type> [= expr | = @prop]
  cpp <C++ statement>
  py <Python statement>
  py out <name> [if T <concept>] = expr
  py import <module>
  js … / js out … / js import …
  overload "<label>"
end

multi-line: cpp, py or js alone on a line, or an out … = with nothing after it, takes the more-indented lines below as one block:

  cpp
    if ({v} > 0)
        std::puts("positive");
  out r : T =
    {a} * {a} +
    {b} * {b}

kinds: pure (expression), exec (statement)

concepts: any, arithmetic, integral, floating_point, signed_integral, unsigned_integral, string, container, equality_comparable, totally_ordered, printable

exec outputs: with = expr they're declared after the code; without, they're declared before it so the code can assign {out} (Python code just assigns it; in JavaScript it is declared with let).

Python / JavaScript: {T} becomes that language's type (float, list[int] / number, number[], …). With several py out lines for one output, the first whose if T concept holds wins. A node without lines for the target language is reported, unless its snippet is just a placeholder like {text}.

Copy a built-in

How it works

Editing

Control flow → code

Target language

Templates & overloads

About & licenses