Skip to documentation content

Documentation · Structure

Object diagram

Declare the objects that exist at one moment, each with the values its slots hold, then the links between them.

When to use it

Show the objects a system holds at one moment and how they are linked: a worked example of a class diagram, a test fixture, or the state just before and after an operation.

Write each object as name : Class and give only the values that matter to the moment you are showing. Every link should be an instance of an association in the class diagram.

Working example

Copy this complete example into the Source tab, then press Generate. Change its labels or values to make your first version.

Tingraph source
object "Library on 3 March" {
  object MEMBER "ada : Member" {
    value "name = \"Ada Lovelace\""
    value "email = \"ada@example.org\""
  }
  object LOAN1 "loan1 : Loan" {
    value "dueDate = 2026-03-17"
    value "status = ACTIVE"
  }
  object LOAN2 "loan2 : Loan" {
    value "dueDate = 2026-03-24"
    value "status = ACTIVE"
  }
  object BOOK1 "sicp : Book" {
    value "isbn = \"978-0262510875\""
    value "pages = 657"
  }
  object BOOK2 ": Book" {
    value "isbn = \"978-0201633610\""
    value "pages = 395"
  }

  MEMBER "borrower" -> "loan" LOAN1 "makes"
  MEMBER "borrower" -> "loan" LOAN2 "makes"
  navigate LOAN1 -> BOOK1 "lends"
  navigate LOAN2 -> BOOK2 "lends"
}

Syntax reference

The same reference used by the editor and AI briefing. Syntax is notation-specific; use the keywords listed here.

Diagram

SyntaxMeaning
object "Title" {open a UML object diagram

Objects

SyntaxMeaning
object ID "name : Class" { ... }an instance; the name is drawn underlined
object ID ": Class" { ... }an anonymous instance of Class
value "total = 42.50"a slot and the value it holds, inside the block
value "name = \"Ada\""a text value, its quotes escaped

Links

SyntaxMeaning
A -> Ba link (plain line)
A "owner" -> "pet" B "has"a link with a role at each end and a name
navigate A -> Ba link navigable one way (open arrow at B)
aggregate A -> Ban aggregation link: A has B (hollow diamond at A)
compose A -> Ba composition link: A owns B (filled diamond at A)
A -> Aa link from an object to itself
# commentline comment (also //)

Language rules

  • The file is one object "Title" { ... } block: a snapshot of the objects that exist at one moment.
  • An object is object, then an ID and its name in quotes. Write the name as name : Class; leave the name out (: Class) for an anonymous instance. The whole name is drawn underlined, which is what tells an object from a class.
  • Its block lists value lines, each a slot and the value it holds: value "total = 42.50". Escape the quotes of a text value: value "name = \"Ada\"". An object has no operations; they belong on its class.
  • A link joins two objects and is always solid: a bare A -> B is a link, navigate A -> B is navigable towards B, and aggregate A -> B and compose A -> B put the diamond on the whole, A.
  • Role names are quoted on either side of the arrow and the link's name follows the second object: order "order" -> "customer" ada "placed by". A link carries no multiplicity: it joins exactly these two objects.

Edit on the canvas

  • Move and rename objects on the sheet; every value is a caption you can retype in place, and the underline follows the name.
  • Draw a link, a directed link, an aggregation or a composition from the connector rail.

Generate replaces the drawing from source. Save before generating again if you want to preserve manual finishing touches.

Read Saving & exporting

Write 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 UML object diagram. Answer with Tingraph source only.

SYNTAX
Diagram
  object "Title" {            open a UML object diagram

Objects
  object ID "name : Class" { ... }  an instance; the name is drawn underlined
  object ID ": Class" { ... }  an anonymous instance of Class
  value "total = 42.50"       a slot and the value it holds, inside the block
  value "name = \"Ada\""      a text value, its quotes escaped

Links
  A -> B                      a link (plain line)
  A "owner" -> "pet" B "has"  a link with a role at each end and a name
  navigate A -> B             a link navigable one way (open arrow at B)
  aggregate A -> B            an aggregation link: A has B (hollow diamond at A)
  compose A -> B              a composition link: A owns B (filled diamond at A)
  A -> A                      a link from an object to itself
  # comment                   line comment (also //)

RULES
- The file is one `object "Title" { ... }` block: a snapshot of the objects that exist at one moment.
- An object is `object`, then an ID and its name in quotes. Write the name as `name : Class`; leave the name out (`: Class`) for an anonymous instance. The whole name is drawn underlined, which is what tells an object from a class.
- Its block lists `value` lines, each a slot and the value it holds: `value "total = 42.50"`. Escape the quotes of a text value: `value "name = \"Ada\""`. An object has no operations; they belong on its class.
- A link joins two objects and is always solid: a bare `A -> B` is a link, `navigate A -> B` is navigable towards B, and `aggregate A -> B` and `compose A -> B` put the diamond on the whole, A.
- Role names are quoted on either side of the arrow and the link's name follows the second object: `order "order" -> "customer" ada "placed by"`. A link carries no multiplicity: it joins exactly these two objects.

WORKED EXAMPLE
object "Library on 3 March" {
  object MEMBER "ada : Member" {
    value "name = \"Ada Lovelace\""
    value "email = \"ada@example.org\""
  }
  object LOAN1 "loan1 : Loan" {
    value "dueDate = 2026-03-17"
    value "status = ACTIVE"
  }
  object LOAN2 "loan2 : Loan" {
    value "dueDate = 2026-03-24"
    value "status = ACTIVE"
  }
  object BOOK1 "sicp : Book" {
    value "isbn = \"978-0262510875\""
    value "pages = 657"
  }
  object BOOK2 ": Book" {
    value "isbn = \"978-0201633610\""
    value "pages = 395"
  }

  MEMBER "borrower" -> "loan" LOAN1 "makes"
  MEMBER "borrower" -> "loan" LOAN2 "makes"
  navigate LOAN1 -> BOOK1 "lends"
  navigate LOAN2 -> BOOK2 "lends"
}

OUTPUT
- Reply with one fenced code block and nothing else.
- The block starts with `object "…" {` 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.
How AI requests, attachments and privacy work

Something unclear? Contact support or read the Privacy Policy.