chartlet 0.23.0

Compile structured data into deterministic, accessible static charts
Documentation
1
<div class="chartlet-wrapper"><style>.chartlet-stage{position:relative;display:inline-block;max-width:100%;vertical-align:top}.chartlet-stage>svg{display:block}.chartlet-hotspot{position:absolute;border-radius:8px;cursor:pointer}.chartlet-focus{margin:0 0 12px 0;font-size:13px}.chartlet-focus summary{cursor:pointer;min-height:24px}.chartlet-focus fieldset{border:none;padding:0;margin:4px 0 0 0}.chartlet-focus label{display:inline-flex;align-items:center;min-height:44px;margin-right:14px;cursor:pointer;white-space:nowrap}.chartlet-focus input{margin-right:4px}.chartlet-focus input:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.chartlet-wrapper:has(.chartlet-focus-node:checked) #chartlet-6c2d06c417e7fb7f .chartlet-f{opacity:.18}#chartlet-6c2d06c417e7fb7f-hs-0{left:35.61%;top:10.769%;width:12.683%;height:18.462%}#chartlet-6c2d06c417e7fb7f-hs-1{left:33.659%;top:37.692%;width:16.585%;height:20%}#chartlet-6c2d06c417e7fb7f-hs-2{left:41.951%;top:70%;width:18.537%;height:18.462%}#chartlet-6c2d06c417e7fb7f-hs-3{left:53.659%;top:37.692%;width:12.683%;height:20%}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-0:checked) #chartlet-6c2d06c417e7fb7f .chartlet-f-0{opacity:1}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-0:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-0 .chartlet-flow-node,.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-0:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-0 .chartlet-seq-box{stroke-width:3}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-1:checked) #chartlet-6c2d06c417e7fb7f .chartlet-f-1{opacity:1}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-1:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-1 .chartlet-flow-node,.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-1:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-1 .chartlet-seq-box{stroke-width:3}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-2:checked) #chartlet-6c2d06c417e7fb7f .chartlet-f-2{opacity:1}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-2:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-2 .chartlet-flow-node,.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-2:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-2 .chartlet-seq-box{stroke-width:3}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-3:checked) #chartlet-6c2d06c417e7fb7f .chartlet-f-3{opacity:1}.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-3:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-3 .chartlet-flow-node,.chartlet-wrapper:has(#chartlet-6c2d06c417e7fb7f-focus-3:checked) #chartlet-6c2d06c417e7fb7f .chartlet-n-3 .chartlet-seq-box{stroke-width:3}</style><details class="chartlet-focus"><summary>Focus</summary><fieldset><label><input type="radio" name="chartlet-6c2d06c417e7fb7f-focus" checked> Show all</label><label><input type="radio" name="chartlet-6c2d06c417e7fb7f-focus" class="chartlet-focus-node" id="chartlet-6c2d06c417e7fb7f-focus-0"> customers</label><label><input type="radio" name="chartlet-6c2d06c417e7fb7f-focus" class="chartlet-focus-node" id="chartlet-6c2d06c417e7fb7f-focus-1"> orders</label><label><input type="radio" name="chartlet-6c2d06c417e7fb7f-focus" class="chartlet-focus-node" id="chartlet-6c2d06c417e7fb7f-focus-2"> order_items</label><label><input type="radio" name="chartlet-6c2d06c417e7fb7f-focus" class="chartlet-focus-node" id="chartlet-6c2d06c417e7fb7f-focus-3"> products</label></fieldset></details><figure class="chartlet-figure" data-viz="chart"><figcaption>Shop database</figcaption><div class="chartlet-stage"><svg xmlns="http://www.w3.org/2000/svg" width="820" height="520" viewBox="0 0 820 520" id="chartlet-6c2d06c417e7fb7f" role="img" aria-labelledby="chartlet-6c2d06c417e7fb7f-title chartlet-6c2d06c417e7fb7f-description" class="chartlet-root"><title id="chartlet-6c2d06c417e7fb7f-title">Shop database</title><desc id="chartlet-6c2d06c417e7fb7f-description">Class diagram with 4 classes and 3 relations. customers: 3 attributes, 0 methods. customers is associated with orders (1 : 0..*). orders: 4 attributes, 0 methods. orders is associated with order_items (1 : 1..*). order_items: 3 attributes, 0 methods. products: 4 attributes, 0 methods. products is associated with order_items (1 : 0..*).</desc><style>.chartlet-root{--chartlet-text:#172033;--chartlet-muted:#344054;--chartlet-grid:#d9dee8;--chartlet-zero:#667085;--chartlet-accent:#2563eb;--chartlet-background:#fff;--chartlet-color-1:#2563eb;--chartlet-color-2:#c2410c;--chartlet-color-3:#475569;--chartlet-color-4:#111827;max-width:100%;height:auto;font-family:Inter,ui-sans-serif,system-ui,sans-serif;color:var(--chartlet-text)}#chartlet-6c2d06c417e7fb7f .chartlet-title{font-size:22px;font-weight:650;fill:var(--chartlet-text)}#chartlet-6c2d06c417e7fb7f .chartlet-label,#chartlet-6c2d06c417e7fb7f .chartlet-tick,#chartlet-6c2d06c417e7fb7f .chartlet-value,#chartlet-6c2d06c417e7fb7f .chartlet-value-inverse,#chartlet-6c2d06c417e7fb7f .chartlet-axis-title{font-size:12px;fill:var(--chartlet-muted)}#chartlet-6c2d06c417e7fb7f .chartlet-value,#chartlet-6c2d06c417e7fb7f .chartlet-value-inverse{font-weight:600}#chartlet-6c2d06c417e7fb7f .chartlet-value{fill:var(--chartlet-text)}#chartlet-6c2d06c417e7fb7f .chartlet-value-inverse{fill:var(--chartlet-background)}#chartlet-6c2d06c417e7fb7f .chartlet-axis-title{font-weight:600}#chartlet-6c2d06c417e7fb7f .chartlet-grid{stroke:var(--chartlet-grid);stroke-width:1}#chartlet-6c2d06c417e7fb7f .chartlet-zero{stroke:var(--chartlet-zero);stroke-width:1.5}#chartlet-6c2d06c417e7fb7f .chartlet-bar,#chartlet-6c2d06c417e7fb7f .chartlet-point{fill:var(--chartlet-accent)}#chartlet-6c2d06c417e7fb7f .chartlet-line{fill:none;stroke:var(--chartlet-accent);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}#chartlet-6c2d06c417e7fb7f .chartlet-background{fill:var(--chartlet-background)}.chartlet-root{--chartlet-node:#eef3fd;--chartlet-lane:#f7f9fc;--chartlet-lane-head:#eef1f6;--chartlet-shadow:rgba(16,24,40,.09);--chartlet-role-blue:#2563eb;--chartlet-role-blue-fill:#eef3fd;--chartlet-role-green:#15803d;--chartlet-role-green-fill:#ecfdf3;--chartlet-role-amber:#b45309;--chartlet-role-amber-fill:#fff7e8;--chartlet-role-teal:#0f766e;--chartlet-role-teal-fill:#e9faf7;--chartlet-role-violet:#6d28d9;--chartlet-role-violet-fill:#f3efff;--chartlet-role-gray:#667085;--chartlet-role-gray-fill:#f7f8fa;--chartlet-role-red:#b42318;--chartlet-role-red-fill:#fef3f2}.chartlet-root.chartlet-theme-dark{--chartlet-node:#1a2436;--chartlet-lane:#121925;--chartlet-lane-head:#18212f;--chartlet-shadow:rgba(0,0,0,.45);--chartlet-role-blue:#7ea6ff;--chartlet-role-blue-fill:#1a2436;--chartlet-role-green:#4ade80;--chartlet-role-green-fill:#132a1d;--chartlet-role-amber:#fbbf24;--chartlet-role-amber-fill:#2b2210;--chartlet-role-teal:#2dd4bf;--chartlet-role-teal-fill:#0f2a27;--chartlet-role-violet:#b69cff;--chartlet-role-violet-fill:#231c38;--chartlet-role-gray:#9aa7bd;--chartlet-role-gray-fill:#161d29;--chartlet-role-red:#f97066;--chartlet-role-red-fill:#2d1616}#chartlet-6c2d06c417e7fb7f .chartlet-role-blue{fill:var(--chartlet-role-blue-fill);stroke:var(--chartlet-role-blue)}#chartlet-6c2d06c417e7fb7f .chartlet-role-green{fill:var(--chartlet-role-green-fill);stroke:var(--chartlet-role-green)}#chartlet-6c2d06c417e7fb7f .chartlet-role-amber{fill:var(--chartlet-role-amber-fill);stroke:var(--chartlet-role-amber)}#chartlet-6c2d06c417e7fb7f .chartlet-role-teal{fill:var(--chartlet-role-teal-fill);stroke:var(--chartlet-role-teal)}#chartlet-6c2d06c417e7fb7f .chartlet-role-violet{fill:var(--chartlet-role-violet-fill);stroke:var(--chartlet-role-violet)}#chartlet-6c2d06c417e7fb7f .chartlet-role-gray{fill:var(--chartlet-role-gray-fill);stroke:var(--chartlet-role-gray)}#chartlet-6c2d06c417e7fb7f .chartlet-role-red{fill:var(--chartlet-role-red-fill);stroke:var(--chartlet-role-red)}#chartlet-6c2d06c417e7fb7f .chartlet-diagram-rim{fill:none;stroke:var(--chartlet-role-teal);stroke-width:1.5}#chartlet-6c2d06c417e7fb7f .chartlet-diagram-shadow{fill:var(--chartlet-shadow);stroke:none;rx:7px}#chartlet-6c2d06c417e7fb7f .chartlet-diagram-chip{fill:var(--chartlet-background);stroke:var(--chartlet-grid);stroke-width:1;rx:4px}#chartlet-6c2d06c417e7fb7f .chartlet-diagram-chip-text{font-size:12px;fill:var(--chartlet-text)}#chartlet-6c2d06c417e7fb7f .chartlet-diagram-badge{fill:var(--chartlet-accent);stroke:var(--chartlet-background);stroke-width:2}#chartlet-6c2d06c417e7fb7f .chartlet-diagram-badge-text{font-size:10px;font-weight:700;fill:var(--chartlet-background)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-node{stroke-width:1.5;stroke-linejoin:round;rx:7px}#chartlet-6c2d06c417e7fb7f .chartlet-flow-start{stroke-width:2}#chartlet-6c2d06c417e7fb7f .chartlet-flow-end{stroke-width:3}#chartlet-6c2d06c417e7fb7f .chartlet-flow-external{stroke-dasharray:5 3}#chartlet-6c2d06c417e7fb7f .chartlet-flow-inner{stroke:var(--chartlet-role-blue);stroke-width:1}#chartlet-6c2d06c417e7fb7f .chartlet-flow-label{font-size:13px;font-weight:600;fill:var(--chartlet-text)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-sublabel{font-size:11px;fill:var(--chartlet-muted)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-edge{fill:none;stroke:var(--chartlet-zero);stroke-width:1.4;stroke-linejoin:round}#chartlet-6c2d06c417e7fb7f .chartlet-flow-dashed{stroke-dasharray:5 4}#chartlet-6c2d06c417e7fb7f .chartlet-flow-dotted{stroke-dasharray:1 4;stroke-linecap:round}#chartlet-6c2d06c417e7fb7f .chartlet-flow-main{stroke:var(--chartlet-accent);stroke-width:2.2}#chartlet-6c2d06c417e7fb7f .chartlet-flow-head{fill:var(--chartlet-zero);stroke:var(--chartlet-zero);stroke-width:1;stroke-linejoin:round}#chartlet-6c2d06c417e7fb7f .chartlet-flow-main-head{fill:var(--chartlet-accent);stroke:var(--chartlet-accent)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-lane{fill:var(--chartlet-lane);stroke:var(--chartlet-grid);stroke-width:1}#chartlet-6c2d06c417e7fb7f .chartlet-flow-lane-alt{fill:var(--chartlet-background)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-lane-head{fill:var(--chartlet-lane-head);stroke:none}#chartlet-6c2d06c417e7fb7f .chartlet-flow-lane-label{font-size:11px;font-weight:650;fill:var(--chartlet-muted);letter-spacing:.04em}#chartlet-6c2d06c417e7fb7f .chartlet-flow-group{fill:var(--chartlet-accent);fill-opacity:.04;stroke:var(--chartlet-zero);stroke-width:1;stroke-dasharray:4 3;rx:10px}#chartlet-6c2d06c417e7fb7f .chartlet-flow-group-label{font-size:11px;font-weight:600;fill:var(--chartlet-muted)}#chartlet-6c2d06c417e7fb7f .chartlet-class-member{font-size:12px;fill:var(--chartlet-text)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-card{font-size:11px;fill:var(--chartlet-muted)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-hollow{fill:var(--chartlet-background)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-solid{fill:var(--chartlet-zero)}#chartlet-6c2d06c417e7fb7f .chartlet-flow-open{fill:none;stroke:var(--chartlet-zero);stroke-width:1.4;stroke-linejoin:round}</style><g class="chartlet-f chartlet-f-0 chartlet-f-1"><polyline points="344,152 344,196" class="chartlet-flow-edge"><title>customers → orders</title></polyline><text x="332" y="192" text-anchor="end" class="chartlet-flow-card">0..*</text><text x="332" y="164" text-anchor="end" class="chartlet-flow-card">1</text></g><g class="chartlet-f chartlet-f-1 chartlet-f-2"><polyline points="344,300 344,322.4 408,322.4 408,364" class="chartlet-flow-edge"><title>orders → order_items</title></polyline><text x="396" y="360" text-anchor="end" class="chartlet-flow-card">1..*</text><text x="332" y="312" text-anchor="end" class="chartlet-flow-card">1</text></g><g class="chartlet-f chartlet-f-2 chartlet-f-3"><polyline points="492,300 492,322.4 432,322.4 432,364" class="chartlet-flow-edge"><title>products → order_items</title></polyline><text x="420" y="360" text-anchor="end" class="chartlet-flow-card">0..*</text><text x="480" y="312" text-anchor="end" class="chartlet-flow-card">1</text></g><g class="chartlet-f chartlet-n-0 chartlet-f-0 chartlet-f-1"></g><g class="chartlet-f chartlet-n-1 chartlet-f-0 chartlet-f-1 chartlet-f-2"></g><g class="chartlet-f chartlet-n-2 chartlet-f-1 chartlet-f-2 chartlet-f-3"></g><g class="chartlet-f chartlet-n-3 chartlet-f-2 chartlet-f-3"></g><g class="chartlet-f chartlet-n-0 chartlet-f-0 chartlet-f-1"><rect x="292" y="58.5" width="104" height="96" class="chartlet-diagram-shadow"/><rect x="292" y="56" width="104" height="96" class="chartlet-flow-node chartlet-role-blue chartlet-class"><title>customers</title></rect><text x="344" y="82" text-anchor="middle" class="chartlet-flow-label">customers</text><line x1="292" y1="88" x2="396" y2="88" class="chartlet-flow-inner"/><text x="304" y="105" text-anchor="start" class="chartlet-class-member">id (PK)</text><text x="304" y="120" text-anchor="start" class="chartlet-class-member">email</text><text x="304" y="135" text-anchor="start" class="chartlet-class-member">created_at</text></g><g class="chartlet-f chartlet-n-1 chartlet-f-0 chartlet-f-1 chartlet-f-2"><rect x="276" y="198.5" width="136" height="104" class="chartlet-diagram-shadow"/><rect x="276" y="196" width="136" height="104" class="chartlet-flow-node chartlet-role-blue chartlet-class"><title>orders</title></rect><text x="344" y="222" text-anchor="middle" class="chartlet-flow-label">orders</text><line x1="276" y1="228" x2="412" y2="228" class="chartlet-flow-inner"/><text x="288" y="245" text-anchor="start" class="chartlet-class-member">id (PK)</text><text x="288" y="260" text-anchor="start" class="chartlet-class-member">customer_id (FK)</text><text x="288" y="275" text-anchor="start" class="chartlet-class-member">placed_at</text><text x="288" y="290" text-anchor="start" class="chartlet-class-member">status</text></g><g class="chartlet-f chartlet-n-2 chartlet-f-1 chartlet-f-2 chartlet-f-3"><rect x="344" y="366.5" width="152" height="96" class="chartlet-diagram-shadow"/><rect x="344" y="364" width="152" height="96" class="chartlet-flow-node chartlet-role-blue chartlet-class"><title>order_items</title></rect><text x="420" y="390" text-anchor="middle" class="chartlet-flow-label">order_items</text><line x1="344" y1="396" x2="496" y2="396" class="chartlet-flow-inner"/><text x="356" y="413" text-anchor="start" class="chartlet-class-member">order_id (PK, FK)</text><text x="356" y="428" text-anchor="start" class="chartlet-class-member">product_id (PK, FK)</text><text x="356" y="443" text-anchor="start" class="chartlet-class-member">quantity</text></g><g class="chartlet-f chartlet-n-3 chartlet-f-2 chartlet-f-3"><rect x="440" y="198.5" width="104" height="104" class="chartlet-diagram-shadow"/><rect x="440" y="196" width="104" height="104" class="chartlet-flow-node chartlet-role-blue chartlet-class"><title>products</title></rect><text x="492" y="222" text-anchor="middle" class="chartlet-flow-label">products</text><line x1="440" y1="228" x2="544" y2="228" class="chartlet-flow-inner"/><text x="452" y="245" text-anchor="start" class="chartlet-class-member">id (PK)</text><text x="452" y="260" text-anchor="start" class="chartlet-class-member">sku</text><text x="452" y="275" text-anchor="start" class="chartlet-class-member">name</text><text x="452" y="290" text-anchor="start" class="chartlet-class-member">price</text></g></svg><label class="chartlet-hotspot" id="chartlet-6c2d06c417e7fb7f-hs-0" for="chartlet-6c2d06c417e7fb7f-focus-0"></label><label class="chartlet-hotspot" id="chartlet-6c2d06c417e7fb7f-hs-1" for="chartlet-6c2d06c417e7fb7f-focus-1"></label><label class="chartlet-hotspot" id="chartlet-6c2d06c417e7fb7f-hs-2" for="chartlet-6c2d06c417e7fb7f-focus-2"></label><label class="chartlet-hotspot" id="chartlet-6c2d06c417e7fb7f-hs-3" for="chartlet-6c2d06c417e7fb7f-focus-3"></label></div><p class="chartlet-source">Source: Illustrative schema</p><details class="chartlet-data" data-viz-text><summary>Show chart data</summary><table><caption>Data for Shop database</caption><thead><tr><th scope="col">Item</th><th scope="col">Kind</th><th scope="col">Attributes</th><th scope="col">Methods</th><th scope="col">Relations</th></tr></thead><tbody><tr><th scope="row">customers</th><td>Entity</td><td>id (PK); email; created_at</td><td></td><td>is associated with orders (1 : 0..*)</td></tr><tr><th scope="row">orders</th><td>Entity</td><td>id (PK); customer_id (FK); placed_at; status</td><td></td><td>is associated with order_items (1 : 1..*)</td></tr><tr><th scope="row">order_items</th><td>Entity</td><td>order_id (PK, FK); product_id (PK, FK); quantity</td><td></td><td></td></tr><tr><th scope="row">products</th><td>Entity</td><td>id (PK); sku; name; price</td><td></td><td>is associated with order_items (1 : 0..*)</td></tr></tbody></table></details></figure></div>