@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": [
|
|
@@ -76,11 +87,18 @@
|
|
|
76
87
|
"required": true
|
|
77
88
|
},
|
|
78
89
|
{
|
|
79
|
-
"name": "
|
|
80
|
-
"type": "
|
|
90
|
+
"name": "actionsMenu",
|
|
91
|
+
"type": "boolean",
|
|
81
92
|
"default": null,
|
|
82
|
-
"description": "
|
|
83
|
-
"required":
|
|
93
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
94
|
+
"required": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "autoRange",
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": null,
|
|
100
|
+
"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.",
|
|
101
|
+
"required": false
|
|
84
102
|
},
|
|
85
103
|
{
|
|
86
104
|
"name": "brand",
|
|
@@ -100,7 +118,7 @@
|
|
|
100
118
|
"name": "dataTable",
|
|
101
119
|
"type": "boolean",
|
|
102
120
|
"default": null,
|
|
103
|
-
"description": "
|
|
121
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
104
122
|
"required": false
|
|
105
123
|
},
|
|
106
124
|
{
|
|
@@ -128,7 +146,14 @@
|
|
|
128
146
|
"name": "exportable",
|
|
129
147
|
"type": "boolean | readonly ExportFormat[]",
|
|
130
148
|
"default": null,
|
|
131
|
-
"description": "
|
|
149
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
150
|
+
"required": false
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "filterable",
|
|
154
|
+
"type": "boolean",
|
|
155
|
+
"default": null,
|
|
156
|
+
"description": "The legend chips switch the series on and off. Default true.",
|
|
132
157
|
"required": false
|
|
133
158
|
},
|
|
134
159
|
{
|
|
@@ -159,6 +184,13 @@
|
|
|
159
184
|
"description": "The id of the figure.",
|
|
160
185
|
"required": false
|
|
161
186
|
},
|
|
187
|
+
{
|
|
188
|
+
"name": "insight",
|
|
189
|
+
"type": "ReactNode",
|
|
190
|
+
"default": null,
|
|
191
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
192
|
+
"required": false
|
|
193
|
+
},
|
|
162
194
|
{
|
|
163
195
|
"name": "labels",
|
|
164
196
|
"type": "Partial<ThroughputLabels>",
|
|
@@ -201,6 +233,13 @@
|
|
|
201
233
|
"description": "Vertical markers at a category: a launch, an incident.",
|
|
202
234
|
"required": false
|
|
203
235
|
},
|
|
236
|
+
{
|
|
237
|
+
"name": "minPoints",
|
|
238
|
+
"type": "number",
|
|
239
|
+
"default": null,
|
|
240
|
+
"description": "With `autoRange`, the fewest categories to keep so a short burst still has a time scale. Default 7.",
|
|
241
|
+
"required": false
|
|
242
|
+
},
|
|
204
243
|
{
|
|
205
244
|
"name": "onSelect",
|
|
206
245
|
"type": "((datum: T, index: number) => void)",
|
|
@@ -250,6 +289,13 @@
|
|
|
250
289
|
"description": "Horizontal lines at a value: a goal, a payout threshold.",
|
|
251
290
|
"required": false
|
|
252
291
|
},
|
|
292
|
+
{
|
|
293
|
+
"name": "title",
|
|
294
|
+
"type": "string",
|
|
295
|
+
"default": null,
|
|
296
|
+
"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.",
|
|
297
|
+
"required": false
|
|
298
|
+
},
|
|
253
299
|
{
|
|
254
300
|
"name": "x",
|
|
255
301
|
"type": "string | ((datum: T, index: number) => unknown)",
|
|
@@ -453,11 +499,18 @@
|
|
|
453
499
|
"required": true
|
|
454
500
|
},
|
|
455
501
|
{
|
|
456
|
-
"name": "
|
|
457
|
-
"type": "
|
|
502
|
+
"name": "actionsMenu",
|
|
503
|
+
"type": "boolean",
|
|
458
504
|
"default": null,
|
|
459
|
-
"description": "
|
|
460
|
-
"required":
|
|
505
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
506
|
+
"required": false
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"name": "autoRange",
|
|
510
|
+
"type": "boolean",
|
|
511
|
+
"default": null,
|
|
512
|
+
"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.",
|
|
513
|
+
"required": false
|
|
461
514
|
},
|
|
462
515
|
{
|
|
463
516
|
"name": "brand",
|
|
@@ -477,7 +530,7 @@
|
|
|
477
530
|
"name": "dataTable",
|
|
478
531
|
"type": "boolean",
|
|
479
532
|
"default": null,
|
|
480
|
-
"description": "
|
|
533
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
481
534
|
"required": false
|
|
482
535
|
},
|
|
483
536
|
{
|
|
@@ -505,7 +558,14 @@
|
|
|
505
558
|
"name": "exportable",
|
|
506
559
|
"type": "boolean | readonly ExportFormat[]",
|
|
507
560
|
"default": null,
|
|
508
|
-
"description": "
|
|
561
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
562
|
+
"required": false
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"name": "filterable",
|
|
566
|
+
"type": "boolean",
|
|
567
|
+
"default": null,
|
|
568
|
+
"description": "The legend chips switch the series on and off. Default true.",
|
|
509
569
|
"required": false
|
|
510
570
|
},
|
|
511
571
|
{
|
|
@@ -536,6 +596,13 @@
|
|
|
536
596
|
"description": "The id of the figure.",
|
|
537
597
|
"required": false
|
|
538
598
|
},
|
|
599
|
+
{
|
|
600
|
+
"name": "insight",
|
|
601
|
+
"type": "ReactNode",
|
|
602
|
+
"default": null,
|
|
603
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
604
|
+
"required": false
|
|
605
|
+
},
|
|
539
606
|
{
|
|
540
607
|
"name": "labels",
|
|
541
608
|
"type": "Partial<ThroughputLabels>",
|
|
@@ -578,6 +645,13 @@
|
|
|
578
645
|
"description": "Vertical markers at a category: a launch, an incident.",
|
|
579
646
|
"required": false
|
|
580
647
|
},
|
|
648
|
+
{
|
|
649
|
+
"name": "minPoints",
|
|
650
|
+
"type": "number",
|
|
651
|
+
"default": null,
|
|
652
|
+
"description": "With `autoRange`, the fewest categories to keep so a short burst still has a time scale. Default 7.",
|
|
653
|
+
"required": false
|
|
654
|
+
},
|
|
581
655
|
{
|
|
582
656
|
"name": "onSelect",
|
|
583
657
|
"type": "((datum: T, index: number) => void)",
|
|
@@ -627,6 +701,13 @@
|
|
|
627
701
|
"description": "Horizontal lines at a value: a goal, a payout threshold.",
|
|
628
702
|
"required": false
|
|
629
703
|
},
|
|
704
|
+
{
|
|
705
|
+
"name": "title",
|
|
706
|
+
"type": "string",
|
|
707
|
+
"default": null,
|
|
708
|
+
"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.",
|
|
709
|
+
"required": false
|
|
710
|
+
},
|
|
630
711
|
{
|
|
631
712
|
"name": "x",
|
|
632
713
|
"type": "string | ((datum: T, index: number) => unknown)",
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kpi-stat",
|
|
3
|
+
"package": "@krizaka/charts",
|
|
4
|
+
"type": "chart",
|
|
5
|
+
"title": "KPI stat",
|
|
6
|
+
"summary": "A key figure with its change against the previous period and a sparkline of the period, on the kit's Stat.",
|
|
7
|
+
"description": "A key figure with its change against the previous period and a sparkline of the period, on the kit's Stat.",
|
|
8
|
+
"status": "beta",
|
|
9
|
+
"category": "charts",
|
|
10
|
+
"platforms": "web",
|
|
11
|
+
"parity": {
|
|
12
|
+
"web": {
|
|
13
|
+
"state": "yes"
|
|
14
|
+
},
|
|
15
|
+
"native": {
|
|
16
|
+
"state": "gap",
|
|
17
|
+
"reason": "A phone dashboard's head writes its figures by hand today.",
|
|
18
|
+
"issue": "krizaka/krizaka-ui#275"
|
|
19
|
+
},
|
|
20
|
+
"desktop": {
|
|
21
|
+
"state": "yes"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"engine": null,
|
|
25
|
+
"tier": "ready-made",
|
|
26
|
+
"whenToUse": [
|
|
27
|
+
"The head of a dashboard: jobs, success rate, time to a result, spend.",
|
|
28
|
+
"Anywhere a figure needs its direction and its shape at a glance."
|
|
29
|
+
],
|
|
30
|
+
"whenNotToUse": [
|
|
31
|
+
{
|
|
32
|
+
"when": "A chart the reader will explore.",
|
|
33
|
+
"use": "line-chart"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"when": "A value against a limit.",
|
|
37
|
+
"use": "gauge"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"bestPractices": [
|
|
41
|
+
"Pass `previous` and the trend is computed and written in words; the arrow is only decoration.",
|
|
42
|
+
"Use `good=down` for latency, failures and spend: the arrow's colour says whether the change is good news.",
|
|
43
|
+
"Put several in a `StatGrid` of the kit: they wrap with the width."
|
|
44
|
+
],
|
|
45
|
+
"accessibility": {
|
|
46
|
+
"keyboard": [],
|
|
47
|
+
"notes": [
|
|
48
|
+
"The change is written (`+24 % vs previous period`), never colour or arrow alone.",
|
|
49
|
+
"The sparkline has its own accessible summary; the figure is read as text."
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"related": [
|
|
53
|
+
"chart-card",
|
|
54
|
+
"sparkline",
|
|
55
|
+
"gauge"
|
|
56
|
+
],
|
|
57
|
+
"source": "packages/charts/src/meta/kpi-stat.ts",
|
|
58
|
+
"install": {
|
|
59
|
+
"web": "npm install @krizaka/charts",
|
|
60
|
+
"native": "npx expo install react-native-svg\nnpm install @krizaka/charts"
|
|
61
|
+
},
|
|
62
|
+
"web": {
|
|
63
|
+
"entry": "@krizaka/charts/card",
|
|
64
|
+
"import": "import { KpiStat } from \"@krizaka/charts/card\";",
|
|
65
|
+
"props": [
|
|
66
|
+
{
|
|
67
|
+
"component": "KpiStat",
|
|
68
|
+
"description": "A key figure, its change against the previous period and the shape of the period.",
|
|
69
|
+
"props": [
|
|
70
|
+
{
|
|
71
|
+
"name": "label",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"default": null,
|
|
74
|
+
"description": "What the figure is (“Jobs”).",
|
|
75
|
+
"required": true
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "value",
|
|
79
|
+
"type": "number",
|
|
80
|
+
"default": null,
|
|
81
|
+
"description": "The figure for the period.",
|
|
82
|
+
"required": true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "brand",
|
|
86
|
+
"type": "BrandId",
|
|
87
|
+
"default": null,
|
|
88
|
+
"description": "The brand whose palette the charts use. Without it, a chart follows a `.brand-<id>` ancestor, else Krizaka. Set it\nwhen the app loads a brand stylesheet on `:root` (`@krizaka/tokens/brands/orazaka.css`).",
|
|
89
|
+
"required": false
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "categories",
|
|
93
|
+
"type": "readonly unknown[]",
|
|
94
|
+
"default": null,
|
|
95
|
+
"description": "The labels of `data` (dates), for the sparkline's summary and table.",
|
|
96
|
+
"required": false
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "color",
|
|
100
|
+
"type": "SeriesColor",
|
|
101
|
+
"default": null,
|
|
102
|
+
"description": "The sparkline's colour. Default: the brand's.",
|
|
103
|
+
"required": false
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "data",
|
|
107
|
+
"type": "readonly (number | null)[]",
|
|
108
|
+
"default": null,
|
|
109
|
+
"description": "The shape of the period, oldest first (`null` for a gap). Without it, no sparkline.",
|
|
110
|
+
"required": false
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "format",
|
|
114
|
+
"type": "ValueFormat",
|
|
115
|
+
"default": null,
|
|
116
|
+
"description": "How it is written. Default `\"number\"`.",
|
|
117
|
+
"required": false
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "good",
|
|
121
|
+
"type": "\"up\" | \"down\"",
|
|
122
|
+
"default": "up",
|
|
123
|
+
"description": "Which direction is good news. Default `\"up\"`; `\"down\"` for latency, failures, spend.",
|
|
124
|
+
"required": false
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "hint",
|
|
128
|
+
"type": "ReactNode",
|
|
129
|
+
"default": null,
|
|
130
|
+
"description": "A line under the value: the period, the comparison.",
|
|
131
|
+
"required": false
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "labels",
|
|
135
|
+
"type": "ChartLabelsInput",
|
|
136
|
+
"default": null,
|
|
137
|
+
"description": "The words, translated: the buttons, the states, the written summary.",
|
|
138
|
+
"required": false
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "locale",
|
|
142
|
+
"type": "Locale",
|
|
143
|
+
"default": null,
|
|
144
|
+
"description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
|
|
145
|
+
"required": false
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "previous",
|
|
149
|
+
"type": "number",
|
|
150
|
+
"default": null,
|
|
151
|
+
"description": "The same figure for the previous period: the trend is computed from it.",
|
|
152
|
+
"required": false
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "trendLabel",
|
|
156
|
+
"type": "ReactNode",
|
|
157
|
+
"default": null,
|
|
158
|
+
"description": "Your own words for the change instead of “+12 % vs previous period”.",
|
|
159
|
+
"required": false
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "variant",
|
|
163
|
+
"type": "\"area\" | \"line\" | \"bar\"",
|
|
164
|
+
"default": "area",
|
|
165
|
+
"description": "`bar` for discrete counts (jobs per day), `area` (default) or `line`.",
|
|
166
|
+
"required": false
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"examples": [
|
|
172
|
+
{
|
|
173
|
+
"name": "dashboard-row",
|
|
174
|
+
"title": "A dashboard row",
|
|
175
|
+
"description": "Four figures in a StatGrid, with sparklines and trends.",
|
|
176
|
+
"path": "examples/kpi-stat/dashboard-row.tsx",
|
|
177
|
+
"module": "@krizaka/charts/registry/examples/kpi-stat/dashboard-row",
|
|
178
|
+
"code": "import { KpiStat } from \"@krizaka/charts/card\";\nimport { StatGrid } from \"@krizaka/ui/stat\";\n\nconst jobs = [12, 18, 9, 22, 31, 27, 35, 41];\nconst minutes = [4.2, 4.6, 5.1, 4.4, 3.9, 3.7, 3.5, 3.2];\n\n// The head of a dashboard: each figure with its change against the previous period and the shape of the period.\nexport default function DashboardRow() {\n return (\n <StatGrid>\n <KpiStat label=\"Jobs\" value={195} previous={157} data={jobs} variant=\"bar\" hint=\"last 8 days\" />\n <KpiStat label=\"Success rate\" value={0.94} previous={0.91} format=\"percent\" hint=\"completed / all\" />\n <KpiStat label=\"Median time\" value={3.2} previous={4.2} good=\"down\" data={minutes} format={{ style: \"unit\", unit: \"minute\" }} hint=\"to a result\" />\n <KpiStat label=\"Credits spent\" value={1240} previous={1100} good=\"down\" format=\"integer\" hint=\"this period\" />\n </StatGrid>\n );\n}\n"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "single",
|
|
182
|
+
"title": "One figure",
|
|
183
|
+
"description": "A rise in latency is bad: good=down.",
|
|
184
|
+
"path": "examples/kpi-stat/single.tsx",
|
|
185
|
+
"module": "@krizaka/charts/registry/examples/kpi-stat/single",
|
|
186
|
+
"code": "import { KpiStat } from \"@krizaka/charts/card\";\n\n// A rise in latency is bad news: good=\"down\" makes the arrow say so.\nexport default function Single() {\n 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\" />;\n}\n"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"native": null,
|
|
191
|
+
"files": [],
|
|
192
|
+
"dependencies": [
|
|
193
|
+
"@krizaka/intl@workspace:^",
|
|
194
|
+
"d3-geo@^3.1.1",
|
|
195
|
+
"echarts@^6.1.0",
|
|
196
|
+
"topojson-client@^3.1.0"
|
|
197
|
+
],
|
|
198
|
+
"registryDependencies": [],
|
|
199
|
+
"demo": {
|
|
200
|
+
"path": "examples/kpi-stat/dashboard-row.tsx",
|
|
201
|
+
"content": "import { KpiStat } from \"@krizaka/charts/card\";\nimport { StatGrid } from \"@krizaka/ui/stat\";\n\nconst jobs = [12, 18, 9, 22, 31, 27, 35, 41];\nconst minutes = [4.2, 4.6, 5.1, 4.4, 3.9, 3.7, 3.5, 3.2];\n\n// The head of a dashboard: each figure with its change against the previous period and the shape of the period.\nexport default function DashboardRow() {\n return (\n <StatGrid>\n <KpiStat label=\"Jobs\" value={195} previous={157} data={jobs} variant=\"bar\" hint=\"last 8 days\" />\n <KpiStat label=\"Success rate\" value={0.94} previous={0.91} format=\"percent\" hint=\"completed / all\" />\n <KpiStat label=\"Median time\" value={3.2} previous={4.2} good=\"down\" data={minutes} format={{ style: \"unit\", unit: \"minute\" }} hint=\"to a result\" />\n <KpiStat label=\"Credits spent\" value={1240} previous={1100} good=\"down\" format=\"integer\" hint=\"this period\" />\n </StatGrid>\n );\n}\n"
|
|
202
|
+
},
|
|
203
|
+
"props": [
|
|
204
|
+
{
|
|
205
|
+
"component": "KpiStat",
|
|
206
|
+
"description": "A key figure, its change against the previous period and the shape of the period.",
|
|
207
|
+
"props": [
|
|
208
|
+
{
|
|
209
|
+
"name": "label",
|
|
210
|
+
"type": "string",
|
|
211
|
+
"default": null,
|
|
212
|
+
"description": "What the figure is (“Jobs”).",
|
|
213
|
+
"required": true
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "value",
|
|
217
|
+
"type": "number",
|
|
218
|
+
"default": null,
|
|
219
|
+
"description": "The figure for the period.",
|
|
220
|
+
"required": true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "brand",
|
|
224
|
+
"type": "BrandId",
|
|
225
|
+
"default": null,
|
|
226
|
+
"description": "The brand whose palette the charts use. Without it, a chart follows a `.brand-<id>` ancestor, else Krizaka. Set it\nwhen the app loads a brand stylesheet on `:root` (`@krizaka/tokens/brands/orazaka.css`).",
|
|
227
|
+
"required": false
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "categories",
|
|
231
|
+
"type": "readonly unknown[]",
|
|
232
|
+
"default": null,
|
|
233
|
+
"description": "The labels of `data` (dates), for the sparkline's summary and table.",
|
|
234
|
+
"required": false
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"name": "color",
|
|
238
|
+
"type": "SeriesColor",
|
|
239
|
+
"default": null,
|
|
240
|
+
"description": "The sparkline's colour. Default: the brand's.",
|
|
241
|
+
"required": false
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "data",
|
|
245
|
+
"type": "readonly (number | null)[]",
|
|
246
|
+
"default": null,
|
|
247
|
+
"description": "The shape of the period, oldest first (`null` for a gap). Without it, no sparkline.",
|
|
248
|
+
"required": false
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "format",
|
|
252
|
+
"type": "ValueFormat",
|
|
253
|
+
"default": null,
|
|
254
|
+
"description": "How it is written. Default `\"number\"`.",
|
|
255
|
+
"required": false
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "good",
|
|
259
|
+
"type": "\"up\" | \"down\"",
|
|
260
|
+
"default": "up",
|
|
261
|
+
"description": "Which direction is good news. Default `\"up\"`; `\"down\"` for latency, failures, spend.",
|
|
262
|
+
"required": false
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "hint",
|
|
266
|
+
"type": "ReactNode",
|
|
267
|
+
"default": null,
|
|
268
|
+
"description": "A line under the value: the period, the comparison.",
|
|
269
|
+
"required": false
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "labels",
|
|
273
|
+
"type": "ChartLabelsInput",
|
|
274
|
+
"default": null,
|
|
275
|
+
"description": "The words, translated: the buttons, the states, the written summary.",
|
|
276
|
+
"required": false
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "locale",
|
|
280
|
+
"type": "Locale",
|
|
281
|
+
"default": null,
|
|
282
|
+
"description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
|
|
283
|
+
"required": false
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "previous",
|
|
287
|
+
"type": "number",
|
|
288
|
+
"default": null,
|
|
289
|
+
"description": "The same figure for the previous period: the trend is computed from it.",
|
|
290
|
+
"required": false
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "trendLabel",
|
|
294
|
+
"type": "ReactNode",
|
|
295
|
+
"default": null,
|
|
296
|
+
"description": "Your own words for the change instead of “+12 % vs previous period”.",
|
|
297
|
+
"required": false
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "variant",
|
|
301
|
+
"type": "\"area\" | \"line\" | \"bar\"",
|
|
302
|
+
"default": "area",
|
|
303
|
+
"description": "`bar` for discrete counts (jobs per day), `area` (default) or `line`.",
|
|
304
|
+
"required": false
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
]
|
|
309
|
+
}
|