feat: deployable design studio and updated component showcase

This commit is contained in:
Clintchiz committed 2026-10-19 13:18:06 +05:30
1 parent 3dddcaac1a
commit 3987ddbcfe
113 files changed
+4544 -1039

No files matched your search

+601 -62
View File
@@ -5,6 +5,9 @@ page ChartDetail {
state playground_description = ctx.url.searchParams.get("pg_description") ?? "Completed tasks this week"
state playground_items = JSON.parse(ctx.url.searchParams.get("pg_items") ?? "[{\"label\":\"Mon\",\"value\":24},{\"label\":\"Tue\",\"value\":38},{\"label\":\"Wed\",\"value\":29},{\"label\":\"Thu\",\"value\":52},{\"label\":\"Fri\",\"value\":45}]")
state playground_data = JSON.parse(ctx.url.searchParams.get("pg_data") ?? "[]")
state playground_labels = JSON.parse(ctx.url.searchParams.get("pg_labels") ?? "[]")
state playground_datasets = JSON.parse(ctx.url.searchParams.get("pg_datasets") ?? "[]")
state playground_options = JSON.parse(ctx.url.searchParams.get("pg_options") ?? "{}")
state playground_type = ctx.url.searchParams.get("pg_type") ?? ""
state playground_valueKey = ctx.url.searchParams.get("pg_valueKey") ?? "value"
state playground_labelKey = ctx.url.searchParams.get("pg_labelKey") ?? "label"
@@ -15,6 +18,17 @@ page ChartDetail {
state playground_color = ctx.url.searchParams.get("pg_color") ?? "primary"
state playground_variant = ctx.url.searchParams.get("pg_variant") ?? "bar"
state playground_class = ctx.url.searchParams.get("pg_class") ?? ""
state demo_obj_0 = JSON.parse("{\"labels\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\"],\"datasets\":[{\"label\":\"Series A\",\"data\":[24,38,29,52,45]}]}")
state demo_obj_1 = JSON.parse("{\"labels\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\"],\"datasets\":[{\"label\":\"Series A\",\"data\":[24,38,29,52,45]}]}")
state demo_obj_2 = JSON.parse("{\"labels\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\"],\"datasets\":[{\"label\":\"Series A\",\"data\":[24,38,29,52,45]}]}")
state demo_obj_3 = JSON.parse("{\"labels\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\"],\"datasets\":[{\"label\":\"Series A\",\"data\":[24,38,29,52,45]}]}")
state demo_obj_4 = JSON.parse("{\"labels\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\"],\"datasets\":[{\"label\":\"Series A\",\"data\":[24,38,29,52,45]}]}")
state demo_obj_5 = JSON.parse("{\"labels\":[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\"],\"datasets\":[{\"label\":\"Series A\",\"data\":[24,38,29,52,45]}]}")
state demo_obj_6 = JSON.parse("{\"datasets\":[{\"label\":\"Observations\",\"data\":[{\"x\":1,\"y\":4},{\"x\":3,\"y\":8},{\"x\":5,\"y\":3}]}]}")
state demo_obj_7 = JSON.parse("{\"datasets\":[{\"label\":\"Observations\",\"data\":[{\"x\":1,\"y\":4,\"r\":8},{\"x\":3,\"y\":8,\"r\":16},{\"x\":5,\"y\":3,\"r\":12}]}]}")
state demo_obj_8 = JSON.parse("{\"labels\":[\"Jan\",\"Feb\",\"Mar\"],\"datasets\":[{\"type\":\"bar\",\"label\":\"Actual\",\"data\":[20,35,28]},{\"type\":\"line\",\"label\":\"Target\",\"data\":[25,30,40]}]}")
state demo_obj_9 = JSON.parse("{\"labels\":[\"Jan\",\"Feb\",\"Mar\"],\"datasets\":[{\"label\":\"A\",\"data\":[20,35,28]},{\"label\":\"B\",\"data\":[25,30,40]}]}")
state demo_obj_10 = JSON.parse("{\"indexAxis\":\"y\",\"scales\":{\"x\":{\"stacked\":true},\"y\":{\"stacked\":true}}}")
seo {
title = "Chart"
description = "Theme-aware, responsive chart component."
@@ -28,7 +42,7 @@ page ChartDetail {
<span class="showcase-eyebrow">Integrations component</span>
<h1>Chart</h1>
<p>Theme-aware, responsive chart component.</p>
<div class="detail-badges"><span>14 props</span><span>1 slots</span><span>3 outputs</span><span>Theme ready</span><span>Responsive</span></div>
<div class="detail-badges"><span>17 props</span><span>1 slots</span><span>3 outputs</span><span>Theme ready</span><span>Responsive</span></div>
</div>
<div class="detail-hero-icon"><span class="icon-[lucide--component] size-10" aria-hidden="true"></span></div>
</header>
@@ -37,7 +51,7 @@ page ChartDetail {
<div class="playground-workbench">
<div class="playground-preview">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="playground-preview-source" data-playground-preview><Chart title='{playground_title}' description='{playground_description}' items='{playground_items}' data='{playground_data}' type='{playground_type}' valueKey='{playground_valueKey}' labelKey='{playground_labelKey}' height='{playground_height}' showLegend='{playground_showLegend}' showValues='{playground_showValues}' size='{playground_size}' color='{playground_color}' variant='{playground_variant}' class='{playground_class}' /></div>
<div class="playground-preview-source" data-playground-preview><Chart title='{playground_title}' description='{playground_description}' items='{playground_items}' data='{playground_data}' labels='{playground_labels}' datasets='{playground_datasets}' options='{playground_options}' type='{playground_type}' valueKey='{playground_valueKey}' labelKey='{playground_labelKey}' height='{playground_height}' showLegend='{playground_showLegend}' showValues='{playground_showValues}' size='{playground_size}' color='{playground_color}' variant='{playground_variant}' class='{playground_class}' /></div>
<section class="playground-code" aria-label="Current component code">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component code</span><button type="button" data-playground-copy><span class="icon-[lucide--copy] size-4" aria-hidden="true"></span>Copy</button></header>
<pre><code data-playground-code>page ChartExample <span>&#123;</span>
@@ -63,13 +77,15 @@ page ChartDetail {
"value": 45
<span>&#125;</span>
]
state data = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Weekly activity"
description="Completed tasks this week"
items="<span>&#123;</span>items<span>&#125;</span>"
data="<span>&#123;</span>data<span>&#125;</span>"
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
height="220"
showLegend="false"
/&gt;
@@ -80,7 +96,7 @@ page ChartDetail {
<div class="playground-event-log" data-playground-event-log aria-live="polite"><strong>Event output</strong><span>Interact with the preview to inspect the typed <code>payload</code>.</span></div>
</div>
<form class="playground-controls" data-playground-form>
<header><div><span>Component props</span><strong>14 controls</strong></div><button type="reset"><span class="icon-[lucide--rotate-ccw] size-4" aria-hidden="true"></span>Reset</button></header>
<header><div><span>Component props</span><strong>17 controls</strong></div><button type="reset"><span class="icon-[lucide--rotate-ccw] size-4" aria-hidden="true"></span>Reset</button></header>
<div class="playground-fields"><label class="playground-field" for="playground-chart-title"><span><strong>title</strong><small>string</small></span><input id="playground-chart-title" name="pg_title" type="text" value="Weekly activity" /></label><label class="playground-field" for="playground-chart-description"><span><strong>description</strong><small>string</small></span><input id="playground-chart-description" name="pg_description" type="text" value="Completed tasks this week" /></label><label class="playground-field" for="playground-chart-items"><span><strong>items</strong><small>unknown[]</small></span><textarea id="playground-chart-items" name="pg_items" rows="5" spellcheck="false" data-playground-json>[
&#123;
"label": "Mon",
@@ -102,7 +118,7 @@ page ChartDetail {
"label": "Fri",
"value": 45
&#125;
]</textarea><em data-playground-error></em></label><label class="playground-field" for="playground-chart-data"><span><strong>data</strong><small>unknown[]</small></span><textarea id="playground-chart-data" name="pg_data" rows="5" spellcheck="false" data-playground-json>[]</textarea><em data-playground-error></em></label><label class="playground-field" for="playground-chart-type"><span><strong>type</strong><small>string</small></span><select id="playground-chart-type" name="pg_type"><option value="" selected>Auto / default</option><option value="bar">bar</option><option value="line">line</option></select></label><label class="playground-field" for="playground-chart-valueKey"><span><strong>value Key</strong><small>string</small></span><input id="playground-chart-valueKey" name="pg_valueKey" type="text" value="value" /></label><label class="playground-field" for="playground-chart-labelKey"><span><strong>label Key</strong><small>string</small></span><input id="playground-chart-labelKey" name="pg_labelKey" type="text" value="label" /></label><label class="playground-field" for="playground-chart-height"><span><strong>height</strong><small>number</small></span><input id="playground-chart-height" name="pg_height" type="number" value="220" /></label><label class="playground-toggle" for="playground-chart-showLegend"><span><strong>show Legend</strong><small>boolean</small></span><input id="playground-chart-showLegend" name="pg_showLegend" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-chart-showValues"><span><strong>show Values</strong><small>boolean</small></span><input id="playground-chart-showValues" name="pg_showValues" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-chart-size"><span><strong>size</strong><small>string</small></span><select id="playground-chart-size" name="pg_size"><option value="default" selected>default</option><option value="xs">xs</option><option value="sm">sm</option><option value="md">md</option><option value="lg">lg</option><option value="xl">xl</option><option value="icon">icon</option><option value="icon-xs">icon-xs</option><option value="icon-sm">icon-sm</option><option value="icon-lg">icon-lg</option></select></label><label class="playground-field" for="playground-chart-color"><span><strong>color</strong><small>string</small></span><select id="playground-chart-color" name="pg_color"><option value="primary" selected>primary</option><option value="secondary">secondary</option><option value="success">success</option><option value="warning">warning</option><option value="danger">danger</option><option value="info">info</option></select></label><label class="playground-field" for="playground-chart-variant"><span><strong>variant</strong><small>string</small></span><input id="playground-chart-variant" name="pg_variant" type="text" value="bar" /></label><label class="playground-field" for="playground-chart-class"><span><strong>class</strong><small>string</small></span><input id="playground-chart-class" name="pg_class" type="text" value="" /></label></div>
]</textarea><em data-playground-error></em></label><label class="playground-field" for="playground-chart-data"><span><strong>data</strong><small>unknown</small></span><input id="playground-chart-data" name="pg_data" type="text" value="" /></label><label class="playground-field" for="playground-chart-labels"><span><strong>labels</strong><small>unknown[]</small></span><textarea id="playground-chart-labels" name="pg_labels" rows="5" spellcheck="false" data-playground-json>[]</textarea><em data-playground-error></em></label><label class="playground-field" for="playground-chart-datasets"><span><strong>datasets</strong><small>unknown[]</small></span><textarea id="playground-chart-datasets" name="pg_datasets" rows="5" spellcheck="false" data-playground-json>[]</textarea><em data-playground-error></em></label><label class="playground-field" for="playground-chart-options"><span><strong>options</strong><small>object</small></span><textarea id="playground-chart-options" name="pg_options" rows="5" spellcheck="false" data-playground-json></textarea><em data-playground-error></em></label><label class="playground-field" for="playground-chart-type"><span><strong>type</strong><small>string</small></span><select id="playground-chart-type" name="pg_type"><option value="" selected>Auto / default</option><option value="bar">bar</option><option value="line">line</option><option value="area">area</option><option value="pie">pie</option><option value="doughnut">doughnut</option><option value="radar">radar</option><option value="polarArea">polarArea</option><option value="scatter">scatter</option><option value="bubble">bubble</option></select></label><label class="playground-field" for="playground-chart-valueKey"><span><strong>value Key</strong><small>string</small></span><input id="playground-chart-valueKey" name="pg_valueKey" type="text" value="value" /></label><label class="playground-field" for="playground-chart-labelKey"><span><strong>label Key</strong><small>string</small></span><input id="playground-chart-labelKey" name="pg_labelKey" type="text" value="label" /></label><label class="playground-field" for="playground-chart-height"><span><strong>height</strong><small>number</small></span><input id="playground-chart-height" name="pg_height" type="number" value="220" /></label><label class="playground-toggle" for="playground-chart-showLegend"><span><strong>show Legend</strong><small>boolean</small></span><input id="playground-chart-showLegend" name="pg_showLegend" type="checkbox" value="true" data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-toggle" for="playground-chart-showValues"><span><strong>show Values</strong><small>boolean</small></span><input id="playground-chart-showValues" name="pg_showValues" type="checkbox" value="true" checked data-playground-boolean /><i aria-hidden="true"></i></label><label class="playground-field" for="playground-chart-size"><span><strong>size</strong><small>string</small></span><select id="playground-chart-size" name="pg_size"><option value="default" selected>default</option><option value="xs">xs</option><option value="sm">sm</option><option value="md">md</option><option value="lg">lg</option><option value="xl">xl</option><option value="icon">icon</option><option value="icon-xs">icon-xs</option><option value="icon-sm">icon-sm</option><option value="icon-lg">icon-lg</option></select></label><label class="playground-field" for="playground-chart-color"><span><strong>color</strong><small>string</small></span><select id="playground-chart-color" name="pg_color"><option value="primary" selected>primary</option><option value="secondary">secondary</option><option value="success">success</option><option value="warning">warning</option><option value="danger">danger</option><option value="info">info</option></select></label><label class="playground-field" for="playground-chart-variant"><span><strong>variant</strong><small>string</small></span><input id="playground-chart-variant" name="pg_variant" type="text" value="bar" /></label><label class="playground-field" for="playground-chart-class"><span><strong>class</strong><small>string</small></span><input id="playground-chart-class" name="pg_class" type="text" value="" /></label></div>
</form>
</div>
</section>
@@ -111,50 +127,53 @@ page ChartDetail {
<section class="detail-section"><div class="detail-section-heading"><span>Live examples</span><h2>Designed for real product surfaces</h2><p>Compare configurations and resize the browser to check responsive behavior.</p></div><div class="demo-list">
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Recommended</span><h2>Bar chart</h2><p>Pass an array of label/value objects through data.</p></div>
<div><span class="demo-case-eyebrow">Recommended</span><h2>Bar chart</h2><p>Chart.js bars with positive and negative values.</p></div>
<span class="demo-case-number">01</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-1" class="demo-canvas demo-canvas--1">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Weekly signups" description="Completed tasks this week" items='[]' data='[{"label":"Mon","value":24},{"label":"Tue","value":38},{"label":"Wed","value":29},{"label":"Thu","value":52},{"label":"Fri","value":45}]' type="bar" valueKey="value" labelKey="label" height="220" showLegend="false" showValues="true" size="default" color="primary" variant="bar" class="" /></div>
<div class="demo-render"><Chart title="Sample weekly changes" description="Sample data" items='[]' data='[{"label":"Mon","value":24},{"label":"Tue","value":-12},{"label":"Wed","value":29},{"label":"Thu","value":52},{"label":"Fri","value":45}]' labels='[]' datasets='[]' type="bar" valueKey="value" labelKey="label" height="220" showLegend="true" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="Bar chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state data = [
<span>&#123;</span>
"label": "Mon",
"value": 24
<span>&#125;</span>,
<span>&#123;</span>
"label": "Tue",
"value": 38
<span>&#125;</span>,
<span>&#123;</span>
"label": "Wed",
"value": 29
<span>&#125;</span>,
<span>&#123;</span>
"label": "Thu",
"value": 52
<span>&#125;</span>,
<span>&#123;</span>
"label": "Fri",
"value": 45
<span>&#125;</span>
]
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Weekly signups"
description="Completed tasks this week"
title="Sample weekly changes"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data="<span>&#123;</span>data<span>&#125;</span>"
data='[
<span>&#123;</span>
"label": "Mon",
"value": 24
<span>&#125;</span>,
<span>&#123;</span>
"label": "Tue",
"value": -12
<span>&#125;</span>,
<span>&#123;</span>
"label": "Wed",
"value": 29
<span>&#125;</span>,
<span>&#123;</span>
"label": "Thu",
"value": 52
<span>&#125;</span>,
<span>&#123;</span>
"label": "Fri",
"value": 45
<span>&#125;</span>
]'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="bar"
height="220"
showLegend="false"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
@@ -163,46 +182,566 @@ page ChartDetail {
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Compact</span><h2>Line chart</h2><p>Use type=line to compare a trend over time.</p></div>
<div><span class="demo-case-eyebrow">Compact</span><h2>line chart</h2><p>Rendered by Chart.js with native tooltips and legend interactions.</p></div>
<span class="demo-case-number">02</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-2" class="demo-canvas demo-canvas--2">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Monthly revenue" description="Completed tasks this week" items='[]' data='[{"label":"Jan","value":20},{"label":"Feb","value":35},{"label":"Mar","value":28},{"label":"Apr","value":55}]' type="line" valueKey="value" labelKey="label" height="220" showLegend="false" showValues="true" size="default" color="primary" variant="bar" class="" /></div>
<div class="demo-render"><Chart title="Sample line" description="Sample data" items='[]' data='{demo_obj_0}' labels='[]' datasets='[]' type="line" valueKey="value" labelKey="label" height="220" showLegend="true" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="Line chart usage">
<section class="demo-code" aria-label="line chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state data = [
<span>&#123;</span>
"label": "Jan",
"value": 20
<span>&#125;</span>,
<span>&#123;</span>
"label": "Feb",
"value": 35
<span>&#125;</span>,
<span>&#123;</span>
"label": "Mar",
"value": 28
<span>&#125;</span>,
<span>&#123;</span>
"label": "Apr",
"value": 55
<span>&#125;</span>
]
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Monthly revenue"
description="Completed tasks this week"
title="Sample line"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data="<span>&#123;</span>data<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"datasets": [
<span>&#123;</span>
"label": "Series A",
"data": [
24,
38,
29,
52,
45
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="line"
height="220"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Compact</span><h2>area chart</h2><p>Rendered by Chart.js with native tooltips and legend interactions.</p></div>
<span class="demo-case-number">03</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-3" class="demo-canvas demo-canvas--3">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample area" description="Sample data" items='[]' data='{demo_obj_1}' labels='[]' datasets='[]' type="area" valueKey="value" labelKey="label" height="220" showLegend="true" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="area chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample area"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"datasets": [
<span>&#123;</span>
"label": "Series A",
"data": [
24,
38,
29,
52,
45
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="area"
height="220"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Compact</span><h2>pie chart</h2><p>Rendered by Chart.js with native tooltips and legend interactions.</p></div>
<span class="demo-case-number">04</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-4" class="demo-canvas demo-canvas--4">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample pie" description="Sample data" items='[]' data='{demo_obj_2}' labels='[]' datasets='[]' type="pie" valueKey="value" labelKey="label" height="220" showLegend="true" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="pie chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample pie"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"datasets": [
<span>&#123;</span>
"label": "Series A",
"data": [
24,
38,
29,
52,
45
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="pie"
height="220"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Compact</span><h2>doughnut chart</h2><p>Rendered by Chart.js with native tooltips and legend interactions.</p></div>
<span class="demo-case-number">05</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-5" class="demo-canvas demo-canvas--5">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample doughnut" description="Sample data" items='[]' data='{demo_obj_3}' labels='[]' datasets='[]' type="doughnut" valueKey="value" labelKey="label" height="220" showLegend="true" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="doughnut chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample doughnut"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"datasets": [
<span>&#123;</span>
"label": "Series A",
"data": [
24,
38,
29,
52,
45
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="doughnut"
height="220"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Compact</span><h2>radar chart</h2><p>Rendered by Chart.js with native tooltips and legend interactions.</p></div>
<span class="demo-case-number">06</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-6" class="demo-canvas demo-canvas--6">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample radar" description="Sample data" items='[]' data='{demo_obj_4}' labels='[]' datasets='[]' type="radar" valueKey="value" labelKey="label" height="220" showLegend="true" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="radar chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample radar"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"datasets": [
<span>&#123;</span>
"label": "Series A",
"data": [
24,
38,
29,
52,
45
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="radar"
height="220"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Compact</span><h2>polarArea chart</h2><p>Rendered by Chart.js with native tooltips and legend interactions.</p></div>
<span class="demo-case-number">07</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-7" class="demo-canvas demo-canvas--7">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample polarArea" description="Sample data" items='[]' data='{demo_obj_5}' labels='[]' datasets='[]' type="polarArea" valueKey="value" labelKey="label" height="220" showLegend="true" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="polarArea chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample polarArea"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri"
],
"datasets": [
<span>&#123;</span>
"label": "Series A",
"data": [
24,
38,
29,
52,
45
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="polarArea"
height="220"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Advanced</span><h2>Scatter chart</h2><p>Pass native x/y coordinates without flattening them.</p></div>
<span class="demo-case-number">08</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-8" class="demo-canvas demo-canvas--8">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample coordinates" description="Sample data" items='[]' data='{demo_obj_6}' labels='[]' datasets='[]' type="scatter" valueKey="value" labelKey="label" height="220" showLegend="false" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="Scatter chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample coordinates"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"datasets": [
<span>&#123;</span>
"label": "Observations",
"data": [
<span>&#123;</span>
"x": 1,
"y": 4
<span>&#125;</span>,
<span>&#123;</span>
"x": 3,
"y": 8
<span>&#125;</span>,
<span>&#123;</span>
"x": 5,
"y": 3
<span>&#125;</span>
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="scatter"
height="220"
showLegend="false"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Advanced</span><h2>Bubble chart</h2><p>Native x/y/r points preserve bubble radii.</p></div>
<span class="demo-case-number">09</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-9" class="demo-canvas demo-canvas--9">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample bubbles" description="Sample data" items='[]' data='{demo_obj_7}' labels='[]' datasets='[]' type="bubble" valueKey="value" labelKey="label" height="220" showLegend="false" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="Bubble chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample bubbles"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"datasets": [
<span>&#123;</span>
"label": "Observations",
"data": [
<span>&#123;</span>
"x": 1,
"y": 4,
"r": 8
<span>&#125;</span>,
<span>&#123;</span>
"x": 3,
"y": 8,
"r": 16
<span>&#125;</span>,
<span>&#123;</span>
"x": 5,
"y": 3,
"r": 12
<span>&#125;</span>
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="bubble"
height="220"
showLegend="false"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Advanced</span><h2>Mixed chart</h2><p>Set each dataset's type and pass native Chart.js options.</p></div>
<span class="demo-case-number">010</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-10" class="demo-canvas demo-canvas--10">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample mixed chart" description="Sample data" items='[]' data='{demo_obj_8}' labels='[]' datasets='[]' type="bar" valueKey="value" labelKey="label" height="220" showLegend="false" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="Mixed chart usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample mixed chart"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Jan",
"Feb",
"Mar"
],
"datasets": [
<span>&#123;</span>
"type": "bar",
"label": "Actual",
"data": [
20,
35,
28
]
<span>&#125;</span>,
<span>&#123;</span>
"type": "line",
"label": "Target",
"data": [
25,
30,
40
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
type="bar"
height="220"
showLegend="false"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
</section>
</div>
</article>
<article class="demo-case">
<header class="demo-case-header">
<div><span class="demo-case-eyebrow">Advanced</span><h2>Horizontal stacked bars</h2><p>Configure indexAxis and stacked scales through options.</p></div>
<span class="demo-case-number">011</span>
</header>
<div class="demo-workbench">
<div id="chart-demo-11" class="demo-canvas demo-canvas--11">
<div class="demo-browser-chrome"><span></span><span></span><span></span><small>Live preview</small></div>
<div class="demo-render"><Chart title="Sample stacked chart" description="Sample data" items='[]' data='{demo_obj_9}' labels='[]' datasets='[]' options='{demo_obj_10}' type="bar" valueKey="value" labelKey="label" height="220" showLegend="false" showValues="false" size="default" color="primary" variant="bar" class="" /></div>
</div>
<section class="demo-code" aria-label="Horizontal stacked bars usage">
<header><span><span class="icon-[lucide--code-2] size-4" aria-hidden="true"></span>Component usage</span><small>.wrn</small></header>
<pre><code>page ChartExample <span>&#123;</span>
state items = []
state labels = []
state datasets = []
view <span>&#123;</span>
&lt;Chart
title="Sample stacked chart"
description="Sample data"
items="<span>&#123;</span>items<span>&#125;</span>"
data='<span>&#123;</span>
"labels": [
"Jan",
"Feb",
"Mar"
],
"datasets": [
<span>&#123;</span>
"label": "A",
"data": [
20,
35,
28
]
<span>&#125;</span>,
<span>&#123;</span>
"label": "B",
"data": [
25,
30,
40
]
<span>&#125;</span>
]
<span>&#125;</span>'
labels="<span>&#123;</span>labels<span>&#125;</span>"
datasets="<span>&#123;</span>datasets<span>&#125;</span>"
options='<span>&#123;</span>
"indexAxis": "y",
"scales": <span>&#123;</span>
"x": <span>&#123;</span>
"stacked": true
<span>&#125;</span>,
"y": <span>&#123;</span>
"stacked": true
<span>&#125;</span>
<span>&#125;</span>
<span>&#125;</span>'
type="bar"
height="220"
showLegend="false"
showValues="false"
/&gt;
<span>&#125;</span>
<span>&#125;</span></code></pre>
@@ -228,10 +767,10 @@ if (component) registerOutputHandler(component, "dataPointClick", (payload) =&gt
if (component) registerOutputHandler(component, "legendToggle", (payload) =&gt; <span>&#123;</span>
console.log("legendToggle", payload)
<span>&#125;</span>)</code></pre></section></div></div></section>
<section id="api" class="detail-section"><div class="detail-section-heading"><span>Component API</span><h2>Props and configuration</h2><p>All content and behavior shown above is supplied through these props and slots.</p></div><div class="docs-table-wrap"><table class="docs-table"><thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td><code>title</code></td><td>string</td><td><code>"Chart"</code></td><td>No</td></tr><tr><td><code>description</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>items</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>data</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>type</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>valueKey</code></td><td>string</td><td><code>"value"</code></td><td>No</td></tr><tr><td><code>labelKey</code></td><td>string</td><td><code>"label"</code></td><td>No</td></tr><tr><td><code>height</code></td><td>number</td><td><code>240</code></td><td>No</td></tr><tr><td><code>showLegend</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>showValues</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>size</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>color</code></td><td>string</td><td><code>"primary"</code></td><td>No</td></tr><tr><td><code>variant</code></td><td>string</td><td><code>"bar"</code></td><td>No</td></tr><tr><td><code>class</code></td><td>string</td><td><code>""</code></td><td>No</td></tr></tbody></table></div></section>
<section id="api" class="detail-section"><div class="detail-section-heading"><span>Component API</span><h2>Props and configuration</h2><p>All content and behavior shown above is supplied through these props and slots.</p></div><div class="docs-table-wrap"><table class="docs-table"><thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Required</th></tr></thead><tbody><tr><td><code>title</code></td><td>string</td><td><code>"Chart"</code></td><td>No</td></tr><tr><td><code>description</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>items</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>data</code></td><td>unknown</td><td><code>undefined</code></td><td>No</td></tr><tr><td><code>labels</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>datasets</code></td><td>unknown[]</td><td><code>[]</code></td><td>No</td></tr><tr><td><code>options</code></td><td>object</td><td><code><span>&#123;</span><span>&#125;</span></code></td><td>No</td></tr><tr><td><code>type</code></td><td>string</td><td><code>""</code></td><td>No</td></tr><tr><td><code>valueKey</code></td><td>string</td><td><code>"value"</code></td><td>No</td></tr><tr><td><code>labelKey</code></td><td>string</td><td><code>"label"</code></td><td>No</td></tr><tr><td><code>height</code></td><td>number</td><td><code>240</code></td><td>No</td></tr><tr><td><code>showLegend</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>showValues</code></td><td>boolean</td><td><code>true</code></td><td>No</td></tr><tr><td><code>size</code></td><td>string</td><td><code>"default"</code></td><td>No</td></tr><tr><td><code>color</code></td><td>string</td><td><code>"primary"</code></td><td>No</td></tr><tr><td><code>variant</code></td><td>string</td><td><code>"bar"</code></td><td>No</td></tr><tr><td><code>class</code></td><td>string</td><td><code>""</code></td><td>No</td></tr></tbody></table></div></section>
</main>
<aside class="detail-aside">
<div class="detail-toc"><strong>On this page</strong><a href="#playground">Playground</a><a href="#chart-demo-1">Bar chart</a><a href="#chart-demo-2">Line chart</a><a href="#events">Outputs</a><a href="#api">Props API</a></div>
<div class="detail-toc"><strong>On this page</strong><a href="#playground">Playground</a><a href="#chart-demo-1">Bar chart</a><a href="#chart-demo-2">line chart</a><a href="#chart-demo-3">area chart</a><a href="#chart-demo-4">pie chart</a><a href="#chart-demo-5">doughnut chart</a><a href="#chart-demo-6">radar chart</a><a href="#chart-demo-7">polarArea chart</a><a href="#chart-demo-8">Scatter chart</a><a href="#chart-demo-9">Bubble chart</a><a href="#chart-demo-10">Mixed chart</a><a href="#chart-demo-11">Horizontal stacked bars</a><a href="#events">Outputs</a><a href="#api">Props API</a></div>
</aside>
</div>
<nav class="detail-pagination">