Tritone documentation

Tritone turns a few lines of text into an animated isometric diagram: actors on a floor, messages travelling between them, and a narration that explains each step. It also reads Mermaid text and draws it in space.

A diagram is only text, so anything that writes text can draw one: you, a script, an AI agent. This page lists what there is to draw with, and what each part is for. Every example is a whole diagram, and the picture under it is what that text draws.

New here? Use cases shows what people use Tritone for, one situation at a time. Stories and Models show every diagram it draws, each with an example and what it is good for. None of these pages asks you to write code, and the words they use are explained at the end of this one.

Components

Component Use it to Reference
Story Explain how something happens, one step at a time The story language
Actors Show who takes part, each as the thing it is Kinds
Messages Show who asks whom, and who answers Steps
Narration Say why a step matters, and follow a number through the story Steps
Mermaid in 3D Show what a system is made of, from Mermaid text you already have Graph views
Models Choose the question a 3D diagram answers Models
Embeds Put a diagram where its reader is Embedding

Story

Use a story when order is the point: what a request goes through, what changed between before and after, how an incident unfolded. The reader walks through it step by step, and each step brings its own words.

story A cache in front of a database
subtitle The second read never reaches the database.

app(service)[App]
cache(cache)[Cache]
db(database)[Database]

step First read
  app -> cache: get user:42
  cache --> app: miss
  app -> db: SELECT user 42
  db --> app: row
  say Nothing is cached yet, so the app pays for the database.
  set Read = 24 ms

step Second read
  app -> cache: get user:42
  cache --> app: hit
  note cache: user:42
  say The copy answers. The database is not asked at all.
  idea A cache only helps the reads that come after the first one.
  set Read = 1 ms
CacheAppDatabaseget user:42missSELECT user 42row1/2 · First readget user:42hituser:422/2 · Second read
Open in the live editor

A story is made of the three components that follow: actors, messages and narration. Stories shows the kinds of story people write, from a request followed hop by hop to an incident told minute by minute.

Actors

An actor is anything that takes part: a program, a machine, a person. Its kind is its shape. Choose the kind by what the thing is, so the reader knows it before reading its label.

story The eight kinds of actor

service(service)[service]
server(server)[server]
database(database)[database]
cache(cache)[cache]
queue(queue)[queue]
laptop(laptop)[laptop]
user(user)[user]
cloud(cloud)[cloud]
laptopservercachecloudservicedatabasequeueuser
Open in the live editor
Kind Use it for
service Something that runs your code: an application, an API, a worker. The kind an actor has when it names none
server A machine, or a service that reads as infrastructure: a gateway, a load balancer
database Where data is kept for good
cache A fast copy that can be rebuilt
queue Work that waits for later: a job queue, a topic, a stream
laptop Where the reader sits: a browser, a client application
user A person
cloud What you do not run yourself: a CDN, the internet, a third party

Each kind has other names (db, browser, cdn…): see the list. A kind that does not exist is drawn as a service, and more kinds come from plugins.

Messages

A message is one thing that goes from an actor to another. The messages of a step play one after the other, in the order they are written.

story Three kinds of message

app(laptop)[App]
api(server)[API]

step Connect
  app <-> api: TLS handshake

step Ask
  app -> api: GET /orders

step Answer
  api --> app: 200 OK
APIAppTLS handshake1/3 · ConnectGET /orders2/3 · Ask200 OK3/3 · Answer
Open in the live editor
Write It is Use it for
a -> b: label A request One side asks, sends or calls
a --> b: label A response The answer on its way back
a <-> b: label A handshake What two sides do together: open a connection, agree on a key

Narration

The words and the numbers of a step. They are what turns a moving picture into an explanation.

Statement Use it to
step <title> Cut the story where the reader should stop and look. One thing happens in a step
say <text> Explain what just moved, in a sentence or two
idea <text> Leave the one thing to remember from the step
note <actor>: <text> Pin a fact on an actor while the step is on screen: a state, a count
set <name> = <value> Follow a number through the story: a latency, a cost, the length of a queue

A note is part of the drawing. What say, idea and set write is shown by the player around it, so a story shown as an image does not have them.

