Diagram source
Formats and diagram types
How Nodeslate reads the source you send: Mermaid, SQL or plain lines, for each of the seven diagram types. Layout, colours and icons are automatic.
Send only structure and words; Nodeslate lays the diagram out. Keep box text short. Set type whenever you know it: with lines, auto draws a flowchart.
Which format
- mermaid:
flowchart/graph,mindmap,erDiagram,sequenceDiagram,journey. Best for flowcharts with several branches. - sql:
CREATE TABLEstatements (Postgres, MySQL, SQLite, SQL Server) become an Entity Relationship diagram with keys and relationships. - lines: plain lines, the way people type in Nodeslate. The rules depend on the type, below.
Mermaid
- Shapes:
A[Step],A(Rounded),A([Start]),A{Paid?}decision,A[(Orders)]database,A[/Upload/]input or output,A[[Billing run]]sub-process,A{{Prepare}},A((Merge)), and Mermaid 11'sA@{ shape: doc, label: "Invoice" }. - Links:
A --> B,A -->|Yes| BorA -- Yes --> B, dashedA -.-> B, both waysA <--> B, fan outA --> B & C. Label every way out of a decision. subgraph Billing…endmakes a group; groups can nest.- Styling (
classDef,style,click) and comments are ignored. With typearchitecture, a flowchart becomes an architecture diagram.
flowchart TD
A([Cart]) --> B{Paid?}
B -->|Yes| C[Order placed]
B -->|No| D[Retry payment]
C --> E[(Orders)]Lines, by type
Flowchart
Two styles; one -> anywhere switches the whole source to the arrow style.
- Typed (no arrows): the first line is the start, each line follows the one before. A line ending in
?or starting withIfis a decision; plain lines after it go down its Yes path.No: Retry paymentadds one step on the No path of the nearest decision and doesn't move you.If payment fails, show an errormakes “Payment OK?” with the error on No.Start,End,note: text, and shapesdb:,doc:,ip:(input),op:(output),circle:,queue:,cache:,external:. - Arrows:
A -> B: labellinks boxes by name. Write each way out of a decision as its own arrow:Paid? -> Retry payment: No. Use Mermaid when you need shapes and many branches.
Checkout
Paid?
Order placed
No: Retry payment
Ship order
EndArchitecture
Web app -> API: callsadds both boxes and a labelled line;API -> Orders, Billing: create orderdraws one to each;-->is dashed,<->two-way.- Kinds before a name:
db:,queue:,cache:,external:,doc:,service:. InAPI -> db: Orders, “Orders” is the database's name, not the label. group: Billing: Invoices, Paymentsputs boxes in a group. End a line with#checkoutto tag it as part of a named flow.- Icons are automatic: name boxes after the real service (
SQS,S3,Lambda,Postgres,Redis,Stripe). AWS service names get AWS's own icons; others get a matching plain icon.
Web app -> API: REST
API -> db: Orders
API --> queue: Jobs
API -> external: Stripe
group: Payments: API, StripeEntity Relationship
Prefer sql or Mermaid erDiagram. In lines, start every table with table: table users: id pk, email text unique, org_id -> orgs.id, or table users then one column per line. Flags: pk, unique, null, fk. Relationships: orders > users many-to-one, <, 1-1, 1-n, n-1, <> many-to-many, with : label.
Org chart, mind map and journey
An indented outline, two spaces per level; the first line is the top. Org chart lines are Name, title. A journey has stages, then steps ending in : 1 to : 5 for how they feel.
Ordering groceries
Order
Fill the basket: 4
Pay at checkout: 2
Receive
Unpack the bag: 5Sequence
One message per line, in order: App -> Auth: Sign in; a reply is Auth --> App: Token. A line with only a name adds that participant, so list them first to fix their order.
Stuck, or missing something? Contact us.