@krizaka/charts 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +47 -2
- package/dist/bar.d.ts +17 -0
- package/dist/bar.js +16 -0
- package/dist/bar.js.map +1 -0
- package/dist/candlestick-IG626XL4.js +13 -0
- package/dist/candlestick-IG626XL4.js.map +1 -0
- package/dist/candlestick.d.ts +42 -0
- package/dist/candlestick.js +13 -0
- package/dist/candlestick.js.map +1 -0
- package/dist/canvas-4MSYDVFO.js +14 -0
- package/dist/canvas-4MSYDVFO.js.map +1 -0
- package/dist/cartesian-BRhNQ3ib.d.ts +34 -0
- package/dist/chart.d.ts +58 -0
- package/dist/chart.js +11 -0
- package/dist/chart.js.map +1 -0
- package/dist/chunk-3CJHBJXA.js +186 -0
- package/dist/chunk-3CJHBJXA.js.map +1 -0
- package/dist/chunk-6FINSUOS.js +49 -0
- package/dist/chunk-6FINSUOS.js.map +1 -0
- package/dist/chunk-7CSAGFBW.js +166 -0
- package/dist/chunk-7CSAGFBW.js.map +1 -0
- package/dist/chunk-7TIFCK5E.js +103 -0
- package/dist/chunk-7TIFCK5E.js.map +1 -0
- package/dist/chunk-AHQXJSAQ.js +38 -0
- package/dist/chunk-AHQXJSAQ.js.map +1 -0
- package/dist/chunk-ANUCSRUN.js +43 -0
- package/dist/chunk-ANUCSRUN.js.map +1 -0
- package/dist/chunk-BISL7DYW.js +66 -0
- package/dist/chunk-BISL7DYW.js.map +1 -0
- package/dist/chunk-BZ5CQFPH.js +19 -0
- package/dist/chunk-BZ5CQFPH.js.map +1 -0
- package/dist/chunk-DWJPPEMC.js +455 -0
- package/dist/chunk-DWJPPEMC.js.map +1 -0
- package/dist/chunk-DZB6HEVO.js +73 -0
- package/dist/chunk-DZB6HEVO.js.map +1 -0
- package/dist/chunk-EK3Z647J.js +133 -0
- package/dist/chunk-EK3Z647J.js.map +1 -0
- package/dist/chunk-I5QUZVU2.js +234 -0
- package/dist/chunk-I5QUZVU2.js.map +1 -0
- package/dist/chunk-OB5EFDDH.js +118 -0
- package/dist/chunk-OB5EFDDH.js.map +1 -0
- package/dist/chunk-OER6ETT4.js +155 -0
- package/dist/chunk-OER6ETT4.js.map +1 -0
- package/dist/chunk-PTSB3H5Q.js +205 -0
- package/dist/chunk-PTSB3H5Q.js.map +1 -0
- package/dist/chunk-TPJDOB7R.js +15 -0
- package/dist/chunk-TPJDOB7R.js.map +1 -0
- package/dist/chunk-UNK4MJVG.js +378 -0
- package/dist/chunk-UNK4MJVG.js.map +1 -0
- package/dist/chunk-VKO2OYYM.js +88 -0
- package/dist/chunk-VKO2OYYM.js.map +1 -0
- package/dist/chunk-VKTZD7UT.js +107 -0
- package/dist/chunk-VKTZD7UT.js.map +1 -0
- package/dist/chunk-W5FX4TU3.js +102 -0
- package/dist/chunk-W5FX4TU3.js.map +1 -0
- package/dist/chunk-WBH2QU77.js +178 -0
- package/dist/chunk-WBH2QU77.js.map +1 -0
- package/dist/chunk-WIRCIOLH.js +145 -0
- package/dist/chunk-WIRCIOLH.js.map +1 -0
- package/dist/chunk-XAJ3KCC4.js +116 -0
- package/dist/chunk-XAJ3KCC4.js.map +1 -0
- package/dist/chunk-XC6BQ3RN.js +92 -0
- package/dist/chunk-XC6BQ3RN.js.map +1 -0
- package/dist/chunk-XLLYNNC6.js +89 -0
- package/dist/chunk-XLLYNNC6.js.map +1 -0
- package/dist/chunk-XR4ZJDOV.js +15 -0
- package/dist/chunk-XR4ZJDOV.js.map +1 -0
- package/dist/context-BgYUymEO.d.ts +163 -0
- package/dist/frame-I7_xYGy5.d.ts +45 -0
- package/dist/full-S2MBPEEP.js +11 -0
- package/dist/full-S2MBPEEP.js.map +1 -0
- package/dist/funnel-QU5ZPC52.js +13 -0
- package/dist/funnel-QU5ZPC52.js.map +1 -0
- package/dist/funnel.d.ts +26 -0
- package/dist/funnel.js +13 -0
- package/dist/funnel.js.map +1 -0
- package/dist/gauge.d.ts +38 -0
- package/dist/gauge.js +12 -0
- package/dist/gauge.js.map +1 -0
- package/dist/geo.d.ts +37 -0
- package/dist/geo.js +13 -0
- package/dist/geo.js.map +1 -0
- package/dist/globe.d.ts +36 -0
- package/dist/globe.js +12 -0
- package/dist/globe.js.map +1 -0
- package/dist/heatmap-JWQOKUGM.js +13 -0
- package/dist/heatmap-JWQOKUGM.js.map +1 -0
- package/dist/heatmap.d.ts +47 -0
- package/dist/heatmap.js +15 -0
- package/dist/heatmap.js.map +1 -0
- package/dist/host-_F8RgiIz.d.ts +15 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +101 -0
- package/dist/index.js.map +1 -0
- package/dist/line.d.ts +25 -0
- package/dist/line.js +18 -0
- package/dist/line.js.map +1 -0
- package/dist/native.d.ts +300 -0
- package/dist/native.js +875 -0
- package/dist/native.js.map +1 -0
- package/dist/pie.d.ts +37 -0
- package/dist/pie.js +16 -0
- package/dist/pie.js.map +1 -0
- package/dist/provider.d.ts +73 -0
- package/dist/provider.js +24 -0
- package/dist/provider.js.map +1 -0
- package/dist/radar-75GRJ2IK.js +13 -0
- package/dist/radar-75GRJ2IK.js.map +1 -0
- package/dist/radar.d.ts +22 -0
- package/dist/radar.js +13 -0
- package/dist/radar.js.map +1 -0
- package/dist/sankey-XQTX2EG6.js +13 -0
- package/dist/sankey-XQTX2EG6.js.map +1 -0
- package/dist/sankey.d.ts +28 -0
- package/dist/sankey.js +13 -0
- package/dist/sankey.js.map +1 -0
- package/dist/scatter-XSNG4OKD.js +13 -0
- package/dist/scatter-XSNG4OKD.js.map +1 -0
- package/dist/scatter.d.ts +41 -0
- package/dist/scatter.js +15 -0
- package/dist/scatter.js.map +1 -0
- package/dist/sparkline.d.ts +26 -0
- package/dist/sparkline.js +15 -0
- package/dist/sparkline.js.map +1 -0
- package/dist/svg-BJUHYX3B.js +14 -0
- package/dist/svg-BJUHYX3B.js.map +1 -0
- package/dist/treemap-OMGGGB5U.js +13 -0
- package/dist/treemap-OMGGGB5U.js.map +1 -0
- package/dist/treemap.d.ts +24 -0
- package/dist/treemap.js +14 -0
- package/dist/treemap.js.map +1 -0
- package/dist/world-110m-DVFWXS42.js +18 -0
- package/dist/world-110m-DVFWXS42.js.map +1 -0
- package/package.json +518 -3
- package/registry/area-chart.json +784 -0
- package/registry/bar-chart.json +783 -0
- package/registry/calendar-heatmap.json +459 -0
- package/registry/candlestick.json +552 -0
- package/registry/chart.json +440 -0
- package/registry/charts-provider.json +190 -0
- package/registry/examples/area-chart/credits-usage.d.ts +4 -0
- package/registry/examples/area-chart/credits-usage.js +38 -0
- package/registry/examples/area-chart/credits-usage.tsx +32 -0
- package/registry/examples/area-chart/native/credits-usage.d.ts +4 -0
- package/registry/examples/area-chart/native/credits-usage.dark.png +0 -0
- package/registry/examples/area-chart/native/credits-usage.js +33 -0
- package/registry/examples/area-chart/native/credits-usage.light.png +0 -0
- package/registry/examples/area-chart/native/credits-usage.tsx +27 -0
- package/registry/examples/area-chart/storage.d.ts +4 -0
- package/registry/examples/area-chart/storage.js +27 -0
- package/registry/examples/area-chart/storage.tsx +21 -0
- package/registry/examples/bar-chart/jobs-by-status.d.ts +4 -0
- package/registry/examples/bar-chart/jobs-by-status.js +37 -0
- package/registry/examples/bar-chart/jobs-by-status.tsx +31 -0
- package/registry/examples/bar-chart/native/jobs-by-status.d.ts +4 -0
- package/registry/examples/bar-chart/native/jobs-by-status.dark.png +0 -0
- package/registry/examples/bar-chart/native/jobs-by-status.js +32 -0
- package/registry/examples/bar-chart/native/jobs-by-status.light.png +0 -0
- package/registry/examples/bar-chart/native/jobs-by-status.tsx +26 -0
- package/registry/examples/bar-chart/plans-by-quarter.d.ts +4 -0
- package/registry/examples/bar-chart/plans-by-quarter.js +31 -0
- package/registry/examples/bar-chart/plans-by-quarter.tsx +26 -0
- package/registry/examples/bar-chart/top-supporters.d.ts +4 -0
- package/registry/examples/bar-chart/top-supporters.js +32 -0
- package/registry/examples/bar-chart/top-supporters.tsx +27 -0
- package/registry/examples/calendar-heatmap/publishing.d.ts +4 -0
- package/registry/examples/calendar-heatmap/publishing.js +28 -0
- package/registry/examples/calendar-heatmap/publishing.tsx +23 -0
- package/registry/examples/candlestick/auction-bids.d.ts +4 -0
- package/registry/examples/candlestick/auction-bids.js +37 -0
- package/registry/examples/candlestick/auction-bids.tsx +32 -0
- package/registry/examples/chart/polar-uploads.d.ts +4 -0
- package/registry/examples/chart/polar-uploads.js +34 -0
- package/registry/examples/chart/polar-uploads.tsx +30 -0
- package/registry/examples/charts-provider/french-orazaka.d.ts +4 -0
- package/registry/examples/charts-provider/french-orazaka.js +26 -0
- package/registry/examples/charts-provider/french-orazaka.tsx +22 -0
- package/registry/examples/charts-provider/native/french-orazaka.d.ts +4 -0
- package/registry/examples/charts-provider/native/french-orazaka.dark.png +0 -0
- package/registry/examples/charts-provider/native/french-orazaka.js +17 -0
- package/registry/examples/charts-provider/native/french-orazaka.light.png +0 -0
- package/registry/examples/charts-provider/native/french-orazaka.tsx +17 -0
- package/registry/examples/funnel/signup.d.ts +4 -0
- package/registry/examples/funnel/signup.js +30 -0
- package/registry/examples/funnel/signup.tsx +24 -0
- package/registry/examples/gauge/challenge-goal.d.ts +4 -0
- package/registry/examples/gauge/challenge-goal.js +24 -0
- package/registry/examples/gauge/challenge-goal.tsx +18 -0
- package/registry/examples/gauge/credits-quota.d.ts +4 -0
- package/registry/examples/gauge/credits-quota.js +26 -0
- package/registry/examples/gauge/credits-quota.tsx +19 -0
- package/registry/examples/gauge/native/credits-quota.d.ts +4 -0
- package/registry/examples/gauge/native/credits-quota.dark.png +0 -0
- package/registry/examples/gauge/native/credits-quota.js +25 -0
- package/registry/examples/gauge/native/credits-quota.light.png +0 -0
- package/registry/examples/gauge/native/credits-quota.tsx +18 -0
- package/registry/examples/geo-map/viewers.d.ts +4 -0
- package/registry/examples/geo-map/viewers.js +43 -0
- package/registry/examples/geo-map/viewers.tsx +29 -0
- package/registry/examples/globe/deployment-regions.d.ts +4 -0
- package/registry/examples/globe/deployment-regions.js +36 -0
- package/registry/examples/globe/deployment-regions.tsx +30 -0
- package/registry/examples/heatmap/upload-activity.d.ts +4 -0
- package/registry/examples/heatmap/upload-activity.js +30 -0
- package/registry/examples/heatmap/upload-activity.tsx +25 -0
- package/registry/examples/line-chart/creator-earnings.d.ts +4 -0
- package/registry/examples/line-chart/creator-earnings.js +35 -0
- package/registry/examples/line-chart/creator-earnings.tsx +30 -0
- package/registry/examples/line-chart/forecast.d.ts +4 -0
- package/registry/examples/line-chart/forecast.js +36 -0
- package/registry/examples/line-chart/forecast.tsx +30 -0
- package/registry/examples/line-chart/live-jobs.d.ts +4 -0
- package/registry/examples/line-chart/live-jobs.js +21 -0
- package/registry/examples/line-chart/live-jobs.tsx +23 -0
- package/registry/examples/line-chart/native/creator-earnings.d.ts +4 -0
- package/registry/examples/line-chart/native/creator-earnings.dark.png +0 -0
- package/registry/examples/line-chart/native/creator-earnings.js +32 -0
- package/registry/examples/line-chart/native/creator-earnings.light.png +0 -0
- package/registry/examples/line-chart/native/creator-earnings.tsx +26 -0
- package/registry/examples/line-chart/states.d.ts +4 -0
- package/registry/examples/line-chart/states.js +16 -0
- package/registry/examples/line-chart/states.tsx +13 -0
- package/registry/examples/pie-chart/credit-spend.d.ts +4 -0
- package/registry/examples/pie-chart/credit-spend.js +30 -0
- package/registry/examples/pie-chart/credit-spend.tsx +24 -0
- package/registry/examples/pie-chart/native/credit-spend.d.ts +4 -0
- package/registry/examples/pie-chart/native/credit-spend.dark.png +0 -0
- package/registry/examples/pie-chart/native/credit-spend.js +17 -0
- package/registry/examples/pie-chart/native/credit-spend.light.png +0 -0
- package/registry/examples/pie-chart/native/credit-spend.tsx +12 -0
- package/registry/examples/pie-chart/storage-by-kind.d.ts +4 -0
- package/registry/examples/pie-chart/storage-by-kind.js +31 -0
- package/registry/examples/pie-chart/storage-by-kind.tsx +26 -0
- package/registry/examples/radar-chart/model-comparison.d.ts +4 -0
- package/registry/examples/radar-chart/model-comparison.js +33 -0
- package/registry/examples/radar-chart/model-comparison.tsx +28 -0
- package/registry/examples/sankey/credit-flow.d.ts +4 -0
- package/registry/examples/sankey/credit-flow.js +37 -0
- package/registry/examples/sankey/credit-flow.tsx +32 -0
- package/registry/examples/scatter-chart/watch-time.d.ts +4 -0
- package/registry/examples/scatter-chart/watch-time.js +36 -0
- package/registry/examples/scatter-chart/watch-time.tsx +31 -0
- package/registry/examples/sparkline/bars.d.ts +4 -0
- package/registry/examples/sparkline/bars.js +12 -0
- package/registry/examples/sparkline/bars.tsx +7 -0
- package/registry/examples/sparkline/native/stat-trend.d.ts +4 -0
- package/registry/examples/sparkline/native/stat-trend.dark.png +0 -0
- package/registry/examples/sparkline/native/stat-trend.js +12 -0
- package/registry/examples/sparkline/native/stat-trend.light.png +0 -0
- package/registry/examples/sparkline/native/stat-trend.tsx +7 -0
- package/registry/examples/sparkline/stat-trend.d.ts +4 -0
- package/registry/examples/sparkline/stat-trend.js +18 -0
- package/registry/examples/sparkline/stat-trend.tsx +15 -0
- package/registry/examples/sparkline/table-rows.d.ts +4 -0
- package/registry/examples/sparkline/table-rows.js +23 -0
- package/registry/examples/sparkline/table-rows.tsx +26 -0
- package/registry/examples/treemap/storage.d.ts +4 -0
- package/registry/examples/treemap/storage.js +17 -0
- package/registry/examples/treemap/storage.tsx +13 -0
- package/registry/funnel.json +486 -0
- package/registry/gauge.json +599 -0
- package/registry/geo-map.json +483 -0
- package/registry/globe.json +468 -0
- package/registry/heatmap.json +530 -0
- package/registry/index.json +420 -0
- package/registry/line-chart.json +792 -0
- package/registry/pie-chart.json +1287 -0
- package/registry/radar-chart.json +458 -0
- package/registry/sankey.json +502 -0
- package/registry/scatter-chart.json +558 -0
- package/registry/sparkline.json +562 -0
- package/registry/treemap.json +431 -0
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "heatmap",
|
|
3
|
+
"package": "@krizaka/charts",
|
|
4
|
+
"type": "chart",
|
|
5
|
+
"title": "Heatmap",
|
|
6
|
+
"summary": "A measure across two dimensions — activity by weekday and hour — in one sequential hue, with a step legend.",
|
|
7
|
+
"description": "A measure across two dimensions — activity by weekday and hour — in one sequential hue, with a step legend.",
|
|
8
|
+
"status": "beta",
|
|
9
|
+
"category": "charts",
|
|
10
|
+
"platforms": "web",
|
|
11
|
+
"engine": "echarts",
|
|
12
|
+
"whenToUse": [
|
|
13
|
+
"When something happens: uploads by weekday and hour, errors by service and day.",
|
|
14
|
+
"A matrix of two categorical dimensions with a value in each cell."
|
|
15
|
+
],
|
|
16
|
+
"whenNotToUse": [
|
|
17
|
+
{
|
|
18
|
+
"when": "One value per day over a year.",
|
|
19
|
+
"use": "calendar-heatmap"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"when": "Exact values matter more than the pattern.",
|
|
23
|
+
"use": "bar-chart"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"bestPractices": [
|
|
27
|
+
"Give the order of the rows and columns (`xCategories`, `yCategories`): weekdays in order, not as they appear.",
|
|
28
|
+
"Keep empty cells empty: a missing value is not a zero."
|
|
29
|
+
],
|
|
30
|
+
"accessibility": {
|
|
31
|
+
"keyboard": [
|
|
32
|
+
{
|
|
33
|
+
"keys": "Tab",
|
|
34
|
+
"action": "Moves the focus to the plot (one tab stop), then to the data and export buttons."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"keys": "Arrow keys",
|
|
38
|
+
"action": "Walk the items one by one: each is announced and highlighted, its tooltip shown."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"keys": "Home / End",
|
|
42
|
+
"action": "Jump to the first or the last item."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"keys": "Esc",
|
|
46
|
+
"action": "Hides the tooltip and clears the highlight."
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"notes": [
|
|
50
|
+
"The plot is a group named by the title and described by a summary written from the data, read before anything else.",
|
|
51
|
+
"The data table is always in the page for assistive technology; “Show data” reveals it for everyone.",
|
|
52
|
+
"The engine (ECharts core and this one chart type) loads when the chart nears the screen; a skeleton of the same height holds its place, so nothing shifts.",
|
|
53
|
+
"Under reduced motion the chart is drawn without animation.",
|
|
54
|
+
"The cells are walked row by row; each is read with its row, column and value."
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"related": [
|
|
58
|
+
"calendar-heatmap",
|
|
59
|
+
"bar-chart",
|
|
60
|
+
"geo-map"
|
|
61
|
+
],
|
|
62
|
+
"source": "packages/charts/src/meta/heatmap.ts",
|
|
63
|
+
"install": {
|
|
64
|
+
"web": "npm install @krizaka/charts",
|
|
65
|
+
"native": "npx expo install react-native-svg\nnpm install @krizaka/charts"
|
|
66
|
+
},
|
|
67
|
+
"web": {
|
|
68
|
+
"entry": "@krizaka/charts/heatmap",
|
|
69
|
+
"import": "import { Heatmap } from \"@krizaka/charts/heatmap\";",
|
|
70
|
+
"props": [
|
|
71
|
+
{
|
|
72
|
+
"component": "Heatmap",
|
|
73
|
+
"description": "",
|
|
74
|
+
"props": [
|
|
75
|
+
{
|
|
76
|
+
"name": "data",
|
|
77
|
+
"type": "readonly T[]",
|
|
78
|
+
"default": null,
|
|
79
|
+
"description": "One row per cell.",
|
|
80
|
+
"required": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "title",
|
|
84
|
+
"type": "string",
|
|
85
|
+
"default": null,
|
|
86
|
+
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
87
|
+
"required": true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "value",
|
|
91
|
+
"type": "string | ((datum: T, index: number) => number)",
|
|
92
|
+
"default": null,
|
|
93
|
+
"description": "The field of the cell's value.",
|
|
94
|
+
"required": true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "x",
|
|
98
|
+
"type": "string | ((datum: T, index: number) => unknown)",
|
|
99
|
+
"default": null,
|
|
100
|
+
"description": "The field of the column (an hour, a day) and of the row (a weekday, a team).",
|
|
101
|
+
"required": true
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "y",
|
|
105
|
+
"type": "string | ((datum: T, index: number) => unknown)",
|
|
106
|
+
"default": null,
|
|
107
|
+
"description": "The field of the row (a weekday, a team).",
|
|
108
|
+
"required": true
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "brand",
|
|
112
|
+
"type": "BrandId",
|
|
113
|
+
"default": null,
|
|
114
|
+
"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`).",
|
|
115
|
+
"required": false
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "className",
|
|
119
|
+
"type": "string",
|
|
120
|
+
"default": null,
|
|
121
|
+
"description": "A class on the figure (layout: margins, grid placement).",
|
|
122
|
+
"required": false
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "dataTable",
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"default": null,
|
|
128
|
+
"description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
|
|
129
|
+
"required": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "description",
|
|
133
|
+
"type": "ReactNode",
|
|
134
|
+
"default": null,
|
|
135
|
+
"description": "A sentence under the title: the period, the unit, the source.",
|
|
136
|
+
"required": false
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "empty",
|
|
140
|
+
"type": "ReactNode",
|
|
141
|
+
"default": null,
|
|
142
|
+
"description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
|
|
143
|
+
"required": false
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "error",
|
|
147
|
+
"type": "ReactNode",
|
|
148
|
+
"default": null,
|
|
149
|
+
"description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
|
|
150
|
+
"required": false
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "exportable",
|
|
154
|
+
"type": "boolean | readonly ExportFormat[]",
|
|
155
|
+
"default": null,
|
|
156
|
+
"description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
|
|
157
|
+
"required": false
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "format",
|
|
161
|
+
"type": "ValueFormat",
|
|
162
|
+
"default": null,
|
|
163
|
+
"description": "How the values, the columns and the rows are written.",
|
|
164
|
+
"required": false
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "height",
|
|
168
|
+
"type": "number",
|
|
169
|
+
"default": null,
|
|
170
|
+
"description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
|
|
171
|
+
"required": false
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "hideTitle",
|
|
175
|
+
"type": "boolean",
|
|
176
|
+
"default": null,
|
|
177
|
+
"description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
|
|
178
|
+
"required": false
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "id",
|
|
182
|
+
"type": "string",
|
|
183
|
+
"default": null,
|
|
184
|
+
"description": "The id of the figure.",
|
|
185
|
+
"required": false
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"name": "labels",
|
|
189
|
+
"type": "ChartLabelsInput",
|
|
190
|
+
"default": null,
|
|
191
|
+
"description": "The words, translated: the buttons, the states, the written summary.",
|
|
192
|
+
"required": false
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "live",
|
|
196
|
+
"type": "boolean",
|
|
197
|
+
"default": null,
|
|
198
|
+
"description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
|
|
199
|
+
"required": false
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "loading",
|
|
203
|
+
"type": "boolean",
|
|
204
|
+
"default": null,
|
|
205
|
+
"description": "The data is on its way: a skeleton of the chart, announced once.",
|
|
206
|
+
"required": false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "locale",
|
|
210
|
+
"type": "Locale",
|
|
211
|
+
"default": null,
|
|
212
|
+
"description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
|
|
213
|
+
"required": false
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "renderer",
|
|
217
|
+
"type": "Renderer",
|
|
218
|
+
"default": null,
|
|
219
|
+
"description": "`svg` (default): sharp, exportable as SVG. `canvas`: for tens of thousands of marks.",
|
|
220
|
+
"required": false
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "style",
|
|
224
|
+
"type": "CSSProperties",
|
|
225
|
+
"default": null,
|
|
226
|
+
"description": "Inline style on the figure (layout only: colours come from the tokens).",
|
|
227
|
+
"required": false
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "summary",
|
|
231
|
+
"type": "\"hidden\" | \"visible\"",
|
|
232
|
+
"default": null,
|
|
233
|
+
"description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
|
|
234
|
+
"required": false
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"name": "summaryText",
|
|
238
|
+
"type": "string",
|
|
239
|
+
"default": null,
|
|
240
|
+
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
241
|
+
"required": false
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "xCategories",
|
|
245
|
+
"type": "readonly unknown[]",
|
|
246
|
+
"default": null,
|
|
247
|
+
"description": "The order of the columns and the rows. Default: as they first appear.",
|
|
248
|
+
"required": false
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "xFormat",
|
|
252
|
+
"type": "CategoryFormat",
|
|
253
|
+
"default": null,
|
|
254
|
+
"description": "How the columns are written.",
|
|
255
|
+
"required": false
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "xLabel",
|
|
259
|
+
"type": "string",
|
|
260
|
+
"default": null,
|
|
261
|
+
"description": "The headers of the data table.",
|
|
262
|
+
"required": false
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"name": "yCategories",
|
|
266
|
+
"type": "readonly unknown[]",
|
|
267
|
+
"default": null,
|
|
268
|
+
"description": "The order of the rows. Default: as they first appear.",
|
|
269
|
+
"required": false
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "yFormat",
|
|
273
|
+
"type": "CategoryFormat",
|
|
274
|
+
"default": null,
|
|
275
|
+
"description": "How the rows are written.",
|
|
276
|
+
"required": false
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "yLabel",
|
|
280
|
+
"type": "string",
|
|
281
|
+
"default": null,
|
|
282
|
+
"description": "The header of the rows in the data table.",
|
|
283
|
+
"required": false
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"examples": [
|
|
289
|
+
{
|
|
290
|
+
"name": "upload-activity",
|
|
291
|
+
"title": "Activity by hour",
|
|
292
|
+
"description": "Uploads by weekday and hour of the day: when a community is awake.",
|
|
293
|
+
"path": "examples/heatmap/upload-activity.tsx",
|
|
294
|
+
"module": "@krizaka/charts/registry/examples/heatmap/upload-activity",
|
|
295
|
+
"code": "import { Heatmap } from \"@krizaka/charts/heatmap\";\n\nconst days = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\nconst hours = [\"00\", \"03\", \"06\", \"09\", \"12\", \"15\", \"18\", \"21\"];\n// A deterministic week: evenings and weekends are busier.\nconst cells = days.flatMap((day, d) =>\n hours.map((hour, h) => ({ day, hour: `${hour}:00`, uploads: Math.round((h >= 5 ? 40 : h >= 3 ? 22 : 6) * (d >= 5 ? 1.6 : 1) + ((d * 7 + h * 3) % 11)) })),\n);\n\nexport default function UploadActivity() {\n return (\n <Heatmap\n title=\"Uploads by day and hour\"\n description=\"Last 4 weeks, Montréal time\"\n data={cells}\n x=\"hour\"\n y=\"day\"\n value=\"uploads\"\n yCategories={days}\n xLabel=\"Hour\"\n yLabel=\"Day\"\n format=\"integer\"\n />\n );\n}\n"
|
|
296
|
+
}
|
|
297
|
+
]
|
|
298
|
+
},
|
|
299
|
+
"native": null,
|
|
300
|
+
"files": [],
|
|
301
|
+
"dependencies": [
|
|
302
|
+
"@krizaka/intl@workspace:^",
|
|
303
|
+
"d3-geo@^3.1.1",
|
|
304
|
+
"echarts@^6.1.0",
|
|
305
|
+
"topojson-client@^3.1.0"
|
|
306
|
+
],
|
|
307
|
+
"registryDependencies": [],
|
|
308
|
+
"demo": {
|
|
309
|
+
"path": "examples/heatmap/upload-activity.tsx",
|
|
310
|
+
"content": "import { Heatmap } from \"@krizaka/charts/heatmap\";\n\nconst days = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\nconst hours = [\"00\", \"03\", \"06\", \"09\", \"12\", \"15\", \"18\", \"21\"];\n// A deterministic week: evenings and weekends are busier.\nconst cells = days.flatMap((day, d) =>\n hours.map((hour, h) => ({ day, hour: `${hour}:00`, uploads: Math.round((h >= 5 ? 40 : h >= 3 ? 22 : 6) * (d >= 5 ? 1.6 : 1) + ((d * 7 + h * 3) % 11)) })),\n);\n\nexport default function UploadActivity() {\n return (\n <Heatmap\n title=\"Uploads by day and hour\"\n description=\"Last 4 weeks, Montréal time\"\n data={cells}\n x=\"hour\"\n y=\"day\"\n value=\"uploads\"\n yCategories={days}\n xLabel=\"Hour\"\n yLabel=\"Day\"\n format=\"integer\"\n />\n );\n}\n"
|
|
311
|
+
},
|
|
312
|
+
"props": [
|
|
313
|
+
{
|
|
314
|
+
"component": "Heatmap",
|
|
315
|
+
"description": "",
|
|
316
|
+
"props": [
|
|
317
|
+
{
|
|
318
|
+
"name": "data",
|
|
319
|
+
"type": "readonly T[]",
|
|
320
|
+
"default": null,
|
|
321
|
+
"description": "One row per cell.",
|
|
322
|
+
"required": true
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "title",
|
|
326
|
+
"type": "string",
|
|
327
|
+
"default": null,
|
|
328
|
+
"description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
|
|
329
|
+
"required": true
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"name": "value",
|
|
333
|
+
"type": "string | ((datum: T, index: number) => number)",
|
|
334
|
+
"default": null,
|
|
335
|
+
"description": "The field of the cell's value.",
|
|
336
|
+
"required": true
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "x",
|
|
340
|
+
"type": "string | ((datum: T, index: number) => unknown)",
|
|
341
|
+
"default": null,
|
|
342
|
+
"description": "The field of the column (an hour, a day) and of the row (a weekday, a team).",
|
|
343
|
+
"required": true
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"name": "y",
|
|
347
|
+
"type": "string | ((datum: T, index: number) => unknown)",
|
|
348
|
+
"default": null,
|
|
349
|
+
"description": "The field of the row (a weekday, a team).",
|
|
350
|
+
"required": true
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"name": "brand",
|
|
354
|
+
"type": "BrandId",
|
|
355
|
+
"default": null,
|
|
356
|
+
"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`).",
|
|
357
|
+
"required": false
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"name": "className",
|
|
361
|
+
"type": "string",
|
|
362
|
+
"default": null,
|
|
363
|
+
"description": "A class on the figure (layout: margins, grid placement).",
|
|
364
|
+
"required": false
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"name": "dataTable",
|
|
368
|
+
"type": "boolean",
|
|
369
|
+
"default": null,
|
|
370
|
+
"description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
|
|
371
|
+
"required": false
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"name": "description",
|
|
375
|
+
"type": "ReactNode",
|
|
376
|
+
"default": null,
|
|
377
|
+
"description": "A sentence under the title: the period, the unit, the source.",
|
|
378
|
+
"required": false
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"name": "empty",
|
|
382
|
+
"type": "ReactNode",
|
|
383
|
+
"default": null,
|
|
384
|
+
"description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
|
|
385
|
+
"required": false
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "error",
|
|
389
|
+
"type": "ReactNode",
|
|
390
|
+
"default": null,
|
|
391
|
+
"description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
|
|
392
|
+
"required": false
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"name": "exportable",
|
|
396
|
+
"type": "boolean | readonly ExportFormat[]",
|
|
397
|
+
"default": null,
|
|
398
|
+
"description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
|
|
399
|
+
"required": false
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "format",
|
|
403
|
+
"type": "ValueFormat",
|
|
404
|
+
"default": null,
|
|
405
|
+
"description": "How the values, the columns and the rows are written.",
|
|
406
|
+
"required": false
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "height",
|
|
410
|
+
"type": "number",
|
|
411
|
+
"default": null,
|
|
412
|
+
"description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
|
|
413
|
+
"required": false
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "hideTitle",
|
|
417
|
+
"type": "boolean",
|
|
418
|
+
"default": null,
|
|
419
|
+
"description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
|
|
420
|
+
"required": false
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "id",
|
|
424
|
+
"type": "string",
|
|
425
|
+
"default": null,
|
|
426
|
+
"description": "The id of the figure.",
|
|
427
|
+
"required": false
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "labels",
|
|
431
|
+
"type": "ChartLabelsInput",
|
|
432
|
+
"default": null,
|
|
433
|
+
"description": "The words, translated: the buttons, the states, the written summary.",
|
|
434
|
+
"required": false
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"name": "live",
|
|
438
|
+
"type": "boolean",
|
|
439
|
+
"default": null,
|
|
440
|
+
"description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
|
|
441
|
+
"required": false
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"name": "loading",
|
|
445
|
+
"type": "boolean",
|
|
446
|
+
"default": null,
|
|
447
|
+
"description": "The data is on its way: a skeleton of the chart, announced once.",
|
|
448
|
+
"required": false
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"name": "locale",
|
|
452
|
+
"type": "Locale",
|
|
453
|
+
"default": null,
|
|
454
|
+
"description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
|
|
455
|
+
"required": false
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "renderer",
|
|
459
|
+
"type": "Renderer",
|
|
460
|
+
"default": null,
|
|
461
|
+
"description": "`svg` (default): sharp, exportable as SVG. `canvas`: for tens of thousands of marks.",
|
|
462
|
+
"required": false
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"name": "style",
|
|
466
|
+
"type": "CSSProperties",
|
|
467
|
+
"default": null,
|
|
468
|
+
"description": "Inline style on the figure (layout only: colours come from the tokens).",
|
|
469
|
+
"required": false
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"name": "summary",
|
|
473
|
+
"type": "\"hidden\" | \"visible\"",
|
|
474
|
+
"default": null,
|
|
475
|
+
"description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
|
|
476
|
+
"required": false
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "summaryText",
|
|
480
|
+
"type": "string",
|
|
481
|
+
"default": null,
|
|
482
|
+
"description": "Your own summary instead of the generated one (still read first by screen readers).",
|
|
483
|
+
"required": false
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "xCategories",
|
|
487
|
+
"type": "readonly unknown[]",
|
|
488
|
+
"default": null,
|
|
489
|
+
"description": "The order of the columns and the rows. Default: as they first appear.",
|
|
490
|
+
"required": false
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "xFormat",
|
|
494
|
+
"type": "CategoryFormat",
|
|
495
|
+
"default": null,
|
|
496
|
+
"description": "How the columns are written.",
|
|
497
|
+
"required": false
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "xLabel",
|
|
501
|
+
"type": "string",
|
|
502
|
+
"default": null,
|
|
503
|
+
"description": "The headers of the data table.",
|
|
504
|
+
"required": false
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "yCategories",
|
|
508
|
+
"type": "readonly unknown[]",
|
|
509
|
+
"default": null,
|
|
510
|
+
"description": "The order of the rows. Default: as they first appear.",
|
|
511
|
+
"required": false
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "yFormat",
|
|
515
|
+
"type": "CategoryFormat",
|
|
516
|
+
"default": null,
|
|
517
|
+
"description": "How the rows are written.",
|
|
518
|
+
"required": false
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "yLabel",
|
|
522
|
+
"type": "string",
|
|
523
|
+
"default": null,
|
|
524
|
+
"description": "The header of the rows in the data table.",
|
|
525
|
+
"required": false
|
|
526
|
+
}
|
|
527
|
+
]
|
|
528
|
+
}
|
|
529
|
+
]
|
|
530
|
+
}
|