@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.
Files changed (273) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +47 -2
  3. package/dist/bar.d.ts +17 -0
  4. package/dist/bar.js +16 -0
  5. package/dist/bar.js.map +1 -0
  6. package/dist/candlestick-IG626XL4.js +13 -0
  7. package/dist/candlestick-IG626XL4.js.map +1 -0
  8. package/dist/candlestick.d.ts +42 -0
  9. package/dist/candlestick.js +13 -0
  10. package/dist/candlestick.js.map +1 -0
  11. package/dist/canvas-4MSYDVFO.js +14 -0
  12. package/dist/canvas-4MSYDVFO.js.map +1 -0
  13. package/dist/cartesian-BRhNQ3ib.d.ts +34 -0
  14. package/dist/chart.d.ts +58 -0
  15. package/dist/chart.js +11 -0
  16. package/dist/chart.js.map +1 -0
  17. package/dist/chunk-3CJHBJXA.js +186 -0
  18. package/dist/chunk-3CJHBJXA.js.map +1 -0
  19. package/dist/chunk-6FINSUOS.js +49 -0
  20. package/dist/chunk-6FINSUOS.js.map +1 -0
  21. package/dist/chunk-7CSAGFBW.js +166 -0
  22. package/dist/chunk-7CSAGFBW.js.map +1 -0
  23. package/dist/chunk-7TIFCK5E.js +103 -0
  24. package/dist/chunk-7TIFCK5E.js.map +1 -0
  25. package/dist/chunk-AHQXJSAQ.js +38 -0
  26. package/dist/chunk-AHQXJSAQ.js.map +1 -0
  27. package/dist/chunk-ANUCSRUN.js +43 -0
  28. package/dist/chunk-ANUCSRUN.js.map +1 -0
  29. package/dist/chunk-BISL7DYW.js +66 -0
  30. package/dist/chunk-BISL7DYW.js.map +1 -0
  31. package/dist/chunk-BZ5CQFPH.js +19 -0
  32. package/dist/chunk-BZ5CQFPH.js.map +1 -0
  33. package/dist/chunk-DWJPPEMC.js +455 -0
  34. package/dist/chunk-DWJPPEMC.js.map +1 -0
  35. package/dist/chunk-DZB6HEVO.js +73 -0
  36. package/dist/chunk-DZB6HEVO.js.map +1 -0
  37. package/dist/chunk-EK3Z647J.js +133 -0
  38. package/dist/chunk-EK3Z647J.js.map +1 -0
  39. package/dist/chunk-I5QUZVU2.js +234 -0
  40. package/dist/chunk-I5QUZVU2.js.map +1 -0
  41. package/dist/chunk-OB5EFDDH.js +118 -0
  42. package/dist/chunk-OB5EFDDH.js.map +1 -0
  43. package/dist/chunk-OER6ETT4.js +155 -0
  44. package/dist/chunk-OER6ETT4.js.map +1 -0
  45. package/dist/chunk-PTSB3H5Q.js +205 -0
  46. package/dist/chunk-PTSB3H5Q.js.map +1 -0
  47. package/dist/chunk-TPJDOB7R.js +15 -0
  48. package/dist/chunk-TPJDOB7R.js.map +1 -0
  49. package/dist/chunk-UNK4MJVG.js +378 -0
  50. package/dist/chunk-UNK4MJVG.js.map +1 -0
  51. package/dist/chunk-VKO2OYYM.js +88 -0
  52. package/dist/chunk-VKO2OYYM.js.map +1 -0
  53. package/dist/chunk-VKTZD7UT.js +107 -0
  54. package/dist/chunk-VKTZD7UT.js.map +1 -0
  55. package/dist/chunk-W5FX4TU3.js +102 -0
  56. package/dist/chunk-W5FX4TU3.js.map +1 -0
  57. package/dist/chunk-WBH2QU77.js +178 -0
  58. package/dist/chunk-WBH2QU77.js.map +1 -0
  59. package/dist/chunk-WIRCIOLH.js +145 -0
  60. package/dist/chunk-WIRCIOLH.js.map +1 -0
  61. package/dist/chunk-XAJ3KCC4.js +116 -0
  62. package/dist/chunk-XAJ3KCC4.js.map +1 -0
  63. package/dist/chunk-XC6BQ3RN.js +92 -0
  64. package/dist/chunk-XC6BQ3RN.js.map +1 -0
  65. package/dist/chunk-XLLYNNC6.js +89 -0
  66. package/dist/chunk-XLLYNNC6.js.map +1 -0
  67. package/dist/chunk-XR4ZJDOV.js +15 -0
  68. package/dist/chunk-XR4ZJDOV.js.map +1 -0
  69. package/dist/context-BgYUymEO.d.ts +163 -0
  70. package/dist/frame-I7_xYGy5.d.ts +45 -0
  71. package/dist/full-S2MBPEEP.js +11 -0
  72. package/dist/full-S2MBPEEP.js.map +1 -0
  73. package/dist/funnel-QU5ZPC52.js +13 -0
  74. package/dist/funnel-QU5ZPC52.js.map +1 -0
  75. package/dist/funnel.d.ts +26 -0
  76. package/dist/funnel.js +13 -0
  77. package/dist/funnel.js.map +1 -0
  78. package/dist/gauge.d.ts +38 -0
  79. package/dist/gauge.js +12 -0
  80. package/dist/gauge.js.map +1 -0
  81. package/dist/geo.d.ts +37 -0
  82. package/dist/geo.js +13 -0
  83. package/dist/geo.js.map +1 -0
  84. package/dist/globe.d.ts +36 -0
  85. package/dist/globe.js +12 -0
  86. package/dist/globe.js.map +1 -0
  87. package/dist/heatmap-JWQOKUGM.js +13 -0
  88. package/dist/heatmap-JWQOKUGM.js.map +1 -0
  89. package/dist/heatmap.d.ts +47 -0
  90. package/dist/heatmap.js +15 -0
  91. package/dist/heatmap.js.map +1 -0
  92. package/dist/host-_F8RgiIz.d.ts +15 -0
  93. package/dist/index.d.ts +22 -0
  94. package/dist/index.js +101 -0
  95. package/dist/index.js.map +1 -0
  96. package/dist/line.d.ts +25 -0
  97. package/dist/line.js +18 -0
  98. package/dist/line.js.map +1 -0
  99. package/dist/native.d.ts +300 -0
  100. package/dist/native.js +875 -0
  101. package/dist/native.js.map +1 -0
  102. package/dist/pie.d.ts +37 -0
  103. package/dist/pie.js +16 -0
  104. package/dist/pie.js.map +1 -0
  105. package/dist/provider.d.ts +73 -0
  106. package/dist/provider.js +24 -0
  107. package/dist/provider.js.map +1 -0
  108. package/dist/radar-75GRJ2IK.js +13 -0
  109. package/dist/radar-75GRJ2IK.js.map +1 -0
  110. package/dist/radar.d.ts +22 -0
  111. package/dist/radar.js +13 -0
  112. package/dist/radar.js.map +1 -0
  113. package/dist/sankey-XQTX2EG6.js +13 -0
  114. package/dist/sankey-XQTX2EG6.js.map +1 -0
  115. package/dist/sankey.d.ts +28 -0
  116. package/dist/sankey.js +13 -0
  117. package/dist/sankey.js.map +1 -0
  118. package/dist/scatter-XSNG4OKD.js +13 -0
  119. package/dist/scatter-XSNG4OKD.js.map +1 -0
  120. package/dist/scatter.d.ts +41 -0
  121. package/dist/scatter.js +15 -0
  122. package/dist/scatter.js.map +1 -0
  123. package/dist/sparkline.d.ts +26 -0
  124. package/dist/sparkline.js +15 -0
  125. package/dist/sparkline.js.map +1 -0
  126. package/dist/svg-BJUHYX3B.js +14 -0
  127. package/dist/svg-BJUHYX3B.js.map +1 -0
  128. package/dist/treemap-OMGGGB5U.js +13 -0
  129. package/dist/treemap-OMGGGB5U.js.map +1 -0
  130. package/dist/treemap.d.ts +24 -0
  131. package/dist/treemap.js +14 -0
  132. package/dist/treemap.js.map +1 -0
  133. package/dist/world-110m-DVFWXS42.js +18 -0
  134. package/dist/world-110m-DVFWXS42.js.map +1 -0
  135. package/package.json +518 -3
  136. package/registry/area-chart.json +784 -0
  137. package/registry/bar-chart.json +783 -0
  138. package/registry/calendar-heatmap.json +459 -0
  139. package/registry/candlestick.json +552 -0
  140. package/registry/chart.json +440 -0
  141. package/registry/charts-provider.json +190 -0
  142. package/registry/examples/area-chart/credits-usage.d.ts +4 -0
  143. package/registry/examples/area-chart/credits-usage.js +38 -0
  144. package/registry/examples/area-chart/credits-usage.tsx +32 -0
  145. package/registry/examples/area-chart/native/credits-usage.d.ts +4 -0
  146. package/registry/examples/area-chart/native/credits-usage.dark.png +0 -0
  147. package/registry/examples/area-chart/native/credits-usage.js +33 -0
  148. package/registry/examples/area-chart/native/credits-usage.light.png +0 -0
  149. package/registry/examples/area-chart/native/credits-usage.tsx +27 -0
  150. package/registry/examples/area-chart/storage.d.ts +4 -0
  151. package/registry/examples/area-chart/storage.js +27 -0
  152. package/registry/examples/area-chart/storage.tsx +21 -0
  153. package/registry/examples/bar-chart/jobs-by-status.d.ts +4 -0
  154. package/registry/examples/bar-chart/jobs-by-status.js +37 -0
  155. package/registry/examples/bar-chart/jobs-by-status.tsx +31 -0
  156. package/registry/examples/bar-chart/native/jobs-by-status.d.ts +4 -0
  157. package/registry/examples/bar-chart/native/jobs-by-status.dark.png +0 -0
  158. package/registry/examples/bar-chart/native/jobs-by-status.js +32 -0
  159. package/registry/examples/bar-chart/native/jobs-by-status.light.png +0 -0
  160. package/registry/examples/bar-chart/native/jobs-by-status.tsx +26 -0
  161. package/registry/examples/bar-chart/plans-by-quarter.d.ts +4 -0
  162. package/registry/examples/bar-chart/plans-by-quarter.js +31 -0
  163. package/registry/examples/bar-chart/plans-by-quarter.tsx +26 -0
  164. package/registry/examples/bar-chart/top-supporters.d.ts +4 -0
  165. package/registry/examples/bar-chart/top-supporters.js +32 -0
  166. package/registry/examples/bar-chart/top-supporters.tsx +27 -0
  167. package/registry/examples/calendar-heatmap/publishing.d.ts +4 -0
  168. package/registry/examples/calendar-heatmap/publishing.js +28 -0
  169. package/registry/examples/calendar-heatmap/publishing.tsx +23 -0
  170. package/registry/examples/candlestick/auction-bids.d.ts +4 -0
  171. package/registry/examples/candlestick/auction-bids.js +37 -0
  172. package/registry/examples/candlestick/auction-bids.tsx +32 -0
  173. package/registry/examples/chart/polar-uploads.d.ts +4 -0
  174. package/registry/examples/chart/polar-uploads.js +34 -0
  175. package/registry/examples/chart/polar-uploads.tsx +30 -0
  176. package/registry/examples/charts-provider/french-orazaka.d.ts +4 -0
  177. package/registry/examples/charts-provider/french-orazaka.js +26 -0
  178. package/registry/examples/charts-provider/french-orazaka.tsx +22 -0
  179. package/registry/examples/charts-provider/native/french-orazaka.d.ts +4 -0
  180. package/registry/examples/charts-provider/native/french-orazaka.dark.png +0 -0
  181. package/registry/examples/charts-provider/native/french-orazaka.js +17 -0
  182. package/registry/examples/charts-provider/native/french-orazaka.light.png +0 -0
  183. package/registry/examples/charts-provider/native/french-orazaka.tsx +17 -0
  184. package/registry/examples/funnel/signup.d.ts +4 -0
  185. package/registry/examples/funnel/signup.js +30 -0
  186. package/registry/examples/funnel/signup.tsx +24 -0
  187. package/registry/examples/gauge/challenge-goal.d.ts +4 -0
  188. package/registry/examples/gauge/challenge-goal.js +24 -0
  189. package/registry/examples/gauge/challenge-goal.tsx +18 -0
  190. package/registry/examples/gauge/credits-quota.d.ts +4 -0
  191. package/registry/examples/gauge/credits-quota.js +26 -0
  192. package/registry/examples/gauge/credits-quota.tsx +19 -0
  193. package/registry/examples/gauge/native/credits-quota.d.ts +4 -0
  194. package/registry/examples/gauge/native/credits-quota.dark.png +0 -0
  195. package/registry/examples/gauge/native/credits-quota.js +25 -0
  196. package/registry/examples/gauge/native/credits-quota.light.png +0 -0
  197. package/registry/examples/gauge/native/credits-quota.tsx +18 -0
  198. package/registry/examples/geo-map/viewers.d.ts +4 -0
  199. package/registry/examples/geo-map/viewers.js +43 -0
  200. package/registry/examples/geo-map/viewers.tsx +29 -0
  201. package/registry/examples/globe/deployment-regions.d.ts +4 -0
  202. package/registry/examples/globe/deployment-regions.js +36 -0
  203. package/registry/examples/globe/deployment-regions.tsx +30 -0
  204. package/registry/examples/heatmap/upload-activity.d.ts +4 -0
  205. package/registry/examples/heatmap/upload-activity.js +30 -0
  206. package/registry/examples/heatmap/upload-activity.tsx +25 -0
  207. package/registry/examples/line-chart/creator-earnings.d.ts +4 -0
  208. package/registry/examples/line-chart/creator-earnings.js +35 -0
  209. package/registry/examples/line-chart/creator-earnings.tsx +30 -0
  210. package/registry/examples/line-chart/forecast.d.ts +4 -0
  211. package/registry/examples/line-chart/forecast.js +36 -0
  212. package/registry/examples/line-chart/forecast.tsx +30 -0
  213. package/registry/examples/line-chart/live-jobs.d.ts +4 -0
  214. package/registry/examples/line-chart/live-jobs.js +21 -0
  215. package/registry/examples/line-chart/live-jobs.tsx +23 -0
  216. package/registry/examples/line-chart/native/creator-earnings.d.ts +4 -0
  217. package/registry/examples/line-chart/native/creator-earnings.dark.png +0 -0
  218. package/registry/examples/line-chart/native/creator-earnings.js +32 -0
  219. package/registry/examples/line-chart/native/creator-earnings.light.png +0 -0
  220. package/registry/examples/line-chart/native/creator-earnings.tsx +26 -0
  221. package/registry/examples/line-chart/states.d.ts +4 -0
  222. package/registry/examples/line-chart/states.js +16 -0
  223. package/registry/examples/line-chart/states.tsx +13 -0
  224. package/registry/examples/pie-chart/credit-spend.d.ts +4 -0
  225. package/registry/examples/pie-chart/credit-spend.js +30 -0
  226. package/registry/examples/pie-chart/credit-spend.tsx +24 -0
  227. package/registry/examples/pie-chart/native/credit-spend.d.ts +4 -0
  228. package/registry/examples/pie-chart/native/credit-spend.dark.png +0 -0
  229. package/registry/examples/pie-chart/native/credit-spend.js +17 -0
  230. package/registry/examples/pie-chart/native/credit-spend.light.png +0 -0
  231. package/registry/examples/pie-chart/native/credit-spend.tsx +12 -0
  232. package/registry/examples/pie-chart/storage-by-kind.d.ts +4 -0
  233. package/registry/examples/pie-chart/storage-by-kind.js +31 -0
  234. package/registry/examples/pie-chart/storage-by-kind.tsx +26 -0
  235. package/registry/examples/radar-chart/model-comparison.d.ts +4 -0
  236. package/registry/examples/radar-chart/model-comparison.js +33 -0
  237. package/registry/examples/radar-chart/model-comparison.tsx +28 -0
  238. package/registry/examples/sankey/credit-flow.d.ts +4 -0
  239. package/registry/examples/sankey/credit-flow.js +37 -0
  240. package/registry/examples/sankey/credit-flow.tsx +32 -0
  241. package/registry/examples/scatter-chart/watch-time.d.ts +4 -0
  242. package/registry/examples/scatter-chart/watch-time.js +36 -0
  243. package/registry/examples/scatter-chart/watch-time.tsx +31 -0
  244. package/registry/examples/sparkline/bars.d.ts +4 -0
  245. package/registry/examples/sparkline/bars.js +12 -0
  246. package/registry/examples/sparkline/bars.tsx +7 -0
  247. package/registry/examples/sparkline/native/stat-trend.d.ts +4 -0
  248. package/registry/examples/sparkline/native/stat-trend.dark.png +0 -0
  249. package/registry/examples/sparkline/native/stat-trend.js +12 -0
  250. package/registry/examples/sparkline/native/stat-trend.light.png +0 -0
  251. package/registry/examples/sparkline/native/stat-trend.tsx +7 -0
  252. package/registry/examples/sparkline/stat-trend.d.ts +4 -0
  253. package/registry/examples/sparkline/stat-trend.js +18 -0
  254. package/registry/examples/sparkline/stat-trend.tsx +15 -0
  255. package/registry/examples/sparkline/table-rows.d.ts +4 -0
  256. package/registry/examples/sparkline/table-rows.js +23 -0
  257. package/registry/examples/sparkline/table-rows.tsx +26 -0
  258. package/registry/examples/treemap/storage.d.ts +4 -0
  259. package/registry/examples/treemap/storage.js +17 -0
  260. package/registry/examples/treemap/storage.tsx +13 -0
  261. package/registry/funnel.json +486 -0
  262. package/registry/gauge.json +599 -0
  263. package/registry/geo-map.json +483 -0
  264. package/registry/globe.json +468 -0
  265. package/registry/heatmap.json +530 -0
  266. package/registry/index.json +420 -0
  267. package/registry/line-chart.json +792 -0
  268. package/registry/pie-chart.json +1287 -0
  269. package/registry/radar-chart.json +458 -0
  270. package/registry/sankey.json +502 -0
  271. package/registry/scatter-chart.json +558 -0
  272. package/registry/sparkline.json +562 -0
  273. package/registry/treemap.json +431 -0
