@diagrammo/dgmo 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/auto.mjs +1 -1
- package/package.json +2 -2
- package/docs/guide/chart-arc.md +0 -71
- package/docs/guide/chart-area.md +0 -73
- package/docs/guide/chart-bar-stacked.md +0 -61
- package/docs/guide/chart-bar.md +0 -62
- package/docs/guide/chart-boxes-and-lines.md +0 -243
- package/docs/guide/chart-c4.md +0 -298
- package/docs/guide/chart-chord.md +0 -43
- package/docs/guide/chart-class.md +0 -204
- package/docs/guide/chart-cycle.md +0 -156
- package/docs/guide/chart-doughnut.md +0 -38
- package/docs/guide/chart-er.md +0 -218
- package/docs/guide/chart-flowchart.md +0 -102
- package/docs/guide/chart-function.md +0 -56
- package/docs/guide/chart-funnel.md +0 -38
- package/docs/guide/chart-gantt.md +0 -368
- package/docs/guide/chart-heatmap.md +0 -41
- package/docs/guide/chart-infra.md +0 -694
- package/docs/guide/chart-journey-map.md +0 -179
- package/docs/guide/chart-kanban.md +0 -158
- package/docs/guide/chart-line.md +0 -79
- package/docs/guide/chart-mindmap.md +0 -198
- package/docs/guide/chart-multi-line.md +0 -84
- package/docs/guide/chart-org.md +0 -209
- package/docs/guide/chart-pie.md +0 -39
- package/docs/guide/chart-polar-area.md +0 -38
- package/docs/guide/chart-pyramid.md +0 -111
- package/docs/guide/chart-quadrant.md +0 -69
- package/docs/guide/chart-radar.md +0 -38
- package/docs/guide/chart-sankey.md +0 -103
- package/docs/guide/chart-scatter.md +0 -91
- package/docs/guide/chart-sequence.md +0 -354
- package/docs/guide/chart-sitemap.md +0 -265
- package/docs/guide/chart-slope.md +0 -56
- package/docs/guide/chart-state.md +0 -171
- package/docs/guide/chart-tech-radar.md +0 -219
- package/docs/guide/chart-timeline.md +0 -229
- package/docs/guide/chart-venn.md +0 -81
- package/docs/guide/chart-wireframe.md +0 -100
- package/docs/guide/chart-wordcloud.md +0 -66
- package/docs/guide/colors.md +0 -287
- package/docs/guide/how-dgmo-thinks.md +0 -277
- package/docs/guide/index.md +0 -63
- package/docs/guide/keyboard-shortcuts.md +0 -49
- package/docs/guide/registry.json +0 -58
package/dist/auto.cjs
CHANGED
|
@@ -42402,7 +42402,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
42402
42402
|
|
|
42403
42403
|
// src/auto/index.ts
|
|
42404
42404
|
init_safe_href();
|
|
42405
|
-
var VERSION = "0.10.
|
|
42405
|
+
var VERSION = "0.10.2";
|
|
42406
42406
|
var DEFAULTS = {
|
|
42407
42407
|
theme: "auto",
|
|
42408
42408
|
palette: "nord",
|
package/dist/auto.js
CHANGED
|
@@ -634,7 +634,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
634
634
|
.dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-comment,
|
|
635
635
|
.dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-noteContent,
|
|
636
636
|
.dgmo-rendered.dgmo-theme-dark .dgmo-source-pre .dgmo-tok-punctuation { color: #616e88; }
|
|
637
|
-
`;rz();var y$e="0.10.
|
|
637
|
+
`;rz();var y$e="0.10.2",xai={theme:"auto",palette:"nord",showSource:!0,showEditorLink:!0},QAe={...xai},RZ=new Set,Cai="https://online.diagrammo.app",kai=8192,wmr=256*1024,Iai=200,_ai=1200,Dai="[dgmo:auto]",Bai=/[\x00-\x1F--]/g,f$e="dgmoAutoStyles";function Zf(...e){typeof console<"u"&&console.warn&&console.warn(Dai,...e)}function Tmr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Nai(e){e.querySelectorAll("script, foreignObject").forEach(i=>i.remove());let n=[e,...Array.from(e.querySelectorAll("*"))];for(let i of n){for(let o of Array.from(i.attributes))o.name.toLowerCase().startsWith("on")&&i.removeAttribute(o.name);if(i.hasAttribute("href")&&qx(i.getAttribute("href"))===null&&i.removeAttribute("href"),i.hasAttributeNS("http://www.w3.org/1999/xlink","href")){let o=i.getAttributeNS("http://www.w3.org/1999/xlink","href");qx(o)===null&&i.removeAttributeNS("http://www.w3.org/1999/xlink","href")}}}function xmr(e){try{return FO().some(t=>t.id===e)}catch{return!1}}function Cmr(){if(typeof document>"u")return null;let e=document.currentScript;if(e&&e instanceof HTMLScriptElement)return e;let t=document.querySelectorAll('script[src*="auto.js"], script[src*="auto.min.js"]');return t.length===0?null:t[t.length-1]}var Fai=["theme","palette","showSource","showEditorLink"],kmr=["__proto__","constructor","prototype"],Mai=["auto","light","dark","transparent"];function Imr(e){return typeof e=="string"&&Mai.includes(e)}function _mr(e){if(!e)return{};let t;try{t=JSON.parse(e)}catch(i){return Zf("data-config: invalid JSON",i),{}}if(!Tmr(t))return Zf("data-config: not an object"),{};for(let i of kmr)if(Object.prototype.hasOwnProperty.call(t,i))return Zf("data-config: rejected (prototype-pollution key:",i,")"),{};let n={};for(let[i,o]of Object.entries(t)){if(!Fai.includes(i)){Zf("data-config: dropping unknown key",i);continue}if(i==="theme"){if(!Imr(o)){Zf("data-config: rejected theme",o);continue}n.theme=o}else if(i==="palette"){if(typeof o!="string"||!xmr(o)){Zf("data-config: rejected palette",o);continue}n.palette=o}else if(i==="showSource"){if(typeof o!="boolean"){Zf("data-config: rejected showSource",o);continue}n.showSource=o}else if(i==="showEditorLink"){if(typeof o!="boolean"){Zf("data-config: rejected showEditorLink",o);continue}n.showEditorLink=o}}return n}function Dmr(e=document){let t=e.querySelectorAll(".dgmo:not([data-dgmo-processed]), .language-dgmo:not([data-dgmo-processed])");return Array.from(t).filter(n=>!n.closest(".dgmo-rendered"))}function Bmr(e){if(e==="light"||e==="dark"||e==="transparent")return e;if(typeof document>"u")return"light";let t=document.documentElement,n=t.getAttribute("data-theme");return n==="dark"?"dark":n==="light"?"light":t.classList.contains("dark")?"dark":t.classList.contains("light")?"light":typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Nmr(){if(typeof document>"u")return;let e=document.documentElement;if(e&&e.dataset&&e.dataset[f$e]==="1")return;if(document.querySelector('link[rel="stylesheet"][href*="auto.css"]')){e&&e.dataset&&(e.dataset[f$e]="1");return}let n=document.createElement("style");n.setAttribute("data-dgmo-auto",""),n.textContent=vmr,document.head.appendChild(n),e&&e.dataset&&(e.dataset[f$e]="1")}function Pai(e){let t=document.createDocumentFragment(),n;try{n=Smr(e)}catch{return t.appendChild(document.createTextNode(e)),t}for(let i of n){if(!i.text)continue;let o=document.createElement("span");o.className=`dgmo-tok-${i.role}`,o.textContent=i.text,t.appendChild(o)}return t}var Fmr='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5V3a1.5 1.5 0 0 0-1.5-1.5H3A1.5 1.5 0 0 0 1.5 3v6A1.5 1.5 0 0 0 3 10.5h2.5"/></svg>',Lai='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 8.5 6.5 12 13 4.5"/></svg>',Rai='<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 2h5v5"/><path d="M14 2L7 9"/><path d="M13 9v4a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4"/></svg>';function HAe(e,t){e.innerHTML=t}function bai(e,t,n){let i=document.createElement("div");i.className="dgmo-source-panel";let o=document.createElement("button");o.type="button",o.className="dgmo-source-toggle",o.setAttribute("aria-expanded","false");let r=document.createElement("span");r.className="dgmo-chevron",r.setAttribute("aria-hidden","true"),r.textContent="\u25B8",o.appendChild(r);let s=document.createElement("span");s.textContent="DGMO source",o.appendChild(s);let a=document.createElement("div");a.className="dgmo-source-body";let l=document.createElement("pre");l.className="dgmo-source-pre",l.appendChild(Pai(e)),a.appendChild(l);let u=document.createElement("div");u.className="dgmo-source-actions";let c=document.createElement("button");if(c.type="button",c.className="dgmo-btn dgmo-btn-copy",c.setAttribute("aria-label","Copy DGMO source"),c.title="Copy source",HAe(c,Fmr),c.addEventListener("click",()=>{Qai(e,c)}),u.appendChild(c),n){let d=document.createElement("a");d.className="dgmo-btn dgmo-btn-editor",d.target="_blank",d.rel="noopener noreferrer",d.setAttribute("aria-label","Open in editor"),HAe(d,Rai),t?(d.href=t,d.title="Open in editor"):(d.setAttribute("aria-disabled","true"),d.title="Diagram too large for share link; copy source and paste into editor",d.addEventListener("click",p=>p.preventDefault())),u.appendChild(d)}return a.appendChild(u),i.appendChild(o),i.appendChild(a),o.addEventListener("click",()=>{let d=a.classList.toggle("dgmo-open");o.setAttribute("aria-expanded",d?"true":"false")}),i}async function Qai(e,t){let n=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(e),n=!0)}catch{}if(!n&&typeof document<"u")try{let i=document.createElement("textarea");i.value=e,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),n=document.execCommand("copy"),document.body.removeChild(i)}catch{n=!1}n?(HAe(t,Lai),t.classList.add("dgmo-btn-copied"),setTimeout(()=>{HAe(t,Fmr),t.classList.remove("dgmo-btn-copied")},_ai)):Zf("clipboard write failed")}function LZ(e){let t=document.createElement("div");t.className="dgmo-error-banner",t.setAttribute("role","alert");let n=document.createElement("div");if(n.className="dgmo-error-banner-title",n.textContent=`${e.severity??"error"}: ${e.message}`,t.appendChild(n),e.line!==void 0&&e.line>0){let i=document.createElement("div");i.className="dgmo-error-banner-loc",i.textContent=e.column!==void 0?`at ${e.line}:${e.column}`:`at line ${e.line}`,t.appendChild(i)}return t}function Hai(e){let t=e.split(`
|
|
638
638
|
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.replace(Bai,"").slice(0,Iai):"DGMO diagram"}function Wai(e){if(e.tagName==="CODE"){let t=e.parentElement;if(t&&t.tagName==="PRE"){let n=Array.from(t.childNodes).filter(i=>i.nodeType===1||i.nodeType===3&&(i.textContent||"").trim().length>0);if(n.length===1&&n[0]===e)return t}}return e}async function Mmr(e){if(!(e instanceof HTMLElement))return{};if(e.dataset.dgmoProcessed==="true")return{};e.dataset.dgmoProcessed="true";let t=e.textContent||"";if(new TextEncoder().encode(t).byteLength>wmr){e.style.visibility="";let w=LZ({message:`DGMO source too large to render \u2014 ${wmr/1024} KB max`,severity:"error"});return e.parentElement?.insertBefore(w,e),Zf("source exceeds 256 KB cap"),{}}let i=QAe,o=i.theme==="transparent"?"transparent":Bmr(i.theme),r=o==="transparent"?"transparent":o,s=Hai(t),a=e.dataset.showSource,l=i.showSource;a==="true"?l=!0:a==="false"?l=!1:a!==void 0&&Zf("data-show-source: invalid value",a,'\u2014 expected "true" or "false"');let u;try{u=await Zfr(t,{theme:r,palette:i.palette})}catch(w){e.style.visibility="";let E=w instanceof Error?w.message:"Render failed unexpectedly",T=LZ({message:E,severity:"error"});return e.parentElement?.insertBefore(T,e),Zf("render() rejected:",w),{}}if(u.diagnostics&&u.diagnostics.length>0){e.style.visibility="";let w=u.diagnostics[0],E=LZ({message:w.message,severity:w.severity,line:w.line,column:w.column});return e.parentElement?.insertBefore(E,e),Zf("diagnostic:",w.message,w.line,w.column),{}}if(!u.svg){e.style.visibility="";let w=LZ({message:"Empty SVG returned from renderer",severity:"error"});return e.parentElement?.insertBefore(w,e),{}}let c=document.createElement("div"),d=o==="dark"?"dgmo-theme-dark":o==="transparent"?"dgmo-theme-transparent":"dgmo-theme-light";c.className=`dgmo-rendered ${d}`,c.dataset.dgmoProcessed="true";let p=document.createElement("div");p.innerHTML=u.svg;let h=p.querySelector("svg");if(!h){e.style.visibility="";let w=LZ({message:"Empty SVG returned from renderer",severity:"error"});return e.parentElement?.insertBefore(w,e),{}}if(Nai(h),h.setAttribute("role","img"),h.setAttribute("aria-label",s),c.appendChild(h),l){let w=null;if(i.showEditorLink){let T=o==="dark"?"dark":"light",x=emr(t,{baseUrl:Cai,palette:i.palette,theme:T});if(x.url){let I=`utm_source=auto-embed&utm_medium=html&utm_campaign=${encodeURIComponent(y$e)}`,_=x.url.indexOf("#"),D;if(_===-1){let B=x.url.includes("?")?"&":"?";D=x.url+B+I}else{let B=x.url.slice(0,_),F=x.url.slice(_+1),M=B.includes("?")?"&":"?",R=F.length>0?"&":"";D=B+M+I+"#"+F+R+I}w=D,qx(w)||(w=null)}else x.error==="too-large"&&x.compressedSize>kai&&(w=null)}let E=bai(t,w,i.showEditorLink);c.appendChild(E)}let S={wrapper:c,source:t,perElementShowSource:a==="true"?!0:a==="false"?!1:null};return RZ.add(S),Wai(e).replaceWith(c),{wrapper:c}}function A$e(e={}){if(!Tmr(e))return;for(let n of kmr)if(Object.prototype.hasOwnProperty.call(e,n)){Zf("initialize: rejected (prototype-pollution key:",n,")");return}let t={...QAe};Imr(e.theme)&&(t.theme=e.theme),typeof e.palette=="string"&&xmr(e.palette)&&(t.palette=e.palette),typeof e.showSource=="boolean"&&(t.showSource=e.showSource),typeof e.showEditorLink=="boolean"&&(t.showEditorLink=e.showEditorLink),QAe=t}async function g$e(e={}){Nmr();for(let n of Array.from(RZ))document.contains(n.wrapper)||RZ.delete(n);let t;if(e.nodes){t=("length"in e.nodes&&typeof e.nodes!="string"?Array.from(e.nodes):[]).filter(o=>o instanceof Element&&(o.matches(".dgmo, .language-dgmo")||o.querySelector(".dgmo, .language-dgmo")!==null));let i=[];for(let o of t)o.matches(".dgmo, .language-dgmo")&&i.push(o),o.querySelectorAll(".dgmo:not([data-dgmo-processed]), .language-dgmo:not([data-dgmo-processed])").forEach(s=>i.push(s));t=Array.from(new Set(i)).filter(o=>!o.closest(".dgmo-rendered"))}else t=Dmr();await Promise.all(t.map(n=>Mmr(n).catch(()=>({}))))}function Uai(){if(QAe.theme==="auto")for(let e of Array.from(RZ)){let t=document.createElement("pre");t.className="dgmo",t.textContent=e.source,e.perElementShowSource!==null&&(t.dataset.showSource=String(e.perElementShowSource)),e.wrapper.replaceWith(t),RZ.delete(e),Mmr(t)}}function Gai(){if(typeof window>"u"||!window.matchMedia)return;let e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>Uai();e.addEventListener?e.addEventListener("change",t):"addListener"in e&&typeof e.addListener=="function"&&e.addListener(t)}function m$e(){if(typeof document>"u")return;document.querySelectorAll(".dgmo:not(.dgmo-rendered), .language-dgmo").forEach(t=>{t.closest(".dgmo-rendered")||(t.style.visibility="visible")}),document.documentElement&&document.documentElement.dataset&&(document.documentElement.dataset.dgmoAutoFailed="1")}function Vai(){try{Nmr();let e=Cmr(),t=e?.getAttribute("data-auto"),n=e?.getAttribute("data-config");if(n){let o=_mr(n);A$e(o)}if(Gai(),typeof window<"u"&&window.setTimeout(()=>{document.querySelectorAll(".dgmo:not(.dgmo-rendered):not([data-dgmo-processed])").length>0&&(Zf("safety timeout: un-hiding unrendered sources"),m$e())},3e4),t==="false")return;let i=()=>{g$e().catch(o=>{Zf("run() crashed:",o),m$e()})};typeof document<"u"&&document.readyState!=="loading"?i():typeof document<"u"&&document.addEventListener("DOMContentLoaded",i,{once:!0})}catch(e){Zf("bootstrap failed:",e),m$e()}}var Pmr=Object.freeze({initialize:A$e,run:g$e,version:y$e});function Emr(e,t){try{Object.defineProperty(e,t,{value:Pmr,writable:!1,configurable:!1,enumerable:!0})}catch{}}typeof window<"u"&&(Emr(window,"dgmo"),Emr(window,"diagrammo"),Vai());var qai=Pmr;return sc(zai);})();
|
|
639
639
|
/*! Bundled license information:
|
|
640
640
|
|
package/dist/auto.mjs
CHANGED
|
@@ -42404,7 +42404,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
42404
42404
|
|
|
42405
42405
|
// src/auto/index.ts
|
|
42406
42406
|
init_safe_href();
|
|
42407
|
-
var VERSION = "0.10.
|
|
42407
|
+
var VERSION = "0.10.2";
|
|
42408
42408
|
var DEFAULTS = {
|
|
42409
42409
|
theme: "auto",
|
|
42410
42410
|
palette: "nord",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diagrammo/dgmo",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "DGMO diagram markup language — parser, renderer, and color system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"dist",
|
|
73
73
|
"fonts",
|
|
74
74
|
"src",
|
|
75
|
-
"docs",
|
|
75
|
+
"docs/*.md",
|
|
76
76
|
"gallery/fixtures",
|
|
77
77
|
".claude/commands",
|
|
78
78
|
".github/copilot-instructions.md",
|
package/docs/guide/chart-arc.md
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# Arc Diagram
|
|
2
|
-
|
|
3
|
-
```dgmo
|
|
4
|
-
arc Pirate Alliances
|
|
5
|
-
//order appearance | name | group | degree
|
|
6
|
-
|
|
7
|
-
// Source -> Target weight
|
|
8
|
-
[Caribbean](red)
|
|
9
|
-
Blackbeard -> Bonnet 8
|
|
10
|
-
Blackbeard -> Vane 5
|
|
11
|
-
Blackbeard -> Hornigold 4
|
|
12
|
-
Hornigold -> Bonnet 2
|
|
13
|
-
|
|
14
|
-
[Women Pirates](purple)
|
|
15
|
-
Bonny -> Rackham 9
|
|
16
|
-
Bonny -> Read 7
|
|
17
|
-
Rackham -> Vane 3
|
|
18
|
-
|
|
19
|
-
[West Africa](teal)
|
|
20
|
-
Roberts -> Davis 6
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Syntax
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
arc Chart Title
|
|
27
|
-
order appearance
|
|
28
|
-
|
|
29
|
-
Source -> Target weight
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Metadata Keys
|
|
33
|
-
|
|
34
|
-
| Key | Description | Required |
|
|
35
|
-
| ------- | ------------------------------------------------------------------- | -------- |
|
|
36
|
-
| `chart` | Must be `arc` | Yes |
|
|
37
|
-
| `title` | Chart title displayed above the chart | No |
|
|
38
|
-
| `order` | Node ordering: `appearance` (default), `name`, `group`, or `degree` | No |
|
|
39
|
-
|
|
40
|
-
## Data Format
|
|
41
|
-
|
|
42
|
-
Each data line defines a connection between two nodes with an optional weight:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
Source -> Target weight
|
|
46
|
-
Source -> Target
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
If weight is omitted, it defaults to 1. Arc thickness is proportional to weight.
|
|
50
|
-
|
|
51
|
-
## Node Groups
|
|
52
|
-
|
|
53
|
-
Use `[Group Name](color)` headers to group nodes by color:
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
[Captains](red)
|
|
57
|
-
Blackbeard -> Bonnet 8
|
|
58
|
-
Blackbeard -> Vane 5
|
|
59
|
-
|
|
60
|
-
[Crew](blue)
|
|
61
|
-
Bonny -> Read 7
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Nodes inherit the color of the group in which they first appear.
|
|
65
|
-
|
|
66
|
-
## Node Ordering
|
|
67
|
-
|
|
68
|
-
- `appearance` — nodes appear in the order they are first mentioned (default)
|
|
69
|
-
- `name` — nodes sorted alphabetically
|
|
70
|
-
- `group` — nodes sorted by group, then by appearance within group
|
|
71
|
-
- `degree` — nodes sorted by number of connections (most connected first)
|
package/docs/guide/chart-area.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Area Chart
|
|
2
|
-
|
|
3
|
-
```dgmo
|
|
4
|
-
area Fleet Growth Over Time
|
|
5
|
-
series Ships
|
|
6
|
-
x-label Year
|
|
7
|
-
|
|
8
|
-
era 1710 -> 1716 Rise (green)
|
|
9
|
-
era 1716 -> 1720 Decline (red)
|
|
10
|
-
|
|
11
|
-
1710 3
|
|
12
|
-
1712 5
|
|
13
|
-
1714 9
|
|
14
|
-
1716 14
|
|
15
|
-
1718 8
|
|
16
|
-
1720 4
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Syntax
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
area Chart Title
|
|
23
|
-
series Series Name
|
|
24
|
-
x-label X Axis Label
|
|
25
|
-
y-label Y Axis Label
|
|
26
|
-
|
|
27
|
-
Label value
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Era Bands
|
|
31
|
-
|
|
32
|
-
Annotate named time periods with a shaded background band and label:
|
|
33
|
-
|
|
34
|
-
```dgmo
|
|
35
|
-
area Fleet Growth by Era
|
|
36
|
-
x-label Year
|
|
37
|
-
|
|
38
|
-
era 1710 -> 1714 Early Growth (blue)
|
|
39
|
-
era 1714 -> 1720 Decline (red)
|
|
40
|
-
|
|
41
|
-
1710 3
|
|
42
|
-
1712 5
|
|
43
|
-
1714 9
|
|
44
|
-
1716 14
|
|
45
|
-
1718 8
|
|
46
|
-
1720 4
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Era syntax: `era <start> -> <end> Label (color)`
|
|
50
|
-
|
|
51
|
-
- `start` and `end` must exactly match data point labels
|
|
52
|
-
- Color is optional; omit for the palette default
|
|
53
|
-
|
|
54
|
-
## Metadata Keys
|
|
55
|
-
|
|
56
|
-
| Key | Description | Required |
|
|
57
|
-
| --------- | ----------------------------------------- | -------- |
|
|
58
|
-
| `chart` | Must be `area` | Yes |
|
|
59
|
-
| `title` | Chart title displayed above the chart | No |
|
|
60
|
-
| `series` | Name of the data series (shown in legend) | No |
|
|
61
|
-
| `x-label` | Label for the X axis | No |
|
|
62
|
-
| `y-label` | Label for the Y axis | No |
|
|
63
|
-
| `color` | Override the area fill color | No |
|
|
64
|
-
|
|
65
|
-
## Data Format
|
|
66
|
-
|
|
67
|
-
Each data line follows the pattern `Label value`:
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
1710 3
|
|
71
|
-
1712 5
|
|
72
|
-
1714 9
|
|
73
|
-
```
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Stacked Bar Chart
|
|
2
|
-
|
|
3
|
-
```dgmo
|
|
4
|
-
bar-stacked Cargo by Voyage
|
|
5
|
-
series Rum, Spices, Silk, Gold
|
|
6
|
-
|
|
7
|
-
Voyage 1 40 20 10 30
|
|
8
|
-
Voyage 2 25 35 20 20
|
|
9
|
-
Voyage 3 15 10 45 30
|
|
10
|
-
Voyage 4 30 25 15 30
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Syntax
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
bar-stacked Chart Title
|
|
17
|
-
series Series1, Series2, Series3
|
|
18
|
-
|
|
19
|
-
Label value1 value2 value3
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Metadata Keys
|
|
23
|
-
|
|
24
|
-
| Key | Description | Required |
|
|
25
|
-
| ------------------------ | ---------------------------------------------------------------- | -------- |
|
|
26
|
-
| `chart` | Must be `bar-stacked` | Yes |
|
|
27
|
-
| `title` | Chart title displayed above the chart | No |
|
|
28
|
-
| `series` | Comma-separated series names with optional colors in parentheses | Yes |
|
|
29
|
-
| `orientation-horizontal` | Horizontal bars (default is vertical) | No |
|
|
30
|
-
|
|
31
|
-
## Data Format
|
|
32
|
-
|
|
33
|
-
Each data line provides space-separated values matching the series order:
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
Voyage 1 40 20 10 30
|
|
37
|
-
Voyage 2 25 35 20 20
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Series Colors
|
|
41
|
-
|
|
42
|
-
Colors can be specified per series:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
series Imports(blue), Exports(green), Tariffs(orange)
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Variants
|
|
49
|
-
|
|
50
|
-
### Horizontal Stacked Bar
|
|
51
|
-
|
|
52
|
-
```dgmo
|
|
53
|
-
bar-stacked Port Revenue by Trade
|
|
54
|
-
orientation-horizontal
|
|
55
|
-
series Imports(blue), Exports(green), Tariffs(orange)
|
|
56
|
-
|
|
57
|
-
Port Royal 300 450 80
|
|
58
|
-
Tortuga 150 200 30
|
|
59
|
-
Nassau 400 350 120
|
|
60
|
-
Havana 500 600 150
|
|
61
|
-
```
|
package/docs/guide/chart-bar.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# Bar Chart
|
|
2
|
-
|
|
3
|
-
```dgmo
|
|
4
|
-
bar Treasure Hauls by Port
|
|
5
|
-
series Gold Doubloons
|
|
6
|
-
|
|
7
|
-
Port Royal 850
|
|
8
|
-
Tortuga 620
|
|
9
|
-
Nassau 1100
|
|
10
|
-
Havana 430
|
|
11
|
-
Cartagena 780
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Syntax
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
bar Chart Title
|
|
18
|
-
series Series Name
|
|
19
|
-
x-label X Axis Label
|
|
20
|
-
y-label Y Axis Label
|
|
21
|
-
|
|
22
|
-
Label value
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Metadata Keys
|
|
26
|
-
|
|
27
|
-
| Key | Description | Required |
|
|
28
|
-
| ------------------------ | ----------------------------------------- | -------- |
|
|
29
|
-
| `chart` | Must be `bar` | Yes |
|
|
30
|
-
| `title` | Chart title displayed above the chart | No |
|
|
31
|
-
| `series` | Name of the data series (shown in legend) | No |
|
|
32
|
-
| `x-label` | Label for the X axis | No |
|
|
33
|
-
| `y-label` | Label for the Y axis | No |
|
|
34
|
-
| `orientation-horizontal` | Horizontal bars (default is vertical) | No |
|
|
35
|
-
| `color` | Override the bar color (e.g., `red`) | No |
|
|
36
|
-
|
|
37
|
-
## Data Format
|
|
38
|
-
|
|
39
|
-
Each data line follows the pattern `Label value`:
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
Port Royal 850
|
|
43
|
-
Tortuga 620
|
|
44
|
-
Nassau 1100
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Variants
|
|
48
|
-
|
|
49
|
-
### Horizontal Bar
|
|
50
|
-
|
|
51
|
-
Add `orientation-horizontal` to display bars horizontally:
|
|
52
|
-
|
|
53
|
-
```dgmo
|
|
54
|
-
bar Crew Size by Ship
|
|
55
|
-
orientation-horizontal
|
|
56
|
-
series Crew Members
|
|
57
|
-
|
|
58
|
-
Queen Anne's Revenge 300
|
|
59
|
-
Royal Fortune 262
|
|
60
|
-
Whydah Gally 146
|
|
61
|
-
Adventure Galley 152
|
|
62
|
-
```
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
# Boxes and Lines
|
|
2
|
-
|
|
3
|
-
```dgmo
|
|
4
|
-
boxes-and-lines Pirate Software
|
|
5
|
-
|
|
6
|
-
tag Status s
|
|
7
|
-
Done(green)
|
|
8
|
-
Doing(yellow)
|
|
9
|
-
Todo(red)
|
|
10
|
-
NA(gray) default
|
|
11
|
-
|
|
12
|
-
active-tag Status
|
|
13
|
-
|
|
14
|
-
MobileApp | s:Todo
|
|
15
|
-
-> API
|
|
16
|
-
|
|
17
|
-
WebSite | s:Doing
|
|
18
|
-
-> API
|
|
19
|
-
|
|
20
|
-
[Backend]
|
|
21
|
-
API | s:Doing
|
|
22
|
-
-> DB
|
|
23
|
-
-> AuthVendor
|
|
24
|
-
|
|
25
|
-
DB | s:Done
|
|
26
|
-
|
|
27
|
-
AuthVendor
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Overview
|
|
31
|
-
|
|
32
|
-
Boxes and lines is a general-purpose node-edge diagram for modeling systems, architectures, and relationships. Nodes are connected with labeled arrows, organized into nested groups, and annotated with color-coded tags.
|
|
33
|
-
|
|
34
|
-
Unlike more specialized diagram types (infra for traffic simulation, C4 for system context), boxes-and-lines is intentionally flexible. Node shapes are inferred from names — a node called "UserDB" renders as a cylinder, "Redis" as a diamond, "OrderQueue" as a hexagon.
|
|
35
|
-
|
|
36
|
-
## Declaration
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
boxes-and-lines Optional Title
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The first line declares the diagram type and optional title.
|
|
43
|
-
|
|
44
|
-
## Nodes
|
|
45
|
-
|
|
46
|
-
Nodes are created explicitly or implicitly when referenced in edges.
|
|
47
|
-
|
|
48
|
-
### Explicit nodes
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
API Gateway | description: Main entry point
|
|
52
|
-
UserDB
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
A name on its own line creates a node. Pipe metadata is optional.
|
|
56
|
-
|
|
57
|
-
### Implicit nodes
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
API Gateway -routes-> UserService
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
If `UserService` hasn't been declared yet, it's created automatically from the edge.
|
|
64
|
-
|
|
65
|
-
### Pipe metadata
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
API Gateway | t: Backend, description: Main entry point
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Metadata uses pipe syntax with `key: value` pairs separated by commas. Common keys:
|
|
72
|
-
|
|
73
|
-
- Tag aliases (e.g., `t: Backend` where `t` is a tag alias)
|
|
74
|
-
- `description` — shown as a subtitle on the node
|
|
75
|
-
|
|
76
|
-
### Shape inference
|
|
77
|
-
|
|
78
|
-
Node shapes are inferred from names:
|
|
79
|
-
|
|
80
|
-
| Name contains | Shape |
|
|
81
|
-
| ---------------------------------------------- | ----------------- |
|
|
82
|
-
| `DB`, `Database`, `Postgres`, `MySQL`, `Mongo` | Cylinder |
|
|
83
|
-
| `Cache`, `Redis`, `Memcached` | Diamond |
|
|
84
|
-
| `Queue`, `Kafka`, `SQS`, `EventBus` | Hexagon |
|
|
85
|
-
| `Gateway`, `LB`, `Proxy`, `Router` | Wide rectangle |
|
|
86
|
-
| `User`, `Actor`, `Client`, `Admin` | Rounded rectangle |
|
|
87
|
-
| `External`, `Stripe`, `Twilio` | Dashed border |
|
|
88
|
-
| Everything else | Default rectangle |
|
|
89
|
-
|
|
90
|
-
## Edges
|
|
91
|
-
|
|
92
|
-
### Directed edges
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
A -> B // unlabeled
|
|
96
|
-
A -routes-> B // labeled
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Bidirectional edges
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
A <-syncs-> B // bidirectional with label
|
|
103
|
-
A <-> B // bidirectional unlabeled
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Indented shorthand
|
|
107
|
-
|
|
108
|
-
When a node has multiple outbound edges, indent them below:
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
API Gateway
|
|
112
|
-
-routes-> UserService
|
|
113
|
-
-routes-> ProductService
|
|
114
|
-
-routes-> OrderService
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
This is equivalent to writing three separate edge lines with `API Gateway` as the source.
|
|
118
|
-
|
|
119
|
-
### Edge metadata
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
SessionCache <-syncs-> ProductDB | p: Medium
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Edges support pipe metadata, typically for tag values.
|
|
126
|
-
|
|
127
|
-
## Groups
|
|
128
|
-
|
|
129
|
-
Groups visually contain nodes in a dashed rectangle.
|
|
130
|
-
|
|
131
|
-
### Basic groups
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
[AWS us-east-1]
|
|
135
|
-
API Gateway
|
|
136
|
-
UserService
|
|
137
|
-
ProductDB
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Nested groups (max 2 levels)
|
|
141
|
-
|
|
142
|
-
```
|
|
143
|
-
[AWS us-east-1]
|
|
144
|
-
[Compute]
|
|
145
|
-
API Gateway
|
|
146
|
-
UserService
|
|
147
|
-
[Data]
|
|
148
|
-
UserDB
|
|
149
|
-
ProductDB
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Group-to-group edges
|
|
153
|
-
|
|
154
|
-
Groups can be edge endpoints:
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
[Frontend] -> [Backend]
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Tags
|
|
161
|
-
|
|
162
|
-
Tags add colored metadata dimensions for filtering and visual grouping.
|
|
163
|
-
|
|
164
|
-
### Declaring tags
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
tag Team t Backend(blue), Frontend(green), Platform(purple)
|
|
168
|
-
tag Priority p High(red), Medium(orange), Low(gray)
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Format: `tag Name alias Value1(color), Value2(color), ...`
|
|
172
|
-
|
|
173
|
-
### Assigning tags
|
|
174
|
-
|
|
175
|
-
Use the alias in pipe metadata:
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
API Gateway | t: Backend
|
|
179
|
-
UserDB | t: Platform
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Filtering
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
active-tag Team // color nodes by Team tag
|
|
186
|
-
hide priority:Low // hide nodes tagged Low priority
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
## Options
|
|
190
|
-
|
|
191
|
-
| Directive | Values | Default | Description |
|
|
192
|
-
| ------------ | -------------- | ------- | ------------------------------------------- |
|
|
193
|
-
| `direction` | `LR`, `TB` | `TB` | Layout direction (left-right or top-bottom) |
|
|
194
|
-
| `active-tag` | tag group name | none | Which tag group drives node coloring |
|
|
195
|
-
| `hide` | `alias:value` | none | Hide nodes with a specific tag value |
|
|
196
|
-
| `mode` | `shapes` | — | Force shape rendering mode |
|
|
197
|
-
|
|
198
|
-
## Comments
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
// This is a comment
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
Only `//` comments are supported.
|
|
205
|
-
|
|
206
|
-
## Complete Example
|
|
207
|
-
|
|
208
|
-
```dgmo
|
|
209
|
-
boxes-and-lines Microservices
|
|
210
|
-
|
|
211
|
-
tag Team t Backend(blue), Frontend(green), Infra(purple)
|
|
212
|
-
active-tag Team
|
|
213
|
-
direction LR
|
|
214
|
-
|
|
215
|
-
WebApp | t: Frontend
|
|
216
|
-
-> API Gateway
|
|
217
|
-
|
|
218
|
-
API Gateway | t: Infra
|
|
219
|
-
-auth-> AuthService
|
|
220
|
-
-data-> DataService
|
|
221
|
-
|
|
222
|
-
AuthService | t: Backend
|
|
223
|
-
-> UserDB
|
|
224
|
-
|
|
225
|
-
DataService | t: Backend
|
|
226
|
-
-> PostgreSQL
|
|
227
|
-
-> Redis
|
|
228
|
-
|
|
229
|
-
UserDB | t: Infra
|
|
230
|
-
PostgreSQL | t: Infra
|
|
231
|
-
Redis | t: Infra
|
|
232
|
-
|
|
233
|
-
[Cloud]
|
|
234
|
-
[Services]
|
|
235
|
-
API Gateway
|
|
236
|
-
AuthService
|
|
237
|
-
DataService
|
|
238
|
-
[Storage]
|
|
239
|
-
UserDB
|
|
240
|
-
PostgreSQL
|
|
241
|
-
|
|
242
|
-
Redis <-cache-> DataService
|
|
243
|
-
```
|