@krizaka/charts 0.3.1 → 0.5.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/actions-5VG352VZ.js +53 -0
- package/dist/actions-5VG352VZ.js.map +1 -0
- package/dist/bar.d.ts +3 -3
- package/dist/bar.js +7 -6
- package/dist/candlestick.d.ts +2 -2
- package/dist/candlestick.js +6 -5
- package/dist/card.d.ts +52 -0
- package/dist/card.js +19 -0
- package/dist/card.js.map +1 -0
- package/dist/{cartesian-BRhNQ3ib.d.ts → cartesian-CEY_wwe_.d.ts} +12 -2
- package/dist/chart.d.ts +2 -2
- package/dist/chart.js +5 -4
- package/dist/{chunk-BV4DBGN7.js → chunk-7W4T255Q.js} +4 -4
- package/dist/{chunk-W5ILLSPK.js → chunk-AGSSNMK5.js} +5 -5
- package/dist/{chunk-VKZZY2QD.js → chunk-FE4LUGAE.js} +5 -5
- package/dist/{chunk-ARARFMNE.js → chunk-FIQHMJZK.js} +5 -5
- package/dist/chunk-FIQHMJZK.js.map +1 -0
- package/dist/{chunk-ANUCSRUN.js → chunk-GD7TWEN3.js} +3 -3
- package/dist/chunk-GRRFPI27.js +89 -0
- package/dist/chunk-GRRFPI27.js.map +1 -0
- package/dist/{chunk-SLEJDQ3A.js → chunk-HH65IEUV.js} +3 -3
- package/dist/{chunk-OIRHLJBC.js → chunk-IJTI6VJD.js} +3 -3
- package/dist/{chunk-WVTIKOII.js → chunk-IURCLBUQ.js} +2 -2
- package/dist/{chunk-CVWSMUUB.js → chunk-JST4HJC3.js} +33 -15
- package/dist/chunk-JST4HJC3.js.map +1 -0
- package/dist/{chunk-IKQV3NSL.js → chunk-KERGFVSN.js} +3 -3
- package/dist/{chunk-XDDALY4C.js → chunk-KMQ7RANJ.js} +5 -5
- package/dist/{chunk-NCIQMRV3.js → chunk-LLUQEK5J.js} +5 -5
- package/dist/{chunk-AA5EWWYV.js → chunk-LZPZWBBY.js} +2 -2
- package/dist/{chunk-PBQV3B6O.js → chunk-MK2ZFUWM.js} +31 -16
- package/dist/chunk-MK2ZFUWM.js.map +1 -0
- package/dist/{chunk-CSSZLFLO.js → chunk-MRGMLDNS.js} +5 -5
- package/dist/{chunk-I3D7KUGN.js → chunk-NLTZWJLV.js} +3 -3
- package/dist/{chunk-PWMMXRMC.js → chunk-NV52AKHG.js} +3 -3
- package/dist/{chunk-MXLITIGU.js → chunk-NWJ5VDN7.js} +5 -5
- package/dist/{chunk-3CJHBJXA.js → chunk-OVASCEGF.js} +12 -73
- package/dist/chunk-OVASCEGF.js.map +1 -0
- package/dist/{chunk-EQLC2QVN.js → chunk-OZOAKP5F.js} +4 -4
- package/dist/chunk-OZOAKP5F.js.map +1 -0
- package/dist/{chunk-KNDHO67X.js → chunk-P2NK5L3B.js} +3 -3
- package/dist/{chunk-JTKR7ZWP.js → chunk-P6RS2L23.js} +140 -36
- package/dist/chunk-P6RS2L23.js.map +1 -0
- package/dist/{chunk-W5FX4TU3.js → chunk-PGD6SH5I.js} +30 -2
- package/dist/chunk-PGD6SH5I.js.map +1 -0
- package/dist/{chunk-4LBXEAGC.js → chunk-PWZHIGPO.js} +5 -5
- package/dist/{chunk-L2EKYWVI.js → chunk-VEOJNMPF.js} +3 -3
- package/dist/chunk-YHQFW2PR.js +71 -0
- package/dist/chunk-YHQFW2PR.js.map +1 -0
- package/dist/{chunk-C4MFZLJM.js → chunk-Z4T3JFNU.js} +2 -2
- package/dist/{chunk-EEP7PS2L.js → chunk-ZF7LVQTR.js} +3 -3
- package/dist/{context-BgYUymEO.d.ts → context-DNW7bJYw.d.ts} +19 -0
- package/dist/credits.d.ts +1 -1
- package/dist/credits.js +7 -6
- package/dist/earnings.d.ts +3 -3
- package/dist/earnings.js +8 -7
- package/dist/{frame-I7_xYGy5.d.ts → frame-B1HDNm7c.d.ts} +9 -5
- package/dist/funnel.d.ts +2 -2
- package/dist/funnel.js +6 -5
- package/dist/gauge.d.ts +2 -2
- package/dist/gauge.js +4 -3
- package/dist/geo.d.ts +2 -2
- package/dist/geo.js +5 -4
- package/dist/globe.d.ts +2 -2
- package/dist/globe.js +4 -3
- package/dist/goal.d.ts +2 -2
- package/dist/goal.js +5 -4
- package/dist/heatmap.d.ts +2 -2
- package/dist/heatmap.js +6 -5
- package/dist/index.d.ts +5 -3
- package/dist/index.js +45 -37
- package/dist/latency.d.ts +3 -3
- package/dist/latency.js +8 -7
- package/dist/line.d.ts +3 -3
- package/dist/line.js +7 -6
- package/dist/native.d.ts +19 -0
- package/dist/native.js +13 -1
- package/dist/native.js.map +1 -1
- package/dist/pie.d.ts +2 -2
- package/dist/pie.js +6 -5
- package/dist/provider.d.ts +2 -2
- package/dist/provider.js +4 -2
- package/dist/radar.d.ts +2 -2
- package/dist/radar.js +6 -5
- package/dist/sankey.d.ts +2 -2
- package/dist/sankey.js +6 -5
- package/dist/scatter.d.ts +2 -2
- package/dist/scatter.js +6 -5
- package/dist/sparkline.d.ts +2 -2
- package/dist/sparkline.js +6 -5
- package/dist/table-sheet-CQBIAV5N.js +36 -0
- package/dist/table-sheet-CQBIAV5N.js.map +1 -0
- package/dist/throughput.d.ts +3 -3
- package/dist/throughput.js +8 -7
- package/dist/ticker.d.ts +3 -3
- package/dist/ticker.js +8 -7
- package/dist/treemap.d.ts +2 -2
- package/dist/treemap.js +7 -6
- package/package.json +292 -50
- package/registry/area-chart.json +93 -12
- package/registry/bar-chart.json +93 -12
- package/registry/calendar-heatmap.json +59 -18
- package/registry/candlestick.json +59 -18
- package/registry/chart-card.json +248 -0
- package/registry/chart.json +53 -12
- package/registry/charts-provider.json +13 -2
- package/registry/credit-usage.json +11 -0
- package/registry/earnings-chart.json +93 -12
- package/registry/examples/chart-card/before-after.d.ts +4 -0
- package/registry/examples/chart-card/before-after.js +22 -0
- package/registry/examples/chart-card/before-after.tsx +22 -0
- package/registry/examples/chart-card/jobs-activity.d.ts +4 -0
- package/registry/examples/chart-card/jobs-activity.js +20 -0
- package/registry/examples/chart-card/jobs-activity.tsx +20 -0
- package/registry/examples/chart-card/sparse-and-empty.d.ts +4 -0
- package/registry/examples/chart-card/sparse-and-empty.js +16 -0
- package/registry/examples/chart-card/sparse-and-empty.tsx +18 -0
- package/registry/examples/chart-card/usage-donut.d.ts +4 -0
- package/registry/examples/chart-card/usage-donut.js +18 -0
- package/registry/examples/chart-card/usage-donut.tsx +18 -0
- package/registry/examples/charts-provider/french-orazaka.js +1 -1
- package/registry/examples/charts-provider/french-orazaka.tsx +1 -1
- package/registry/examples/kpi-stat/dashboard-row.d.ts +4 -0
- package/registry/examples/kpi-stat/dashboard-row.js +19 -0
- package/registry/examples/kpi-stat/dashboard-row.tsx +17 -0
- package/registry/examples/kpi-stat/single.d.ts +4 -0
- package/registry/examples/kpi-stat/single.js +11 -0
- package/registry/examples/kpi-stat/single.tsx +6 -0
- package/registry/funnel.json +59 -18
- package/registry/gauge.json +53 -14
- package/registry/geo-map.json +59 -18
- package/registry/globe.json +54 -12
- package/registry/goal-progress.json +47 -8
- package/registry/heatmap.json +59 -18
- package/registry/index.json +362 -1
- package/registry/job-throughput.json +93 -12
- package/registry/kpi-stat.json +309 -0
- package/registry/latency-chart.json +93 -12
- package/registry/line-chart.json +93 -12
- package/registry/pie-chart.json +103 -36
- package/registry/price-ticker.json +93 -12
- package/registry/radar-chart.json +59 -18
- package/registry/sankey.json +59 -18
- package/registry/scatter-chart.json +59 -18
- package/registry/sparkline.json +49 -10
- package/registry/treemap.json +53 -12
- package/dist/chunk-3CJHBJXA.js.map +0 -1
- package/dist/chunk-ARARFMNE.js.map +0 -1
- package/dist/chunk-CVWSMUUB.js.map +0 -1
- package/dist/chunk-EQLC2QVN.js.map +0 -1
- package/dist/chunk-JTKR7ZWP.js.map +0 -1
- package/dist/chunk-PBQV3B6O.js.map +0 -1
- package/dist/chunk-W5FX4TU3.js.map +0 -1
- /package/dist/{chunk-BV4DBGN7.js.map → chunk-7W4T255Q.js.map} +0 -0
- /package/dist/{chunk-W5ILLSPK.js.map → chunk-AGSSNMK5.js.map} +0 -0
- /package/dist/{chunk-VKZZY2QD.js.map → chunk-FE4LUGAE.js.map} +0 -0
- /package/dist/{chunk-ANUCSRUN.js.map → chunk-GD7TWEN3.js.map} +0 -0
- /package/dist/{chunk-SLEJDQ3A.js.map → chunk-HH65IEUV.js.map} +0 -0
- /package/dist/{chunk-OIRHLJBC.js.map → chunk-IJTI6VJD.js.map} +0 -0
- /package/dist/{chunk-WVTIKOII.js.map → chunk-IURCLBUQ.js.map} +0 -0
- /package/dist/{chunk-IKQV3NSL.js.map → chunk-KERGFVSN.js.map} +0 -0
- /package/dist/{chunk-XDDALY4C.js.map → chunk-KMQ7RANJ.js.map} +0 -0
- /package/dist/{chunk-NCIQMRV3.js.map → chunk-LLUQEK5J.js.map} +0 -0
- /package/dist/{chunk-AA5EWWYV.js.map → chunk-LZPZWBBY.js.map} +0 -0
- /package/dist/{chunk-CSSZLFLO.js.map → chunk-MRGMLDNS.js.map} +0 -0
- /package/dist/{chunk-I3D7KUGN.js.map → chunk-NLTZWJLV.js.map} +0 -0
- /package/dist/{chunk-PWMMXRMC.js.map → chunk-NV52AKHG.js.map} +0 -0
- /package/dist/{chunk-MXLITIGU.js.map → chunk-NWJ5VDN7.js.map} +0 -0
- /package/dist/{chunk-KNDHO67X.js.map → chunk-P2NK5L3B.js.map} +0 -0
- /package/dist/{chunk-4LBXEAGC.js.map → chunk-PWZHIGPO.js.map} +0 -0
- /package/dist/{chunk-L2EKYWVI.js.map → chunk-VEOJNMPF.js.map} +0 -0
- /package/dist/{chunk-C4MFZLJM.js.map → chunk-Z4T3JFNU.js.map} +0 -0
- /package/dist/{chunk-EEP7PS2L.js.map → chunk-ZF7LVQTR.js.map} +0 -0
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
"status": "beta",
|
|
9
9
|
"category": "charts",
|
|
10
10
|
"platforms": "both",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "yes"
|
|
14
|
+
},
|
|
15
|
+
"native": {
|
|
16
|
+
"state": "yes"
|
|
17
|
+
},
|
|
18
|
+
"desktop": {
|
|
19
|
+
"state": "yes"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
11
22
|
"engine": "svg",
|
|
12
23
|
"tier": "ready-made",
|
|
13
24
|
"whenToUse": [
|
|
@@ -90,11 +101,18 @@
|
|
|
90
101
|
"required": true
|
|
91
102
|
},
|
|
92
103
|
{
|
|
93
|
-
"name": "
|
|
94
|
-
"type": "
|
|
104
|
+
"name": "actionsMenu",
|
|
105
|
+
"type": "boolean",
|
|
95
106
|
"default": null,
|
|
96
|
-
"description": "
|
|
97
|
-
"required":
|
|
107
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
108
|
+
"required": false
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "autoRange",
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"default": null,
|
|
114
|
+
"description": "Zoom the time axis on the period that has data: the empty days before the first and after the last value are\nleft out (never fewer than `minPoints`), and a sparse period says so under the chart instead of drawing 13 empty\ndays around one bar. Default false.",
|
|
115
|
+
"required": false
|
|
98
116
|
},
|
|
99
117
|
{
|
|
100
118
|
"name": "brand",
|
|
@@ -114,7 +132,7 @@
|
|
|
114
132
|
"name": "dataTable",
|
|
115
133
|
"type": "boolean",
|
|
116
134
|
"default": null,
|
|
117
|
-
"description": "
|
|
135
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
118
136
|
"required": false
|
|
119
137
|
},
|
|
120
138
|
{
|
|
@@ -142,7 +160,14 @@
|
|
|
142
160
|
"name": "exportable",
|
|
143
161
|
"type": "boolean | readonly ExportFormat[]",
|
|
144
162
|
"default": null,
|
|
145
|
-
"description": "
|
|
163
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
164
|
+
"required": false
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "filterable",
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"default": null,
|
|
170
|
+
"description": "The legend chips switch the series on and off. Default true.",
|
|
146
171
|
"required": false
|
|
147
172
|
},
|
|
148
173
|
{
|
|
@@ -180,6 +205,13 @@
|
|
|
180
205
|
"description": "The id of the figure.",
|
|
181
206
|
"required": false
|
|
182
207
|
},
|
|
208
|
+
{
|
|
209
|
+
"name": "insight",
|
|
210
|
+
"type": "ReactNode",
|
|
211
|
+
"default": null,
|
|
212
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
213
|
+
"required": false
|
|
214
|
+
},
|
|
183
215
|
{
|
|
184
216
|
"name": "labels",
|
|
185
217
|
"type": "Partial<EarningsLabels>",
|
|
@@ -222,6 +254,13 @@
|
|
|
222
254
|
"description": "Vertical markers at a category: a launch, an incident.",
|
|
223
255
|
"required": false
|
|
224
256
|
},
|
|
257
|
+
{
|
|
258
|
+
"name": "minPoints",
|
|
259
|
+
"type": "number",
|
|
260
|
+
"default": null,
|
|
261
|
+
"description": "With `autoRange`, the fewest categories to keep so a short burst still has a time scale. Default 7.",
|
|
262
|
+
"required": false
|
|
263
|
+
},
|
|
225
264
|
{
|
|
226
265
|
"name": "onSelect",
|
|
227
266
|
"type": "((datum: T, index: number) => void)",
|
|
@@ -264,6 +303,13 @@
|
|
|
264
303
|
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
265
304
|
"required": false
|
|
266
305
|
},
|
|
306
|
+
{
|
|
307
|
+
"name": "title",
|
|
308
|
+
"type": "string",
|
|
309
|
+
"default": null,
|
|
310
|
+
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`. Inside a `ChartCard`, the card's title is the default.",
|
|
311
|
+
"required": false
|
|
312
|
+
},
|
|
267
313
|
{
|
|
268
314
|
"name": "x",
|
|
269
315
|
"type": "string | ((datum: T, index: number) => unknown)",
|
|
@@ -502,11 +548,18 @@
|
|
|
502
548
|
"required": true
|
|
503
549
|
},
|
|
504
550
|
{
|
|
505
|
-
"name": "
|
|
506
|
-
"type": "
|
|
551
|
+
"name": "actionsMenu",
|
|
552
|
+
"type": "boolean",
|
|
507
553
|
"default": null,
|
|
508
|
-
"description": "
|
|
509
|
-
"required":
|
|
554
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
555
|
+
"required": false
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "autoRange",
|
|
559
|
+
"type": "boolean",
|
|
560
|
+
"default": null,
|
|
561
|
+
"description": "Zoom the time axis on the period that has data: the empty days before the first and after the last value are\nleft out (never fewer than `minPoints`), and a sparse period says so under the chart instead of drawing 13 empty\ndays around one bar. Default false.",
|
|
562
|
+
"required": false
|
|
510
563
|
},
|
|
511
564
|
{
|
|
512
565
|
"name": "brand",
|
|
@@ -526,7 +579,7 @@
|
|
|
526
579
|
"name": "dataTable",
|
|
527
580
|
"type": "boolean",
|
|
528
581
|
"default": null,
|
|
529
|
-
"description": "
|
|
582
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
530
583
|
"required": false
|
|
531
584
|
},
|
|
532
585
|
{
|
|
@@ -554,7 +607,14 @@
|
|
|
554
607
|
"name": "exportable",
|
|
555
608
|
"type": "boolean | readonly ExportFormat[]",
|
|
556
609
|
"default": null,
|
|
557
|
-
"description": "
|
|
610
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
611
|
+
"required": false
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"name": "filterable",
|
|
615
|
+
"type": "boolean",
|
|
616
|
+
"default": null,
|
|
617
|
+
"description": "The legend chips switch the series on and off. Default true.",
|
|
558
618
|
"required": false
|
|
559
619
|
},
|
|
560
620
|
{
|
|
@@ -592,6 +652,13 @@
|
|
|
592
652
|
"description": "The id of the figure.",
|
|
593
653
|
"required": false
|
|
594
654
|
},
|
|
655
|
+
{
|
|
656
|
+
"name": "insight",
|
|
657
|
+
"type": "ReactNode",
|
|
658
|
+
"default": null,
|
|
659
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
660
|
+
"required": false
|
|
661
|
+
},
|
|
595
662
|
{
|
|
596
663
|
"name": "labels",
|
|
597
664
|
"type": "Partial<EarningsLabels>",
|
|
@@ -634,6 +701,13 @@
|
|
|
634
701
|
"description": "Vertical markers at a category: a launch, an incident.",
|
|
635
702
|
"required": false
|
|
636
703
|
},
|
|
704
|
+
{
|
|
705
|
+
"name": "minPoints",
|
|
706
|
+
"type": "number",
|
|
707
|
+
"default": null,
|
|
708
|
+
"description": "With `autoRange`, the fewest categories to keep so a short burst still has a time scale. Default 7.",
|
|
709
|
+
"required": false
|
|
710
|
+
},
|
|
637
711
|
{
|
|
638
712
|
"name": "onSelect",
|
|
639
713
|
"type": "((datum: T, index: number) => void)",
|
|
@@ -676,6 +750,13 @@
|
|
|
676
750
|
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
677
751
|
"required": false
|
|
678
752
|
},
|
|
753
|
+
{
|
|
754
|
+
"name": "title",
|
|
755
|
+
"type": "string",
|
|
756
|
+
"default": null,
|
|
757
|
+
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`. Inside a `ChartCard`, the card's title is the default.",
|
|
758
|
+
"required": false
|
|
759
|
+
},
|
|
679
760
|
{
|
|
680
761
|
"name": "x",
|
|
681
762
|
"type": "string | ((datum: T, index: number) => unknown)",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/chart-card/before-after.tsx
|
|
4
|
+
import { BarChart } from "@krizaka/charts/bar";
|
|
5
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var data = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"].map((day, i) => ({ day, jobs: [12, 18, 9, 22, 31, 27, 35][i] }));
|
|
8
|
+
function BeforeAfter() {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16, gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11
|
+
/* @__PURE__ */ jsx("p", { style: { margin: "0 0 8px", fontSize: 12, color: "var(--kz-text-secondary)" }, children: "Before" }),
|
|
12
|
+
/* @__PURE__ */ jsx(BarChart, { title: "Jobs per day", data, x: "day", y: "jobs", yLabel: "Jobs", height: 180, actionsMenu: false, exportable: true })
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
15
|
+
/* @__PURE__ */ jsx("p", { style: { margin: "0 0 8px", fontSize: 12, color: "var(--kz-text-secondary)" }, children: "After" }),
|
|
16
|
+
/* @__PURE__ */ jsx(ChartCard, { title: "Jobs per day", insight: "154 jobs \xB7 busiest on Sunday", footer: "Source: your own jobs.", children: /* @__PURE__ */ jsx(BarChart, { data, x: "day", y: "jobs", yLabel: "Jobs", height: 180 }) })
|
|
17
|
+
] })
|
|
18
|
+
] });
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
BeforeAfter as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BarChart } from "@krizaka/charts/bar";
|
|
2
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
3
|
+
|
|
4
|
+
const data = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"].map((day, i) => ({ day, jobs: [12, 18, 9, 22, 31, 27, 35][i] }));
|
|
5
|
+
|
|
6
|
+
// Before: a bare chart, “Show data” and the exports as text buttons. After: the same chart in a ChartCard.
|
|
7
|
+
export default function BeforeAfter() {
|
|
8
|
+
return (
|
|
9
|
+
<div style={{ display: "grid", gap: 16, gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }}>
|
|
10
|
+
<div>
|
|
11
|
+
<p style={{ margin: "0 0 8px", fontSize: 12, color: "var(--kz-text-secondary)" }}>Before</p>
|
|
12
|
+
<BarChart title="Jobs per day" data={data} x="day" y="jobs" yLabel="Jobs" height={180} actionsMenu={false} exportable />
|
|
13
|
+
</div>
|
|
14
|
+
<div>
|
|
15
|
+
<p style={{ margin: "0 0 8px", fontSize: 12, color: "var(--kz-text-secondary)" }}>After</p>
|
|
16
|
+
<ChartCard title="Jobs per day" insight="154 jobs · busiest on Sunday" footer="Source: your own jobs.">
|
|
17
|
+
<BarChart data={data} x="day" y="jobs" yLabel="Jobs" height={180} />
|
|
18
|
+
</ChartCard>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/chart-card/jobs-activity.tsx
|
|
4
|
+
import { BarChart } from "@krizaka/charts/bar";
|
|
5
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var days = ["2026-10-03", "2026-10-04", "2026-10-05", "2026-10-06", "2026-10-07", "2026-10-08", "2026-10-09", "2026-10-10"];
|
|
8
|
+
var completed = [12, 18, 9, 22, 31, 27, 35, 41];
|
|
9
|
+
var failed = [1, 0, 2, 1, 3, 0, 1, 2];
|
|
10
|
+
var data = days.map((day, i) => ({ day, completed: completed[i], failed: failed[i] }));
|
|
11
|
+
var series = [
|
|
12
|
+
{ key: "completed", label: "Completed", color: "accent" },
|
|
13
|
+
{ key: "failed", label: "Failed", color: "danger" }
|
|
14
|
+
];
|
|
15
|
+
function JobsActivity() {
|
|
16
|
+
return /* @__PURE__ */ jsx(ChartCard, { title: "Jobs per day", insight: "195 jobs \xB7 +24 % vs the week before", footer: "Read from your own jobs \u2014 nothing estimated.", children: /* @__PURE__ */ jsx(BarChart, { data, x: "day", xFormat: "day", xLabel: "Day", series, stacked: true, format: "integer", height: 220, autoRange: true }) });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
JobsActivity as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BarChart } from "@krizaka/charts/bar";
|
|
2
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
3
|
+
|
|
4
|
+
const days = ["2026-10-03", "2026-10-04", "2026-10-05", "2026-10-06", "2026-10-07", "2026-10-08", "2026-10-09", "2026-10-10"];
|
|
5
|
+
const completed = [12, 18, 9, 22, 31, 27, 35, 41];
|
|
6
|
+
const failed = [1, 0, 2, 1, 3, 0, 1, 2];
|
|
7
|
+
const data = days.map((day, i) => ({ day, completed: completed[i], failed: failed[i] }));
|
|
8
|
+
const series = [
|
|
9
|
+
{ key: "completed", label: "Completed", color: "accent" },
|
|
10
|
+
{ key: "failed", label: "Failed", color: "danger" },
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
// The card hands the chart its title and insight; the ⋯ menu (table, CSV, PNG, SVG, copy) comes with it.
|
|
14
|
+
export default function JobsActivity() {
|
|
15
|
+
return (
|
|
16
|
+
<ChartCard title="Jobs per day" insight="195 jobs · +24 % vs the week before" footer="Read from your own jobs — nothing estimated.">
|
|
17
|
+
<BarChart data={data} x="day" xFormat="day" xLabel="Day" series={series} stacked format="integer" height={220} autoRange />
|
|
18
|
+
</ChartCard>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/chart-card/sparse-and-empty.tsx
|
|
4
|
+
import { BarChart } from "@krizaka/charts/bar";
|
|
5
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var days = Array.from({ length: 30 }, (_, i) => ({ day: `2026-09-${String(i + 1).padStart(2, "0")}`, jobs: i === 27 ? 100 : 0 }));
|
|
8
|
+
function SparseAndEmpty() {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "grid", gap: 16, gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }, children: [
|
|
10
|
+
/* @__PURE__ */ jsx(ChartCard, { title: "Jobs per day", insight: "100 jobs on Sep 28", children: /* @__PURE__ */ jsx(BarChart, { data: days, x: "day", xFormat: "day", y: "jobs", yLabel: "Jobs", format: "integer", height: 180, autoRange: true }) }),
|
|
11
|
+
/* @__PURE__ */ jsx(ChartCard, { title: "Failed jobs", insight: "Nothing failed yet", children: /* @__PURE__ */ jsx(BarChart, { data: [], x: "day", y: "jobs", yLabel: "Jobs", height: 180 }) })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
SparseAndEmpty as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BarChart } from "@krizaka/charts/bar";
|
|
2
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
3
|
+
|
|
4
|
+
const days = Array.from({ length: 30 }, (_, i) => ({ day: `2026-09-${String(i + 1).padStart(2, "0")}`, jobs: i === 27 ? 100 : 0 }));
|
|
5
|
+
|
|
6
|
+
// 29 empty days and one bar: `autoRange` zooms on the active period and says how sparse it is. No data: a calm state.
|
|
7
|
+
export default function SparseAndEmpty() {
|
|
8
|
+
return (
|
|
9
|
+
<div style={{ display: "grid", gap: 16, gridTemplateColumns: "repeat(auto-fit, minmax(280px, 1fr))" }}>
|
|
10
|
+
<ChartCard title="Jobs per day" insight="100 jobs on Sep 28">
|
|
11
|
+
<BarChart data={days} x="day" xFormat="day" y="jobs" yLabel="Jobs" format="integer" height={180} autoRange />
|
|
12
|
+
</ChartCard>
|
|
13
|
+
<ChartCard title="Failed jobs" insight="Nothing failed yet">
|
|
14
|
+
<BarChart data={[]} x="day" y="jobs" yLabel="Jobs" height={180} />
|
|
15
|
+
</ChartCard>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/chart-card/usage-donut.tsx
|
|
4
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
5
|
+
import { DonutChart } from "@krizaka/charts/pie";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var kinds = [
|
|
8
|
+
{ kind: "Images", jobs: 96 },
|
|
9
|
+
{ kind: "Video", jobs: 41 },
|
|
10
|
+
{ kind: "Audio", jobs: 33 },
|
|
11
|
+
{ kind: "Text", jobs: 25 }
|
|
12
|
+
];
|
|
13
|
+
function UsageDonut() {
|
|
14
|
+
return /* @__PURE__ */ jsx(ChartCard, { title: "What you made", insight: "195 jobs, most of them images", description: "Jobs by kind, last 7 days.", children: /* @__PURE__ */ jsx(DonutChart, { data: kinds, label: "kind", value: "jobs", labelHeader: "Kind", valueHeader: "Jobs", centerLabel: "jobs", format: "integer", height: 220 }) });
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
UsageDonut as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChartCard } from "@krizaka/charts/card";
|
|
2
|
+
import { DonutChart } from "@krizaka/charts/pie";
|
|
3
|
+
|
|
4
|
+
const kinds = [
|
|
5
|
+
{ kind: "Images", jobs: 96 },
|
|
6
|
+
{ kind: "Video", jobs: 41 },
|
|
7
|
+
{ kind: "Audio", jobs: 33 },
|
|
8
|
+
{ kind: "Text", jobs: 25 },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
// Legend chips carry the value and the share, and switch a part off: click “Video” and the ring re-measures.
|
|
12
|
+
export default function UsageDonut() {
|
|
13
|
+
return (
|
|
14
|
+
<ChartCard title="What you made" insight="195 jobs, most of them images" description="Jobs by kind, last 7 days.">
|
|
15
|
+
<DonutChart data={kinds} label="kind" value="jobs" labelHeader="Kind" valueHeader="Jobs" centerLabel="jobs" format="integer" height={220} />
|
|
16
|
+
</ChartCard>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -16,7 +16,7 @@ function FrenchOrazaka() {
|
|
|
16
16
|
{
|
|
17
17
|
locale: "fr-FR",
|
|
18
18
|
brand: "orazaka",
|
|
19
|
-
labels: {
|
|
19
|
+
labels: { actions: "Actions du graphique", viewTable: "Voir en tableau", downloadCsv: "T\xE9l\xE9charger le CSV", copyData: "Copier les donn\xE9es", empty: "Pas encore de donn\xE9es.", kinds: { bar: "Histogramme" } },
|
|
20
20
|
children: /* @__PURE__ */ jsx(BarChart, { title: "Cr\xE9dits consomm\xE9s par mois", data: months, x: "month", xLabel: "Mois", y: "credits", yLabel: "Cr\xE9dits", format: "compact" })
|
|
21
21
|
}
|
|
22
22
|
);
|
|
@@ -14,7 +14,7 @@ export default function FrenchOrazaka() {
|
|
|
14
14
|
<ChartsProvider
|
|
15
15
|
locale="fr-FR"
|
|
16
16
|
brand="orazaka"
|
|
17
|
-
labels={{
|
|
17
|
+
labels={{ actions: "Actions du graphique", viewTable: "Voir en tableau", downloadCsv: "Télécharger le CSV", copyData: "Copier les données", empty: "Pas encore de données.", kinds: { bar: "Histogramme" } }}
|
|
18
18
|
>
|
|
19
19
|
<BarChart title="Crédits consommés par mois" data={months} x="month" xLabel="Mois" y="credits" yLabel="Crédits" format="compact" />
|
|
20
20
|
</ChartsProvider>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/kpi-stat/dashboard-row.tsx
|
|
4
|
+
import { KpiStat } from "@krizaka/charts/card";
|
|
5
|
+
import { StatGrid } from "@krizaka/ui/stat";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var jobs = [12, 18, 9, 22, 31, 27, 35, 41];
|
|
8
|
+
var minutes = [4.2, 4.6, 5.1, 4.4, 3.9, 3.7, 3.5, 3.2];
|
|
9
|
+
function DashboardRow() {
|
|
10
|
+
return /* @__PURE__ */ jsxs(StatGrid, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(KpiStat, { label: "Jobs", value: 195, previous: 157, data: jobs, variant: "bar", hint: "last 8 days" }),
|
|
12
|
+
/* @__PURE__ */ jsx(KpiStat, { label: "Success rate", value: 0.94, previous: 0.91, format: "percent", hint: "completed / all" }),
|
|
13
|
+
/* @__PURE__ */ jsx(KpiStat, { label: "Median time", value: 3.2, previous: 4.2, good: "down", data: minutes, format: { style: "unit", unit: "minute" }, hint: "to a result" }),
|
|
14
|
+
/* @__PURE__ */ jsx(KpiStat, { label: "Credits spent", value: 1240, previous: 1100, good: "down", format: "integer", hint: "this period" })
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
DashboardRow as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { KpiStat } from "@krizaka/charts/card";
|
|
2
|
+
import { StatGrid } from "@krizaka/ui/stat";
|
|
3
|
+
|
|
4
|
+
const jobs = [12, 18, 9, 22, 31, 27, 35, 41];
|
|
5
|
+
const minutes = [4.2, 4.6, 5.1, 4.4, 3.9, 3.7, 3.5, 3.2];
|
|
6
|
+
|
|
7
|
+
// The head of a dashboard: each figure with its change against the previous period and the shape of the period.
|
|
8
|
+
export default function DashboardRow() {
|
|
9
|
+
return (
|
|
10
|
+
<StatGrid>
|
|
11
|
+
<KpiStat label="Jobs" value={195} previous={157} data={jobs} variant="bar" hint="last 8 days" />
|
|
12
|
+
<KpiStat label="Success rate" value={0.94} previous={0.91} format="percent" hint="completed / all" />
|
|
13
|
+
<KpiStat label="Median time" value={3.2} previous={4.2} good="down" data={minutes} format={{ style: "unit", unit: "minute" }} hint="to a result" />
|
|
14
|
+
<KpiStat label="Credits spent" value={1240} previous={1100} good="down" format="integer" hint="this period" />
|
|
15
|
+
</StatGrid>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/kpi-stat/single.tsx
|
|
4
|
+
import { KpiStat } from "@krizaka/charts/card";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function Single() {
|
|
7
|
+
return /* @__PURE__ */ jsx(KpiStat, { label: "Time to a result", value: 48, previous: 31, good: "down", format: { style: "unit", unit: "second" }, data: [31, 29, 35, 38, 41, 44, 48], hint: "median, last 7 days" });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
Single as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { KpiStat } from "@krizaka/charts/card";
|
|
2
|
+
|
|
3
|
+
// A rise in latency is bad news: good="down" makes the arrow say so.
|
|
4
|
+
export default function Single() {
|
|
5
|
+
return <KpiStat label="Time to a result" value={48} previous={31} good="down" format={{ style: "unit", unit: "second" }} data={[31, 29, 35, 38, 41, 44, 48]} hint="median, last 7 days" />;
|
|
6
|
+
}
|
package/registry/funnel.json
CHANGED
|
@@ -8,6 +8,19 @@
|
|
|
8
8
|
"status": "beta",
|
|
9
9
|
"category": "charts",
|
|
10
10
|
"platforms": "web",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "yes"
|
|
14
|
+
},
|
|
15
|
+
"native": {
|
|
16
|
+
"state": "gap",
|
|
17
|
+
"reason": "Advanced tier: no phone screen needs it yet.",
|
|
18
|
+
"issue": "krizaka/krizaka-ui#280"
|
|
19
|
+
},
|
|
20
|
+
"desktop": {
|
|
21
|
+
"state": "yes"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
11
24
|
"engine": "echarts",
|
|
12
25
|
"tier": "advanced",
|
|
13
26
|
"whenToUse": [
|
|
@@ -85,13 +98,6 @@
|
|
|
85
98
|
"description": "The field (or function) naming the stage.",
|
|
86
99
|
"required": true
|
|
87
100
|
},
|
|
88
|
-
{
|
|
89
|
-
"name": "title",
|
|
90
|
-
"type": "string",
|
|
91
|
-
"default": null,
|
|
92
|
-
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
93
|
-
"required": true
|
|
94
|
-
},
|
|
95
101
|
{
|
|
96
102
|
"name": "value",
|
|
97
103
|
"type": "string | ((datum: T, index: number) => number)",
|
|
@@ -99,6 +105,13 @@
|
|
|
99
105
|
"description": "The field of how many reached it.",
|
|
100
106
|
"required": true
|
|
101
107
|
},
|
|
108
|
+
{
|
|
109
|
+
"name": "actionsMenu",
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"default": null,
|
|
112
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
113
|
+
"required": false
|
|
114
|
+
},
|
|
102
115
|
{
|
|
103
116
|
"name": "brand",
|
|
104
117
|
"type": "BrandId",
|
|
@@ -117,7 +130,7 @@
|
|
|
117
130
|
"name": "dataTable",
|
|
118
131
|
"type": "boolean",
|
|
119
132
|
"default": null,
|
|
120
|
-
"description": "
|
|
133
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
121
134
|
"required": false
|
|
122
135
|
},
|
|
123
136
|
{
|
|
@@ -145,7 +158,7 @@
|
|
|
145
158
|
"name": "exportable",
|
|
146
159
|
"type": "boolean | readonly ExportFormat[]",
|
|
147
160
|
"default": null,
|
|
148
|
-
"description": "
|
|
161
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
149
162
|
"required": false
|
|
150
163
|
},
|
|
151
164
|
{
|
|
@@ -190,6 +203,13 @@
|
|
|
190
203
|
"description": "The id of the figure.",
|
|
191
204
|
"required": false
|
|
192
205
|
},
|
|
206
|
+
{
|
|
207
|
+
"name": "insight",
|
|
208
|
+
"type": "ReactNode",
|
|
209
|
+
"default": null,
|
|
210
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
211
|
+
"required": false
|
|
212
|
+
},
|
|
193
213
|
{
|
|
194
214
|
"name": "labels",
|
|
195
215
|
"type": "ChartLabelsInput",
|
|
@@ -253,6 +273,13 @@
|
|
|
253
273
|
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
254
274
|
"required": false
|
|
255
275
|
},
|
|
276
|
+
{
|
|
277
|
+
"name": "title",
|
|
278
|
+
"type": "string",
|
|
279
|
+
"default": null,
|
|
280
|
+
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`. Inside a `ChartCard`, the card's title is the default.",
|
|
281
|
+
"required": false
|
|
282
|
+
},
|
|
256
283
|
{
|
|
257
284
|
"name": "valueLabel",
|
|
258
285
|
"type": "string",
|
|
@@ -306,13 +333,6 @@
|
|
|
306
333
|
"description": "The field (or function) naming the stage.",
|
|
307
334
|
"required": true
|
|
308
335
|
},
|
|
309
|
-
{
|
|
310
|
-
"name": "title",
|
|
311
|
-
"type": "string",
|
|
312
|
-
"default": null,
|
|
313
|
-
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
314
|
-
"required": true
|
|
315
|
-
},
|
|
316
336
|
{
|
|
317
337
|
"name": "value",
|
|
318
338
|
"type": "string | ((datum: T, index: number) => number)",
|
|
@@ -320,6 +340,13 @@
|
|
|
320
340
|
"description": "The field of how many reached it.",
|
|
321
341
|
"required": true
|
|
322
342
|
},
|
|
343
|
+
{
|
|
344
|
+
"name": "actionsMenu",
|
|
345
|
+
"type": "boolean",
|
|
346
|
+
"default": null,
|
|
347
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
348
|
+
"required": false
|
|
349
|
+
},
|
|
323
350
|
{
|
|
324
351
|
"name": "brand",
|
|
325
352
|
"type": "BrandId",
|
|
@@ -338,7 +365,7 @@
|
|
|
338
365
|
"name": "dataTable",
|
|
339
366
|
"type": "boolean",
|
|
340
367
|
"default": null,
|
|
341
|
-
"description": "
|
|
368
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
342
369
|
"required": false
|
|
343
370
|
},
|
|
344
371
|
{
|
|
@@ -366,7 +393,7 @@
|
|
|
366
393
|
"name": "exportable",
|
|
367
394
|
"type": "boolean | readonly ExportFormat[]",
|
|
368
395
|
"default": null,
|
|
369
|
-
"description": "
|
|
396
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
370
397
|
"required": false
|
|
371
398
|
},
|
|
372
399
|
{
|
|
@@ -411,6 +438,13 @@
|
|
|
411
438
|
"description": "The id of the figure.",
|
|
412
439
|
"required": false
|
|
413
440
|
},
|
|
441
|
+
{
|
|
442
|
+
"name": "insight",
|
|
443
|
+
"type": "ReactNode",
|
|
444
|
+
"default": null,
|
|
445
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
446
|
+
"required": false
|
|
447
|
+
},
|
|
414
448
|
{
|
|
415
449
|
"name": "labels",
|
|
416
450
|
"type": "ChartLabelsInput",
|
|
@@ -474,6 +508,13 @@
|
|
|
474
508
|
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
475
509
|
"required": false
|
|
476
510
|
},
|
|
511
|
+
{
|
|
512
|
+
"name": "title",
|
|
513
|
+
"type": "string",
|
|
514
|
+
"default": null,
|
|
515
|
+
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`. Inside a `ChartCard`, the card's title is the default.",
|
|
516
|
+
"required": false
|
|
517
|
+
},
|
|
477
518
|
{
|
|
478
519
|
"name": "valueLabel",
|
|
479
520
|
"type": "string",
|