@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,562 @@
1
+ {
2
+ "name": "sparkline",
3
+ "package": "@krizaka/charts",
4
+ "type": "chart",
5
+ "title": "Sparkline",
6
+ "summary": "A word-sized trend without axes — in a stat, a table cell or a sentence — drawn on the server when its width is known.",
7
+ "description": "A word-sized trend without axes — in a stat, a table cell or a sentence — drawn on the server when its width is known.",
8
+ "status": "beta",
9
+ "category": "charts",
10
+ "platforms": "both",
11
+ "engine": "svg",
12
+ "whenToUse": [
13
+ "Beside a key figure: the last 30 days of a stat.",
14
+ "In a table, one per row: each model's throughput, each video's views."
15
+ ],
16
+ "whenNotToUse": [
17
+ {
18
+ "when": "When the reader needs the values, the axes or a comparison.",
19
+ "use": "line-chart"
20
+ },
21
+ {
22
+ "when": "A value against a range.",
23
+ "use": "gauge"
24
+ }
25
+ ],
26
+ "bestPractices": [
27
+ "Give it a `width` in a table: it renders on the server, with no placeholder.",
28
+ "Colour by the trend with `trendTone` (`\"inverse\"` when down is good: costs, latency).",
29
+ "Write the current value next to it: the line shows the shape, not the figure."
30
+ ],
31
+ "accessibility": {
32
+ "keyboard": [],
33
+ "notes": [
34
+ "Its title is visually hidden but names it; its summary (first, last, extremes, trend) is read.",
35
+ "It does not take the focus: it is a picture of the trend, the figures are in the summary and its table."
36
+ ]
37
+ },
38
+ "related": [
39
+ "line-chart",
40
+ "gauge",
41
+ "bar-chart"
42
+ ],
43
+ "source": "packages/charts/src/meta/sparkline.ts",
44
+ "install": {
45
+ "web": "npm install @krizaka/charts",
46
+ "native": "npx expo install react-native-svg\nnpm install @krizaka/charts"
47
+ },
48
+ "web": {
49
+ "entry": "@krizaka/charts/sparkline",
50
+ "import": "import { Sparkline } from \"@krizaka/charts/sparkline\";",
51
+ "props": [
52
+ {
53
+ "component": "Sparkline",
54
+ "description": "The shape of a trend in a few pixels: a stat's last 30 days, a job's throughput.",
55
+ "props": [
56
+ {
57
+ "name": "data",
58
+ "type": "readonly (number | null)[]",
59
+ "default": null,
60
+ "description": "The values, oldest first (`null` for a gap).",
61
+ "required": true
62
+ },
63
+ {
64
+ "name": "title",
65
+ "type": "string",
66
+ "default": null,
67
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
68
+ "required": true
69
+ },
70
+ {
71
+ "name": "brand",
72
+ "type": "BrandId",
73
+ "default": null,
74
+ "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`).",
75
+ "required": false
76
+ },
77
+ {
78
+ "name": "categories",
79
+ "type": "readonly unknown[]",
80
+ "default": null,
81
+ "description": "The labels of the values (dates, ISO or `Date`), for the summary and the table. Default: their positions.",
82
+ "required": false
83
+ },
84
+ {
85
+ "name": "className",
86
+ "type": "string",
87
+ "default": null,
88
+ "description": "A class on the figure (layout: margins, grid placement).",
89
+ "required": false
90
+ },
91
+ {
92
+ "name": "color",
93
+ "type": "SeriesColor",
94
+ "default": null,
95
+ "description": "A palette slot, a tone or a CSS colour. Default: the trend's tone when `trendTone`, else slot 1.",
96
+ "required": false
97
+ },
98
+ {
99
+ "name": "empty",
100
+ "type": "ReactNode",
101
+ "default": null,
102
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
103
+ "required": false
104
+ },
105
+ {
106
+ "name": "error",
107
+ "type": "ReactNode",
108
+ "default": null,
109
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
110
+ "required": false
111
+ },
112
+ {
113
+ "name": "format",
114
+ "type": "ValueFormat",
115
+ "default": null,
116
+ "description": "How the values are written in the summary and table.",
117
+ "required": false
118
+ },
119
+ {
120
+ "name": "height",
121
+ "type": "number",
122
+ "default": null,
123
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
124
+ "required": false
125
+ },
126
+ {
127
+ "name": "id",
128
+ "type": "string",
129
+ "default": null,
130
+ "description": "The id of the figure.",
131
+ "required": false
132
+ },
133
+ {
134
+ "name": "labels",
135
+ "type": "ChartLabelsInput",
136
+ "default": null,
137
+ "description": "The words, translated: the buttons, the states, the written summary.",
138
+ "required": false
139
+ },
140
+ {
141
+ "name": "live",
142
+ "type": "boolean",
143
+ "default": null,
144
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
145
+ "required": false
146
+ },
147
+ {
148
+ "name": "loading",
149
+ "type": "boolean",
150
+ "default": null,
151
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
152
+ "required": false
153
+ },
154
+ {
155
+ "name": "locale",
156
+ "type": "Locale",
157
+ "default": null,
158
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
159
+ "required": false
160
+ },
161
+ {
162
+ "name": "style",
163
+ "type": "CSSProperties",
164
+ "default": null,
165
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
166
+ "required": false
167
+ },
168
+ {
169
+ "name": "summary",
170
+ "type": "\"hidden\" | \"visible\"",
171
+ "default": null,
172
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
173
+ "required": false
174
+ },
175
+ {
176
+ "name": "summaryText",
177
+ "type": "string",
178
+ "default": null,
179
+ "description": "Your own summary instead of the generated one (still read first by screen readers).",
180
+ "required": false
181
+ },
182
+ {
183
+ "name": "threshold",
184
+ "type": "Threshold",
185
+ "default": null,
186
+ "description": "A dashed reference line (yesterday's average, a quota).",
187
+ "required": false
188
+ },
189
+ {
190
+ "name": "trendTone",
191
+ "type": "boolean | \"inverse\"",
192
+ "default": null,
193
+ "description": "Colour by the trend: success up, danger down (or the reverse with `\"inverse\"`: costs, latency).",
194
+ "required": false
195
+ },
196
+ {
197
+ "name": "variant",
198
+ "type": "\"line\" | \"area\" | \"bar\"",
199
+ "default": null,
200
+ "description": "`line` (default), `area` (line over a wash) or `bar` (discrete counts: jobs per hour).",
201
+ "required": false
202
+ },
203
+ {
204
+ "name": "width",
205
+ "type": "number",
206
+ "default": null,
207
+ "description": "A fixed width in pixels: drawn on the server too. Default: the container's width.",
208
+ "required": false
209
+ }
210
+ ]
211
+ }
212
+ ],
213
+ "examples": [
214
+ {
215
+ "name": "stat-trend",
216
+ "title": "In a stat",
217
+ "description": "Thirty days of views beside the figure, coloured by the trend.",
218
+ "path": "examples/sparkline/stat-trend.tsx",
219
+ "module": "@krizaka/charts/registry/examples/sparkline/stat-trend",
220
+ "code": "import { Sparkline } from \"@krizaka/charts/sparkline\";\n\nconst views = [820, 760, 910, 880, 1_020, 990, 1_130, 1_210, 1_090, 1_340, 1_280, 1_420, 1_390, 1_510, 1_620, 1_580, 1_700, 1_640, 1_810, 1_760, 1_930, 2_040, 1_980, 2_150, 2_090, 2_260, 2_340, 2_280, 2_410, 2_520];\n\nexport default function StatTrend() {\n return (\n <div style={{ display: \"flex\", alignItems: \"flex-end\", gap: 16 }}>\n <div>\n <p style={{ margin: 0, fontSize: 13, color: \"var(--kz-text-secondary)\" }}>Views, last 30 days</p>\n <p style={{ margin: 0, fontSize: 28, fontWeight: 600, color: \"var(--kz-text-primary)\" }}>2,520</p>\n </div>\n <Sparkline title=\"Views, last 30 days\" data={views} variant=\"area\" trendTone width={140} height={40} format=\"integer\" />\n </div>\n );\n}\n"
221
+ },
222
+ {
223
+ "name": "table-rows",
224
+ "title": "In a table",
225
+ "description": "One fixed-width sparkline per row, drawn on the server: latency, coloured inverse.",
226
+ "path": "examples/sparkline/table-rows.tsx",
227
+ "module": "@krizaka/charts/registry/examples/sparkline/table-rows",
228
+ "code": "import { Sparkline } from \"@krizaka/charts/sparkline\";\n\n// p95 latency (ms) over the last 12 hours: down is good, hence `trendTone=\"inverse\"`.\nconst models = [\n { name: \"Chat · Mistral Large\", p95: [820, 790, 805, 760, 742, 731, 720, 704, 699, 688, 690, 676] },\n { name: \"Image · Flux\", p95: [2_400, 2_380, 2_520, 2_610, 2_590, 2_700, 2_760, 2_810, 2_790, 2_880, 2_910, 2_950] },\n { name: \"Speech · Whisper\", p95: [310, 305, 312, 309, 300, 311, 306, 304, 308, 302, 307, 305] },\n];\n\nexport default function TableRows() {\n return (\n <table style={{ borderCollapse: \"collapse\", fontSize: 13, color: \"var(--kz-text-primary)\" }}>\n <tbody>\n {models.map((m) => (\n <tr key={m.name} style={{ borderTop: \"1px solid var(--kz-border-subtle)\" }}>\n <th scope=\"row\" style={{ padding: \"8px 16px 8px 0\", textAlign: \"left\", fontWeight: 500 }}>{m.name}</th>\n <td style={{ padding: 8 }}>\n <Sparkline title={`${m.name}, p95 latency`} data={m.p95} trendTone=\"inverse\" width={120} height={28} format={{ style: \"unit\", unit: \"millisecond\" }} />\n </td>\n <td style={{ padding: 8, textAlign: \"right\" }}>{m.p95[m.p95.length - 1]} ms</td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n"
229
+ },
230
+ {
231
+ "name": "bars",
232
+ "title": "Bars",
233
+ "description": "Discrete counts: jobs per hour.",
234
+ "path": "examples/sparkline/bars.tsx",
235
+ "module": "@krizaka/charts/registry/examples/sparkline/bars",
236
+ "code": "import { Sparkline } from \"@krizaka/charts/sparkline\";\n\nconst jobsPerHour = [12, 8, 5, 3, 2, 4, 9, 21, 38, 52, 61, 58, 64, 70, 66, 59, 63, 55, 47, 41, 33, 26, 19, 14];\n\nexport default function Bars() {\n return <Sparkline title=\"Jobs per hour, today\" data={jobsPerHour} variant=\"bar\" width={180} height={36} format=\"integer\" color={2} />;\n}\n"
237
+ }
238
+ ]
239
+ },
240
+ "native": {
241
+ "entry": "@krizaka/charts/native",
242
+ "import": "import { Sparkline } from \"@krizaka/charts/native\";",
243
+ "differences": [
244
+ "No threshold line."
245
+ ],
246
+ "props": [
247
+ {
248
+ "component": "Sparkline",
249
+ "description": "A word-sized trend (React Native).",
250
+ "props": [
251
+ {
252
+ "name": "data",
253
+ "type": "readonly (number | null)[]",
254
+ "default": null,
255
+ "description": "The values, oldest first (`null` for a gap).",
256
+ "required": true
257
+ },
258
+ {
259
+ "name": "title",
260
+ "type": "string",
261
+ "default": null,
262
+ "description": "What the chart shows: its heading and accessible name.",
263
+ "required": true
264
+ },
265
+ {
266
+ "name": "brand",
267
+ "type": "BrandId",
268
+ "default": null,
269
+ "description": "The brand whose palette leads. Default Krizaka.",
270
+ "required": false
271
+ },
272
+ {
273
+ "name": "categories",
274
+ "type": "readonly unknown[]",
275
+ "default": null,
276
+ "description": "The labels of the values (dates), for the summary.",
277
+ "required": false
278
+ },
279
+ {
280
+ "name": "color",
281
+ "type": "SeriesColor",
282
+ "default": null,
283
+ "description": "A palette slot, a tone or a colour.",
284
+ "required": false
285
+ },
286
+ {
287
+ "name": "empty",
288
+ "type": "ReactNode",
289
+ "default": null,
290
+ "description": "Shown instead of the plot when there is nothing to draw. Default: the `empty` label.",
291
+ "required": false
292
+ },
293
+ {
294
+ "name": "format",
295
+ "type": "ValueFormat",
296
+ "default": null,
297
+ "description": "How the values are written in the summary.",
298
+ "required": false
299
+ },
300
+ {
301
+ "name": "height",
302
+ "type": "number",
303
+ "default": null,
304
+ "description": "The plot's height.",
305
+ "required": false
306
+ },
307
+ {
308
+ "name": "labels",
309
+ "type": "ChartLabelsInput",
310
+ "default": null,
311
+ "description": "The words: the readout, the summary.",
312
+ "required": false
313
+ },
314
+ {
315
+ "name": "loading",
316
+ "type": "boolean",
317
+ "default": null,
318
+ "description": "The data is on its way.",
319
+ "required": false
320
+ },
321
+ {
322
+ "name": "locale",
323
+ "type": "Locale",
324
+ "default": null,
325
+ "description": "The locale of every figure and date. Default `\"en-US\"`.",
326
+ "required": false
327
+ },
328
+ {
329
+ "name": "scheme",
330
+ "type": "Mode",
331
+ "default": null,
332
+ "description": "Dark or light. Default: the device's (pass `useTheme().scheme` of\n@krizaka /ui/native to follow the app).",
333
+ "required": false
334
+ },
335
+ {
336
+ "name": "style",
337
+ "type": "ViewStyle",
338
+ "default": null,
339
+ "description": "The style of the chart's container (layout only: colours come from the theme).",
340
+ "required": false
341
+ },
342
+ {
343
+ "name": "theme",
344
+ "type": "Partial<ChartTheme>",
345
+ "default": null,
346
+ "description": "The app's colour roles (`useTheme().theme` of\n@krizaka /ui/native): a product's brand overrides apply.",
347
+ "required": false
348
+ },
349
+ {
350
+ "name": "trendTone",
351
+ "type": "boolean | \"inverse\"",
352
+ "default": null,
353
+ "description": "Colour by the trend (success up, danger down; `\"inverse\"` for costs).",
354
+ "required": false
355
+ },
356
+ {
357
+ "name": "variant",
358
+ "type": "\"line\" | \"area\" | \"bar\"",
359
+ "default": null,
360
+ "description": "`line` (default), `area` or `bar`.",
361
+ "required": false
362
+ },
363
+ {
364
+ "name": "width",
365
+ "type": "number",
366
+ "default": null,
367
+ "description": "A fixed width. Default: the container's.",
368
+ "required": false
369
+ }
370
+ ]
371
+ }
372
+ ],
373
+ "examples": [
374
+ {
375
+ "name": "stat-trend",
376
+ "title": "In a stat",
377
+ "description": "Thirty days of views, coloured by the trend.",
378
+ "path": "examples/sparkline/native/stat-trend.tsx",
379
+ "module": "@krizaka/charts/registry/examples/sparkline/native/stat-trend",
380
+ "code": "import { Sparkline } from \"@krizaka/charts/native\";\n\nconst views = [820, 760, 910, 880, 1_020, 990, 1_130, 1_210, 1_090, 1_340, 1_280, 1_420, 1_390, 1_510, 1_620, 1_580, 1_700, 1_640, 1_810, 1_760, 1_930, 2_040, 1_980, 2_150, 2_090, 2_260, 2_340, 2_280, 2_410, 2_520];\n\nexport default function StatTrend() {\n return <Sparkline title=\"Views, last 30 days\" data={views} variant=\"area\" trendTone width={160} height={40} format=\"integer\" />;\n}\n",
381
+ "screenshots": {
382
+ "dark": "examples/sparkline/native/stat-trend.dark.png",
383
+ "light": "examples/sparkline/native/stat-trend.light.png"
384
+ }
385
+ }
386
+ ]
387
+ },
388
+ "files": [],
389
+ "dependencies": [
390
+ "@krizaka/intl@workspace:^",
391
+ "d3-geo@^3.1.1",
392
+ "echarts@^6.1.0",
393
+ "topojson-client@^3.1.0"
394
+ ],
395
+ "registryDependencies": [],
396
+ "demo": {
397
+ "path": "examples/sparkline/stat-trend.tsx",
398
+ "content": "import { Sparkline } from \"@krizaka/charts/sparkline\";\n\nconst views = [820, 760, 910, 880, 1_020, 990, 1_130, 1_210, 1_090, 1_340, 1_280, 1_420, 1_390, 1_510, 1_620, 1_580, 1_700, 1_640, 1_810, 1_760, 1_930, 2_040, 1_980, 2_150, 2_090, 2_260, 2_340, 2_280, 2_410, 2_520];\n\nexport default function StatTrend() {\n return (\n <div style={{ display: \"flex\", alignItems: \"flex-end\", gap: 16 }}>\n <div>\n <p style={{ margin: 0, fontSize: 13, color: \"var(--kz-text-secondary)\" }}>Views, last 30 days</p>\n <p style={{ margin: 0, fontSize: 28, fontWeight: 600, color: \"var(--kz-text-primary)\" }}>2,520</p>\n </div>\n <Sparkline title=\"Views, last 30 days\" data={views} variant=\"area\" trendTone width={140} height={40} format=\"integer\" />\n </div>\n );\n}\n"
399
+ },
400
+ "props": [
401
+ {
402
+ "component": "Sparkline",
403
+ "description": "The shape of a trend in a few pixels: a stat's last 30 days, a job's throughput.",
404
+ "props": [
405
+ {
406
+ "name": "data",
407
+ "type": "readonly (number | null)[]",
408
+ "default": null,
409
+ "description": "The values, oldest first (`null` for a gap).",
410
+ "required": true
411
+ },
412
+ {
413
+ "name": "title",
414
+ "type": "string",
415
+ "default": null,
416
+ "description": "What the chart shows, in a few words: its accessible name, and its heading unless `hideTitle`.",
417
+ "required": true
418
+ },
419
+ {
420
+ "name": "brand",
421
+ "type": "BrandId",
422
+ "default": null,
423
+ "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`).",
424
+ "required": false
425
+ },
426
+ {
427
+ "name": "categories",
428
+ "type": "readonly unknown[]",
429
+ "default": null,
430
+ "description": "The labels of the values (dates, ISO or `Date`), for the summary and the table. Default: their positions.",
431
+ "required": false
432
+ },
433
+ {
434
+ "name": "className",
435
+ "type": "string",
436
+ "default": null,
437
+ "description": "A class on the figure (layout: margins, grid placement).",
438
+ "required": false
439
+ },
440
+ {
441
+ "name": "color",
442
+ "type": "SeriesColor",
443
+ "default": null,
444
+ "description": "A palette slot, a tone or a CSS colour. Default: the trend's tone when `trendTone`, else slot 1.",
445
+ "required": false
446
+ },
447
+ {
448
+ "name": "empty",
449
+ "type": "ReactNode",
450
+ "default": null,
451
+ "description": "What to show when there is nothing to draw (default: the `empty` label). An `EmptyState` of\n@krizaka /ui fits.",
452
+ "required": false
453
+ },
454
+ {
455
+ "name": "error",
456
+ "type": "ReactNode",
457
+ "default": null,
458
+ "description": "The data could not be loaded: `true` says the default words, a node says yours (a retry button…).",
459
+ "required": false
460
+ },
461
+ {
462
+ "name": "format",
463
+ "type": "ValueFormat",
464
+ "default": null,
465
+ "description": "How the values are written in the summary and table.",
466
+ "required": false
467
+ },
468
+ {
469
+ "name": "height",
470
+ "type": "number",
471
+ "default": null,
472
+ "description": "The height of the plot in pixels. Default 280 (a sparkline: 32).",
473
+ "required": false
474
+ },
475
+ {
476
+ "name": "id",
477
+ "type": "string",
478
+ "default": null,
479
+ "description": "The id of the figure.",
480
+ "required": false
481
+ },
482
+ {
483
+ "name": "labels",
484
+ "type": "ChartLabelsInput",
485
+ "default": null,
486
+ "description": "The words, translated: the buttons, the states, the written summary.",
487
+ "required": false
488
+ },
489
+ {
490
+ "name": "live",
491
+ "type": "boolean",
492
+ "default": null,
493
+ "description": "Streaming data (a job queue, an auction): no entrance on updates, no announcement of every new point.",
494
+ "required": false
495
+ },
496
+ {
497
+ "name": "loading",
498
+ "type": "boolean",
499
+ "default": null,
500
+ "description": "The data is on its way: a skeleton of the chart, announced once.",
501
+ "required": false
502
+ },
503
+ {
504
+ "name": "locale",
505
+ "type": "Locale",
506
+ "default": null,
507
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
508
+ "required": false
509
+ },
510
+ {
511
+ "name": "style",
512
+ "type": "CSSProperties",
513
+ "default": null,
514
+ "description": "Inline style on the figure (layout only: colours come from the tokens).",
515
+ "required": false
516
+ },
517
+ {
518
+ "name": "summary",
519
+ "type": "\"hidden\" | \"visible\"",
520
+ "default": null,
521
+ "description": "The written summary: read by screen readers only (`\"hidden\"`, default), or shown under the chart (`\"visible\"`).",
522
+ "required": false
523
+ },
524
+ {
525
+ "name": "summaryText",
526
+ "type": "string",
527
+ "default": null,
528
+ "description": "Your own summary instead of the generated one (still read first by screen readers).",
529
+ "required": false
530
+ },
531
+ {
532
+ "name": "threshold",
533
+ "type": "Threshold",
534
+ "default": null,
535
+ "description": "A dashed reference line (yesterday's average, a quota).",
536
+ "required": false
537
+ },
538
+ {
539
+ "name": "trendTone",
540
+ "type": "boolean | \"inverse\"",
541
+ "default": null,
542
+ "description": "Colour by the trend: success up, danger down (or the reverse with `\"inverse\"`: costs, latency).",
543
+ "required": false
544
+ },
545
+ {
546
+ "name": "variant",
547
+ "type": "\"line\" | \"area\" | \"bar\"",
548
+ "default": null,
549
+ "description": "`line` (default), `area` (line over a wash) or `bar` (discrete counts: jobs per hour).",
550
+ "required": false
551
+ },
552
+ {
553
+ "name": "width",
554
+ "type": "number",
555
+ "default": null,
556
+ "description": "A fixed width in pixels: drawn on the server too. Default: the container's width.",
557
+ "required": false
558
+ }
559
+ ]
560
+ }
561
+ ]
562
+ }