@@ -0,0 +1,440 @@
1
+ {
2
+ "name": "chart",
3
+ "package": "@krizaka/charts",
4
+ "type": "chart",
5
+ "title": "Chart (ECharts option)",
6
+ "summary": "Any ECharts option on the Krizaka frame: the theme resolved from the tokens, the lazy engine, the states, the table, the keyboard, the export.",
7
+ "description": "Any ECharts option on the Krizaka frame: the theme resolved from the tokens, the lazy engine, the states, the table, the keyboard, the export.",
8
+ "status": "beta",
9
+ "category": "charts",
10
+ "platforms": "web",
11
+ "engine": "echarts",
12
+ "whenToUse": [
13
+ "A chart type the typed components do not cover: polar bars, a sunburst, a parallel axis, a graph."
14
+ ],
15
+ "whenNotToUse": [
16
+ {
17
+ "when": "A type the package has: its props say more and its summary is written for you.",
18
+ "use": "line-chart"
19
+ }
20
+ ],
21
+ "bestPractices": [
22
+ "Pass `modules` with only what the option needs (`use([...])` in a module of yours): the default loads all of ECharts.",
23
+ "Write `summaryText` and `table`: an option is opaque, the alternative is yours to give.",
24
+ "Read the colours from the theme function (`theme.palette`, `theme.text2`), never hard-coded."
25
+ ],
26
+ "accessibility": {
27
+ "keyboard": [
28
+ {
29
+ "keys": "Tab",
30
+ "action": "Moves the focus to the plot (one tab stop), then to the data and export buttons."
31
+ },
32
+ {
33
+ "keys": "Arrow keys",
34
+ "action": "Walk the items one by one: each is announced and highlighted, its tooltip shown."
35
+ },
36
+ {
37
+ "keys": "Home / End",
38
+ "action": "Jump to the first or the last item."
39
+ },
40
+ {
41
+ "keys": "Esc",
42
+ "action": "Hides the tooltip and clears the highlight."
43
+ }
44
+ ],
45
+ "notes": [
46
+ "The plot is a group named by the title and described by `summaryText`.",
47
+ "Give `items` for the arrow keys to walk; without them the plot is not a tab stop.",
48
+ "`table` is the data table, always in the page for assistive technology."
49
+ ]
50
+ },
51
+ "related": [
52
+ "charts-provider",
53
+ "radar-chart",
54
+ "heatmap"
55
+ ],
56
+ "source": "packages/charts/src/meta/chart.ts",
57
+ "install": {
58
+ "web": "npm install @krizaka/charts",
59
+ "native": "npx expo install react-native-svg\nnpm install @krizaka/charts"
60
+ },
61
+ "web": {
62
+ "entry": "@krizaka/charts/chart",
63
+ "import": "import { Chart } from \"@krizaka/charts/chart\";",
64
+ "props": [
65
+ {
66
+ "component": "Chart",
67
+ "description": "Any ECharts option, themed and framed like the typed charts. Memoise `option` when it is a function.",
68
+ "props": [
69
+ {
70
+ "name": "option",
71
+ "type": "ECBasicOption | ((theme: ResolvedTheme, size: { width: number; height: number; }) => ECBasicOption)",
72
+ "default": null,
73
+ "description": "The ECharts option, or a function of the resolved theme (colours as plain strings, the palette, the ramp).",
74
+ "required": true
75
+ },
76
+ {
77
+ "name": "summaryText",
78
+ "type": "string",
79
+ "default": null,
80
+ "description": "The written summary: an option says nothing on its own.",
81
+ "required": true
82
+ },
83
+ {
84
+ "name": "table",
85
+ "type": "TableModel",
86
+ "default": null,
87
+ "description": "The data as a table: the alternative of every chart.",
88
+ "required": true
89
+ },
90
+ {
91
+ "name": "title",
92
+ "type": "string",
93
+ "default": null,
94
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
95
+ "required": true
96
+ },
97
+ {
98
+ "name": "brand",
99
+ "type": "BrandId",
100
+ "default": null,
101
+ "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`).",
102
+ "required": false
103
+ },
104
+ {
105
+ "name": "className",
106
+ "type": "string",
107
+ "default": null,
108
+ "description": "A class on the figure (layout: margins, grid placement).",
109
+ "required": false
110
+ },
111
+ {
112
+ "name": "dataTable",
113
+ "type": "boolean",
114
+ "default": null,
115
+ "description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
116
+ "required": false
117
+ },
118
+ {
119
+ "name": "description",
120
+ "type": "ReactNode",
121
+ "default": null,
122
+ "description": "A sentence under the title: the period, the unit, the source.",
123
+ "required": false
124
+ },
125
+ {
126
+ "name": "empty",
127
+ "type": "ReactNode",
128
+ "default": null,
129
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
130
+ "required": false
131
+ },
132
+ {
133
+ "name": "error",
134
+ "type": "ReactNode",
135
+ "default": null,
136
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
137
+ "required": false
138
+ },
139
+ {
140
+ "name": "exportable",
141
+ "type": "boolean | readonly ExportFormat[]",
142
+ "default": null,
143
+ "description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
144
+ "required": false
145
+ },
146
+ {
147
+ "name": "height",
148
+ "type": "number",
149
+ "default": null,
150
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
151
+ "required": false
152
+ },
153
+ {
154
+ "name": "hideTitle",
155
+ "type": "boolean",
156
+ "default": null,
157
+ "description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
158
+ "required": false
159
+ },
160
+ {
161
+ "name": "id",
162
+ "type": "string",
163
+ "default": null,
164
+ "description": "The id of the figure.",
165
+ "required": false
166
+ },
167
+ {
168
+ "name": "items",
169
+ "type": "readonly WalkItem[]",
170
+ "default": null,
171
+ "description": "What the arrow keys walk (series and data indexes, and what each one says).",
172
+ "required": false
173
+ },
174
+ {
175
+ "name": "labels",
176
+ "type": "ChartLabelsInput",
177
+ "default": null,
178
+ "description": "The words, translated: the buttons, the states, the written summary.",
179
+ "required": false
180
+ },
181
+ {
182
+ "name": "live",
183
+ "type": "boolean",
184
+ "default": null,
185
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
186
+ "required": false
187
+ },
188
+ {
189
+ "name": "loading",
190
+ "type": "boolean",
191
+ "default": null,
192
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
193
+ "required": false
194
+ },
195
+ {
196
+ "name": "locale",
197
+ "type": "Locale",
198
+ "default": null,
199
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
200
+ "required": false
201
+ },
202
+ {
203
+ "name": "modules",
204
+ "type": "(() => Promise<unknown>)",
205
+ "default": "() => import(\"../echarts/engines/full\")",
206
+ "description": "Registers what the option needs, from `echarts/charts` and `echarts/components` (tree-shaken):\n`() => import(\"./my-echarts\")` where that module calls `use([...])`. Default: all of ECharts (~380 kB gzip).",
207
+ "required": false
208
+ },
209
+ {
210
+ "name": "onItem",
211
+ "type": "((item: { seriesIndex: number; dataIndex: number; }) => void)",
212
+ "default": null,
213
+ "description": "A click (or Enter) on a data item.",
214
+ "required": false
215
+ },
216
+ {
217
+ "name": "renderer",
218
+ "type": "Renderer",
219
+ "default": null,
220
+ "description": "`svg` (default): sharp, exportable as SVG. `canvas`: for tens of thousands of marks.",
221
+ "required": false
222
+ },
223
+ {
224
+ "name": "style",
225
+ "type": "CSSProperties",
226
+ "default": null,
227
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
228
+ "required": false
229
+ },
230
+ {
231
+ "name": "summary",
232
+ "type": "\"hidden\" | \"visible\"",
233
+ "default": null,
234
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
235
+ "required": false
236
+ }
237
+ ]
238
+ }
239
+ ],
240
+ "examples": [
241
+ {
242
+ "name": "polar-uploads",
243
+ "title": "Polar bars",
244
+ "description": "Uploads per hour on a clock face: a type the package does not ship, with only its modules loaded.",
245
+ "path": "examples/chart/polar-uploads.tsx",
246
+ "module": "@krizaka/charts/registry/examples/chart/polar-uploads",
247
+ "code": "import { Chart } from \"@krizaka/charts/chart\";\n\nconst uploads = [3, 2, 1, 1, 2, 4, 9, 18, 26, 31, 34, 37, 41, 39, 36, 38, 44, 52, 58, 61, 49, 33, 17, 8];\nconst hours = uploads.map((_, h) => `${String(h).padStart(2, \"0\")}:00`);\n\n// Only what the option needs: polar bars and the tooltip (not all of ECharts).\nconst modules = async () => {\n const [{ use: register }, { BarChart }, { PolarComponent, TooltipComponent }] = await Promise.all([import(\"echarts/core\"), import(\"echarts/charts\"), import(\"echarts/components\")]);\n register([BarChart, PolarComponent, TooltipComponent]);\n};\n\nexport default function PolarUploads() {\n return (\n <Chart\n title=\"Uploads by hour of the day\"\n modules={modules}\n option={(theme) => ({\n polar: { radius: [\"18%\", \"80%\"] },\n angleAxis: { type: \"category\", data: hours, axisLabel: { color: theme.text2, interval: 2 }, axisLine: { lineStyle: { color: theme.axis } } },\n radiusAxis: { axisLabel: { show: false }, splitLine: { lineStyle: { color: theme.grid } }, axisLine: { show: false } },\n tooltip: { trigger: \"item\" },\n series: [{ type: \"bar\", coordinateSystem: \"polar\", data: uploads, itemStyle: { color: theme.palette[0], borderRadius: 3 } }],\n })}\n summaryText={`Uploads by hour: quietest at 02:00 (1), busiest at 19:00 (61).`}\n table={{ columns: [\"Hour\", \"Uploads\"], rows: hours.map((h, i) => [h, String(uploads[i])]) }}\n items={uploads.map((u, i) => ({ seriesIndex: 0, dataIndex: i, text: `${hours[i]}: ${u}` }))}\n height={340}\n />\n );\n}\n"
248
+ }
249
+ ]
250
+ },
251
+ "native": null,
252
+ "files": [],
253
+ "dependencies": [
254
+ "@krizaka/intl@workspace:^",
255
+ "d3-geo@^3.1.1",
256
+ "echarts@^6.1.0",
257
+ "topojson-client@^3.1.0"
258
+ ],
259
+ "registryDependencies": [],
260
+ "demo": {
261
+ "path": "examples/chart/polar-uploads.tsx",
262
+ "content": "import { Chart } from \"@krizaka/charts/chart\";\n\nconst uploads = [3, 2, 1, 1, 2, 4, 9, 18, 26, 31, 34, 37, 41, 39, 36, 38, 44, 52, 58, 61, 49, 33, 17, 8];\nconst hours = uploads.map((_, h) => `${String(h).padStart(2, \"0\")}:00`);\n\n// Only what the option needs: polar bars and the tooltip (not all of ECharts).\nconst modules = async () => {\n const [{ use: register }, { BarChart }, { PolarComponent, TooltipComponent }] = await Promise.all([import(\"echarts/core\"), import(\"echarts/charts\"), import(\"echarts/components\")]);\n register([BarChart, PolarComponent, TooltipComponent]);\n};\n\nexport default function PolarUploads() {\n return (\n <Chart\n title=\"Uploads by hour of the day\"\n modules={modules}\n option={(theme) => ({\n polar: { radius: [\"18%\", \"80%\"] },\n angleAxis: { type: \"category\", data: hours, axisLabel: { color: theme.text2, interval: 2 }, axisLine: { lineStyle: { color: theme.axis } } },\n radiusAxis: { axisLabel: { show: false }, splitLine: { lineStyle: { color: theme.grid } }, axisLine: { show: false } },\n tooltip: { trigger: \"item\" },\n series: [{ type: \"bar\", coordinateSystem: \"polar\", data: uploads, itemStyle: { color: theme.palette[0], borderRadius: 3 } }],\n })}\n summaryText={`Uploads by hour: quietest at 02:00 (1), busiest at 19:00 (61).`}\n table={{ columns: [\"Hour\", \"Uploads\"], rows: hours.map((h, i) => [h, String(uploads[i])]) }}\n items={uploads.map((u, i) => ({ seriesIndex: 0, dataIndex: i, text: `${hours[i]}: ${u}` }))}\n height={340}\n />\n );\n}\n"
263
+ },
264
+ "props": [
265
+ {
266
+ "component": "Chart",
267
+ "description": "Any ECharts option, themed and framed like the typed charts. Memoise `option` when it is a function.",
268
+ "props": [
269
+ {
270
+ "name": "option",
271
+ "type": "ECBasicOption | ((theme: ResolvedTheme, size: { width: number; height: number; }) => ECBasicOption)",
272
+ "default": null,
273
+ "description": "The ECharts option, or a function of the resolved theme (colours as plain strings, the palette, the ramp).",
274
+ "required": true
275
+ },
276
+ {
277
+ "name": "summaryText",
278
+ "type": "string",
279
+ "default": null,
280
+ "description": "The written summary: an option says nothing on its own.",
281
+ "required": true
282
+ },
283
+ {
284
+ "name": "table",
285
+ "type": "TableModel",
286
+ "default": null,
287
+ "description": "The data as a table: the alternative of every chart.",
288
+ "required": true
289
+ },
290
+ {
291
+ "name": "title",
292
+ "type": "string",
293
+ "default": null,
294
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
295
+ "required": true
296
+ },
297
+ {
298
+ "name": "brand",
299
+ "type": "BrandId",
300
+ "default": null,
301
+ "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`).",
302
+ "required": false
303
+ },
304
+ {
305
+ "name": "className",
306
+ "type": "string",
307
+ "default": null,
308
+ "description": "A class on the figure (layout: margins, grid placement).",
309
+ "required": false
310
+ },
311
+ {
312
+ "name": "dataTable",
313
+ "type": "boolean",
314
+ "default": null,
315
+ "description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
316
+ "required": false
317
+ },
318
+ {
319
+ "name": "description",
320
+ "type": "ReactNode",
321
+ "default": null,
322
+ "description": "A sentence under the title: the period, the unit, the source.",
323
+ "required": false
324
+ },
325
+ {
326
+ "name": "empty",
327
+ "type": "ReactNode",
328
+ "default": null,
329
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
330
+ "required": false
331
+ },
332
+ {
333
+ "name": "error",
334
+ "type": "ReactNode",
335
+ "default": null,
336
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
337
+ "required": false
338
+ },
339
+ {
340
+ "name": "exportable",
341
+ "type": "boolean | readonly ExportFormat[]",
342
+ "default": null,
343
+ "description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
344
+ "required": false
345
+ },
346
+ {
347
+ "name": "height",
348
+ "type": "number",
349
+ "default": null,
350
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
351
+ "required": false
352
+ },
353
+ {
354
+ "name": "hideTitle",
355
+ "type": "boolean",
356
+ "default": null,
357
+ "description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
358
+ "required": false
359
+ },
360
+ {
361
+ "name": "id",
362
+ "type": "string",
363
+ "default": null,
364
+ "description": "The id of the figure.",
365
+ "required": false
366
+ },
367
+ {
368
+ "name": "items",
369
+ "type": "readonly WalkItem[]",
370
+ "default": null,
371
+ "description": "What the arrow keys walk (series and data indexes, and what each one says).",
372
+ "required": false
373
+ },
374
+ {
375
+ "name": "labels",
376
+ "type": "ChartLabelsInput",
377
+ "default": null,
378
+ "description": "The words, translated: the buttons, the states, the written summary.",
379
+ "required": false
380
+ },
381
+ {
382
+ "name": "live",
383
+ "type": "boolean",
384
+ "default": null,
385
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
386
+ "required": false
387
+ },
388
+ {
389
+ "name": "loading",
390
+ "type": "boolean",
391
+ "default": null,
392
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
393
+ "required": false
394
+ },
395
+ {
396
+ "name": "locale",
397
+ "type": "Locale",
398
+ "default": null,
399
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
400
+ "required": false
401
+ },
402
+ {
403
+ "name": "modules",
404
+ "type": "(() => Promise<unknown>)",
405
+ "default": "() => import(\"../echarts/engines/full\")",
406
+ "description": "Registers what the option needs, from `echarts/charts` and `echarts/components` (tree-shaken):\n`() => import(\"./my-echarts\")` where that module calls `use([...])`. Default: all of ECharts (~380 kB gzip).",
407
+ "required": false
408
+ },
409
+ {
410
+ "name": "onItem",
411
+ "type": "((item: { seriesIndex: number; dataIndex: number; }) => void)",
412
+ "default": null,
413
+ "description": "A click (or Enter) on a data item.",
414
+ "required": false
415
+ },
416
+ {
417
+ "name": "renderer",
418
+ "type": "Renderer",
419
+ "default": null,
420
+ "description": "`svg` (default): sharp, exportable as SVG. `canvas`: for tens of thousands of marks.",
421
+ "required": false
422
+ },
423
+ {
424
+ "name": "style",
425
+ "type": "CSSProperties",
426
+ "default": null,
427
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
428
+ "required": false
429
+ },
430
+ {
431
+ "name": "summary",
432
+ "type": "\"hidden\" | \"visible\"",
433
+ "default": null,
434
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
435
+ "required": false
436
+ }
437
+ ]
438
+ }
439
+ ]
440
+ }
@@ -0,0 +1,190 @@
1
+ {
2
+ "name": "charts-provider",
3
+ "package": "@krizaka/charts",
4
+ "type": "chart",
5
+ "title": "Charts provider",
6
+ "summary": "The locale, the brand palette and the words of every chart below it, set once; plus the sliding window for live data.",
7
+ "description": "The locale, the brand palette and the words of every chart below it, set once; plus the sliding window for live data.",
8
+ "status": "beta",
9
+ "category": "charts",
10
+ "platforms": "both",
11
+ "engine": null,
12
+ "whenToUse": [
13
+ "Once near the root of an app: its locale (`fr-FR`), its brand (`orazaka`), its translated words.",
14
+ "An app that loads a brand stylesheet on `:root` rather than a `.brand-<id>` class: set `brand` here."
15
+ ],
16
+ "whenNotToUse": [
17
+ {
18
+ "when": "To change one chart only: every chart takes `locale`, `brand` and `labels` itself.",
19
+ "use": "line-chart"
20
+ }
21
+ ],
22
+ "bestPractices": [
23
+ "Translate `labels` from the app's catalogue; the summary templates take `{placeholders}`.",
24
+ "In React Native, pass `scheme` and `theme` from @krizaka/ui/native's `useTheme()` so the charts follow the app's theme and brand."
25
+ ],
26
+ "accessibility": {
27
+ "keyboard": [],
28
+ "notes": [
29
+ "The words it sets are what screen readers hear: the summary, the role description, the keyboard hint."
30
+ ]
31
+ },
32
+ "related": [
33
+ "line-chart",
34
+ "chart",
35
+ "bar-chart"
36
+ ],
37
+ "source": "packages/charts/src/meta/charts-provider.ts",
38
+ "install": {
39
+ "web": "npm install @krizaka/charts",
40
+ "native": "npx expo install react-native-svg\nnpm install @krizaka/charts"
41
+ },
42
+ "web": {
43
+ "entry": "@krizaka/charts/provider",
44
+ "import": "import { ChartsProvider, useSlidingWindow } from \"@krizaka/charts/provider\";",
45
+ "props": [
46
+ {
47
+ "component": "ChartsProvider",
48
+ "description": "Sets the locale, the brand and the words of every chart below it.",
49
+ "props": [
50
+ {
51
+ "name": "brand",
52
+ "type": "BrandId",
53
+ "default": null,
54
+ "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`).",
55
+ "required": false
56
+ },
57
+ {
58
+ "name": "labels",
59
+ "type": "ChartLabelsInput",
60
+ "default": null,
61
+ "description": "The words, translated: the buttons, the states, the written summary.",
62
+ "required": false
63
+ },
64
+ {
65
+ "name": "locale",
66
+ "type": "Locale",
67
+ "default": null,
68
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
69
+ "required": false
70
+ }
71
+ ]
72
+ }
73
+ ],
74
+ "examples": [
75
+ {
76
+ "name": "french-orazaka",
77
+ "title": "French, Orazaka",
78
+ "description": "Figures and dates in French, the Orazaka palette, the words translated.",
79
+ "path": "examples/charts-provider/french-orazaka.tsx",
80
+ "module": "@krizaka/charts/registry/examples/charts-provider/french-orazaka",
81
+ "code": "import { BarChart } from \"@krizaka/charts/bar\";\nimport { ChartsProvider } from \"@krizaka/charts/provider\";\n\nconst months = [\n { month: \"2026-06\", credits: 412_000 },\n { month: \"2026-07\", credits: 468_500 },\n { month: \"2026-08\", credits: 391_200 },\n { month: \"2026-09\", credits: 523_900 },\n];\n\n// Once near the app's root: the locale, the brand's palette, the words from the app's catalogue.\nexport default function FrenchOrazaka() {\n return (\n <ChartsProvider\n locale=\"fr-FR\"\n brand=\"orazaka\"\n labels={{ showData: \"Voir les données\", hideData: \"Masquer les données\", empty: \"Pas encore de données.\", kinds: { bar: \"Histogramme\" } }}\n >\n <BarChart title=\"Crédits consommés par mois\" data={months} x=\"month\" xLabel=\"Mois\" y=\"credits\" yLabel=\"Crédits\" format=\"compact\" />\n </ChartsProvider>\n );\n}\n"
82
+ }
83
+ ]
84
+ },
85
+ "native": {
86
+ "entry": "@krizaka/charts/native",
87
+ "import": "import { ChartsProvider } from \"@krizaka/charts/native\";",
88
+ "differences": [
89
+ "Also takes `scheme` and `theme` (the app's roles); no `useSlidingWindow` export on native."
90
+ ],
91
+ "props": [
92
+ {
93
+ "component": "ChartsProvider",
94
+ "description": "Sets the locale, brand, words, scheme and theme of every chart below it.",
95
+ "props": [
96
+ {
97
+ "name": "brand",
98
+ "type": "BrandId",
99
+ "default": null,
100
+ "description": "The brand whose palette leads. Default Krizaka.",
101
+ "required": false
102
+ },
103
+ {
104
+ "name": "labels",
105
+ "type": "ChartLabelsInput",
106
+ "default": null,
107
+ "description": "The words: the readout, the summary.",
108
+ "required": false
109
+ },
110
+ {
111
+ "name": "locale",
112
+ "type": "Locale",
113
+ "default": null,
114
+ "description": "The locale of every figure and date. Default `\"en-US\"`.",
115
+ "required": false
116
+ },
117
+ {
118
+ "name": "scheme",
119
+ "type": "Mode",
120
+ "default": null,
121
+ "description": "Dark or light. Default: the device's (pass `useTheme().scheme` of\n@krizaka /ui/native to follow the app).",
122
+ "required": false
123
+ },
124
+ {
125
+ "name": "theme",
126
+ "type": "Partial<ChartTheme>",
127
+ "default": null,
128
+ "description": "The app's colour roles (`useTheme().theme` of\n@krizaka /ui/native): a product's brand overrides apply.",
129
+ "required": false
130
+ }
131
+ ]
132
+ }
133
+ ],
134
+ "examples": [
135
+ {
136
+ "name": "french-orazaka",
137
+ "title": "French, Orazaka",
138
+ "description": "French figures, the Orazaka palette.",
139
+ "path": "examples/charts-provider/native/french-orazaka.tsx",
140
+ "module": "@krizaka/charts/registry/examples/charts-provider/native/french-orazaka",
141
+ "code": "import { BarChart, ChartsProvider } from \"@krizaka/charts/native\";\n\nconst months = [\n { month: \"2026-06\", credits: 412_000 },\n { month: \"2026-07\", credits: 468_500 },\n { month: \"2026-08\", credits: 391_200 },\n { month: \"2026-09\", credits: 523_900 },\n];\n\n// In an app: scheme and theme from @krizaka/ui/native's useTheme(), so the charts follow its mode and brand.\nexport default function FrenchOrazaka() {\n return (\n <ChartsProvider locale=\"fr-FR\" brand=\"orazaka\">\n <BarChart title=\"Crédits consommés par mois\" data={months} x=\"month\" y=\"credits\" yLabel=\"Crédits\" format=\"compact\" />\n </ChartsProvider>\n );\n}\n",
142
+ "screenshots": {
143
+ "dark": "examples/charts-provider/native/french-orazaka.dark.png",
144
+ "light": "examples/charts-provider/native/french-orazaka.light.png"
145
+ }
146
+ }
147
+ ]
148
+ },
149
+ "files": [],
150
+ "dependencies": [
151
+ "@krizaka/intl@workspace:^",
152
+ "d3-geo@^3.1.1",
153
+ "echarts@^6.1.0",
154
+ "topojson-client@^3.1.0"
155
+ ],
156
+ "registryDependencies": [],
157
+ "demo": {
158
+ "path": "examples/charts-provider/french-orazaka.tsx",
159
+ "content": "import { BarChart } from \"@krizaka/charts/bar\";\nimport { ChartsProvider } from \"@krizaka/charts/provider\";\n\nconst months = [\n { month: \"2026-06\", credits: 412_000 },\n { month: \"2026-07\", credits: 468_500 },\n { month: \"2026-08\", credits: 391_200 },\n { month: \"2026-09\", credits: 523_900 },\n];\n\n// Once near the app's root: the locale, the brand's palette, the words from the app's catalogue.\nexport default function FrenchOrazaka() {\n return (\n <ChartsProvider\n locale=\"fr-FR\"\n brand=\"orazaka\"\n labels={{ showData: \"Voir les données\", hideData: \"Masquer les données\", empty: \"Pas encore de données.\", kinds: { bar: \"Histogramme\" } }}\n >\n <BarChart title=\"Crédits consommés par mois\" data={months} x=\"month\" xLabel=\"Mois\" y=\"credits\" yLabel=\"Crédits\" format=\"compact\" />\n </ChartsProvider>\n );\n}\n"
160
+ },
161
+ "props": [
162
+ {
163
+ "component": "ChartsProvider",
164
+ "description": "Sets the locale, the brand and the words of every chart below it.",
165
+ "props": [
166
+ {
167
+ "name": "brand",
168
+ "type": "BrandId",
169
+ "default": null,
170
+ "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`).",
171
+ "required": false
172
+ },
173
+ {
174
+ "name": "labels",
175
+ "type": "ChartLabelsInput",
176
+ "default": null,
177
+ "description": "The words, translated: the buttons, the states, the written summary.",
178
+ "required": false
179
+ },
180
+ {
181
+ "name": "locale",
182
+ "type": "Locale",
183
+ "default": null,
184
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
185
+ "required": false
186
+ }
187
+ ]
188
+ }
189
+ ]
190
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComponentType } from "react";
2
+ /** A named example of the @krizaka/charts registry. */
3
+ declare const Example: ComponentType;
4
+ export default Example;