@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,1287 @@
1
+ {
2
+ "name": "pie-chart",
3
+ "package": "@krizaka/charts",
4
+ "type": "chart",
5
+ "title": "Pie and donut chart",
6
+ "summary": "Part of a whole: slices sorted by size, folded into “Other” past six, each share written in the legend; a donut carries the total in its hole.",
7
+ "description": "Part of a whole: slices sorted by size, folded into “Other” past six, each share written in the legend; a donut carries the total in its hole.",
8
+ "status": "beta",
9
+ "category": "charts",
10
+ "platforms": "both",
11
+ "engine": "svg",
12
+ "whenToUse": [
13
+ "How one total splits at one moment: credits spent by model this month, storage by kind.",
14
+ "Two to six parts, one of which clearly dominates or is clearly small."
15
+ ],
16
+ "whenNotToUse": [
17
+ {
18
+ "when": "Parts compared precisely, or more than six of them.",
19
+ "use": "bar-chart"
20
+ },
21
+ {
22
+ "when": "Parts that change over time.",
23
+ "use": "area-chart"
24
+ },
25
+ {
26
+ "when": "Nested parts (a team, then its projects).",
27
+ "use": "treemap"
28
+ }
29
+ ],
30
+ "bestPractices": [
31
+ "Prefer the donut (`DonutChart`) with `centerLabel`: the total is the first thing a reader looks for.",
32
+ "Name the folded slice in your language with `otherLabel`.",
33
+ "Never put two pies side by side to compare them: use bars."
34
+ ],
35
+ "accessibility": {
36
+ "keyboard": [
37
+ {
38
+ "keys": "Tab",
39
+ "action": "Moves the focus to the plot (one tab stop), then to the data and export buttons."
40
+ },
41
+ {
42
+ "keys": "Arrow keys",
43
+ "action": "Walk the items one by one: each is announced and its tooltip shown."
44
+ },
45
+ {
46
+ "keys": "Home / End",
47
+ "action": "Jump to the first or the last item."
48
+ },
49
+ {
50
+ "keys": "Esc",
51
+ "action": "Hides the tooltip and clears the active item."
52
+ },
53
+ {
54
+ "keys": "Enter",
55
+ "action": "Selects the active slice (calls `onSelect` with its row)."
56
+ }
57
+ ],
58
+ "notes": [
59
+ "The plot is a group named by the title and described by a summary written from the data, read before anything else.",
60
+ "The data table is always in the page for assistive technology; “Show data” reveals it for everyone.",
61
+ "Colour never carries a meaning alone: the legend, the labels and the table say it in words.",
62
+ "The entrance plays once, when the chart comes on screen, and never under reduced motion.",
63
+ "A 2 px gap in the surface colour separates the slices."
64
+ ]
65
+ },
66
+ "related": [
67
+ "bar-chart",
68
+ "treemap",
69
+ "gauge"
70
+ ],
71
+ "source": "packages/charts/src/meta/pie-chart.ts",
72
+ "install": {
73
+ "web": "npm install @krizaka/charts",
74
+ "native": "npx expo install react-native-svg\nnpm install @krizaka/charts"
75
+ },
76
+ "web": {
77
+ "entry": "@krizaka/charts/pie",
78
+ "import": "import { DonutChart, PieChart } from \"@krizaka/charts/pie\";",
79
+ "props": [
80
+ {
81
+ "component": "DonutChart",
82
+ "description": "A pie with a hole: the total (or `centerValue`) and `centerLabel` in it.",
83
+ "props": [
84
+ {
85
+ "name": "data",
86
+ "type": "readonly T[]",
87
+ "default": null,
88
+ "description": "One row per part.",
89
+ "required": true
90
+ },
91
+ {
92
+ "name": "label",
93
+ "type": "string | ((datum: T, index: number) => string)",
94
+ "default": null,
95
+ "description": "The field (or function) naming the part.",
96
+ "required": true
97
+ },
98
+ {
99
+ "name": "title",
100
+ "type": "string",
101
+ "default": null,
102
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
103
+ "required": true
104
+ },
105
+ {
106
+ "name": "value",
107
+ "type": "string | ((datum: T, index: number) => number)",
108
+ "default": null,
109
+ "description": "The field (or function) of its amount (≥ 0).",
110
+ "required": true
111
+ },
112
+ {
113
+ "name": "brand",
114
+ "type": "BrandId",
115
+ "default": null,
116
+ "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`).",
117
+ "required": false
118
+ },
119
+ {
120
+ "name": "centerLabel",
121
+ "type": "string",
122
+ "default": null,
123
+ "description": "The words under the number in the hole of a donut (“Total credits”).",
124
+ "required": false
125
+ },
126
+ {
127
+ "name": "centerValue",
128
+ "type": "string",
129
+ "default": null,
130
+ "description": "The number in the hole, written already. Default: the total.",
131
+ "required": false
132
+ },
133
+ {
134
+ "name": "className",
135
+ "type": "string",
136
+ "default": null,
137
+ "description": "A class on the figure (layout: margins, grid placement).",
138
+ "required": false
139
+ },
140
+ {
141
+ "name": "color",
142
+ "type": "string | ((datum: T, index: number) => SeriesColor)",
143
+ "default": null,
144
+ "description": "A part's own colour (a slot, a tone or a CSS colour); default: the palette in order of size.",
145
+ "required": false
146
+ },
147
+ {
148
+ "name": "dataTable",
149
+ "type": "boolean",
150
+ "default": null,
151
+ "description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
152
+ "required": false
153
+ },
154
+ {
155
+ "name": "description",
156
+ "type": "ReactNode",
157
+ "default": null,
158
+ "description": "A sentence under the title: the period, the unit, the source.",
159
+ "required": false
160
+ },
161
+ {
162
+ "name": "empty",
163
+ "type": "ReactNode",
164
+ "default": null,
165
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
166
+ "required": false
167
+ },
168
+ {
169
+ "name": "error",
170
+ "type": "ReactNode",
171
+ "default": null,
172
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
173
+ "required": false
174
+ },
175
+ {
176
+ "name": "exportable",
177
+ "type": "boolean | readonly ExportFormat[]",
178
+ "default": null,
179
+ "description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
180
+ "required": false
181
+ },
182
+ {
183
+ "name": "format",
184
+ "type": "ValueFormat",
185
+ "default": null,
186
+ "description": "How the amounts are written.",
187
+ "required": false
188
+ },
189
+ {
190
+ "name": "height",
191
+ "type": "number",
192
+ "default": null,
193
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
194
+ "required": false
195
+ },
196
+ {
197
+ "name": "hideTitle",
198
+ "type": "boolean",
199
+ "default": null,
200
+ "description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
201
+ "required": false
202
+ },
203
+ {
204
+ "name": "id",
205
+ "type": "string",
206
+ "default": null,
207
+ "description": "The id of the figure.",
208
+ "required": false
209
+ },
210
+ {
211
+ "name": "labelHeader",
212
+ "type": "string",
213
+ "default": null,
214
+ "description": "The header of the parts in the data table.",
215
+ "required": false
216
+ },
217
+ {
218
+ "name": "labels",
219
+ "type": "ChartLabelsInput",
220
+ "default": null,
221
+ "description": "The words, translated: the buttons, the states, the written summary.",
222
+ "required": false
223
+ },
224
+ {
225
+ "name": "live",
226
+ "type": "boolean",
227
+ "default": null,
228
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
229
+ "required": false
230
+ },
231
+ {
232
+ "name": "loading",
233
+ "type": "boolean",
234
+ "default": null,
235
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
236
+ "required": false
237
+ },
238
+ {
239
+ "name": "locale",
240
+ "type": "Locale",
241
+ "default": null,
242
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
243
+ "required": false
244
+ },
245
+ {
246
+ "name": "maxSlices",
247
+ "type": "number",
248
+ "default": null,
249
+ "description": "At most this many slices; the rest fold into one, named `otherLabel`. Default 6.",
250
+ "required": false
251
+ },
252
+ {
253
+ "name": "onSelect",
254
+ "type": "((datum: T, index: number) => void)",
255
+ "default": null,
256
+ "description": "Called with the row when a slice is clicked (or Enter is pressed on it).",
257
+ "required": false
258
+ },
259
+ {
260
+ "name": "otherLabel",
261
+ "type": "string",
262
+ "default": null,
263
+ "description": "The name of the folded slice. Default “Other”.",
264
+ "required": false
265
+ },
266
+ {
267
+ "name": "style",
268
+ "type": "CSSProperties",
269
+ "default": null,
270
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
271
+ "required": false
272
+ },
273
+ {
274
+ "name": "summary",
275
+ "type": "\"hidden\" | \"visible\"",
276
+ "default": null,
277
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
278
+ "required": false
279
+ },
280
+ {
281
+ "name": "summaryText",
282
+ "type": "string",
283
+ "default": null,
284
+ "description": "Your own summary instead of the generated one (still read first by screen readers).",
285
+ "required": false
286
+ },
287
+ {
288
+ "name": "valueHeader",
289
+ "type": "string",
290
+ "default": null,
291
+ "description": "The header of the amounts in the data table.",
292
+ "required": false
293
+ }
294
+ ]
295
+ },
296
+ {
297
+ "component": "PieChart",
298
+ "description": "",
299
+ "props": [
300
+ {
301
+ "name": "data",
302
+ "type": "readonly T[]",
303
+ "default": null,
304
+ "description": "One row per part.",
305
+ "required": true
306
+ },
307
+ {
308
+ "name": "label",
309
+ "type": "string | ((datum: T, index: number) => string)",
310
+ "default": null,
311
+ "description": "The field (or function) naming the part.",
312
+ "required": true
313
+ },
314
+ {
315
+ "name": "title",
316
+ "type": "string",
317
+ "default": null,
318
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
319
+ "required": true
320
+ },
321
+ {
322
+ "name": "value",
323
+ "type": "string | ((datum: T, index: number) => number)",
324
+ "default": null,
325
+ "description": "The field (or function) of its amount (≥ 0).",
326
+ "required": true
327
+ },
328
+ {
329
+ "name": "brand",
330
+ "type": "BrandId",
331
+ "default": null,
332
+ "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`).",
333
+ "required": false
334
+ },
335
+ {
336
+ "name": "centerLabel",
337
+ "type": "string",
338
+ "default": null,
339
+ "description": "The words under the number in the hole of a donut (“Total credits”).",
340
+ "required": false
341
+ },
342
+ {
343
+ "name": "centerValue",
344
+ "type": "string",
345
+ "default": null,
346
+ "description": "The number in the hole, written already. Default: the total.",
347
+ "required": false
348
+ },
349
+ {
350
+ "name": "className",
351
+ "type": "string",
352
+ "default": null,
353
+ "description": "A class on the figure (layout: margins, grid placement).",
354
+ "required": false
355
+ },
356
+ {
357
+ "name": "color",
358
+ "type": "string | ((datum: T, index: number) => SeriesColor)",
359
+ "default": null,
360
+ "description": "A part's own colour (a slot, a tone or a CSS colour); default: the palette in order of size.",
361
+ "required": false
362
+ },
363
+ {
364
+ "name": "dataTable",
365
+ "type": "boolean",
366
+ "default": null,
367
+ "description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
368
+ "required": false
369
+ },
370
+ {
371
+ "name": "description",
372
+ "type": "ReactNode",
373
+ "default": null,
374
+ "description": "A sentence under the title: the period, the unit, the source.",
375
+ "required": false
376
+ },
377
+ {
378
+ "name": "donut",
379
+ "type": "boolean",
380
+ "default": null,
381
+ "description": "A ring rather than a pie: the total (or `centerValue`) is written in its hole.",
382
+ "required": false
383
+ },
384
+ {
385
+ "name": "empty",
386
+ "type": "ReactNode",
387
+ "default": null,
388
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
389
+ "required": false
390
+ },
391
+ {
392
+ "name": "error",
393
+ "type": "ReactNode",
394
+ "default": null,
395
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
396
+ "required": false
397
+ },
398
+ {
399
+ "name": "exportable",
400
+ "type": "boolean | readonly ExportFormat[]",
401
+ "default": null,
402
+ "description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
403
+ "required": false
404
+ },
405
+ {
406
+ "name": "format",
407
+ "type": "ValueFormat",
408
+ "default": null,
409
+ "description": "How the amounts are written.",
410
+ "required": false
411
+ },
412
+ {
413
+ "name": "height",
414
+ "type": "number",
415
+ "default": null,
416
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
417
+ "required": false
418
+ },
419
+ {
420
+ "name": "hideTitle",
421
+ "type": "boolean",
422
+ "default": null,
423
+ "description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
424
+ "required": false
425
+ },
426
+ {
427
+ "name": "id",
428
+ "type": "string",
429
+ "default": null,
430
+ "description": "The id of the figure.",
431
+ "required": false
432
+ },
433
+ {
434
+ "name": "labelHeader",
435
+ "type": "string",
436
+ "default": null,
437
+ "description": "The header of the parts in the data table.",
438
+ "required": false
439
+ },
440
+ {
441
+ "name": "labels",
442
+ "type": "ChartLabelsInput",
443
+ "default": null,
444
+ "description": "The words, translated: the buttons, the states, the written summary.",
445
+ "required": false
446
+ },
447
+ {
448
+ "name": "live",
449
+ "type": "boolean",
450
+ "default": null,
451
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
452
+ "required": false
453
+ },
454
+ {
455
+ "name": "loading",
456
+ "type": "boolean",
457
+ "default": null,
458
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
459
+ "required": false
460
+ },
461
+ {
462
+ "name": "locale",
463
+ "type": "Locale",
464
+ "default": null,
465
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
466
+ "required": false
467
+ },
468
+ {
469
+ "name": "maxSlices",
470
+ "type": "number",
471
+ "default": null,
472
+ "description": "At most this many slices; the rest fold into one, named `otherLabel`. Default 6.",
473
+ "required": false
474
+ },
475
+ {
476
+ "name": "onSelect",
477
+ "type": "((datum: T, index: number) => void)",
478
+ "default": null,
479
+ "description": "Called with the row when a slice is clicked (or Enter is pressed on it).",
480
+ "required": false
481
+ },
482
+ {
483
+ "name": "otherLabel",
484
+ "type": "string",
485
+ "default": null,
486
+ "description": "The name of the folded slice. Default “Other”.",
487
+ "required": false
488
+ },
489
+ {
490
+ "name": "style",
491
+ "type": "CSSProperties",
492
+ "default": null,
493
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
494
+ "required": false
495
+ },
496
+ {
497
+ "name": "summary",
498
+ "type": "\"hidden\" | \"visible\"",
499
+ "default": null,
500
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
501
+ "required": false
502
+ },
503
+ {
504
+ "name": "summaryText",
505
+ "type": "string",
506
+ "default": null,
507
+ "description": "Your own summary instead of the generated one (still read first by screen readers).",
508
+ "required": false
509
+ },
510
+ {
511
+ "name": "valueHeader",
512
+ "type": "string",
513
+ "default": null,
514
+ "description": "The header of the amounts in the data table.",
515
+ "required": false
516
+ }
517
+ ]
518
+ }
519
+ ],
520
+ "examples": [
521
+ {
522
+ "name": "credit-spend",
523
+ "title": "Donut",
524
+ "description": "This month's Orazaka credits by model, the total in the hole.",
525
+ "path": "examples/pie-chart/credit-spend.tsx",
526
+ "module": "@krizaka/charts/registry/examples/pie-chart/credit-spend",
527
+ "code": "import { DonutChart } from \"@krizaka/charts/pie\";\n\nconst spend = [\n { model: \"Chat · Mistral Large\", credits: 18_400 },\n { model: \"Image · Flux\", credits: 9_650 },\n { model: \"Video · Wan 2.2\", credits: 7_200 },\n { model: \"Speech · Whisper\", credits: 2_100 },\n { model: \"Embeddings\", credits: 640 },\n];\n\nexport default function CreditSpend() {\n return (\n <DonutChart\n title=\"Credits spent in September\"\n data={spend}\n label=\"model\"\n value=\"credits\"\n labelHeader=\"Model\"\n valueHeader=\"Credits\"\n format=\"integer\"\n centerLabel=\"credits\"\n />\n );\n}\n"
528
+ },
529
+ {
530
+ "name": "storage-by-kind",
531
+ "title": "Pie",
532
+ "description": "Storage by kind of file, the small kinds folded into “Other”.",
533
+ "path": "examples/pie-chart/storage-by-kind.tsx",
534
+ "module": "@krizaka/charts/registry/examples/pie-chart/storage-by-kind",
535
+ "code": "import { PieChart } from \"@krizaka/charts/pie\";\n\n// Gigabytes; past six slices the smallest fold into “Other”.\nconst kinds = [\n { kind: \"Videos\", gb: 812 },\n { kind: \"Thumbnails\", gb: 64 },\n { kind: \"Audio\", gb: 121 },\n { kind: \"Subtitles\", gb: 3 },\n { kind: \"Project files\", gb: 96 },\n { kind: \"Exports\", gb: 210 },\n { kind: \"Fonts\", gb: 1 },\n { kind: \"Logs\", gb: 2 },\n];\n\nexport default function StorageByKind() {\n return (\n <PieChart\n title=\"Storage by kind\"\n data={kinds}\n label=\"kind\"\n value=\"gb\"\n format={{ style: \"unit\", unit: \"gigabyte\" }}\n otherLabel=\"Other\"\n />\n );\n}\n"
536
+ }
537
+ ]
538
+ },
539
+ "native": {
540
+ "entry": "@krizaka/charts/native",
541
+ "import": "import { DonutChart, PieChart } from \"@krizaka/charts/native\";",
542
+ "differences": [
543
+ "No tooltip: swipe up and down on the chart to hear each slice and its share.",
544
+ "No `onSelect`, no data table."
545
+ ],
546
+ "props": [
547
+ {
548
+ "component": "DonutChart",
549
+ "description": "A pie with a hole (React Native).",
550
+ "props": [
551
+ {
552
+ "name": "data",
553
+ "type": "readonly T[]",
554
+ "default": null,
555
+ "description": "One row per part.",
556
+ "required": true
557
+ },
558
+ {
559
+ "name": "label",
560
+ "type": "string | ((datum: T, index: number) => string)",
561
+ "default": null,
562
+ "description": "The field naming the part.",
563
+ "required": true
564
+ },
565
+ {
566
+ "name": "title",
567
+ "type": "string",
568
+ "default": null,
569
+ "description": "What the chart shows: its heading and accessible name.",
570
+ "required": true
571
+ },
572
+ {
573
+ "name": "value",
574
+ "type": "string | ((datum: T, index: number) => number)",
575
+ "default": null,
576
+ "description": "The field of its amount.",
577
+ "required": true
578
+ },
579
+ {
580
+ "name": "brand",
581
+ "type": "BrandId",
582
+ "default": null,
583
+ "description": "The brand whose palette leads. Default Krizaka.",
584
+ "required": false
585
+ },
586
+ {
587
+ "name": "centerLabel",
588
+ "type": "string",
589
+ "default": null,
590
+ "description": "The words under the total of a donut.",
591
+ "required": false
592
+ },
593
+ {
594
+ "name": "empty",
595
+ "type": "ReactNode",
596
+ "default": null,
597
+ "description": "Shown instead of the plot when there is nothing to draw. Default: the `empty` label.",
598
+ "required": false
599
+ },
600
+ {
601
+ "name": "format",
602
+ "type": "ValueFormat",
603
+ "default": null,
604
+ "description": "How the amounts are written.",
605
+ "required": false
606
+ },
607
+ {
608
+ "name": "height",
609
+ "type": "number",
610
+ "default": null,
611
+ "description": "The plot's height.",
612
+ "required": false
613
+ },
614
+ {
615
+ "name": "hideTitle",
616
+ "type": "boolean",
617
+ "default": null,
618
+ "description": "Hide the heading (it stays the accessible name).",
619
+ "required": false
620
+ },
621
+ {
622
+ "name": "labels",
623
+ "type": "ChartLabelsInput",
624
+ "default": null,
625
+ "description": "The words: the readout, the summary.",
626
+ "required": false
627
+ },
628
+ {
629
+ "name": "loading",
630
+ "type": "boolean",
631
+ "default": null,
632
+ "description": "The data is on its way.",
633
+ "required": false
634
+ },
635
+ {
636
+ "name": "locale",
637
+ "type": "Locale",
638
+ "default": null,
639
+ "description": "The locale of every figure and date. Default `\"en-US\"`.",
640
+ "required": false
641
+ },
642
+ {
643
+ "name": "maxSlices",
644
+ "type": "number",
645
+ "default": null,
646
+ "description": "At most this many slices; the rest fold into `otherLabel`. Default 6.",
647
+ "required": false
648
+ },
649
+ {
650
+ "name": "otherLabel",
651
+ "type": "string",
652
+ "default": null,
653
+ "description": "The name of the folded slice. Default “Other”.",
654
+ "required": false
655
+ },
656
+ {
657
+ "name": "scheme",
658
+ "type": "Mode",
659
+ "default": null,
660
+ "description": "Dark or light. Default: the device's (pass `useTheme().scheme` of\n@krizaka /ui/native to follow the app).",
661
+ "required": false
662
+ },
663
+ {
664
+ "name": "style",
665
+ "type": "ViewStyle",
666
+ "default": null,
667
+ "description": "The style of the chart's container (layout only: colours come from the theme).",
668
+ "required": false
669
+ },
670
+ {
671
+ "name": "theme",
672
+ "type": "Partial<ChartTheme>",
673
+ "default": null,
674
+ "description": "The app's colour roles (`useTheme().theme` of\n@krizaka /ui/native): a product's brand overrides apply.",
675
+ "required": false
676
+ }
677
+ ]
678
+ },
679
+ {
680
+ "component": "PieChart",
681
+ "description": "Part of a whole (React Native).",
682
+ "props": [
683
+ {
684
+ "name": "data",
685
+ "type": "readonly T[]",
686
+ "default": null,
687
+ "description": "One row per part.",
688
+ "required": true
689
+ },
690
+ {
691
+ "name": "label",
692
+ "type": "string | ((datum: T, index: number) => string)",
693
+ "default": null,
694
+ "description": "The field naming the part.",
695
+ "required": true
696
+ },
697
+ {
698
+ "name": "title",
699
+ "type": "string",
700
+ "default": null,
701
+ "description": "What the chart shows: its heading and accessible name.",
702
+ "required": true
703
+ },
704
+ {
705
+ "name": "value",
706
+ "type": "string | ((datum: T, index: number) => number)",
707
+ "default": null,
708
+ "description": "The field of its amount.",
709
+ "required": true
710
+ },
711
+ {
712
+ "name": "brand",
713
+ "type": "BrandId",
714
+ "default": null,
715
+ "description": "The brand whose palette leads. Default Krizaka.",
716
+ "required": false
717
+ },
718
+ {
719
+ "name": "centerLabel",
720
+ "type": "string",
721
+ "default": null,
722
+ "description": "The words under the total of a donut.",
723
+ "required": false
724
+ },
725
+ {
726
+ "name": "donut",
727
+ "type": "boolean",
728
+ "default": null,
729
+ "description": "A ring with the total in its hole.",
730
+ "required": false
731
+ },
732
+ {
733
+ "name": "empty",
734
+ "type": "ReactNode",
735
+ "default": null,
736
+ "description": "Shown instead of the plot when there is nothing to draw. Default: the `empty` label.",
737
+ "required": false
738
+ },
739
+ {
740
+ "name": "format",
741
+ "type": "ValueFormat",
742
+ "default": null,
743
+ "description": "How the amounts are written.",
744
+ "required": false
745
+ },
746
+ {
747
+ "name": "height",
748
+ "type": "number",
749
+ "default": null,
750
+ "description": "The plot's height.",
751
+ "required": false
752
+ },
753
+ {
754
+ "name": "hideTitle",
755
+ "type": "boolean",
756
+ "default": null,
757
+ "description": "Hide the heading (it stays the accessible name).",
758
+ "required": false
759
+ },
760
+ {
761
+ "name": "labels",
762
+ "type": "ChartLabelsInput",
763
+ "default": null,
764
+ "description": "The words: the readout, the summary.",
765
+ "required": false
766
+ },
767
+ {
768
+ "name": "loading",
769
+ "type": "boolean",
770
+ "default": null,
771
+ "description": "The data is on its way.",
772
+ "required": false
773
+ },
774
+ {
775
+ "name": "locale",
776
+ "type": "Locale",
777
+ "default": null,
778
+ "description": "The locale of every figure and date. Default `\"en-US\"`.",
779
+ "required": false
780
+ },
781
+ {
782
+ "name": "maxSlices",
783
+ "type": "number",
784
+ "default": null,
785
+ "description": "At most this many slices; the rest fold into `otherLabel`. Default 6.",
786
+ "required": false
787
+ },
788
+ {
789
+ "name": "otherLabel",
790
+ "type": "string",
791
+ "default": null,
792
+ "description": "The name of the folded slice. Default “Other”.",
793
+ "required": false
794
+ },
795
+ {
796
+ "name": "scheme",
797
+ "type": "Mode",
798
+ "default": null,
799
+ "description": "Dark or light. Default: the device's (pass `useTheme().scheme` of\n@krizaka /ui/native to follow the app).",
800
+ "required": false
801
+ },
802
+ {
803
+ "name": "style",
804
+ "type": "ViewStyle",
805
+ "default": null,
806
+ "description": "The style of the chart's container (layout only: colours come from the theme).",
807
+ "required": false
808
+ },
809
+ {
810
+ "name": "theme",
811
+ "type": "Partial<ChartTheme>",
812
+ "default": null,
813
+ "description": "The app's colour roles (`useTheme().theme` of\n@krizaka /ui/native): a product's brand overrides apply.",
814
+ "required": false
815
+ }
816
+ ]
817
+ }
818
+ ],
819
+ "examples": [
820
+ {
821
+ "name": "credit-spend",
822
+ "title": "Donut",
823
+ "description": "Credits by model, the total in the hole.",
824
+ "path": "examples/pie-chart/native/credit-spend.tsx",
825
+ "module": "@krizaka/charts/registry/examples/pie-chart/native/credit-spend",
826
+ "code": "import { DonutChart } from \"@krizaka/charts/native\";\n\nconst spend = [\n { model: \"Chat\", credits: 18_400 },\n { model: \"Image\", credits: 9_650 },\n { model: \"Video\", credits: 7_200 },\n { model: \"Speech\", credits: 2_100 },\n];\n\nexport default function CreditSpend() {\n return <DonutChart title=\"Credits spent in September\" data={spend} label=\"model\" value=\"credits\" format=\"compact\" centerLabel=\"credits\" />;\n}\n",
827
+ "screenshots": {
828
+ "dark": "examples/pie-chart/native/credit-spend.dark.png",
829
+ "light": "examples/pie-chart/native/credit-spend.light.png"
830
+ }
831
+ }
832
+ ]
833
+ },
834
+ "files": [],
835
+ "dependencies": [
836
+ "@krizaka/intl@workspace:^",
837
+ "d3-geo@^3.1.1",
838
+ "echarts@^6.1.0",
839
+ "topojson-client@^3.1.0"
840
+ ],
841
+ "registryDependencies": [],
842
+ "demo": {
843
+ "path": "examples/pie-chart/credit-spend.tsx",
844
+ "content": "import { DonutChart } from \"@krizaka/charts/pie\";\n\nconst spend = [\n { model: \"Chat · Mistral Large\", credits: 18_400 },\n { model: \"Image · Flux\", credits: 9_650 },\n { model: \"Video · Wan 2.2\", credits: 7_200 },\n { model: \"Speech · Whisper\", credits: 2_100 },\n { model: \"Embeddings\", credits: 640 },\n];\n\nexport default function CreditSpend() {\n return (\n <DonutChart\n title=\"Credits spent in September\"\n data={spend}\n label=\"model\"\n value=\"credits\"\n labelHeader=\"Model\"\n valueHeader=\"Credits\"\n format=\"integer\"\n centerLabel=\"credits\"\n />\n );\n}\n"
845
+ },
846
+ "props": [
847
+ {
848
+ "component": "DonutChart",
849
+ "description": "A pie with a hole: the total (or `centerValue`) and `centerLabel` in it.",
850
+ "props": [
851
+ {
852
+ "name": "data",
853
+ "type": "readonly T[]",
854
+ "default": null,
855
+ "description": "One row per part.",
856
+ "required": true
857
+ },
858
+ {
859
+ "name": "label",
860
+ "type": "string | ((datum: T, index: number) => string)",
861
+ "default": null,
862
+ "description": "The field (or function) naming the part.",
863
+ "required": true
864
+ },
865
+ {
866
+ "name": "title",
867
+ "type": "string",
868
+ "default": null,
869
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
870
+ "required": true
871
+ },
872
+ {
873
+ "name": "value",
874
+ "type": "string | ((datum: T, index: number) => number)",
875
+ "default": null,
876
+ "description": "The field (or function) of its amount (≥ 0).",
877
+ "required": true
878
+ },
879
+ {
880
+ "name": "brand",
881
+ "type": "BrandId",
882
+ "default": null,
883
+ "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`).",
884
+ "required": false
885
+ },
886
+ {
887
+ "name": "centerLabel",
888
+ "type": "string",
889
+ "default": null,
890
+ "description": "The words under the number in the hole of a donut (“Total credits”).",
891
+ "required": false
892
+ },
893
+ {
894
+ "name": "centerValue",
895
+ "type": "string",
896
+ "default": null,
897
+ "description": "The number in the hole, written already. Default: the total.",
898
+ "required": false
899
+ },
900
+ {
901
+ "name": "className",
902
+ "type": "string",
903
+ "default": null,
904
+ "description": "A class on the figure (layout: margins, grid placement).",
905
+ "required": false
906
+ },
907
+ {
908
+ "name": "color",
909
+ "type": "string | ((datum: T, index: number) => SeriesColor)",
910
+ "default": null,
911
+ "description": "A part's own colour (a slot, a tone or a CSS colour); default: the palette in order of size.",
912
+ "required": false
913
+ },
914
+ {
915
+ "name": "dataTable",
916
+ "type": "boolean",
917
+ "default": null,
918
+ "description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
919
+ "required": false
920
+ },
921
+ {
922
+ "name": "description",
923
+ "type": "ReactNode",
924
+ "default": null,
925
+ "description": "A sentence under the title: the period, the unit, the source.",
926
+ "required": false
927
+ },
928
+ {
929
+ "name": "empty",
930
+ "type": "ReactNode",
931
+ "default": null,
932
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
933
+ "required": false
934
+ },
935
+ {
936
+ "name": "error",
937
+ "type": "ReactNode",
938
+ "default": null,
939
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
940
+ "required": false
941
+ },
942
+ {
943
+ "name": "exportable",
944
+ "type": "boolean | readonly ExportFormat[]",
945
+ "default": null,
946
+ "description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
947
+ "required": false
948
+ },
949
+ {
950
+ "name": "format",
951
+ "type": "ValueFormat",
952
+ "default": null,
953
+ "description": "How the amounts are written.",
954
+ "required": false
955
+ },
956
+ {
957
+ "name": "height",
958
+ "type": "number",
959
+ "default": null,
960
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
961
+ "required": false
962
+ },
963
+ {
964
+ "name": "hideTitle",
965
+ "type": "boolean",
966
+ "default": null,
967
+ "description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
968
+ "required": false
969
+ },
970
+ {
971
+ "name": "id",
972
+ "type": "string",
973
+ "default": null,
974
+ "description": "The id of the figure.",
975
+ "required": false
976
+ },
977
+ {
978
+ "name": "labelHeader",
979
+ "type": "string",
980
+ "default": null,
981
+ "description": "The header of the parts in the data table.",
982
+ "required": false
983
+ },
984
+ {
985
+ "name": "labels",
986
+ "type": "ChartLabelsInput",
987
+ "default": null,
988
+ "description": "The words, translated: the buttons, the states, the written summary.",
989
+ "required": false
990
+ },
991
+ {
992
+ "name": "live",
993
+ "type": "boolean",
994
+ "default": null,
995
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
996
+ "required": false
997
+ },
998
+ {
999
+ "name": "loading",
1000
+ "type": "boolean",
1001
+ "default": null,
1002
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
1003
+ "required": false
1004
+ },
1005
+ {
1006
+ "name": "locale",
1007
+ "type": "Locale",
1008
+ "default": null,
1009
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
1010
+ "required": false
1011
+ },
1012
+ {
1013
+ "name": "maxSlices",
1014
+ "type": "number",
1015
+ "default": null,
1016
+ "description": "At most this many slices; the rest fold into one, named `otherLabel`. Default 6.",
1017
+ "required": false
1018
+ },
1019
+ {
1020
+ "name": "onSelect",
1021
+ "type": "((datum: T, index: number) => void)",
1022
+ "default": null,
1023
+ "description": "Called with the row when a slice is clicked (or Enter is pressed on it).",
1024
+ "required": false
1025
+ },
1026
+ {
1027
+ "name": "otherLabel",
1028
+ "type": "string",
1029
+ "default": null,
1030
+ "description": "The name of the folded slice. Default “Other”.",
1031
+ "required": false
1032
+ },
1033
+ {
1034
+ "name": "style",
1035
+ "type": "CSSProperties",
1036
+ "default": null,
1037
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
1038
+ "required": false
1039
+ },
1040
+ {
1041
+ "name": "summary",
1042
+ "type": "\"hidden\" | \"visible\"",
1043
+ "default": null,
1044
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
1045
+ "required": false
1046
+ },
1047
+ {
1048
+ "name": "summaryText",
1049
+ "type": "string",
1050
+ "default": null,
1051
+ "description": "Your own summary instead of the generated one (still read first by screen readers).",
1052
+ "required": false
1053
+ },
1054
+ {
1055
+ "name": "valueHeader",
1056
+ "type": "string",
1057
+ "default": null,
1058
+ "description": "The header of the amounts in the data table.",
1059
+ "required": false
1060
+ }
1061
+ ]
1062
+ },
1063
+ {
1064
+ "component": "PieChart",
1065
+ "description": "",
1066
+ "props": [
1067
+ {
1068
+ "name": "data",
1069
+ "type": "readonly T[]",
1070
+ "default": null,
1071
+ "description": "One row per part.",
1072
+ "required": true
1073
+ },
1074
+ {
1075
+ "name": "label",
1076
+ "type": "string | ((datum: T, index: number) => string)",
1077
+ "default": null,
1078
+ "description": "The field (or function) naming the part.",
1079
+ "required": true
1080
+ },
1081
+ {
1082
+ "name": "title",
1083
+ "type": "string",
1084
+ "default": null,
1085
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
1086
+ "required": true
1087
+ },
1088
+ {
1089
+ "name": "value",
1090
+ "type": "string | ((datum: T, index: number) => number)",
1091
+ "default": null,
1092
+ "description": "The field (or function) of its amount (≥ 0).",
1093
+ "required": true
1094
+ },
1095
+ {
1096
+ "name": "brand",
1097
+ "type": "BrandId",
1098
+ "default": null,
1099
+ "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`).",
1100
+ "required": false
1101
+ },
1102
+ {
1103
+ "name": "centerLabel",
1104
+ "type": "string",
1105
+ "default": null,
1106
+ "description": "The words under the number in the hole of a donut (“Total credits”).",
1107
+ "required": false
1108
+ },
1109
+ {
1110
+ "name": "centerValue",
1111
+ "type": "string",
1112
+ "default": null,
1113
+ "description": "The number in the hole, written already. Default: the total.",
1114
+ "required": false
1115
+ },
1116
+ {
1117
+ "name": "className",
1118
+ "type": "string",
1119
+ "default": null,
1120
+ "description": "A class on the figure (layout: margins, grid placement).",
1121
+ "required": false
1122
+ },
1123
+ {
1124
+ "name": "color",
1125
+ "type": "string | ((datum: T, index: number) => SeriesColor)",
1126
+ "default": null,
1127
+ "description": "A part's own colour (a slot, a tone or a CSS colour); default: the palette in order of size.",
1128
+ "required": false
1129
+ },
1130
+ {
1131
+ "name": "dataTable",
1132
+ "type": "boolean",
1133
+ "default": null,
1134
+ "description": "The \"Show data\" button (the table is in the page for screen readers either way). Default true.",
1135
+ "required": false
1136
+ },
1137
+ {
1138
+ "name": "description",
1139
+ "type": "ReactNode",
1140
+ "default": null,
1141
+ "description": "A sentence under the title: the period, the unit, the source.",
1142
+ "required": false
1143
+ },
1144
+ {
1145
+ "name": "donut",
1146
+ "type": "boolean",
1147
+ "default": null,
1148
+ "description": "A ring rather than a pie: the total (or `centerValue`) is written in its hole.",
1149
+ "required": false
1150
+ },
1151
+ {
1152
+ "name": "empty",
1153
+ "type": "ReactNode",
1154
+ "default": null,
1155
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
1156
+ "required": false
1157
+ },
1158
+ {
1159
+ "name": "error",
1160
+ "type": "ReactNode",
1161
+ "default": null,
1162
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
1163
+ "required": false
1164
+ },
1165
+ {
1166
+ "name": "exportable",
1167
+ "type": "boolean | readonly ExportFormat[]",
1168
+ "default": null,
1169
+ "description": "Export buttons: `true` for PNG, SVG and CSV, or the formats you want.",
1170
+ "required": false
1171
+ },
1172
+ {
1173
+ "name": "format",
1174
+ "type": "ValueFormat",
1175
+ "default": null,
1176
+ "description": "How the amounts are written.",
1177
+ "required": false
1178
+ },
1179
+ {
1180
+ "name": "height",
1181
+ "type": "number",
1182
+ "default": null,
1183
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
1184
+ "required": false
1185
+ },
1186
+ {
1187
+ "name": "hideTitle",
1188
+ "type": "boolean",
1189
+ "default": null,
1190
+ "description": "Visually hide the title (it stays the chart's accessible name): a card that already has its heading.",
1191
+ "required": false
1192
+ },
1193
+ {
1194
+ "name": "id",
1195
+ "type": "string",
1196
+ "default": null,
1197
+ "description": "The id of the figure.",
1198
+ "required": false
1199
+ },
1200
+ {
1201
+ "name": "labelHeader",
1202
+ "type": "string",
1203
+ "default": null,
1204
+ "description": "The header of the parts in the data table.",
1205
+ "required": false
1206
+ },
1207
+ {
1208
+ "name": "labels",
1209
+ "type": "ChartLabelsInput",
1210
+ "default": null,
1211
+ "description": "The words, translated: the buttons, the states, the written summary.",
1212
+ "required": false
1213
+ },
1214
+ {
1215
+ "name": "live",
1216
+ "type": "boolean",
1217
+ "default": null,
1218
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
1219
+ "required": false
1220
+ },
1221
+ {
1222
+ "name": "loading",
1223
+ "type": "boolean",
1224
+ "default": null,
1225
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
1226
+ "required": false
1227
+ },
1228
+ {
1229
+ "name": "locale",
1230
+ "type": "Locale",
1231
+ "default": null,
1232
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
1233
+ "required": false
1234
+ },
1235
+ {
1236
+ "name": "maxSlices",
1237
+ "type": "number",
1238
+ "default": null,
1239
+ "description": "At most this many slices; the rest fold into one, named `otherLabel`. Default 6.",
1240
+ "required": false
1241
+ },
1242
+ {
1243
+ "name": "onSelect",
1244
+ "type": "((datum: T, index: number) => void)",
1245
+ "default": null,
1246
+ "description": "Called with the row when a slice is clicked (or Enter is pressed on it).",
1247
+ "required": false
1248
+ },
1249
+ {
1250
+ "name": "otherLabel",
1251
+ "type": "string",
1252
+ "default": null,
1253
+ "description": "The name of the folded slice. Default “Other”.",
1254
+ "required": false
1255
+ },
1256
+ {
1257
+ "name": "style",
1258
+ "type": "CSSProperties",
1259
+ "default": null,
1260
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
1261
+ "required": false
1262
+ },
1263
+ {
1264
+ "name": "summary",
1265
+ "type": "\"hidden\" | \"visible\"",
1266
+ "default": null,
1267
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
1268
+ "required": false
1269
+ },
1270
+ {
1271
+ "name": "summaryText",
1272
+ "type": "string",
1273
+ "default": null,
1274
+ "description": "Your own summary instead of the generated one (still read first by screen readers).",
1275
+ "required": false
1276
+ },
1277
+ {
1278
+ "name": "valueHeader",
1279
+ "type": "string",
1280
+ "default": null,
1281
+ "description": "The header of the amounts in the data table.",
1282
+ "required": false
1283
+ }
1284
+ ]
1285
+ }
1286
+ ]
1287
+ }