editorial Diagramming & Flowchart Library¶
The built-in editorial library provides a publication-quality diagramming
and flowchart aesthetic inspired by cathrynlavery/diagram-design:
a crisp white-smoke and jet-black ink palette, subtle hairline borders,
a single atomic-tangerine focal accent reserved for the critical path or key decision,
and semantic flowchart primitives. Enable it by passing library="editorial" to d2.compile().
import d2
svg = d2.compile(code, library="editorial")
Use the editorial library for:
Flowcharts & Decision Logic - branching algorithms, routing, and triage trees
Action & Process Pipelines - multi-step sequential workflows with happy/fail paths
System Boundaries & Zones - swimlanes, panels, boundaries, and containers
Editorial Categorization - series color tints (sage, dusty blue, mustard, rust, slate)
Design Principles¶
Shape Carries Meaning: Ovals denote terminals (start/end), rectangles denote actions/steps, diamonds denote decisions, and circles denote merge points.
Restrained Focal Accent: Atomic tangerine (
#EB6C36) is reserved for 1–2 focal elements per diagram (such as the happy path or key decision).Dual Light/Dark Fidelity: Diagrams render crisp in light mode (white-smoke surface with jet-black ink) and dark mode (slate-indigo base with bright white-smoke typography).
Example: Flowchart Decision Tree¶
direction: down
title: User Onboarding Flow { class: editorial-title }
start: Start Onboarding { class: editorial-start }
check_email: Email Verified? { class: editorial-decision }
setup_profile: Setup Profile { class: editorial-step }
verify_identity: Verify Identity { class: [editorial-decision; editorial-decision-accent] }
grant_access: Grant Full Access { class: [editorial-step; editorial-focal] }
manual_review: Route to Review { class: [editorial-step; editorial-warning] }
complete: Done { class: editorial-end }
start -> check_email: { class: editorial-flow }
check_email -> setup_profile: Yes { class: editorial-flow-success }
check_email -> check_email: Resend link { class: editorial-flow-dashed }
setup_profile -> verify_identity: { class: editorial-flow }
verify_identity -> grant_access: Approved { class: editorial-flow-primary }
verify_identity -> manual_review: Flagged { class: editorial-flow-danger }
grant_access -> complete: { class: editorial-flow-primary }
manual_review -> complete: Resolved { class: editorial-flow-muted }
Component Classes¶
Class |
Description |
|---|---|
|
Terminal start/end oval node. |
|
Standard action or process step (rounded rectangle). |
|
Decision / branching diamond. |
|
Merge / join circle node. |
|
Input/output data node (parallelogram). |
|
Document or report page artifact. |
|
Database or storage cylinder. |
|
Queue buffer node. |
|
Cloud / managed infrastructure node. |
|
User / actor person shape. |
|
Service or endpoint block. |
|
Gateway hexagon node. |
|
External or third-party system (dashed border). |
|
Key emphasized step with atomic-tangerine tint and border. |
|
Emphasized decision diamond with atomic-tangerine styling. |
|
Approved or success state (green tint). |
|
Review or warning state (amber tint). |
|
Rejected or error state (coral/red tint). |
|
Secondary or muted node. |
|
Categorical series palette tints (sage, blue, mustard, rust, slate). |
Theme & Flow Classes¶
Class |
Description |
|---|---|
|
Structural container box with subtle fill and border. |
|
Card / panel container with solid border. |
|
Swimlane grouping container. |
|
System / trust boundary (dashed border). |
|
Clean card element. |
|
Bold diagram title text (size 22). |
|
Diagram subtitle text (size 14). |
|
Section and node header labels. |
|
Small uppercase tracking tag. |
|
Editorial italic annotations. |
|
Metadata / parameter sublabel. |
|
Standard connection arrow. |
|
Emphasized happy-path connection arrow (atomic-tangerine). |
|
Secondary or return connection arrow. |
|
Asynchronous, feedback, or write-back connector. |
|
External API or HTTP connection arrow. |
|
Positive / approved path arrow (green). |
|
Negative / rejected / error path arrow (red). |