Documentation · Thinking
Tree diagram
Declare every box, then hang each one from its parent. Every box has one parent, and a leaf ends a path.
When to use it
Lay out any hierarchy from one root: a decision tree, a work breakdown structure, a problem tree or a classification.
Use leaf for the boxes a path ends on, and caption the branches out of a decision with the answer that leads there.
Working example
Copy this complete example into the Source tab, then press Generate. Change its labels or values to make your first version.
tree "Play Outside?" {
node OUT "Outlook?"
node HUM "Humidity?"
node WIND "Windy?"
leaf Y1 "Play"
leaf N1 "Don't play"
leaf Y2 "Play"
leaf Y3 "Play"
leaf N2 "Don't play"
OUT -> HUM "sunny"
OUT -> Y1 "overcast"
OUT -> WIND "rain"
HUM -> N1 "high"
HUM -> Y2 "normal"
WIND -> N2 "true"
WIND -> Y3 "false"
}Syntax reference
The same reference used by the editor and AI briefing. Syntax is notation-specific; use the keywords listed here.
Diagram
| Syntax | Meaning |
|---|---|
tree "Title" { | open a tree: decision tree, WBS or hierarchy |
Boxes
| Syntax | Meaning |
|---|---|
node ID "Label" | branch: a box with boxes under it |
leaf ID "Label" | leaf (rounded): a path ends here |
Branches
| Syntax | Meaning |
|---|---|
A -> B | B hangs from A |
A -> B "sunny" | branch with a caption, e.g. a decision's answer |
A -.-> B | cross link (dashed), outside the hierarchy |
# comment | line comment (also //) |
Language rules
- The file is one tree "Title" { ... } block.
- Declare every box with node (has boxes under it) or leaf (ends a path), then hang each from its parent with A -> B.
- Every box has exactly one parent, the boxes never loop back, and nothing hangs from a leaf.
- Children are drawn left to right in the order their branches are written.
- A caption on a branch says what leads there: OUTLOOK -> HUMIDITY "sunny".
- A -.-> B is a dashed cross link between two boxes the hierarchy has already placed.
Edit on the canvas
- Move and rename boxes on the sheet; a branch re-routes along its parent's rail.
- Draw a branch or a dashed cross link from the connector rail.
Generate replaces the drawing from source. Save before generating again if you want to preserve manual finishing touches.
Read Saving & exportingWrite it with an assistant
Tingraph AI already knows this notation. For another assistant, copy the tutorial below, describe your diagram under MY DIAGRAM, then paste the returned source into the editor. This prompt includes every syntax row, rule and working example above.
Read the complete prompt
You are writing Tingraph source. Tingraph is a small text language that draws a tree diagram. Answer with Tingraph source only.
SYNTAX
Diagram
tree "Title" { open a tree: decision tree, WBS or hierarchy
Boxes
node ID "Label" branch: a box with boxes under it
leaf ID "Label" leaf (rounded): a path ends here
Branches
A -> B B hangs from A
A -> B "sunny" branch with a caption, e.g. a decision's answer
A -.-> B cross link (dashed), outside the hierarchy
# comment line comment (also //)
RULES
- The file is one `tree "Title" { ... }` block.
- Declare every box with `node` (has boxes under it) or `leaf` (ends a path), then hang each from its parent with `A -> B`.
- Every box has exactly one parent, the boxes never loop back, and nothing hangs from a leaf.
- Children are drawn left to right in the order their branches are written.
- A caption on a branch says what leads there: `OUTLOOK -> HUMIDITY "sunny"`.
- `A -.-> B` is a dashed cross link between two boxes the hierarchy has already placed.
WORKED EXAMPLE
tree "Play Outside?" {
node OUT "Outlook?"
node HUM "Humidity?"
node WIND "Windy?"
leaf Y1 "Play"
leaf N1 "Don't play"
leaf Y2 "Play"
leaf Y3 "Play"
leaf N2 "Don't play"
OUT -> HUM "sunny"
OUT -> Y1 "overcast"
OUT -> WIND "rain"
HUM -> N1 "high"
HUM -> Y2 "normal"
WIND -> N2 "true"
WIND -> Y3 "false"
}
OUTPUT
- Reply with one fenced code block and nothing else.
- The block starts with `tree "…" {` and ends with `}`.
- Do not invent keywords: use only the ones listed above.
- Keep labels short enough to read inside a box, and keep every ID unique.
MY DIAGRAM
Describe what you want here, then send this message.Something unclear? Contact support or read the Privacy Policy.