Mermaid in 3D

Use it when structure is the point, not order: what a system is made of, and what is connected to what. The text is plain Mermaid, a flowchart, an architecture-beta or a sankey-beta diagram, so one you already have works as it is, and still renders in 2D wherever Mermaid does. A comment that starts with @ and the id of a node gives that node the notes a reader sees when selecting it.

flowchart TB
  subgraph edge[Edge]
    cdn[CDN]
    gateway[API gateway]
  end
  subgraph app[Application]
    web[Web app]
    api[Orders API]
    worker[Worker]
  end
  subgraph data[Data]
    db[(PostgreSQL)]
    queue[(Job queue)]
  end

  cdn -->|serves| web
  web -->|fetch| gateway
  gateway -->|REST| api
  api -->|read, write| db
  api -->|enqueue| queue
  queue -->|deliver| worker
  worker -->|write| db

  %% @gateway: The only public way in. Authenticates the caller and applies rate limits.
  %% @api: Owns the order lifecycle. Hands slow work to the queue.
Open in the live editor

Models

A model decides where everything stands in space. The text stays the same: each model answers another question about it. In the live editor the Model menu changes it: the menu is there when the text is Mermaid.

Model Use it to show
planes Layers: which tier each thing belongs to
nodes Neighbourhoods: what is close to what
city Hubs: the nodes with the most links
tree Dependencies: what hangs on what
ring Coupling: how tightly the groups are tied to each other
stages Order: what comes after what, and where branches meet again
lanes Hand-offs: who does each step, and where the work changes hands
dominators Bottlenecks: the nodes no path can get around
sankey Amounts: where a quantity goes, and how it splits
matrix Direction: how many links go from each group to each other one, and which way

Models shows each one live, with what it draws and how to choose it. More models come from plugins.

Embeds

A diagram lives in its own address, so it goes wherever a link, a frame or an image can go.

Way Use it when
A link to the live editor The reader is in a chat or an e-mail. Nothing is stored: the text is in the address
The MCP server The reader is in a conversation with Claude or ChatGPT: the model calls a tool with a story, and the player is drawn there
An iframe The page is yours: a site, a docs tool
The Markdown plugin Your docs are built from Markdown, and a diagram should be a code block
The extension for VS Code and Cursor The Markdown is a file in your editor, and the diagram should play in its preview
A Markdown image Only images are allowed: GitHub, npm. One SVG that plays by itself
An element The diagram belongs in the flow of your page, with no frame around it
The API At build time or on a server: a story needs no browser to become an SVG

Words used in these pages

Word Means
Story A diagram that plays in steps, written in Tritone’s own language. Stories
Actor One part of a story, drawn as a shape: a program, a machine, a person
Step One moment of a story. The reader goes from one to the next
Isometric Seen from above at an angle, with nothing smaller in the distance: the view of an architect’s drawing or a city-building game
Mermaid The most common way to write a diagram as text. GitHub draws it, and so do many documentation tools; Tritone draws it in 3D
Model The way a Mermaid diagram is laid out in space. Each model answers another question. Models
Live editor The page where you write a diagram and watch it at once, then share it
Embed A diagram put inside another page: a frame, an image, an element
SVG A picture made of shapes rather than pixels: sharp at any size, and able to play an animation with no script
Markdown Plain text with a few marks for headings and links: the format of READMEs, and of these pages
AI agent An assistant that writes text and code for you, and so can write a diagram

Where to go

To Read
Find what Tritone is for, in a situation like yours Use cases
See every kind of story, with an example of each Stories
Write a story The story language
Draw Mermaid text in 3D Graph views
Choose how a 3D diagram is laid out Models
Put a diagram in a site, a README or an app Embedding
Add shapes, layouts or diagram types Plugins
Run the live editor, these pages, the image endpoint and the MCP server yourself Hosting
Understand how the library is built Architecture
See what exists around the library, and what does not yet Ecosystem

The fastest way in

Write in the live editor: the text is on the left, the diagram plays on the right, and every mistake names its line. When the diagram is right, the editor hands you a link, an iframe or a Markdown image of it. Nothing is stored anywhere: the diagram travels inside its own address.