@ds-mo/ui 13.6.1 → 13.7.0
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/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +106 -368
- package/dist/angular/ds-card-chart.d.ts +18 -0
- package/dist/angular/{ds-card-data-viz.js → ds-card-chart.js} +10 -10
- package/dist/angular/ds-chart.d.ts +19 -0
- package/dist/angular/{ds-chart-donut.js → ds-chart.js} +15 -15
- package/dist/angular/ds-tooltip-chart.d.ts +12 -0
- package/dist/angular/{ds-chart-line.js → ds-tooltip-chart.js} +12 -12
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.js +3 -5
- package/dist/angular/proxies.d.ts +3 -5
- package/dist/angular/proxies.js +3 -5
- package/dist/components/ds-agent-activity.js +1 -1
- package/dist/components/ds-agent-response.js +1 -1
- package/dist/components/ds-agent-source-list.js +1 -1
- package/dist/components/ds-agent-tool-call.js +1 -1
- package/dist/components/ds-attachment-list.js +1 -1
- package/dist/components/ds-badge.js +1 -1
- package/dist/components/ds-banner.js +1 -1
- package/dist/components/ds-banner.js.map +1 -1
- package/dist/components/ds-bar-nav.js +1 -1
- package/dist/components/ds-bar-title.js +1 -1
- package/dist/components/ds-bar-workflow.js +1 -1
- package/dist/components/ds-breadcrumb.js +1 -1
- package/dist/components/ds-button-filled.js +1 -1
- package/dist/components/ds-button-unfilled.js +1 -1
- package/dist/components/{ds-chart-line.d.ts → ds-card-chart.d.ts} +4 -4
- package/dist/components/ds-card-chart.js +2 -0
- package/dist/components/ds-card-chart.js.map +1 -0
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-card-setting.js +1 -1
- package/dist/components/ds-card-setting.js.map +1 -1
- package/dist/components/ds-chart-legend.js +1 -1
- package/dist/components/ds-chart-legend.js.map +1 -1
- package/dist/components/{ds-chart-bar.d.ts → ds-chart.d.ts} +4 -4
- package/dist/components/ds-chart.js +2 -0
- package/dist/components/ds-chart.js.map +1 -0
- package/dist/components/ds-checkbox.js +1 -1
- package/dist/components/ds-chip.js +1 -1
- package/dist/components/ds-code-block.js +1 -1
- package/dist/components/ds-conversation-list-item.js +1 -1
- package/dist/components/ds-conversation-list-section.js +1 -1
- package/dist/components/ds-conversation-list.js +1 -1
- package/dist/components/ds-divider.js +1 -1
- package/dist/components/ds-empty-state.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-input.js +1 -1
- package/dist/components/ds-markdown.js +1 -1
- package/dist/components/ds-menu.js +1 -1
- package/dist/components/ds-message-actions.js +1 -1
- package/dist/components/ds-message-bubble.js +1 -1
- package/dist/components/ds-message-composer.js +1 -1
- package/dist/components/ds-message-composer.js.map +1 -1
- package/dist/components/ds-message-scroller.js +1 -1
- package/dist/components/ds-message.js +1 -1
- package/dist/components/ds-mobile-bar-nav.js +1 -1
- package/dist/components/ds-mobile-header.js +1 -1
- package/dist/components/ds-mobile-section-switcher.js +1 -1
- package/dist/components/ds-mobile-sheet-nav.js +1 -1
- package/dist/components/ds-modal.js +1 -1
- package/dist/components/ds-modal.js.map +1 -1
- package/dist/components/ds-panel-nav.js +1 -1
- package/dist/components/ds-panel-sub-nav.js +1 -1
- package/dist/components/ds-panel-tool-header.js +1 -1
- package/dist/components/ds-panel-tool-search.js +1 -1
- package/dist/components/ds-panel-tools.js +1 -1
- package/dist/components/ds-radio.js +1 -1
- package/dist/components/ds-scroll-overlay.js +1 -1
- package/dist/components/ds-scroll-overlay.js.map +1 -1
- package/dist/components/ds-select.js +1 -1
- package/dist/components/ds-select.js.map +1 -1
- package/dist/components/ds-shell-app.js +1 -1
- package/dist/components/ds-shell-page.js +1 -1
- package/dist/components/ds-shell-tools.js +1 -1
- package/dist/components/ds-skeleton.js +1 -1
- package/dist/components/ds-slider.js +1 -1
- package/dist/components/ds-swatch-picker.js +1 -1
- package/dist/components/ds-switch.js +1 -1
- package/dist/components/ds-tab-group.js +1 -1
- package/dist/components/ds-tag.js +1 -1
- package/dist/components/ds-text.js +1 -1
- package/dist/components/ds-toast.js +1 -1
- package/dist/components/ds-toast.js.map +1 -1
- package/dist/components/{ds-card-data-viz.d.ts → ds-tooltip-chart.d.ts} +4 -4
- package/dist/components/ds-tooltip-chart.js +2 -0
- package/dist/components/ds-tooltip.js +1 -1
- package/dist/components/ds-typing-indicator.js +1 -1
- package/dist/components/{p-IYy-jODg.js → p-1Zbh1MRy.js} +2 -2
- package/dist/components/{p-wOOAzVMC.js → p-BVsLc3t5.js} +2 -2
- package/dist/components/p-BZCUFHYa.js +2 -0
- package/dist/components/{p-D0bM3cKj.js.map → p-BZCUFHYa.js.map} +1 -1
- package/dist/components/{p-BBtjABBS.js → p-BjiRqLtB.js} +2 -2
- package/dist/components/p-Bk1A9jLm.js +2 -0
- package/dist/components/p-Bk1A9jLm.js.map +1 -0
- package/dist/components/{p-Bsfpxto1.js → p-BsBw-w1q.js} +2 -2
- package/dist/components/p-ByfXC1wu.js +2 -0
- package/dist/components/{p-1S9AW2MA.js.map → p-ByfXC1wu.js.map} +1 -1
- package/dist/components/{p-B6RrZQqw.js → p-C-ENnZzq.js} +2 -2
- package/dist/components/{p-BPyymeuR.js → p-C2U48kDH.js} +2 -2
- package/dist/components/{p-CKRJX0Y0.js → p-C7mCjS2t.js} +2 -2
- package/dist/components/{p-6B411hQA.js → p-CL8XL1eh.js} +2 -2
- package/dist/components/{p-DfvDNcoq.js → p-CMZVPEZ_.js} +2 -2
- package/dist/components/{p-CzraIk34.js → p-CWL61nKt.js} +2 -2
- package/dist/components/p-CWLrXsDQ.js +2 -0
- package/dist/components/{p-D2cjoj2r.js.map → p-CWLrXsDQ.js.map} +1 -1
- package/dist/components/{p-Di81y9Q2.js → p-CX7QIytv.js} +2 -2
- package/dist/components/p-CXduurfd.js +2 -0
- package/dist/components/p-CXduurfd.js.map +1 -0
- package/dist/components/p-CbAfTqlb.js +2 -0
- package/dist/components/{p-CuJ3J6OJ.js.map → p-CbAfTqlb.js.map} +1 -1
- package/dist/components/{p-DVuxzrCC.js → p-CfTThRNX.js} +2 -2
- package/dist/components/{p-BmNpPyzf.js → p-CkLffZGn.js} +2 -2
- package/dist/components/{p-B4_0Ys4w.js → p-CkyXU1YX.js} +2 -2
- package/dist/components/{p-iCjUWcp7.js → p-CywKWfgD.js} +2 -2
- package/dist/components/{p-BR_oMaas.js → p-D3UKwTEo.js} +2 -2
- package/dist/components/{p-Bl6A5AJq.js → p-D7z9bJ6n.js} +2 -2
- package/dist/components/{p-DaqFuVKZ.js → p-DAftUxvL.js} +2 -2
- package/dist/components/{p-BFfHIu6y.js → p-DQ94PkZA.js} +2 -2
- package/dist/components/{p-B-kRByho.js → p-DSpq7xQF.js} +2 -2
- package/dist/components/{p-og48Kh2i.js → p-DzM3TcyQ.js} +2 -2
- package/dist/components/p-GbTasczF.js +2 -0
- package/dist/components/{p-Ca6s5fLR.js → p-Mmr9b1bB.js} +2 -2
- package/dist/components/p-UH2AGfR0.js +2 -0
- package/dist/components/{p-DX4c3kZ1.js.map → p-UH2AGfR0.js.map} +1 -1
- package/dist/components/{p-CxgMUvqg.js → p-Z2zfShlF.js} +2 -2
- package/dist/components/{p-Bmo4T96l.js → p-_mClULFL.js} +2 -2
- package/dist/components/{p-Bb4f5SuF.js → p-jf1zCsuw.js} +2 -2
- package/dist/components/{p-Eep5mxtv.js → p-oiR4IoH1.js} +2 -2
- package/dist/components/{p-DHF5cLzr.js → p-u2OZHaLY.js} +2 -2
- package/dist/docs/components.json +180 -662
- package/dist/lib/utils/chart-grammar.d.ts +359 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/index.js +504 -0
- package/dist/lib/utils/index.js.map +4 -4
- package/dist/lib/utils/token-defaults.d.ts +3 -0
- package/dist/mcp-data/registry/card-chart.json +238 -0
- package/dist/mcp-data/registry/card-overview.json +2 -2
- package/dist/mcp-data/registry/card-setting.json +2 -2
- package/dist/mcp-data/registry/chart-legend.json +11 -18
- package/dist/mcp-data/registry/chart.json +258 -0
- package/dist/mcp-data/registry/registry.json +105 -373
- package/dist/mcp-data/registry/tooltip-chart.json +253 -0
- package/dist/mcp-data/registry/tooltip.json +2 -2
- package/dist/react/components.d.ts +3 -5
- package/dist/react/components.js +3 -5
- package/dist/react/ds-card-chart.d.ts +12 -0
- package/dist/react/ds-card-chart.js +12 -0
- package/dist/react/ds-chart.d.ts +12 -0
- package/dist/react/ds-chart.js +12 -0
- package/dist/react/{ds-chart-bar.d.ts → ds-tooltip-chart.d.ts} +3 -3
- package/dist/react/ds-tooltip-chart.js +12 -0
- package/dist/types/components/{CardDataViz/CardDataViz.d.ts → CardChart/CardChart.d.ts} +9 -13
- package/dist/types/components/CardChart/index.d.ts +2 -0
- package/dist/types/components/Chart/Chart.d.ts +66 -0
- package/dist/types/components/Chart/index.d.ts +2 -0
- package/dist/types/components/ChartLegend/ChartLegend.d.ts +1 -1
- package/dist/types/components/{TooltipDataViz/TooltipDataViz.d.ts → TooltipChart/TooltipChart.d.ts} +15 -6
- package/dist/types/components/TooltipChart/index.d.ts +2 -0
- package/dist/types/components.d.ts +129 -294
- package/dist/types/utils/chart-grammar.d.ts +360 -0
- package/dist/types/utils/chart-scene.d.ts +128 -0
- package/dist/types/utils/chart-theme.d.ts +27 -0
- package/dist/types/utils/chart-types.d.ts +0 -13
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/token-defaults.d.ts +3 -0
- package/package.json +1 -1
- package/dist/angular/ds-card-data-viz.d.ts +0 -18
- package/dist/angular/ds-chart-bar.d.ts +0 -12
- package/dist/angular/ds-chart-bar.js +0 -38
- package/dist/angular/ds-chart-donut.d.ts +0 -19
- package/dist/angular/ds-chart-line.d.ts +0 -12
- package/dist/angular/ds-tooltip-data-viz.d.ts +0 -12
- package/dist/angular/ds-tooltip-data-viz.js +0 -38
- package/dist/components/ds-card-data-viz.js +0 -2
- package/dist/components/ds-card-data-viz.js.map +0 -1
- package/dist/components/ds-chart-bar.js +0 -2
- package/dist/components/ds-chart-bar.js.map +0 -1
- package/dist/components/ds-chart-donut.d.ts +0 -11
- package/dist/components/ds-chart-donut.js +0 -2
- package/dist/components/ds-chart-donut.js.map +0 -1
- package/dist/components/ds-chart-line.js +0 -2
- package/dist/components/ds-chart-line.js.map +0 -1
- package/dist/components/ds-tooltip-data-viz.d.ts +0 -11
- package/dist/components/ds-tooltip-data-viz.js +0 -2
- package/dist/components/p-1S9AW2MA.js +0 -2
- package/dist/components/p-B6Vuayt6.js +0 -2
- package/dist/components/p-B6Vuayt6.js.map +0 -1
- package/dist/components/p-BBpASejH.js +0 -2
- package/dist/components/p-BBpASejH.js.map +0 -1
- package/dist/components/p-BybqPD8K.js +0 -2
- package/dist/components/p-BybqPD8K.js.map +0 -1
- package/dist/components/p-C4uYvyq6.js +0 -2
- package/dist/components/p-C4uYvyq6.js.map +0 -1
- package/dist/components/p-CbjFUpOj.js +0 -2
- package/dist/components/p-CbjFUpOj.js.map +0 -1
- package/dist/components/p-CrCGIx8s.js +0 -2
- package/dist/components/p-CrCGIx8s.js.map +0 -1
- package/dist/components/p-CuJ3J6OJ.js +0 -2
- package/dist/components/p-D0bM3cKj.js +0 -2
- package/dist/components/p-D2cjoj2r.js +0 -2
- package/dist/components/p-DX4c3kZ1.js +0 -2
- package/dist/components/p-DXewjzkM.js +0 -2
- package/dist/components/p-DXewjzkM.js.map +0 -1
- package/dist/components/p-yhj1lIPx.js +0 -2
- package/dist/mcp-data/registry/card-data-viz.json +0 -241
- package/dist/mcp-data/registry/chart-bar.json +0 -245
- package/dist/mcp-data/registry/chart-donut.json +0 -344
- package/dist/mcp-data/registry/chart-line.json +0 -223
- package/dist/mcp-data/registry/tooltip-data-viz.json +0 -224
- package/dist/react/ds-card-data-viz.d.ts +0 -12
- package/dist/react/ds-card-data-viz.js +0 -12
- package/dist/react/ds-chart-bar.js +0 -12
- package/dist/react/ds-chart-donut.d.ts +0 -12
- package/dist/react/ds-chart-donut.js +0 -12
- package/dist/react/ds-chart-line.d.ts +0 -9
- package/dist/react/ds-chart-line.js +0 -12
- package/dist/react/ds-tooltip-data-viz.d.ts +0 -9
- package/dist/react/ds-tooltip-data-viz.js +0 -12
- package/dist/types/components/CardDataViz/index.d.ts +0 -2
- package/dist/types/components/ChartBar/ChartBar.d.ts +0 -31
- package/dist/types/components/ChartBar/index.d.ts +0 -3
- package/dist/types/components/ChartDonut/ChartDonut.d.ts +0 -72
- package/dist/types/components/ChartDonut/index.d.ts +0 -2
- package/dist/types/components/ChartLine/ChartLine.d.ts +0 -23
- package/dist/types/components/ChartLine/index.d.ts +0 -2
- package/dist/types/components/TooltipDataViz/index.d.ts +0 -2
- /package/dist/components/{ds-tooltip-data-viz.js.map → ds-tooltip-chart.js.map} +0 -0
- /package/dist/components/{p-IYy-jODg.js.map → p-1Zbh1MRy.js.map} +0 -0
- /package/dist/components/{p-wOOAzVMC.js.map → p-BVsLc3t5.js.map} +0 -0
- /package/dist/components/{p-BBtjABBS.js.map → p-BjiRqLtB.js.map} +0 -0
- /package/dist/components/{p-Bsfpxto1.js.map → p-BsBw-w1q.js.map} +0 -0
- /package/dist/components/{p-B6RrZQqw.js.map → p-C-ENnZzq.js.map} +0 -0
- /package/dist/components/{p-BPyymeuR.js.map → p-C2U48kDH.js.map} +0 -0
- /package/dist/components/{p-CKRJX0Y0.js.map → p-C7mCjS2t.js.map} +0 -0
- /package/dist/components/{p-6B411hQA.js.map → p-CL8XL1eh.js.map} +0 -0
- /package/dist/components/{p-DfvDNcoq.js.map → p-CMZVPEZ_.js.map} +0 -0
- /package/dist/components/{p-CzraIk34.js.map → p-CWL61nKt.js.map} +0 -0
- /package/dist/components/{p-Di81y9Q2.js.map → p-CX7QIytv.js.map} +0 -0
- /package/dist/components/{p-DVuxzrCC.js.map → p-CfTThRNX.js.map} +0 -0
- /package/dist/components/{p-BmNpPyzf.js.map → p-CkLffZGn.js.map} +0 -0
- /package/dist/components/{p-B4_0Ys4w.js.map → p-CkyXU1YX.js.map} +0 -0
- /package/dist/components/{p-iCjUWcp7.js.map → p-CywKWfgD.js.map} +0 -0
- /package/dist/components/{p-BR_oMaas.js.map → p-D3UKwTEo.js.map} +0 -0
- /package/dist/components/{p-Bl6A5AJq.js.map → p-D7z9bJ6n.js.map} +0 -0
- /package/dist/components/{p-DaqFuVKZ.js.map → p-DAftUxvL.js.map} +0 -0
- /package/dist/components/{p-BFfHIu6y.js.map → p-DQ94PkZA.js.map} +0 -0
- /package/dist/components/{p-B-kRByho.js.map → p-DSpq7xQF.js.map} +0 -0
- /package/dist/components/{p-og48Kh2i.js.map → p-DzM3TcyQ.js.map} +0 -0
- /package/dist/components/{p-yhj1lIPx.js.map → p-GbTasczF.js.map} +0 -0
- /package/dist/components/{p-Ca6s5fLR.js.map → p-Mmr9b1bB.js.map} +0 -0
- /package/dist/components/{p-CxgMUvqg.js.map → p-Z2zfShlF.js.map} +0 -0
- /package/dist/components/{p-Bmo4T96l.js.map → p-_mClULFL.js.map} +0 -0
- /package/dist/components/{p-Bb4f5SuF.js.map → p-jf1zCsuw.js.map} +0 -0
- /package/dist/components/{p-Eep5mxtv.js.map → p-oiR4IoH1.js.map} +0 -0
- /package/dist/components/{p-DHF5cLzr.js.map → p-u2OZHaLY.js.map} +0 -0
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
-
"name": "chart-line",
|
|
4
|
-
"title": "ChartLine",
|
|
5
|
-
"description": "Static single- or multi-series line chart for trends across ordered, evenly spaced categories, including preformatted time-period labels.",
|
|
6
|
-
"type": "registry:ui",
|
|
7
|
-
"meta": {
|
|
8
|
-
"library": "@ds-mo/ui",
|
|
9
|
-
"distribution": "npm",
|
|
10
|
-
"storybook": "https://zainadeel.github.io/compomo/?path=/story/chart-line",
|
|
11
|
-
"source": "src/wc/components/ChartLine/ChartLine.tsx",
|
|
12
|
-
"intentStatus": "complete",
|
|
13
|
-
"intent": {
|
|
14
|
-
"audience": "specialized",
|
|
15
|
-
"status": "experimental",
|
|
16
|
-
"summary": "Static single- or multi-series line chart for trends across ordered, evenly spaced categories, including preformatted time-period labels.",
|
|
17
|
-
"useWhen": [
|
|
18
|
-
"Users need to follow one or more numeric trends across a shared ordered x-axis.",
|
|
19
|
-
"Time periods are already grouped into equally spaced labels such as months, weeks, or days.",
|
|
20
|
-
"A horizontal ChartLegend should identify multiple series."
|
|
21
|
-
],
|
|
22
|
-
"avoidWhen": [
|
|
23
|
-
"Pixel position must reflect irregular elapsed time or continuous timestamps.",
|
|
24
|
-
"The primary task is comparing unrelated category magnitudes rather than following a trend.",
|
|
25
|
-
"The chart needs built-in zoom, brushing, selection, or drill-down.",
|
|
26
|
-
"Series lengths do not align with the shared category list."
|
|
27
|
-
],
|
|
28
|
-
"alternatives": [
|
|
29
|
-
{
|
|
30
|
-
"when": "Users need to compare one measure across discrete categories or time buckets.",
|
|
31
|
-
"component": "component:ds-chart-bar",
|
|
32
|
-
"reason": "Bars emphasize independent bucket magnitudes."
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"when": "The data communicates parts of a total.",
|
|
36
|
-
"component": "component:ds-chart-donut",
|
|
37
|
-
"reason": "Donut provides the part-to-whole and center-summary treatment."
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"commonlyComposedWith": [
|
|
41
|
-
"component:ds-chart-legend",
|
|
42
|
-
"component:ds-card-data-viz",
|
|
43
|
-
"component:ds-tooltip-data-viz"
|
|
44
|
-
],
|
|
45
|
-
"accessibility": [
|
|
46
|
-
"Provide a visible legend or adjacent textual summary when exact series values are important; the chart image name alone is not a complete data table.",
|
|
47
|
-
"Do not rely on series color alone to communicate meaning.",
|
|
48
|
-
"A future point tooltip must supplement rather than replace accessible series and value context."
|
|
49
|
-
],
|
|
50
|
-
"states": [
|
|
51
|
-
"The chart is currently static and does not own hover, selection, loading, or empty-state policy.",
|
|
52
|
-
"Its standard horizontal legend is a static key with local hover highlighting disabled.",
|
|
53
|
-
"Point markers may be shown or hidden without changing the underlying series meaning.",
|
|
54
|
-
"Authored series colors override the shared categorical palette."
|
|
55
|
-
],
|
|
56
|
-
"responsiveBehavior": [
|
|
57
|
-
"Width and height provide the standalone intrinsic viewport; constrained card regions are measured and reflow both axes to their rendered pixel dimensions.",
|
|
58
|
-
"Responsive layout changes point positions and plot extents without scaling SVG text, line strokes, point markers, or margins.",
|
|
59
|
-
"Category positions are always equally spaced, even when labels represent time.",
|
|
60
|
-
"Reduce or pre-format dense labels before passing them; the chart renders authored labels without a continuous time scale."
|
|
61
|
-
],
|
|
62
|
-
"frameworkCaveats": {
|
|
63
|
-
"customElements": [
|
|
64
|
-
"Assign series and categories as JavaScript properties and keep every series aligned to the category count."
|
|
65
|
-
],
|
|
66
|
-
"react": [
|
|
67
|
-
"Pass stable series and category arrays; width and height provide standalone intrinsic dimensions while constrained containers reflow automatically."
|
|
68
|
-
],
|
|
69
|
-
"angular": [
|
|
70
|
-
"Bind series and categories as properties; width and height provide standalone intrinsic dimensions while constrained containers reflow automatically."
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
"references": [
|
|
74
|
-
{
|
|
75
|
-
"label": "Storybook examples",
|
|
76
|
-
"path": "src/wc/components/ChartLine/ChartLine.stories.ts"
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
"api": {
|
|
81
|
-
"props": {
|
|
82
|
-
"categories": {
|
|
83
|
-
"type": "string[]",
|
|
84
|
-
"resolvedType": "string[]",
|
|
85
|
-
"default": "[]",
|
|
86
|
-
"required": false,
|
|
87
|
-
"mutable": false,
|
|
88
|
-
"description": "X-axis labels — must match each series' `data` length. Set as a JS property."
|
|
89
|
-
},
|
|
90
|
-
"height": {
|
|
91
|
-
"type": "number",
|
|
92
|
-
"resolvedType": "number",
|
|
93
|
-
"attribute": "height",
|
|
94
|
-
"default": "240",
|
|
95
|
-
"required": false,
|
|
96
|
-
"mutable": false,
|
|
97
|
-
"description": "Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size."
|
|
98
|
-
},
|
|
99
|
-
"series": {
|
|
100
|
-
"type": "ChartSeries[]",
|
|
101
|
-
"resolvedType": "ChartSeries[]",
|
|
102
|
-
"default": "[]",
|
|
103
|
-
"required": false,
|
|
104
|
-
"mutable": false,
|
|
105
|
-
"description": "One or more series to plot. Set as a JS property (not an HTML attribute)."
|
|
106
|
-
},
|
|
107
|
-
"showPoints": {
|
|
108
|
-
"type": "boolean",
|
|
109
|
-
"resolvedType": "boolean",
|
|
110
|
-
"attribute": "show-points",
|
|
111
|
-
"default": "true",
|
|
112
|
-
"required": false,
|
|
113
|
-
"mutable": false
|
|
114
|
-
},
|
|
115
|
-
"width": {
|
|
116
|
-
"type": "number",
|
|
117
|
-
"resolvedType": "number",
|
|
118
|
-
"attribute": "width",
|
|
119
|
-
"default": "480",
|
|
120
|
-
"required": false,
|
|
121
|
-
"mutable": false,
|
|
122
|
-
"description": "Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size."
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"events": [],
|
|
126
|
-
"methods": [],
|
|
127
|
-
"slots": []
|
|
128
|
-
},
|
|
129
|
-
"props": {
|
|
130
|
-
"categories": {
|
|
131
|
-
"type": "string[]",
|
|
132
|
-
"resolvedType": "string[]",
|
|
133
|
-
"default": "[]",
|
|
134
|
-
"required": false,
|
|
135
|
-
"mutable": false,
|
|
136
|
-
"description": "X-axis labels — must match each series' `data` length. Set as a JS property."
|
|
137
|
-
},
|
|
138
|
-
"height": {
|
|
139
|
-
"type": "number",
|
|
140
|
-
"resolvedType": "number",
|
|
141
|
-
"attribute": "height",
|
|
142
|
-
"default": "240",
|
|
143
|
-
"required": false,
|
|
144
|
-
"mutable": false,
|
|
145
|
-
"description": "Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size."
|
|
146
|
-
},
|
|
147
|
-
"series": {
|
|
148
|
-
"type": "ChartSeries[]",
|
|
149
|
-
"resolvedType": "ChartSeries[]",
|
|
150
|
-
"default": "[]",
|
|
151
|
-
"required": false,
|
|
152
|
-
"mutable": false,
|
|
153
|
-
"description": "One or more series to plot. Set as a JS property (not an HTML attribute)."
|
|
154
|
-
},
|
|
155
|
-
"showPoints": {
|
|
156
|
-
"type": "boolean",
|
|
157
|
-
"resolvedType": "boolean",
|
|
158
|
-
"attribute": "show-points",
|
|
159
|
-
"default": "true",
|
|
160
|
-
"required": false,
|
|
161
|
-
"mutable": false
|
|
162
|
-
},
|
|
163
|
-
"width": {
|
|
164
|
-
"type": "number",
|
|
165
|
-
"resolvedType": "number",
|
|
166
|
-
"attribute": "width",
|
|
167
|
-
"default": "480",
|
|
168
|
-
"required": false,
|
|
169
|
-
"mutable": false,
|
|
170
|
-
"description": "Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size."
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"events": [],
|
|
174
|
-
"methods": [],
|
|
175
|
-
"slots": [],
|
|
176
|
-
"exports": {
|
|
177
|
-
"customElement": "ds-chart-line",
|
|
178
|
-
"react": "DsChartLine",
|
|
179
|
-
"angular": "DsChartLine"
|
|
180
|
-
},
|
|
181
|
-
"consumption": {
|
|
182
|
-
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
183
|
-
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
184
|
-
"customElements": {
|
|
185
|
-
"import": "import '@ds-mo/ui/dist/components/ds-chart-line.js';",
|
|
186
|
-
"example": "<ds-chart-line></ds-chart-line>"
|
|
187
|
-
},
|
|
188
|
-
"react": {
|
|
189
|
-
"import": "import { DsChartLine } from '@ds-mo/ui/react';",
|
|
190
|
-
"example": "<DsChartLine />"
|
|
191
|
-
},
|
|
192
|
-
"angular": {
|
|
193
|
-
"import": "import { DsChartLine } from '@ds-mo/ui/angular/ds-chart-line';",
|
|
194
|
-
"example": "<ds-chart-line></ds-chart-line>"
|
|
195
|
-
},
|
|
196
|
-
"complexPropertyNote": "Assign these non-primitive values as JavaScript properties: categories, series.",
|
|
197
|
-
"peerDependencies": {
|
|
198
|
-
"required": [
|
|
199
|
-
"@ds-mo/tokens ^5.1.1",
|
|
200
|
-
"@ds-mo/icons ^6.4.0"
|
|
201
|
-
],
|
|
202
|
-
"frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
"dependencies": [
|
|
207
|
-
"@ds-mo/ui",
|
|
208
|
-
"@ds-mo/tokens"
|
|
209
|
-
],
|
|
210
|
-
"registryDependencies": [],
|
|
211
|
-
"files": [
|
|
212
|
-
{
|
|
213
|
-
"path": "src/wc/components/ChartLine/ChartLine.css",
|
|
214
|
-
"content": "@import '../../utils/forced-colors.css';\n\n:host {\n display: inline-block;\n max-width: 100%;\n font-family: var(--typography-font-family);\n}\n\n.chart-line__svg {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.chart-line__gridline {\n stroke: var(--color-border-tertiary);\n stroke-width: var(--dimension-stroke-width-012);\n vector-effect: non-scaling-stroke;\n}\n\n/* Matches ds-text text-caption regular (SVG cannot host ds-text). */\n.chart-line__axis-label {\n fill: var(--color-foreground-secondary);\n font-family: var(--typography-font-family);\n font-size: var(--typography-fontsize-xs);\n font-weight: var(--typography-weight-medium);\n letter-spacing: var(--typography-letterspacing-positive);\n text-transform: uppercase;\n}\n\n.chart-line__path {\n fill: none;\n stroke-width: var(--dimension-stroke-width-025);\n vector-effect: non-scaling-stroke;\n}\n\n.chart-line__point {\n stroke: var(--color-background-primary);\n stroke-width: var(--dimension-stroke-width-018);\n r: calc(var(--dimension-size-075) / 2);\n vector-effect: non-scaling-stroke;\n}\n\n@media (forced-colors: active) {\n .chart-line__path,\n .chart-line__point {\n forced-color-adjust: none;\n }\n\n .chart-line__point {\n stroke: var(--ds-forced-color-surface);\n }\n}\n",
|
|
215
|
-
"type": "registry:ui"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
"path": "src/wc/components/ChartLine/ChartLine.tsx",
|
|
219
|
-
"content": "import { Component, Prop, State, Watch, h, Host } from '@stencil/core';\nimport { line as lineShape } from 'd3-shape';\nimport { scaleLinear, scalePoint } from 'd3-scale';\nimport { max } from 'd3-array';\nimport { categoryColor } from '../../utils/chart-colors';\nimport { resolveCartesianChartLayout } from '../../utils/cartesian-chart-layout';\nimport {\n ChartViewportController,\n type ChartViewportSize,\n} from '../../utils/chart-viewport-controller';\nimport type { ChartSeries } from '../../utils/chart-types';\n\n@Component({\n tag: 'ds-chart-line',\n styleUrl: 'ChartLine.css',\n scoped: true,\n})\nexport class ChartLine {\n /** One or more series to plot. Set as a JS property (not an HTML attribute). */\n @Prop() series: ChartSeries[] = [];\n /** X-axis labels — must match each series' `data` length. Set as a JS property. */\n @Prop() categories: string[] = [];\n /** Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size. */\n @Prop() width: number = 480;\n /** Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size. */\n @Prop() height: number = 240;\n @Prop() showPoints: boolean = true;\n\n @State() private viewport: ChartViewportSize | undefined;\n\n private viewportController: ChartViewportController | null = null;\n private svgEl: SVGElement | null = null;\n\n componentDidLoad() {\n this.connectViewportController();\n }\n\n connectedCallback() {\n if (this.svgEl && !this.viewportController) this.connectViewportController();\n }\n\n componentDidRender() {\n if (!this.viewportController) this.connectViewportController();\n }\n\n private connectViewportController() {\n if (!this.svgEl) return;\n this.viewportController = new ChartViewportController(this.svgEl, viewport => {\n if (\n viewport.width !== this.viewport?.width ||\n viewport.height !== this.viewport?.height\n ) {\n this.viewport = viewport;\n }\n });\n this.viewportController.connect();\n }\n\n disconnectedCallback() {\n this.viewportController?.disconnect();\n this.viewportController = null;\n }\n\n @Watch('width')\n @Watch('height')\n handleIntrinsicSizeChange() {\n this.viewport = undefined;\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(() => this.viewportController?.measure());\n }\n }\n\n render() {\n const viewportWidth = this.viewport?.width ?? this.width;\n const viewportHeight = this.viewport?.height ?? this.height;\n const { margin, axisLabelGap, categoryLabelOffset } =\n resolveCartesianChartLayout();\n const innerWidth = Math.max(0, viewportWidth - margin.left - margin.right);\n const innerHeight = Math.max(0, viewportHeight - margin.top - margin.bottom);\n\n const allValues = this.series.flatMap(s => s.data);\n const yMax = max(allValues) ?? 0;\n\n const xScale = scalePoint<number>()\n .domain(this.categories.map((_, i) => i))\n .range([0, innerWidth]);\n\n const yScale = scaleLinear()\n .domain([0, yMax || 1])\n .range([innerHeight, 0])\n .nice();\n\n const lineGenerator = lineShape<number>()\n .x((_, i) => xScale(i) ?? 0)\n .y(d => yScale(d));\n\n const yTicks = yScale.ticks(4);\n\n return (\n <Host class=\"chart-line\">\n <svg\n class=\"chart-line__svg\"\n ref={element => {\n this.svgEl = element ?? null;\n }}\n width={viewportWidth}\n height={viewportHeight}\n role=\"img\"\n aria-label={this.series.map(s => s.name).join(', ')}\n >\n <g transform={`translate(${margin.left}, ${margin.top})`}>\n {yTicks.map(tick => (\n <g key={`grid-${tick}`} transform={`translate(0, ${yScale(tick)})`}>\n <line class=\"chart-line__gridline\" x1={0} x2={innerWidth} />\n <text\n class=\"chart-line__axis-label\"\n x={-axisLabelGap}\n text-anchor=\"end\"\n dominant-baseline=\"middle\"\n >\n {tick}\n </text>\n </g>\n ))}\n\n {this.categories.map((label, i) => (\n <text\n key={`x-${label}`}\n class=\"chart-line__axis-label\"\n x={xScale(i) ?? 0}\n y={innerHeight + categoryLabelOffset}\n text-anchor=\"middle\"\n >\n {label}\n </text>\n ))}\n\n {this.series.map((s, si) => {\n const color = s.color ?? categoryColor(si);\n return (\n <g key={s.name}>\n <path class=\"chart-line__path\" d={lineGenerator(s.data) ?? undefined} stroke={color} />\n {this.showPoints &&\n s.data.map((d, i) => (\n <circle\n key={`${s.name}-${i}`}\n class=\"chart-line__point\"\n cx={xScale(i) ?? 0}\n cy={yScale(d)}\n fill={color}\n />\n ))}\n </g>\n );\n })}\n </g>\n </svg>\n </Host>\n );\n }\n}\n",
|
|
220
|
-
"type": "registry:ui"
|
|
221
|
-
}
|
|
222
|
-
]
|
|
223
|
-
}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
-
"name": "tooltip-data-viz",
|
|
4
|
-
"title": "TooltipDataViz",
|
|
5
|
-
"description": "Chart-owned, non-interactive label and value callout positioned from pointer or focused-mark coordinates inside a visualization wrapper.",
|
|
6
|
-
"type": "registry:ui",
|
|
7
|
-
"meta": {
|
|
8
|
-
"library": "@ds-mo/ui",
|
|
9
|
-
"distribution": "npm",
|
|
10
|
-
"storybook": "https://zainadeel.github.io/compomo/?path=/story/tooltip-data-viz",
|
|
11
|
-
"source": "src/wc/components/TooltipDataViz/TooltipDataViz.tsx",
|
|
12
|
-
"intentStatus": "complete",
|
|
13
|
-
"intent": {
|
|
14
|
-
"audience": "specialized",
|
|
15
|
-
"status": "experimental",
|
|
16
|
-
"summary": "Chart-owned, non-interactive label and value callout positioned from pointer or focused-mark coordinates inside a visualization wrapper.",
|
|
17
|
-
"useWhen": [
|
|
18
|
-
"A chart needs immediate visual value feedback for a genuinely hovered or keyboard-focused mark.",
|
|
19
|
-
"The anchor lives inside SVG or chart coordinates rather than on a slotted HTML trigger.",
|
|
20
|
-
"The owning chart can mount the callout for one interaction session and update its coordinates while tracking."
|
|
21
|
-
],
|
|
22
|
-
"avoidWhen": [
|
|
23
|
-
"A normal control or text trigger needs supplemental explanation; use Tooltip.",
|
|
24
|
-
"The content needs links, actions, focus, or touch-primary disclosure.",
|
|
25
|
-
"An externally synchronized highlight has no genuine local pointer or keyboard interaction.",
|
|
26
|
-
"The callout would be the only accessible source of an essential value."
|
|
27
|
-
],
|
|
28
|
-
"alternatives": [
|
|
29
|
-
{
|
|
30
|
-
"when": "A slotted control or text trigger needs a conventional tooltip.",
|
|
31
|
-
"component": "component:ds-tooltip",
|
|
32
|
-
"reason": "Tooltip owns trigger semantics, focus behavior, and anchored overlay lifecycle."
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"when": "Donut details should remain continuously visible beside the chart.",
|
|
36
|
-
"component": "component:ds-chart-legend",
|
|
37
|
-
"reason": "A visible legend avoids redundant transient slice callouts."
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"commonlyComposedWith": [
|
|
41
|
-
"component:ds-chart-bar",
|
|
42
|
-
"component:ds-chart-line",
|
|
43
|
-
"component:ds-chart-donut"
|
|
44
|
-
],
|
|
45
|
-
"accessibility": [
|
|
46
|
-
"The callout is presentation-only and never replaces the owning chart mark's accessible label or an adjacent data summary.",
|
|
47
|
-
"Keyboard-focused marks receive the same visual feedback as pointer-hovered marks.",
|
|
48
|
-
"The callout never receives focus or contains interactive descendants."
|
|
49
|
-
],
|
|
50
|
-
"states": [
|
|
51
|
-
"The owning chart mounts the callout when a local interaction starts and unmounts it when that interaction ends.",
|
|
52
|
-
"Coordinate updates track within one mounted interaction session without restarting the show delay.",
|
|
53
|
-
"Placement flips horizontally or vertically when the rendered callout approaches a viewport edge.",
|
|
54
|
-
"Placement is chosen as a quadrant rather than computed as coordinates: the component measures its own rendered rect and flips its side and align props, which CSS consumes. It therefore does not use the shared anchored-position utilities, which resolve an anchor element into x and y.",
|
|
55
|
-
"This separation is deliberate. The callout follows the pointer instead of an element, so it has no anchor rect to resolve; adopting the shared geometry would mean rewriting its CSS to consume coordinates for no behavioral gain.",
|
|
56
|
-
"Reduced motion preserves the final visible state without an opacity transition."
|
|
57
|
-
],
|
|
58
|
-
"responsiveBehavior": [
|
|
59
|
-
"Render inside a positioned chart wrapper and pass coordinates relative to that wrapper.",
|
|
60
|
-
"Keep labels concise enough for the single-line callout; persistent or long explanations belong outside the chart."
|
|
61
|
-
],
|
|
62
|
-
"frameworkCaveats": {
|
|
63
|
-
"customElements": [
|
|
64
|
-
"The owning chart computes coordinates and conditionally mounts the component; applications should not use it as a standalone overlay."
|
|
65
|
-
],
|
|
66
|
-
"react": [
|
|
67
|
-
"Keep callout lifecycle and coordinates inside the chart wrapper rather than application-global tooltip state."
|
|
68
|
-
],
|
|
69
|
-
"angular": [
|
|
70
|
-
"Keep callout lifecycle and coordinates inside the chart wrapper rather than application-global tooltip state."
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
"references": [
|
|
74
|
-
{
|
|
75
|
-
"label": "Storybook example",
|
|
76
|
-
"path": "src/wc/components/TooltipDataViz/TooltipDataViz.stories.ts"
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
|
-
"api": {
|
|
81
|
-
"props": {
|
|
82
|
-
"delay": {
|
|
83
|
-
"type": "number | string",
|
|
84
|
-
"resolvedType": "number | string",
|
|
85
|
-
"attribute": "delay",
|
|
86
|
-
"default": "TOKEN_DEFAULTS.animationDelayInstant",
|
|
87
|
-
"required": false,
|
|
88
|
-
"mutable": false,
|
|
89
|
-
"description": "Show delay after mount before the callout appears.\nDefault: `--effect-animation-delay-instant` (0ms). Accepts a number (ms)\nor a TokoMo time token / `var(--effect-animation-delay-*)`. Charts need\nimmediate feedback while scrubbing; prefer the default. Mount once per\nhover session so any non-zero delay runs once, then track `x`/`y` instantly."
|
|
90
|
-
},
|
|
91
|
-
"label": {
|
|
92
|
-
"type": "string",
|
|
93
|
-
"resolvedType": "string",
|
|
94
|
-
"attribute": "label",
|
|
95
|
-
"default": "''",
|
|
96
|
-
"required": false,
|
|
97
|
-
"mutable": false
|
|
98
|
-
},
|
|
99
|
-
"value": {
|
|
100
|
-
"type": "string | number",
|
|
101
|
-
"resolvedType": "number | string",
|
|
102
|
-
"attribute": "value",
|
|
103
|
-
"default": "''",
|
|
104
|
-
"required": false,
|
|
105
|
-
"mutable": false
|
|
106
|
-
},
|
|
107
|
-
"x": {
|
|
108
|
-
"type": "number",
|
|
109
|
-
"resolvedType": "number",
|
|
110
|
-
"attribute": "x",
|
|
111
|
-
"default": "0",
|
|
112
|
-
"required": false,
|
|
113
|
-
"mutable": false,
|
|
114
|
-
"description": "Anchor point in px, relative to the nearest `position: relative` ancestor — e.g. the cursor."
|
|
115
|
-
},
|
|
116
|
-
"y": {
|
|
117
|
-
"type": "number",
|
|
118
|
-
"resolvedType": "number",
|
|
119
|
-
"attribute": "y",
|
|
120
|
-
"default": "0",
|
|
121
|
-
"required": false,
|
|
122
|
-
"mutable": false
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"events": [],
|
|
126
|
-
"methods": [],
|
|
127
|
-
"slots": []
|
|
128
|
-
},
|
|
129
|
-
"props": {
|
|
130
|
-
"delay": {
|
|
131
|
-
"type": "number | string",
|
|
132
|
-
"resolvedType": "number | string",
|
|
133
|
-
"attribute": "delay",
|
|
134
|
-
"default": "TOKEN_DEFAULTS.animationDelayInstant",
|
|
135
|
-
"required": false,
|
|
136
|
-
"mutable": false,
|
|
137
|
-
"description": "Show delay after mount before the callout appears.\nDefault: `--effect-animation-delay-instant` (0ms). Accepts a number (ms)\nor a TokoMo time token / `var(--effect-animation-delay-*)`. Charts need\nimmediate feedback while scrubbing; prefer the default. Mount once per\nhover session so any non-zero delay runs once, then track `x`/`y` instantly."
|
|
138
|
-
},
|
|
139
|
-
"label": {
|
|
140
|
-
"type": "string",
|
|
141
|
-
"resolvedType": "string",
|
|
142
|
-
"attribute": "label",
|
|
143
|
-
"default": "''",
|
|
144
|
-
"required": false,
|
|
145
|
-
"mutable": false
|
|
146
|
-
},
|
|
147
|
-
"value": {
|
|
148
|
-
"type": "string | number",
|
|
149
|
-
"resolvedType": "number | string",
|
|
150
|
-
"attribute": "value",
|
|
151
|
-
"default": "''",
|
|
152
|
-
"required": false,
|
|
153
|
-
"mutable": false
|
|
154
|
-
},
|
|
155
|
-
"x": {
|
|
156
|
-
"type": "number",
|
|
157
|
-
"resolvedType": "number",
|
|
158
|
-
"attribute": "x",
|
|
159
|
-
"default": "0",
|
|
160
|
-
"required": false,
|
|
161
|
-
"mutable": false,
|
|
162
|
-
"description": "Anchor point in px, relative to the nearest `position: relative` ancestor — e.g. the cursor."
|
|
163
|
-
},
|
|
164
|
-
"y": {
|
|
165
|
-
"type": "number",
|
|
166
|
-
"resolvedType": "number",
|
|
167
|
-
"attribute": "y",
|
|
168
|
-
"default": "0",
|
|
169
|
-
"required": false,
|
|
170
|
-
"mutable": false
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"events": [],
|
|
174
|
-
"methods": [],
|
|
175
|
-
"slots": [],
|
|
176
|
-
"exports": {
|
|
177
|
-
"customElement": "ds-tooltip-data-viz",
|
|
178
|
-
"react": "DsTooltipDataViz",
|
|
179
|
-
"angular": "DsTooltipDataViz"
|
|
180
|
-
},
|
|
181
|
-
"consumption": {
|
|
182
|
-
"install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
|
|
183
|
-
"cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
|
|
184
|
-
"customElements": {
|
|
185
|
-
"import": "import '@ds-mo/ui/dist/components/ds-tooltip-data-viz.js';",
|
|
186
|
-
"example": "<ds-tooltip-data-viz></ds-tooltip-data-viz>"
|
|
187
|
-
},
|
|
188
|
-
"react": {
|
|
189
|
-
"import": "import { DsTooltipDataViz } from '@ds-mo/ui/react';",
|
|
190
|
-
"example": "<DsTooltipDataViz />"
|
|
191
|
-
},
|
|
192
|
-
"angular": {
|
|
193
|
-
"import": "import { DsTooltipDataViz } from '@ds-mo/ui/angular/ds-tooltip-data-viz';",
|
|
194
|
-
"example": "<ds-tooltip-data-viz></ds-tooltip-data-viz>"
|
|
195
|
-
},
|
|
196
|
-
"peerDependencies": {
|
|
197
|
-
"required": [
|
|
198
|
-
"@ds-mo/tokens ^5.1.1",
|
|
199
|
-
"@ds-mo/icons ^6.4.0"
|
|
200
|
-
],
|
|
201
|
-
"frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
"dependencies": [
|
|
206
|
-
"@ds-mo/ui",
|
|
207
|
-
"@ds-mo/tokens"
|
|
208
|
-
],
|
|
209
|
-
"registryDependencies": [
|
|
210
|
-
"text"
|
|
211
|
-
],
|
|
212
|
-
"files": [
|
|
213
|
-
{
|
|
214
|
-
"path": "src/wc/components/TooltipDataViz/TooltipDataViz.css",
|
|
215
|
-
"content": "@import '../../utils/control-density.css';\n@import '../../utils/forced-colors.css';\n\n/* No padding here — the item div below owns all the spacing, so there's exactly one padding\n box instead of stacking the host's padding on top of the item's. */\n:host {\n position: absolute;\n z-index: var(--dimension-z-index-tooltip);\n display: block;\n box-sizing: border-box;\n background-color: var(--color-translucent-translucent);\n backdrop-filter: blur(var(--effect-blur-md));\n -webkit-backdrop-filter: blur(var(--effect-blur-md));\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n box-shadow: var(--effect-elevation-elevated-floating);\n white-space: nowrap;\n pointer-events: none;\n opacity: 0;\n}\n\n:host(.tooltip-data-viz--visible) {\n animation: tooltip-data-viz-fade-in var(--effect-motion-short-2) forwards;\n}\n\n/* Density: md control recipe (height / pad / label inset) — non-interactive, no interaction-fill. */\n.tooltip-data-viz__item {\n box-sizing: border-box;\n height: var(--ds-control-height, var(--dimension-size-400));\n display: flex;\n align-items: center;\n gap: var(--dimension-space-025);\n padding: 0 var(--ds-control-padding-inline, var(--dimension-space-075));\n}\n\n.tooltip-data-viz__label,\n.tooltip-data-viz__value {\n padding: 0 var(--ds-control-label-inset, var(--dimension-space-025));\n}\n\n@keyframes tooltip-data-viz-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :host(.tooltip-data-viz--visible) {\n animation: none;\n opacity: 1;\n }\n}\n\n@media (forced-colors: active) {\n :host {\n box-shadow: none;\n outline: var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);\n outline-offset: calc(-1 * var(--dimension-stroke-width-012));\n }\n}\n",
|
|
216
|
-
"type": "registry:ui"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
"path": "src/wc/components/TooltipDataViz/TooltipDataViz.tsx",
|
|
220
|
-
"content": "import { Component, Prop, State, Element, Watch, h, Host } from '@stencil/core';\nimport { resolveCssTimeMs, TOKEN_DEFAULTS } from '../../utils';\n\nconst CURSOR_OFFSET_PX = 12;\nconst VIEWPORT_PAD_PX = 8;\n\nexport type TooltipDataVizSide = 'left' | 'right';\nexport type TooltipDataVizAlign = 'top' | 'bottom';\n\n/**\n * Positioned value/label callout for chart hover interactions (bar, line point,\n * standalone donut slice, …). Donut compositions suppress it when a visible\n * legend already surfaces the hovered slice.\n * Unlike `ds-tooltip`, this doesn't bind to a slotted anchor element —\n * charts hover-highlight data that lives inside an SVG, so the chart itself computes\n * the anchor point (e.g. the cursor position while hovering) and passes it in as `x`/`y`.\n *\n * Renders `position: absolute` — place inside a `position: relative` chart wrapper,\n * with `x`/`y` as pixel coordinates within that wrapper. Defaults to sitting below-right\n * of the anchor (matching cursor-following tooltips), flipping to whichever side/edge\n * keeps it on-screen.\n *\n * Mount (or remount) when a hover session starts so `delay` applies once per hover;\n * keep the instance mounted while the cursor moves so tracking stays instant.\n */\n@Component({\n tag: 'ds-tooltip-data-viz',\n styleUrl: 'TooltipDataViz.css',\n scoped: true,\n})\nexport class TooltipDataViz {\n @Element() el!: HTMLElement;\n\n @Prop() value: string | number = '';\n @Prop() label: string = '';\n /** Anchor point in px, relative to the nearest `position: relative` ancestor — e.g. the cursor. */\n @Prop() x: number = 0;\n @Prop() y: number = 0;\n\n /**\n * Show delay after mount before the callout appears.\n * Default: `--effect-animation-delay-instant` (0ms). Accepts a number (ms)\n * or a TokoMo time token / `var(--effect-animation-delay-*)`. Charts need\n * immediate feedback while scrubbing; prefer the default. Mount once per\n * hover session so any non-zero delay runs once, then track `x`/`y` instantly.\n */\n @Prop() delay: number | string = TOKEN_DEFAULTS.animationDelayInstant;\n\n @State() private side: TooltipDataVizSide = 'right';\n @State() private align: TooltipDataVizAlign = 'bottom';\n @State() private visible: boolean = false;\n\n private delayTimer: ReturnType<typeof setTimeout> | null = null;\n\n componentDidLoad() {\n this.scheduleShow();\n this.calculatePlacement();\n }\n\n disconnectedCallback() {\n this.clearDelayTimer();\n }\n\n @Watch('x')\n @Watch('y')\n onAnchorChange() {\n requestAnimationFrame(() => this.calculatePlacement());\n }\n\n @Watch('delay')\n onDelayChange() {\n if (!this.visible) this.scheduleShow();\n }\n\n private get showDelayMs(): number {\n return resolveCssTimeMs(this.delay, TOKEN_DEFAULTS.animationDelayInstant);\n }\n\n private clearDelayTimer() {\n if (this.delayTimer) {\n clearTimeout(this.delayTimer);\n this.delayTimer = null;\n }\n }\n\n private scheduleShow() {\n this.clearDelayTimer();\n this.visible = false;\n const ms = this.showDelayMs;\n if (ms <= 0) {\n this.visible = true;\n return;\n }\n this.delayTimer = setTimeout(() => {\n this.delayTimer = null;\n this.visible = true;\n requestAnimationFrame(() => this.calculatePlacement());\n }, ms);\n }\n\n private calculatePlacement() {\n const rect = this.el.getBoundingClientRect();\n if (!rect.width || !rect.height) return;\n\n const nextSide: TooltipDataVizSide = rect.right > window.innerWidth - VIEWPORT_PAD_PX ? 'left' : 'right';\n const nextAlign: TooltipDataVizAlign = rect.bottom > window.innerHeight - VIEWPORT_PAD_PX ? 'top' : 'bottom';\n\n if (nextSide !== this.side) this.side = nextSide;\n if (nextAlign !== this.align) this.align = nextAlign;\n }\n\n render() {\n const translateX = this.side === 'right' ? `${CURSOR_OFFSET_PX}px` : `calc(-100% - ${CURSOR_OFFSET_PX}px)`;\n const translateY = this.align === 'bottom' ? `${CURSOR_OFFSET_PX}px` : `calc(-100% - ${CURSOR_OFFSET_PX}px)`;\n\n return (\n <Host\n class={{\n 'tooltip-data-viz': true,\n 'tooltip-data-viz--visible': this.visible,\n }}\n style={{ left: `${this.x}px`, top: `${this.y}px`, transform: `translate(${translateX}, ${translateY})` }}\n >\n <div class=\"tooltip-data-viz__item ds-control--md\">\n <ds-text\n class=\"tooltip-data-viz__label\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"var(--color-translucent-foreground-secondary)\"\n >\n {this.label}\n </ds-text>\n <ds-text\n class=\"tooltip-data-viz__value\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n color=\"var(--color-translucent-foreground-primary)\"\n >\n {this.value}\n </ds-text>\n </div>\n </Host>\n );\n }\n}\n",
|
|
221
|
-
"type": "registry:ui"
|
|
222
|
-
}
|
|
223
|
-
]
|
|
224
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by the Stencil React Output Target.
|
|
3
|
-
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
|
-
*/
|
|
5
|
-
import type { EventName, StencilReactComponent } from './react-runtime.js';
|
|
6
|
-
import { type DsCardDataVizCustomEvent } from "@ds-mo/ui";
|
|
7
|
-
import type { Components } from "@ds-mo/ui/dist/components";
|
|
8
|
-
import { DsCardDataViz as DsCardDataVizElement } from "@ds-mo/ui/dist/components/ds-card-data-viz.js";
|
|
9
|
-
export type DsCardDataVizEvents = {
|
|
10
|
-
onDsFilterClick: EventName<DsCardDataVizCustomEvent<void>>;
|
|
11
|
-
};
|
|
12
|
-
export declare const DsCardDataViz: StencilReactComponent<DsCardDataVizElement, DsCardDataVizEvents, Components.DsCardDataViz, 'heading'>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { createComponent } from './react-runtime.js';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { DsCardDataViz as DsCardDataVizElement, defineCustomElement as defineDsCardDataViz } from "@ds-mo/ui/dist/components/ds-card-data-viz.js";
|
|
5
|
-
export const DsCardDataViz = /*@__PURE__*/ createComponent({
|
|
6
|
-
tagName: 'ds-card-data-viz',
|
|
7
|
-
elementClass: DsCardDataVizElement,
|
|
8
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
9
|
-
react: React,
|
|
10
|
-
events: { onDsFilterClick: 'dsFilterClick' },
|
|
11
|
-
defineCustomElement: defineDsCardDataViz
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { createComponent } from './react-runtime.js';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { DsChartBar as DsChartBarElement, defineCustomElement as defineDsChartBar } from "@ds-mo/ui/dist/components/ds-chart-bar.js";
|
|
5
|
-
export const DsChartBar = /*@__PURE__*/ createComponent({
|
|
6
|
-
tagName: 'ds-chart-bar',
|
|
7
|
-
elementClass: DsChartBarElement,
|
|
8
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
9
|
-
react: React,
|
|
10
|
-
events: {},
|
|
11
|
-
defineCustomElement: defineDsChartBar
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by the Stencil React Output Target.
|
|
3
|
-
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
|
-
*/
|
|
5
|
-
import type { EventName, StencilReactComponent } from './react-runtime.js';
|
|
6
|
-
import { type ChartDatum, type DsChartDonutCustomEvent } from "@ds-mo/ui";
|
|
7
|
-
import type { Components } from "@ds-mo/ui/dist/components";
|
|
8
|
-
import { DsChartDonut as DsChartDonutElement } from "@ds-mo/ui/dist/components/ds-chart-donut.js";
|
|
9
|
-
export type DsChartDonutEvents = {
|
|
10
|
-
onDsSliceHover: EventName<DsChartDonutCustomEvent<ChartDatum | null>>;
|
|
11
|
-
};
|
|
12
|
-
export declare const DsChartDonut: StencilReactComponent<DsChartDonutElement, DsChartDonutEvents, Components.DsChartDonut>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { createComponent } from './react-runtime.js';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { DsChartDonut as DsChartDonutElement, defineCustomElement as defineDsChartDonut } from "@ds-mo/ui/dist/components/ds-chart-donut.js";
|
|
5
|
-
export const DsChartDonut = /*@__PURE__*/ createComponent({
|
|
6
|
-
tagName: 'ds-chart-donut',
|
|
7
|
-
elementClass: DsChartDonutElement,
|
|
8
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
9
|
-
react: React,
|
|
10
|
-
events: { onDsSliceHover: 'dsSliceHover' },
|
|
11
|
-
defineCustomElement: defineDsChartDonut
|
|
12
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by the Stencil React Output Target.
|
|
3
|
-
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
|
-
*/
|
|
5
|
-
import type { StencilReactComponent } from './react-runtime.js';
|
|
6
|
-
import type { Components } from "@ds-mo/ui/dist/components";
|
|
7
|
-
import { DsChartLine as DsChartLineElement } from "@ds-mo/ui/dist/components/ds-chart-line.js";
|
|
8
|
-
export type DsChartLineEvents = NonNullable<unknown>;
|
|
9
|
-
export declare const DsChartLine: StencilReactComponent<DsChartLineElement, DsChartLineEvents, Components.DsChartLine>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { createComponent } from './react-runtime.js';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { DsChartLine as DsChartLineElement, defineCustomElement as defineDsChartLine } from "@ds-mo/ui/dist/components/ds-chart-line.js";
|
|
5
|
-
export const DsChartLine = /*@__PURE__*/ createComponent({
|
|
6
|
-
tagName: 'ds-chart-line',
|
|
7
|
-
elementClass: DsChartLineElement,
|
|
8
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
9
|
-
react: React,
|
|
10
|
-
events: {},
|
|
11
|
-
defineCustomElement: defineDsChartLine
|
|
12
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by the Stencil React Output Target.
|
|
3
|
-
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
|
-
*/
|
|
5
|
-
import type { StencilReactComponent } from './react-runtime.js';
|
|
6
|
-
import type { Components } from "@ds-mo/ui/dist/components";
|
|
7
|
-
import { DsTooltipDataViz as DsTooltipDataVizElement } from "@ds-mo/ui/dist/components/ds-tooltip-data-viz.js";
|
|
8
|
-
export type DsTooltipDataVizEvents = NonNullable<unknown>;
|
|
9
|
-
export declare const DsTooltipDataViz: StencilReactComponent<DsTooltipDataVizElement, DsTooltipDataVizEvents, Components.DsTooltipDataViz>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { createComponent } from './react-runtime.js';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { DsTooltipDataViz as DsTooltipDataVizElement, defineCustomElement as defineDsTooltipDataViz } from "@ds-mo/ui/dist/components/ds-tooltip-data-viz.js";
|
|
5
|
-
export const DsTooltipDataViz = /*@__PURE__*/ createComponent({
|
|
6
|
-
tagName: 'ds-tooltip-data-viz',
|
|
7
|
-
elementClass: DsTooltipDataVizElement,
|
|
8
|
-
// @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
|
|
9
|
-
react: React,
|
|
10
|
-
events: {},
|
|
11
|
-
defineCustomElement: defineDsTooltipDataViz
|
|
12
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { ChartDatum, ChartSeries } from '../../utils/chart-types';
|
|
2
|
-
export type ChartBarVariant = 'single' | 'stacked' | 'percentage';
|
|
3
|
-
export declare class ChartBar {
|
|
4
|
-
/** Rendering model. Single uses `data`; stacked and percentage use `series` and `categories`. */
|
|
5
|
-
variant: ChartBarVariant;
|
|
6
|
-
/** Bars to render. Set as a JS property (not an HTML attribute). */
|
|
7
|
-
data: ChartDatum[];
|
|
8
|
-
/** Ordered stack series for stacked and percentage variants. Set as a JS property. */
|
|
9
|
-
series: ChartSeries[];
|
|
10
|
-
/** X-axis labels for stacked and percentage variants. Set as a JS property. */
|
|
11
|
-
categories: string[];
|
|
12
|
-
/** Standalone intrinsic width. Container constraints reflow the plot at rendered pixel size. */
|
|
13
|
-
width: number;
|
|
14
|
-
/** Standalone intrinsic height. Container constraints reflow the plot at rendered pixel size. */
|
|
15
|
-
height: number;
|
|
16
|
-
private viewport;
|
|
17
|
-
private viewportController;
|
|
18
|
-
private svgEl;
|
|
19
|
-
componentDidLoad(): void;
|
|
20
|
-
connectedCallback(): void;
|
|
21
|
-
componentDidRender(): void;
|
|
22
|
-
private connectViewportController;
|
|
23
|
-
disconnectedCallback(): void;
|
|
24
|
-
handleIntrinsicSizeChange(): void;
|
|
25
|
-
private renderSingle;
|
|
26
|
-
private valuesForCategory;
|
|
27
|
-
private stackedAccessibleLabel;
|
|
28
|
-
private renderStacked;
|
|
29
|
-
render(): any;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=ChartBar.d.ts.map
|