@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.
Files changed (172) hide show
  1. package/dist/actions-5VG352VZ.js +53 -0
  2. package/dist/actions-5VG352VZ.js.map +1 -0
  3. package/dist/bar.d.ts +3 -3
  4. package/dist/bar.js +7 -6
  5. package/dist/candlestick.d.ts +2 -2
  6. package/dist/candlestick.js +6 -5
  7. package/dist/card.d.ts +52 -0
  8. package/dist/card.js +19 -0
  9. package/dist/card.js.map +1 -0
  10. package/dist/{cartesian-BRhNQ3ib.d.ts → cartesian-CEY_wwe_.d.ts} +12 -2
  11. package/dist/chart.d.ts +2 -2
  12. package/dist/chart.js +5 -4
  13. package/dist/{chunk-BV4DBGN7.js → chunk-7W4T255Q.js} +4 -4
  14. package/dist/{chunk-W5ILLSPK.js → chunk-AGSSNMK5.js} +5 -5
  15. package/dist/{chunk-VKZZY2QD.js → chunk-FE4LUGAE.js} +5 -5
  16. package/dist/{chunk-ARARFMNE.js → chunk-FIQHMJZK.js} +5 -5
  17. package/dist/chunk-FIQHMJZK.js.map +1 -0
  18. package/dist/{chunk-ANUCSRUN.js → chunk-GD7TWEN3.js} +3 -3
  19. package/dist/chunk-GRRFPI27.js +89 -0
  20. package/dist/chunk-GRRFPI27.js.map +1 -0
  21. package/dist/{chunk-SLEJDQ3A.js → chunk-HH65IEUV.js} +3 -3
  22. package/dist/{chunk-OIRHLJBC.js → chunk-IJTI6VJD.js} +3 -3
  23. package/dist/{chunk-WVTIKOII.js → chunk-IURCLBUQ.js} +2 -2
  24. package/dist/{chunk-CVWSMUUB.js → chunk-JST4HJC3.js} +33 -15
  25. package/dist/chunk-JST4HJC3.js.map +1 -0
  26. package/dist/{chunk-IKQV3NSL.js → chunk-KERGFVSN.js} +3 -3
  27. package/dist/{chunk-XDDALY4C.js → chunk-KMQ7RANJ.js} +5 -5
  28. package/dist/{chunk-NCIQMRV3.js → chunk-LLUQEK5J.js} +5 -5
  29. package/dist/{chunk-AA5EWWYV.js → chunk-LZPZWBBY.js} +2 -2
  30. package/dist/{chunk-PBQV3B6O.js → chunk-MK2ZFUWM.js} +31 -16
  31. package/dist/chunk-MK2ZFUWM.js.map +1 -0
  32. package/dist/{chunk-CSSZLFLO.js → chunk-MRGMLDNS.js} +5 -5
  33. package/dist/{chunk-I3D7KUGN.js → chunk-NLTZWJLV.js} +3 -3
  34. package/dist/{chunk-PWMMXRMC.js → chunk-NV52AKHG.js} +3 -3
  35. package/dist/{chunk-MXLITIGU.js → chunk-NWJ5VDN7.js} +5 -5
  36. package/dist/{chunk-3CJHBJXA.js → chunk-OVASCEGF.js} +12 -73
  37. package/dist/chunk-OVASCEGF.js.map +1 -0
  38. package/dist/{chunk-EQLC2QVN.js → chunk-OZOAKP5F.js} +4 -4
  39. package/dist/chunk-OZOAKP5F.js.map +1 -0
  40. package/dist/{chunk-KNDHO67X.js → chunk-P2NK5L3B.js} +3 -3
  41. package/dist/{chunk-JTKR7ZWP.js → chunk-P6RS2L23.js} +140 -36
  42. package/dist/chunk-P6RS2L23.js.map +1 -0
  43. package/dist/{chunk-W5FX4TU3.js → chunk-PGD6SH5I.js} +30 -2
  44. package/dist/chunk-PGD6SH5I.js.map +1 -0
  45. package/dist/{chunk-4LBXEAGC.js → chunk-PWZHIGPO.js} +5 -5
  46. package/dist/{chunk-L2EKYWVI.js → chunk-VEOJNMPF.js} +3 -3
  47. package/dist/chunk-YHQFW2PR.js +71 -0
  48. package/dist/chunk-YHQFW2PR.js.map +1 -0
  49. package/dist/{chunk-C4MFZLJM.js → chunk-Z4T3JFNU.js} +2 -2
  50. package/dist/{chunk-EEP7PS2L.js → chunk-ZF7LVQTR.js} +3 -3
  51. package/dist/{context-BgYUymEO.d.ts → context-DNW7bJYw.d.ts} +19 -0
  52. package/dist/credits.d.ts +1 -1
  53. package/dist/credits.js +7 -6
  54. package/dist/earnings.d.ts +3 -3
  55. package/dist/earnings.js +8 -7
  56. package/dist/{frame-I7_xYGy5.d.ts → frame-B1HDNm7c.d.ts} +9 -5
  57. package/dist/funnel.d.ts +2 -2
  58. package/dist/funnel.js +6 -5
  59. package/dist/gauge.d.ts +2 -2
  60. package/dist/gauge.js +4 -3
  61. package/dist/geo.d.ts +2 -2
  62. package/dist/geo.js +5 -4
  63. package/dist/globe.d.ts +2 -2
  64. package/dist/globe.js +4 -3
  65. package/dist/goal.d.ts +2 -2
  66. package/dist/goal.js +5 -4
  67. package/dist/heatmap.d.ts +2 -2
  68. package/dist/heatmap.js +6 -5
  69. package/dist/index.d.ts +5 -3
  70. package/dist/index.js +45 -37
  71. package/dist/latency.d.ts +3 -3
  72. package/dist/latency.js +8 -7
  73. package/dist/line.d.ts +3 -3
  74. package/dist/line.js +7 -6
  75. package/dist/native.d.ts +19 -0
  76. package/dist/native.js +13 -1
  77. package/dist/native.js.map +1 -1
  78. package/dist/pie.d.ts +2 -2
  79. package/dist/pie.js +6 -5
  80. package/dist/provider.d.ts +2 -2
  81. package/dist/provider.js +4 -2
  82. package/dist/radar.d.ts +2 -2
  83. package/dist/radar.js +6 -5
  84. package/dist/sankey.d.ts +2 -2
  85. package/dist/sankey.js +6 -5
  86. package/dist/scatter.d.ts +2 -2
  87. package/dist/scatter.js +6 -5
  88. package/dist/sparkline.d.ts +2 -2
  89. package/dist/sparkline.js +6 -5
  90. package/dist/table-sheet-CQBIAV5N.js +36 -0
  91. package/dist/table-sheet-CQBIAV5N.js.map +1 -0
  92. package/dist/throughput.d.ts +3 -3
  93. package/dist/throughput.js +8 -7
  94. package/dist/ticker.d.ts +3 -3
  95. package/dist/ticker.js +8 -7
  96. package/dist/treemap.d.ts +2 -2
  97. package/dist/treemap.js +7 -6
  98. package/package.json +292 -50
  99. package/registry/area-chart.json +93 -12
  100. package/registry/bar-chart.json +93 -12
  101. package/registry/calendar-heatmap.json +59 -18
  102. package/registry/candlestick.json +59 -18
  103. package/registry/chart-card.json +248 -0
  104. package/registry/chart.json +53 -12
  105. package/registry/charts-provider.json +13 -2
  106. package/registry/credit-usage.json +11 -0
  107. package/registry/earnings-chart.json +93 -12
  108. package/registry/examples/chart-card/before-after.d.ts +4 -0
  109. package/registry/examples/chart-card/before-after.js +22 -0
  110. package/registry/examples/chart-card/before-after.tsx +22 -0
  111. package/registry/examples/chart-card/jobs-activity.d.ts +4 -0
  112. package/registry/examples/chart-card/jobs-activity.js +20 -0
  113. package/registry/examples/chart-card/jobs-activity.tsx +20 -0
  114. package/registry/examples/chart-card/sparse-and-empty.d.ts +4 -0
  115. package/registry/examples/chart-card/sparse-and-empty.js +16 -0
  116. package/registry/examples/chart-card/sparse-and-empty.tsx +18 -0
  117. package/registry/examples/chart-card/usage-donut.d.ts +4 -0
  118. package/registry/examples/chart-card/usage-donut.js +18 -0
  119. package/registry/examples/chart-card/usage-donut.tsx +18 -0
  120. package/registry/examples/charts-provider/french-orazaka.js +1 -1
  121. package/registry/examples/charts-provider/french-orazaka.tsx +1 -1
  122. package/registry/examples/kpi-stat/dashboard-row.d.ts +4 -0
  123. package/registry/examples/kpi-stat/dashboard-row.js +19 -0
  124. package/registry/examples/kpi-stat/dashboard-row.tsx +17 -0
  125. package/registry/examples/kpi-stat/single.d.ts +4 -0
  126. package/registry/examples/kpi-stat/single.js +11 -0
  127. package/registry/examples/kpi-stat/single.tsx +6 -0
  128. package/registry/funnel.json +59 -18
  129. package/registry/gauge.json +53 -14
  130. package/registry/geo-map.json +59 -18
  131. package/registry/globe.json +54 -12
  132. package/registry/goal-progress.json +47 -8
  133. package/registry/heatmap.json +59 -18
  134. package/registry/index.json +362 -1
  135. package/registry/job-throughput.json +93 -12
  136. package/registry/kpi-stat.json +309 -0
  137. package/registry/latency-chart.json +93 -12
  138. package/registry/line-chart.json +93 -12
  139. package/registry/pie-chart.json +103 -36
  140. package/registry/price-ticker.json +93 -12
  141. package/registry/radar-chart.json +59 -18
  142. package/registry/sankey.json +59 -18
  143. package/registry/scatter-chart.json +59 -18
  144. package/registry/sparkline.json +49 -10
  145. package/registry/treemap.json +53 -12
  146. package/dist/chunk-3CJHBJXA.js.map +0 -1
  147. package/dist/chunk-ARARFMNE.js.map +0 -1
  148. package/dist/chunk-CVWSMUUB.js.map +0 -1
  149. package/dist/chunk-EQLC2QVN.js.map +0 -1
  150. package/dist/chunk-JTKR7ZWP.js.map +0 -1
  151. package/dist/chunk-PBQV3B6O.js.map +0 -1
  152. package/dist/chunk-W5FX4TU3.js.map +0 -1
  153. /package/dist/{chunk-BV4DBGN7.js.map → chunk-7W4T255Q.js.map} +0 -0
  154. /package/dist/{chunk-W5ILLSPK.js.map → chunk-AGSSNMK5.js.map} +0 -0
  155. /package/dist/{chunk-VKZZY2QD.js.map → chunk-FE4LUGAE.js.map} +0 -0
  156. /package/dist/{chunk-ANUCSRUN.js.map → chunk-GD7TWEN3.js.map} +0 -0
  157. /package/dist/{chunk-SLEJDQ3A.js.map → chunk-HH65IEUV.js.map} +0 -0
  158. /package/dist/{chunk-OIRHLJBC.js.map → chunk-IJTI6VJD.js.map} +0 -0
  159. /package/dist/{chunk-WVTIKOII.js.map → chunk-IURCLBUQ.js.map} +0 -0
  160. /package/dist/{chunk-IKQV3NSL.js.map → chunk-KERGFVSN.js.map} +0 -0
  161. /package/dist/{chunk-XDDALY4C.js.map → chunk-KMQ7RANJ.js.map} +0 -0
  162. /package/dist/{chunk-NCIQMRV3.js.map → chunk-LLUQEK5J.js.map} +0 -0
  163. /package/dist/{chunk-AA5EWWYV.js.map → chunk-LZPZWBBY.js.map} +0 -0
  164. /package/dist/{chunk-CSSZLFLO.js.map → chunk-MRGMLDNS.js.map} +0 -0
  165. /package/dist/{chunk-I3D7KUGN.js.map → chunk-NLTZWJLV.js.map} +0 -0
  166. /package/dist/{chunk-PWMMXRMC.js.map → chunk-NV52AKHG.js.map} +0 -0
  167. /package/dist/{chunk-MXLITIGU.js.map → chunk-NWJ5VDN7.js.map} +0 -0
  168. /package/dist/{chunk-KNDHO67X.js.map → chunk-P2NK5L3B.js.map} +0 -0
  169. /package/dist/{chunk-4LBXEAGC.js.map → chunk-PWZHIGPO.js.map} +0 -0
  170. /package/dist/{chunk-L2EKYWVI.js.map → chunk-VEOJNMPF.js.map} +0 -0
  171. /package/dist/{chunk-C4MFZLJM.js.map → chunk-Z4T3JFNU.js.map} +0 -0
  172. /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": "title",
80
- "type": "string",
90
+ "name": "actionsMenu",
91
+ "type": "boolean",
81
92
  "default": null,
82
- "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
83
- "required": true
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": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
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": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
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": "title",
457
- "type": "string",
502
+ "name": "actionsMenu",
503
+ "type": "boolean",
458
504
  "default": null,
459
- "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
460
- "required": true
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": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
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": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
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
+ }