@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
package/registry/sankey.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": [
|
|
@@ -94,13 +107,6 @@
|
|
|
94
107
|
"description": "The field (or function) naming where the flow goes.",
|
|
95
108
|
"required": true
|
|
96
109
|
},
|
|
97
|
-
{
|
|
98
|
-
"name": "title",
|
|
99
|
-
"type": "string",
|
|
100
|
-
"default": null,
|
|
101
|
-
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
102
|
-
"required": true
|
|
103
|
-
},
|
|
104
110
|
{
|
|
105
111
|
"name": "value",
|
|
106
112
|
"type": "string | ((datum: T, index: number) => number)",
|
|
@@ -108,6 +114,13 @@
|
|
|
108
114
|
"description": "The field of its amount.",
|
|
109
115
|
"required": true
|
|
110
116
|
},
|
|
117
|
+
{
|
|
118
|
+
"name": "actionsMenu",
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"default": null,
|
|
121
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
122
|
+
"required": false
|
|
123
|
+
},
|
|
111
124
|
{
|
|
112
125
|
"name": "brand",
|
|
113
126
|
"type": "BrandId",
|
|
@@ -126,7 +139,7 @@
|
|
|
126
139
|
"name": "dataTable",
|
|
127
140
|
"type": "boolean",
|
|
128
141
|
"default": null,
|
|
129
|
-
"description": "
|
|
142
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
130
143
|
"required": false
|
|
131
144
|
},
|
|
132
145
|
{
|
|
@@ -154,7 +167,7 @@
|
|
|
154
167
|
"name": "exportable",
|
|
155
168
|
"type": "boolean | readonly ExportFormat[]",
|
|
156
169
|
"default": null,
|
|
157
|
-
"description": "
|
|
170
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
158
171
|
"required": false
|
|
159
172
|
},
|
|
160
173
|
{
|
|
@@ -185,6 +198,13 @@
|
|
|
185
198
|
"description": "The id of the figure.",
|
|
186
199
|
"required": false
|
|
187
200
|
},
|
|
201
|
+
{
|
|
202
|
+
"name": "insight",
|
|
203
|
+
"type": "ReactNode",
|
|
204
|
+
"default": null,
|
|
205
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
206
|
+
"required": false
|
|
207
|
+
},
|
|
188
208
|
{
|
|
189
209
|
"name": "labels",
|
|
190
210
|
"type": "ChartLabelsInput",
|
|
@@ -255,6 +275,13 @@
|
|
|
255
275
|
"description": "The header of the targets.",
|
|
256
276
|
"required": false
|
|
257
277
|
},
|
|
278
|
+
{
|
|
279
|
+
"name": "title",
|
|
280
|
+
"type": "string",
|
|
281
|
+
"default": null,
|
|
282
|
+
"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.",
|
|
283
|
+
"required": false
|
|
284
|
+
},
|
|
258
285
|
{
|
|
259
286
|
"name": "valueLabel",
|
|
260
287
|
"type": "string",
|
|
@@ -322,13 +349,6 @@
|
|
|
322
349
|
"description": "The field (or function) naming where the flow goes.",
|
|
323
350
|
"required": true
|
|
324
351
|
},
|
|
325
|
-
{
|
|
326
|
-
"name": "title",
|
|
327
|
-
"type": "string",
|
|
328
|
-
"default": null,
|
|
329
|
-
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
330
|
-
"required": true
|
|
331
|
-
},
|
|
332
352
|
{
|
|
333
353
|
"name": "value",
|
|
334
354
|
"type": "string | ((datum: T, index: number) => number)",
|
|
@@ -336,6 +356,13 @@
|
|
|
336
356
|
"description": "The field of its amount.",
|
|
337
357
|
"required": true
|
|
338
358
|
},
|
|
359
|
+
{
|
|
360
|
+
"name": "actionsMenu",
|
|
361
|
+
"type": "boolean",
|
|
362
|
+
"default": null,
|
|
363
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
364
|
+
"required": false
|
|
365
|
+
},
|
|
339
366
|
{
|
|
340
367
|
"name": "brand",
|
|
341
368
|
"type": "BrandId",
|
|
@@ -354,7 +381,7 @@
|
|
|
354
381
|
"name": "dataTable",
|
|
355
382
|
"type": "boolean",
|
|
356
383
|
"default": null,
|
|
357
|
-
"description": "
|
|
384
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
358
385
|
"required": false
|
|
359
386
|
},
|
|
360
387
|
{
|
|
@@ -382,7 +409,7 @@
|
|
|
382
409
|
"name": "exportable",
|
|
383
410
|
"type": "boolean | readonly ExportFormat[]",
|
|
384
411
|
"default": null,
|
|
385
|
-
"description": "
|
|
412
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
386
413
|
"required": false
|
|
387
414
|
},
|
|
388
415
|
{
|
|
@@ -413,6 +440,13 @@
|
|
|
413
440
|
"description": "The id of the figure.",
|
|
414
441
|
"required": false
|
|
415
442
|
},
|
|
443
|
+
{
|
|
444
|
+
"name": "insight",
|
|
445
|
+
"type": "ReactNode",
|
|
446
|
+
"default": null,
|
|
447
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
448
|
+
"required": false
|
|
449
|
+
},
|
|
416
450
|
{
|
|
417
451
|
"name": "labels",
|
|
418
452
|
"type": "ChartLabelsInput",
|
|
@@ -483,6 +517,13 @@
|
|
|
483
517
|
"description": "The header of the targets.",
|
|
484
518
|
"required": false
|
|
485
519
|
},
|
|
520
|
+
{
|
|
521
|
+
"name": "title",
|
|
522
|
+
"type": "string",
|
|
523
|
+
"default": null,
|
|
524
|
+
"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.",
|
|
525
|
+
"required": false
|
|
526
|
+
},
|
|
486
527
|
{
|
|
487
528
|
"name": "valueLabel",
|
|
488
529
|
"type": "string",
|
|
@@ -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": [
|
|
@@ -80,13 +93,6 @@
|
|
|
80
93
|
"description": "One row per point.",
|
|
81
94
|
"required": true
|
|
82
95
|
},
|
|
83
|
-
{
|
|
84
|
-
"name": "title",
|
|
85
|
-
"type": "string",
|
|
86
|
-
"default": null,
|
|
87
|
-
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
88
|
-
"required": true
|
|
89
|
-
},
|
|
90
96
|
{
|
|
91
97
|
"name": "x",
|
|
92
98
|
"type": "string | ((datum: T, index: number) => number)",
|
|
@@ -115,6 +121,13 @@
|
|
|
115
121
|
"description": "The name of the vertical measure.",
|
|
116
122
|
"required": true
|
|
117
123
|
},
|
|
124
|
+
{
|
|
125
|
+
"name": "actionsMenu",
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"default": null,
|
|
128
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
129
|
+
"required": false
|
|
130
|
+
},
|
|
118
131
|
{
|
|
119
132
|
"name": "brand",
|
|
120
133
|
"type": "BrandId",
|
|
@@ -133,7 +146,7 @@
|
|
|
133
146
|
"name": "dataTable",
|
|
134
147
|
"type": "boolean",
|
|
135
148
|
"default": null,
|
|
136
|
-
"description": "
|
|
149
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
137
150
|
"required": false
|
|
138
151
|
},
|
|
139
152
|
{
|
|
@@ -161,7 +174,7 @@
|
|
|
161
174
|
"name": "exportable",
|
|
162
175
|
"type": "boolean | readonly ExportFormat[]",
|
|
163
176
|
"default": null,
|
|
164
|
-
"description": "
|
|
177
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
165
178
|
"required": false
|
|
166
179
|
},
|
|
167
180
|
{
|
|
@@ -192,6 +205,13 @@
|
|
|
192
205
|
"description": "The id of the figure.",
|
|
193
206
|
"required": false
|
|
194
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
|
+
},
|
|
195
215
|
{
|
|
196
216
|
"name": "labels",
|
|
197
217
|
"type": "ChartLabelsInput",
|
|
@@ -283,6 +303,13 @@
|
|
|
283
303
|
"description": "Horizontal lines at a y value.",
|
|
284
304
|
"required": false
|
|
285
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
|
+
},
|
|
286
313
|
{
|
|
287
314
|
"name": "xFormat",
|
|
288
315
|
"type": "ValueFormat",
|
|
@@ -336,13 +363,6 @@
|
|
|
336
363
|
"description": "One row per point.",
|
|
337
364
|
"required": true
|
|
338
365
|
},
|
|
339
|
-
{
|
|
340
|
-
"name": "title",
|
|
341
|
-
"type": "string",
|
|
342
|
-
"default": null,
|
|
343
|
-
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
344
|
-
"required": true
|
|
345
|
-
},
|
|
346
366
|
{
|
|
347
367
|
"name": "x",
|
|
348
368
|
"type": "string | ((datum: T, index: number) => number)",
|
|
@@ -371,6 +391,13 @@
|
|
|
371
391
|
"description": "The name of the vertical measure.",
|
|
372
392
|
"required": true
|
|
373
393
|
},
|
|
394
|
+
{
|
|
395
|
+
"name": "actionsMenu",
|
|
396
|
+
"type": "boolean",
|
|
397
|
+
"default": null,
|
|
398
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
399
|
+
"required": false
|
|
400
|
+
},
|
|
374
401
|
{
|
|
375
402
|
"name": "brand",
|
|
376
403
|
"type": "BrandId",
|
|
@@ -389,7 +416,7 @@
|
|
|
389
416
|
"name": "dataTable",
|
|
390
417
|
"type": "boolean",
|
|
391
418
|
"default": null,
|
|
392
|
-
"description": "
|
|
419
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
393
420
|
"required": false
|
|
394
421
|
},
|
|
395
422
|
{
|
|
@@ -417,7 +444,7 @@
|
|
|
417
444
|
"name": "exportable",
|
|
418
445
|
"type": "boolean | readonly ExportFormat[]",
|
|
419
446
|
"default": null,
|
|
420
|
-
"description": "
|
|
447
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
421
448
|
"required": false
|
|
422
449
|
},
|
|
423
450
|
{
|
|
@@ -448,6 +475,13 @@
|
|
|
448
475
|
"description": "The id of the figure.",
|
|
449
476
|
"required": false
|
|
450
477
|
},
|
|
478
|
+
{
|
|
479
|
+
"name": "insight",
|
|
480
|
+
"type": "ReactNode",
|
|
481
|
+
"default": null,
|
|
482
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
483
|
+
"required": false
|
|
484
|
+
},
|
|
451
485
|
{
|
|
452
486
|
"name": "labels",
|
|
453
487
|
"type": "ChartLabelsInput",
|
|
@@ -539,6 +573,13 @@
|
|
|
539
573
|
"description": "Horizontal lines at a y value.",
|
|
540
574
|
"required": false
|
|
541
575
|
},
|
|
576
|
+
{
|
|
577
|
+
"name": "title",
|
|
578
|
+
"type": "string",
|
|
579
|
+
"default": null,
|
|
580
|
+
"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.",
|
|
581
|
+
"required": false
|
|
582
|
+
},
|
|
542
583
|
{
|
|
543
584
|
"name": "xFormat",
|
|
544
585
|
"type": "ValueFormat",
|
package/registry/sparkline.json
CHANGED
|
@@ -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": "core",
|
|
13
24
|
"whenToUse": [
|
|
@@ -62,11 +73,11 @@
|
|
|
62
73
|
"required": true
|
|
63
74
|
},
|
|
64
75
|
{
|
|
65
|
-
"name": "
|
|
66
|
-
"type": "
|
|
76
|
+
"name": "actionsMenu",
|
|
77
|
+
"type": "boolean",
|
|
67
78
|
"default": null,
|
|
68
|
-
"description": "
|
|
69
|
-
"required":
|
|
79
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
80
|
+
"required": false
|
|
70
81
|
},
|
|
71
82
|
{
|
|
72
83
|
"name": "brand",
|
|
@@ -131,6 +142,13 @@
|
|
|
131
142
|
"description": "The id of the figure.",
|
|
132
143
|
"required": false
|
|
133
144
|
},
|
|
145
|
+
{
|
|
146
|
+
"name": "insight",
|
|
147
|
+
"type": "ReactNode",
|
|
148
|
+
"default": null,
|
|
149
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
150
|
+
"required": false
|
|
151
|
+
},
|
|
134
152
|
{
|
|
135
153
|
"name": "labels",
|
|
136
154
|
"type": "ChartLabelsInput",
|
|
@@ -187,6 +205,13 @@
|
|
|
187
205
|
"description": "A dashed reference line (yesterday's average, a quota).",
|
|
188
206
|
"required": false
|
|
189
207
|
},
|
|
208
|
+
{
|
|
209
|
+
"name": "title",
|
|
210
|
+
"type": "string",
|
|
211
|
+
"default": null,
|
|
212
|
+
"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.",
|
|
213
|
+
"required": false
|
|
214
|
+
},
|
|
190
215
|
{
|
|
191
216
|
"name": "trendTone",
|
|
192
217
|
"type": "boolean | \"inverse\"",
|
|
@@ -196,7 +221,7 @@
|
|
|
196
221
|
},
|
|
197
222
|
{
|
|
198
223
|
"name": "variant",
|
|
199
|
-
"type": "\"
|
|
224
|
+
"type": "\"area\" | \"line\" | \"bar\"",
|
|
200
225
|
"default": null,
|
|
201
226
|
"description": "`line` (default), `area` (line over a wash) or `bar` (discrete counts: jobs per hour).",
|
|
202
227
|
"required": false
|
|
@@ -411,11 +436,11 @@
|
|
|
411
436
|
"required": true
|
|
412
437
|
},
|
|
413
438
|
{
|
|
414
|
-
"name": "
|
|
415
|
-
"type": "
|
|
439
|
+
"name": "actionsMenu",
|
|
440
|
+
"type": "boolean",
|
|
416
441
|
"default": null,
|
|
417
|
-
"description": "
|
|
418
|
-
"required":
|
|
442
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
443
|
+
"required": false
|
|
419
444
|
},
|
|
420
445
|
{
|
|
421
446
|
"name": "brand",
|
|
@@ -480,6 +505,13 @@
|
|
|
480
505
|
"description": "The id of the figure.",
|
|
481
506
|
"required": false
|
|
482
507
|
},
|
|
508
|
+
{
|
|
509
|
+
"name": "insight",
|
|
510
|
+
"type": "ReactNode",
|
|
511
|
+
"default": null,
|
|
512
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
513
|
+
"required": false
|
|
514
|
+
},
|
|
483
515
|
{
|
|
484
516
|
"name": "labels",
|
|
485
517
|
"type": "ChartLabelsInput",
|
|
@@ -536,6 +568,13 @@
|
|
|
536
568
|
"description": "A dashed reference line (yesterday's average, a quota).",
|
|
537
569
|
"required": false
|
|
538
570
|
},
|
|
571
|
+
{
|
|
572
|
+
"name": "title",
|
|
573
|
+
"type": "string",
|
|
574
|
+
"default": null,
|
|
575
|
+
"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.",
|
|
576
|
+
"required": false
|
|
577
|
+
},
|
|
539
578
|
{
|
|
540
579
|
"name": "trendTone",
|
|
541
580
|
"type": "boolean | \"inverse\"",
|
|
@@ -545,7 +584,7 @@
|
|
|
545
584
|
},
|
|
546
585
|
{
|
|
547
586
|
"name": "variant",
|
|
548
|
-
"type": "\"
|
|
587
|
+
"type": "\"area\" | \"line\" | \"bar\"",
|
|
549
588
|
"default": null,
|
|
550
589
|
"description": "`line` (default), `area` (line over a wash) or `bar` (discrete counts: jobs per hour).",
|
|
551
590
|
"required": false
|
package/registry/treemap.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": [
|
|
@@ -80,11 +93,11 @@
|
|
|
80
93
|
"required": true
|
|
81
94
|
},
|
|
82
95
|
{
|
|
83
|
-
"name": "
|
|
84
|
-
"type": "
|
|
96
|
+
"name": "actionsMenu",
|
|
97
|
+
"type": "boolean",
|
|
85
98
|
"default": null,
|
|
86
|
-
"description": "
|
|
87
|
-
"required":
|
|
99
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
100
|
+
"required": false
|
|
88
101
|
},
|
|
89
102
|
{
|
|
90
103
|
"name": "brand",
|
|
@@ -104,7 +117,7 @@
|
|
|
104
117
|
"name": "dataTable",
|
|
105
118
|
"type": "boolean",
|
|
106
119
|
"default": null,
|
|
107
|
-
"description": "
|
|
120
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
108
121
|
"required": false
|
|
109
122
|
},
|
|
110
123
|
{
|
|
@@ -132,7 +145,7 @@
|
|
|
132
145
|
"name": "exportable",
|
|
133
146
|
"type": "boolean | readonly ExportFormat[]",
|
|
134
147
|
"default": null,
|
|
135
|
-
"description": "
|
|
148
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
136
149
|
"required": false
|
|
137
150
|
},
|
|
138
151
|
{
|
|
@@ -163,6 +176,13 @@
|
|
|
163
176
|
"description": "The id of the figure.",
|
|
164
177
|
"required": false
|
|
165
178
|
},
|
|
179
|
+
{
|
|
180
|
+
"name": "insight",
|
|
181
|
+
"type": "ReactNode",
|
|
182
|
+
"default": null,
|
|
183
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
184
|
+
"required": false
|
|
185
|
+
},
|
|
166
186
|
{
|
|
167
187
|
"name": "labels",
|
|
168
188
|
"type": "ChartLabelsInput",
|
|
@@ -226,6 +246,13 @@
|
|
|
226
246
|
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
227
247
|
"required": false
|
|
228
248
|
},
|
|
249
|
+
{
|
|
250
|
+
"name": "title",
|
|
251
|
+
"type": "string",
|
|
252
|
+
"default": null,
|
|
253
|
+
"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.",
|
|
254
|
+
"required": false
|
|
255
|
+
},
|
|
229
256
|
{
|
|
230
257
|
"name": "valueLabel",
|
|
231
258
|
"type": "string",
|
|
@@ -273,11 +300,11 @@
|
|
|
273
300
|
"required": true
|
|
274
301
|
},
|
|
275
302
|
{
|
|
276
|
-
"name": "
|
|
277
|
-
"type": "
|
|
303
|
+
"name": "actionsMenu",
|
|
304
|
+
"type": "boolean",
|
|
278
305
|
"default": null,
|
|
279
|
-
"description": "
|
|
280
|
-
"required":
|
|
306
|
+
"description": "The ⋯ actions menu of the kit. `false`: the former “Show data” and export buttons, drawn in line. Default true.",
|
|
307
|
+
"required": false
|
|
281
308
|
},
|
|
282
309
|
{
|
|
283
310
|
"name": "brand",
|
|
@@ -297,7 +324,7 @@
|
|
|
297
324
|
"name": "dataTable",
|
|
298
325
|
"type": "boolean",
|
|
299
326
|
"default": null,
|
|
300
|
-
"description": "
|
|
327
|
+
"description": "“View as table” in the actions menu (the table is in the page for screen readers either way). Default true.",
|
|
301
328
|
"required": false
|
|
302
329
|
},
|
|
303
330
|
{
|
|
@@ -325,7 +352,7 @@
|
|
|
325
352
|
"name": "exportable",
|
|
326
353
|
"type": "boolean | readonly ExportFormat[]",
|
|
327
354
|
"default": null,
|
|
328
|
-
"description": "
|
|
355
|
+
"description": "The downloads of the actions menu: all three by default, or the formats you want, or `false` for none.",
|
|
329
356
|
"required": false
|
|
330
357
|
},
|
|
331
358
|
{
|
|
@@ -356,6 +383,13 @@
|
|
|
356
383
|
"description": "The id of the figure.",
|
|
357
384
|
"required": false
|
|
358
385
|
},
|
|
386
|
+
{
|
|
387
|
+
"name": "insight",
|
|
388
|
+
"type": "ReactNode",
|
|
389
|
+
"default": null,
|
|
390
|
+
"description": "One line that says what the chart shows, between the title and the chart: “100 jobs · +100 % vs last week”.",
|
|
391
|
+
"required": false
|
|
392
|
+
},
|
|
359
393
|
{
|
|
360
394
|
"name": "labels",
|
|
361
395
|
"type": "ChartLabelsInput",
|
|
@@ -419,6 +453,13 @@
|
|
|
419
453
|
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
420
454
|
"required": false
|
|
421
455
|
},
|
|
456
|
+
{
|
|
457
|
+
"name": "title",
|
|
458
|
+
"type": "string",
|
|
459
|
+
"default": null,
|
|
460
|
+
"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.",
|
|
461
|
+
"required": false
|
|
462
|
+
},
|
|
422
463
|
{
|
|
423
464
|
"name": "valueLabel",
|
|
424
465
|
"type": "string",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/labels.ts","../src/web/context.tsx","../src/core/palette.ts"],"sourcesContent":["// The words a chart says on its own: its controls, its states and its written summary. English by default; an app\n// passes its own (translated through its catalogue) once, to `ChartsProvider labels`, or to one chart's `labels`.\n// Placeholders are written `{name}`.\n\nexport interface ChartLabels {\n /** The button that shows the data table. */\n showData: string;\n /** The button that hides it. */\n hideData: string;\n /** The caption of the data table: `{title}`. */\n tableCaption: string;\n /** The export buttons. */\n exportPng: string;\n exportSvg: string;\n exportCsv: string;\n /** Announced while the data loads. */\n loading: string;\n /** Shown when there is nothing to draw. */\n empty: string;\n /** Shown when the data could not be loaded. */\n error: string;\n /** The keyboard hint, read once when the plot takes the focus. */\n keyboardHint: string;\n /** The role description of the plot (`chart`). */\n roleDescription: string;\n /** Summary pieces. `{kind}` is the chart's name (`Line chart`), `{count}` a number of points or series. */\n summaryIntro: string;\n summarySeries: string;\n summaryRange: string;\n summaryTrendUp: string;\n summaryTrendDown: string;\n summaryTrendFlat: string;\n summaryTotal: string;\n summaryThreshold: string;\n summaryShare: string;\n /** Scatter: the correlation of x and y (Pearson's r). */\n summaryCorrelation: string;\n /** Funnel: from one stage to the next, and from the first to the last. */\n summaryConversion: string;\n summaryOverall: string;\n /** Heatmap, calendar: the largest cell and the number of cells with a value. */\n summaryPeak: string;\n summaryActive: string;\n /** Candlestick: the period's range. */\n summaryOhlc: string;\n /** The names of the charts, read first in the summary. */\n kinds: Record<ChartKind, string>;\n /** The column of the values, when the chart has no value label. */\n value: string;\n /** The column of the categories in the data table, when the chart has no x label. */\n category: string;\n /** The total row of a stacked chart, a pie, a funnel. */\n total: string;\n /** What a missing value reads as. */\n noValue: string;\n}\n\nexport type ChartKind =\n | \"line\"\n | \"area\"\n | \"bar\"\n | \"pie\"\n | \"donut\"\n | \"gauge\"\n | \"sparkline\"\n | \"radar\"\n | \"heatmap\"\n | \"calendar\"\n | \"sankey\"\n | \"funnel\"\n | \"candlestick\"\n | \"treemap\"\n | \"scatter\"\n | \"map\"\n | \"globe\"\n | \"chart\";\n\nexport const DEFAULT_LABELS: ChartLabels = {\n showData: \"Show data\",\n hideData: \"Hide data\",\n tableCaption: \"{title} — data\",\n exportPng: \"PNG\",\n exportSvg: \"SVG\",\n exportCsv: \"CSV\",\n loading: \"Loading chart…\",\n empty: \"No data for this period yet.\",\n error: \"The chart could not be loaded.\",\n keyboardHint: \"Use the arrow keys to move between points, Home and End to jump to the ends.\",\n roleDescription: \"chart\",\n summaryIntro: \"{kind}, {count}.\",\n summarySeries: \"{label}: from {first} to {last}\",\n summaryRange: \"lowest {min} ({minAt}), highest {max} ({maxAt})\",\n summaryTrendUp: \"up {change}\",\n summaryTrendDown: \"down {change}\",\n summaryTrendFlat: \"stable\",\n summaryTotal: \"total {total}\",\n summaryThreshold: \"{label} at {value}\",\n summaryShare: \"{label} {value} ({share})\",\n summaryCorrelation: \"correlation {r}\",\n summaryConversion: \"{from} → {to} {rate}\",\n summaryOverall: \"overall {rate}\",\n summaryPeak: \"peak {value} ({at})\",\n summaryActive: \"{count} with a value\",\n summaryOhlc: \"opened at {open}, closed at {close}, low {low}, high {high}\",\n kinds: {\n line: \"Line chart\",\n area: \"Area chart\",\n bar: \"Bar chart\",\n pie: \"Pie chart\",\n donut: \"Donut chart\",\n gauge: \"Gauge\",\n sparkline: \"Sparkline\",\n radar: \"Radar chart\",\n heatmap: \"Heatmap\",\n calendar: \"Calendar heatmap\",\n sankey: \"Flow diagram\",\n funnel: \"Funnel\",\n candlestick: \"Candlestick chart\",\n treemap: \"Treemap\",\n scatter: \"Scatter chart\",\n map: \"Map\",\n globe: \"Globe\",\n chart: \"Chart\",\n },\n category: \"Category\",\n value: \"Value\",\n total: \"Total\",\n noValue: \"—\",\n};\n\n/** The words an app or a chart passes: any of them, and any of the chart names. */\nexport type ChartLabelsInput = Partial<Omit<ChartLabels, \"kinds\">> & { kinds?: Partial<Record<ChartKind, string>> };\n\n/** The default labels with an app's and a chart's on top (`kinds` merged too). */\nexport function mergeLabels(...layers: (ChartLabelsInput | undefined)[]): ChartLabels {\n let out = DEFAULT_LABELS;\n for (const layer of layers) {\n if (!layer) continue;\n out = { ...out, ...layer, kinds: { ...out.kinds, ...layer.kinds } };\n }\n return out;\n}\n\n/** A sentence's first letter in upper case (a template that may open a sentence: `total {total}`). */\nexport function capitalize(text: string): string {\n return text.charAt(0).toLocaleUpperCase() + text.slice(1);\n}\n\n/** `{name}` → its value; an unknown placeholder stays as written. */\nexport function fill(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match, name: string) => (name in values ? String(values[name]) : match));\n}\n","\"use client\";\n// One place for what every chart of an app shares: the locale its figures are written in, the brand its palette\n// leads with, and the words it says (translated once, from the app's catalogue). Each chart may still override them.\nimport { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\nimport { type ChartLabels, type ChartLabelsInput, mergeLabels } from \"../core/labels\";\nimport type { BrandId, Locale } from \"../core/types\";\n\nexport interface ChartsSettings {\n /** The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`. */\n locale?: Locale;\n /**\n * The brand whose palette the charts use. Without it, a chart follows a `.brand-<id>` ancestor, else Krizaka. Set it\n * when the app loads a brand stylesheet on `:root` (`@krizaka/tokens/brands/orazaka.css`).\n */\n brand?: BrandId;\n /** The words, translated: the buttons, the states, the written summary. */\n labels?: ChartLabelsInput;\n}\n\ninterface ResolvedSettings {\n readonly locale: Locale;\n readonly brand?: BrandId;\n readonly labels: ChartLabels;\n readonly raw?: ChartLabelsInput;\n}\n\nconst DEFAULTS: ResolvedSettings = { locale: \"en-US\", labels: mergeLabels() };\nconst Context = createContext<ResolvedSettings>(DEFAULTS);\n\nexport interface ChartsProviderProps extends ChartsSettings {\n children: ReactNode;\n}\n\n/** Sets the locale, the brand and the words of every chart below it. */\nexport function ChartsProvider({ locale, brand, labels, children }: ChartsProviderProps) {\n const parent = useContext(Context);\n const value = useMemo<ResolvedSettings>(() => {\n const raw: ChartLabelsInput | undefined = labels ? { ...parent.raw, ...labels, kinds: { ...parent.raw?.kinds, ...labels.kinds } } : parent.raw;\n return { locale: locale ?? parent.locale, brand: brand ?? parent.brand, labels: mergeLabels(raw), raw };\n }, [locale, brand, labels, parent]);\n return <Context.Provider value={value}>{children}</Context.Provider>;\n}\n\n/** The settings of a chart: its own props over the provider's over the defaults. */\nexport function useChartSettings(own: ChartsSettings): { locale: Locale; brand?: BrandId; labels: ChartLabels } {\n const shared = useContext(Context);\n return useMemo(\n () => ({ locale: own.locale ?? shared.locale, brand: own.brand ?? shared.brand, labels: own.labels ? mergeLabels(shared.raw, own.labels) : shared.labels }),\n [own.locale, own.brand, own.labels, shared],\n );\n}\n","// The data palettes. One categorical set of eight hues, stepped for each theme (the dark steps are chosen for the\n// dark surface, not flipped), ordered per brand so that the first series wears the brand's own hue — Krizaka blue,\n// Orazaka orange, Orochia violet then magenta, its gradient. Every order was chosen among the ones that pass the\n// colour-vision checks (scripts/palette.test: lightness band, chroma floor, adjacent ΔE under protan/deutan ≥ 8 —\n// Orochia light 7.2, inside the 6–8 band that requires the secondary encoding every chart carries: legend, direct\n// labels, data table —, normal-vision ΔE ≥ 15, ≥ 3:1 on the surface, the first three slots distinct all-pairs).\n// A 9th series never gets a generated hue: it folds into “Other” or a second chart.\nimport type { BrandId } from \"./types\";\n\nexport type Mode = \"dark\" | \"light\";\n\n/** The eight hues, light and dark steps. */\nexport const HUES = {\n blue: { light: \"#2a78d6\", dark: \"#3987e5\" },\n orange: { light: \"#eb6834\", dark: \"#d95926\" },\n aqua: { light: \"#1baf7a\", dark: \"#199e70\" },\n yellow: { light: \"#eda100\", dark: \"#c98500\" },\n magenta: { light: \"#e87ba4\", dark: \"#d55181\" },\n green: { light: \"#008300\", dark: \"#008300\" },\n violet: { light: \"#6250d6\", dark: \"#9085e9\" },\n red: { light: \"#e34948\", dark: \"#e66767\" },\n} as const;\n\nexport type Hue = keyof typeof HUES;\n\n/** The order of the hues for each brand: slot 1 is the brand. */\nexport const ORDERS: Record<BrandId, readonly Hue[]> = {\n krizaka: [\"blue\", \"green\", \"magenta\", \"yellow\", \"aqua\", \"orange\", \"violet\", \"red\"],\n orazaka: [\"orange\", \"aqua\", \"blue\", \"yellow\", \"magenta\", \"green\", \"violet\", \"red\"],\n orochia: [\"violet\", \"magenta\", \"yellow\", \"aqua\", \"orange\", \"blue\", \"green\", \"red\"],\n};\n\n/** The categorical palette of a brand in a theme: eight hex colours, slot 1 first. */\nexport function palette(brand: BrandId, mode: Mode): string[] {\n return ORDERS[brand].map((hue) => HUES[hue][mode]);\n}\n\n/** The diverging poles (below / above the midpoint): blue ↔ red, a neutral grey between them. */\nexport const DIVERGING = {\n light: { low: HUES.blue.light, high: HUES.red.light },\n dark: { low: HUES.blue.dark, high: HUES.red.dark },\n} as const;\n\n// --- Colour arithmetic (OKLab), for the sequential ramps the canvas engine needs as plain colours. ---------------\n\ntype Rgb = [number, number, number];\n\n/** `#rrggbb`, `#rgb`, `rgb(r, g, b)` / `rgba(…)` or `rgb(r g b / a)` → [r, g, b] in 0–255; null otherwise. */\nexport function parseColor(color: string): Rgb | null {\n const hex = color.trim().match(/^#([\\da-f]{3}|[\\da-f]{6})$/i);\n if (hex) {\n const h = hex[1]!.length === 3 ? [...hex[1]!].map((c) => c + c).join(\"\") : hex[1]!;\n return [0, 2, 4].map((i) => Number.parseInt(h.slice(i, i + 2), 16)) as Rgb;\n }\n const rgb = color.trim().match(/^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)/i);\n if (rgb) return [Number(rgb[1]), Number(rgb[2]), Number(rgb[3])];\n return null;\n}\n\nconst toLinear = (c: number) => {\n const v = c / 255;\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;\n};\nconst fromLinear = (v: number) => {\n const c = v <= 0.0031308 ? v * 12.92 : 1.055 * v ** (1 / 2.4) - 0.055;\n return Math.round(Math.min(1, Math.max(0, c)) * 255);\n};\n\nfunction toOklab([r8, g8, b8]: Rgb): Rgb {\n const [r, g, b] = [toLinear(r8), toLinear(g8), toLinear(b8)];\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n return [0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s, 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s, 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s];\n}\n\nfunction fromOklab([L, a, b]: Rgb): Rgb {\n const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;\n const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;\n const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;\n return [\n fromLinear(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n fromLinear(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n fromLinear(-0.0041960863 * l - 0.7034186147 * m + 1.707614031 * s),\n ];\n}\n\nconst hex = ([r, g, b]: Rgb) => `#${[r, g, b].map((c) => c.toString(16).padStart(2, \"0\")).join(\"\")}`;\n\n/** `a` → `b` at `t` (0–1), interpolated in OKLab (even steps to the eye). Unparseable colours return `b`. */\nexport function mix(a: string, b: string, t: number): string {\n const ca = parseColor(a);\n const cb = parseColor(b);\n if (!ca || !cb) return b;\n const la = toOklab(ca);\n const lb = toOklab(cb);\n return hex(fromOklab([0, 1, 2].map((i) => la[i]! + (lb[i]! - la[i]!) * t) as Rgb));\n}\n\n/**\n * A sequential ramp of `steps` colours, one hue from near the surface (`0`, “almost nothing”) to the full hue: the\n * magnitude of a heatmap, a calendar or a choropleth. The first step is still distinct from the surface.\n */\nexport function sequential(hue: string, surface: string, steps = 5): string[] {\n return Array.from({ length: steps }, (_, i) => mix(surface, hue, 0.22 + (0.78 * i) / Math.max(1, steps - 1)));\n}\n\n/** WCAG contrast ratio between two colours (for the tests and the labels drawn inside a mark). */\nexport function contrast(a: string, b: string): number {\n const lum = (c: string) => {\n const rgb = parseColor(c);\n if (!rgb) return 0;\n const [r, g, bl] = rgb.map(toLinear) as Rgb;\n return 0.2126 * r + 0.7152 * g + 0.0722 * bl;\n };\n const [hi, lo] = [lum(a), lum(b)].sort((x, y) => y - x) as [number, number];\n return (hi + 0.05) / (lo + 0.05);\n}\n"],"mappings":";;;AA6EO,IAAM,iBAA8B;AAAA,EACzC,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,cAA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