@krizaka/charts 0.1.0 → 0.2.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 (193) hide show
  1. package/README.md +17 -5
  2. package/dist/bar.js +5 -4
  3. package/dist/candlestick.js +3 -3
  4. package/dist/chart.js +3 -3
  5. package/dist/{chunk-EK3Z647J.js → chunk-4LBXEAGC.js} +3 -3
  6. package/dist/{chunk-AHQXJSAQ.js → chunk-AA5EWWYV.js} +2 -2
  7. package/dist/{chunk-VKO2OYYM.js → chunk-ARARFMNE.js} +2 -2
  8. package/dist/{chunk-WBH2QU77.js → chunk-BV4DBGN7.js} +2 -2
  9. package/dist/{chunk-BZ5CQFPH.js → chunk-C4MFZLJM.js} +2 -2
  10. package/dist/{chunk-XAJ3KCC4.js → chunk-CSSZLFLO.js} +3 -3
  11. package/dist/{chunk-UNK4MJVG.js → chunk-CVWSMUUB.js} +8 -8
  12. package/dist/chunk-E5DKBSWX.js +2 -0
  13. package/dist/chunk-E5DKBSWX.js.map +1 -0
  14. package/dist/chunk-EEP7PS2L.js +54 -0
  15. package/dist/chunk-EEP7PS2L.js.map +1 -0
  16. package/dist/{chunk-DZB6HEVO.js → chunk-EQLC2QVN.js} +2 -2
  17. package/dist/chunk-FINOPIDN.js +2 -0
  18. package/dist/chunk-FINOPIDN.js.map +1 -0
  19. package/dist/chunk-G2KF2WL4.js +2 -0
  20. package/dist/chunk-G2KF2WL4.js.map +1 -0
  21. package/dist/{chunk-PTSB3H5Q.js → chunk-I3D7KUGN.js} +2 -2
  22. package/dist/chunk-IKQV3NSL.js +76 -0
  23. package/dist/chunk-IKQV3NSL.js.map +1 -0
  24. package/dist/{chunk-DWJPPEMC.js → chunk-JTKR7ZWP.js} +73 -60
  25. package/dist/chunk-JTKR7ZWP.js.map +1 -0
  26. package/dist/chunk-KNDHO67X.js +78 -0
  27. package/dist/chunk-KNDHO67X.js.map +1 -0
  28. package/dist/chunk-L2EKYWVI.js +94 -0
  29. package/dist/chunk-L2EKYWVI.js.map +1 -0
  30. package/dist/{chunk-XC6BQ3RN.js → chunk-MXLITIGU.js} +3 -3
  31. package/dist/{chunk-OER6ETT4.js → chunk-NCIQMRV3.js} +3 -3
  32. package/dist/chunk-OIRHLJBC.js +83 -0
  33. package/dist/chunk-OIRHLJBC.js.map +1 -0
  34. package/dist/{chunk-WIRCIOLH.js → chunk-PBQV3B6O.js} +5 -5
  35. package/dist/chunk-POQIHFAZ.js +2 -0
  36. package/dist/chunk-POQIHFAZ.js.map +1 -0
  37. package/dist/{chunk-I5QUZVU2.js → chunk-PWMMXRMC.js} +2 -2
  38. package/dist/chunk-SLEJDQ3A.js +81 -0
  39. package/dist/chunk-SLEJDQ3A.js.map +1 -0
  40. package/dist/{chunk-7TIFCK5E.js → chunk-VKZZY2QD.js} +3 -3
  41. package/dist/{chunk-VKTZD7UT.js → chunk-W5ILLSPK.js} +3 -3
  42. package/dist/chunk-WBHFVBSK.js +25 -0
  43. package/dist/chunk-WBHFVBSK.js.map +1 -0
  44. package/dist/chunk-WNUFGMS7.js +113 -0
  45. package/dist/chunk-WNUFGMS7.js.map +1 -0
  46. package/dist/{chunk-XR4ZJDOV.js → chunk-WVTIKOII.js} +2 -2
  47. package/dist/{chunk-7CSAGFBW.js → chunk-XDDALY4C.js} +3 -3
  48. package/dist/credits.d.ts +42 -0
  49. package/dist/credits.js +21 -0
  50. package/dist/credits.js.map +1 -0
  51. package/dist/earnings.d.ts +29 -0
  52. package/dist/earnings.js +22 -0
  53. package/dist/earnings.js.map +1 -0
  54. package/dist/funnel.js +3 -3
  55. package/dist/gauge.js +3 -2
  56. package/dist/geo.js +2 -2
  57. package/dist/globe.js +2 -2
  58. package/dist/goal.d.ts +26 -0
  59. package/dist/goal.js +17 -0
  60. package/dist/goal.js.map +1 -0
  61. package/dist/heatmap.js +3 -3
  62. package/dist/index.d.ts +7 -0
  63. package/dist/index.js +80 -33
  64. package/dist/labels-DE_743fQ.d.ts +72 -0
  65. package/dist/latency.d.ts +33 -0
  66. package/dist/latency.js +24 -0
  67. package/dist/latency.js.map +1 -0
  68. package/dist/line.js +5 -4
  69. package/dist/native.d.ts +195 -1
  70. package/dist/native.js +383 -14
  71. package/dist/native.js.map +1 -1
  72. package/dist/pie.js +3 -3
  73. package/dist/radar.js +3 -3
  74. package/dist/sankey.js +3 -3
  75. package/dist/scatter.js +3 -3
  76. package/dist/sparkline.js +4 -3
  77. package/dist/throughput.d.ts +37 -0
  78. package/dist/throughput.js +24 -0
  79. package/dist/throughput.js.map +1 -0
  80. package/dist/ticker.d.ts +38 -0
  81. package/dist/ticker.js +22 -0
  82. package/dist/ticker.js.map +1 -0
  83. package/dist/treemap.js +3 -3
  84. package/package.json +100 -4
  85. package/registry/area-chart.json +1 -0
  86. package/registry/bar-chart.json +1 -0
  87. package/registry/calendar-heatmap.json +1 -0
  88. package/registry/candlestick.json +1 -0
  89. package/registry/chart.json +1 -0
  90. package/registry/charts-provider.json +1 -0
  91. package/registry/credit-usage.json +473 -0
  92. package/registry/earnings-chart.json +703 -0
  93. package/registry/examples/credit-usage/monthly-credits.d.ts +4 -0
  94. package/registry/examples/credit-usage/monthly-credits.js +24 -0
  95. package/registry/examples/credit-usage/monthly-credits.tsx +19 -0
  96. package/registry/examples/credit-usage/native/monthly-credits.d.ts +4 -0
  97. package/registry/examples/credit-usage/native/monthly-credits.dark.png +0 -0
  98. package/registry/examples/credit-usage/native/monthly-credits.js +23 -0
  99. package/registry/examples/credit-usage/native/monthly-credits.light.png +0 -0
  100. package/registry/examples/credit-usage/native/monthly-credits.tsx +18 -0
  101. package/registry/examples/credit-usage/storage-plan.d.ts +4 -0
  102. package/registry/examples/credit-usage/storage-plan.js +21 -0
  103. package/registry/examples/credit-usage/storage-plan.tsx +15 -0
  104. package/registry/examples/earnings-chart/creator-month.d.ts +4 -0
  105. package/registry/examples/earnings-chart/creator-month.js +29 -0
  106. package/registry/examples/earnings-chart/creator-month.tsx +24 -0
  107. package/registry/examples/earnings-chart/gross-and-net.d.ts +4 -0
  108. package/registry/examples/earnings-chart/gross-and-net.js +29 -0
  109. package/registry/examples/earnings-chart/gross-and-net.tsx +24 -0
  110. package/registry/examples/earnings-chart/native/creator-month.d.ts +4 -0
  111. package/registry/examples/earnings-chart/native/creator-month.dark.png +0 -0
  112. package/registry/examples/earnings-chart/native/creator-month.js +29 -0
  113. package/registry/examples/earnings-chart/native/creator-month.light.png +0 -0
  114. package/registry/examples/earnings-chart/native/creator-month.tsx +24 -0
  115. package/registry/examples/goal-progress/challenge-pot.d.ts +4 -0
  116. package/registry/examples/goal-progress/challenge-pot.js +22 -0
  117. package/registry/examples/goal-progress/challenge-pot.tsx +16 -0
  118. package/registry/examples/goal-progress/goal-reached.d.ts +4 -0
  119. package/registry/examples/goal-progress/goal-reached.js +11 -0
  120. package/registry/examples/goal-progress/goal-reached.tsx +6 -0
  121. package/registry/examples/goal-progress/native/challenge-pot.d.ts +4 -0
  122. package/registry/examples/goal-progress/native/challenge-pot.dark.png +0 -0
  123. package/registry/examples/goal-progress/native/challenge-pot.js +11 -0
  124. package/registry/examples/goal-progress/native/challenge-pot.light.png +0 -0
  125. package/registry/examples/goal-progress/native/challenge-pot.tsx +6 -0
  126. package/registry/examples/job-throughput/live-hours.d.ts +4 -0
  127. package/registry/examples/job-throughput/live-hours.js +33 -0
  128. package/registry/examples/job-throughput/live-hours.tsx +28 -0
  129. package/registry/examples/job-throughput/native/week-of-jobs.d.ts +4 -0
  130. package/registry/examples/job-throughput/native/week-of-jobs.dark.png +0 -0
  131. package/registry/examples/job-throughput/native/week-of-jobs.js +20 -0
  132. package/registry/examples/job-throughput/native/week-of-jobs.light.png +0 -0
  133. package/registry/examples/job-throughput/native/week-of-jobs.tsx +16 -0
  134. package/registry/examples/job-throughput/week-of-jobs.d.ts +4 -0
  135. package/registry/examples/job-throughput/week-of-jobs.js +20 -0
  136. package/registry/examples/job-throughput/week-of-jobs.tsx +16 -0
  137. package/registry/examples/latency-chart/by-capability.d.ts +4 -0
  138. package/registry/examples/latency-chart/by-capability.js +26 -0
  139. package/registry/examples/latency-chart/by-capability.tsx +21 -0
  140. package/registry/examples/latency-chart/native/by-capability.d.ts +4 -0
  141. package/registry/examples/latency-chart/native/by-capability.dark.png +0 -0
  142. package/registry/examples/latency-chart/native/by-capability.js +17 -0
  143. package/registry/examples/latency-chart/native/by-capability.light.png +0 -0
  144. package/registry/examples/latency-chart/native/by-capability.tsx +13 -0
  145. package/registry/examples/latency-chart/time-to-result.d.ts +4 -0
  146. package/registry/examples/latency-chart/time-to-result.js +27 -0
  147. package/registry/examples/latency-chart/time-to-result.tsx +22 -0
  148. package/registry/examples/price-ticker/auction-room.d.ts +4 -0
  149. package/registry/examples/price-ticker/auction-room.js +21 -0
  150. package/registry/examples/price-ticker/auction-room.tsx +17 -0
  151. package/registry/examples/price-ticker/native/auction-room.d.ts +4 -0
  152. package/registry/examples/price-ticker/native/auction-room.dark.png +0 -0
  153. package/registry/examples/price-ticker/native/auction-room.js +19 -0
  154. package/registry/examples/price-ticker/native/auction-room.light.png +0 -0
  155. package/registry/examples/price-ticker/native/auction-room.tsx +15 -0
  156. package/registry/examples/price-ticker/no-bid-yet.d.ts +4 -0
  157. package/registry/examples/price-ticker/no-bid-yet.js +11 -0
  158. package/registry/examples/price-ticker/no-bid-yet.tsx +6 -0
  159. package/registry/funnel.json +1 -0
  160. package/registry/gauge.json +1 -0
  161. package/registry/geo-map.json +1 -0
  162. package/registry/globe.json +1 -0
  163. package/registry/goal-progress.json +520 -0
  164. package/registry/heatmap.json +1 -0
  165. package/registry/index.json +163 -1
  166. package/registry/job-throughput.json +654 -0
  167. package/registry/latency-chart.json +671 -0
  168. package/registry/line-chart.json +1 -0
  169. package/registry/pie-chart.json +1 -0
  170. package/registry/price-ticker.json +684 -0
  171. package/registry/radar-chart.json +1 -0
  172. package/registry/sankey.json +1 -0
  173. package/registry/scatter-chart.json +1 -0
  174. package/registry/sparkline.json +1 -0
  175. package/registry/treemap.json +1 -0
  176. package/dist/chunk-DWJPPEMC.js.map +0 -1
  177. /package/dist/{chunk-EK3Z647J.js.map → chunk-4LBXEAGC.js.map} +0 -0
  178. /package/dist/{chunk-AHQXJSAQ.js.map → chunk-AA5EWWYV.js.map} +0 -0
  179. /package/dist/{chunk-VKO2OYYM.js.map → chunk-ARARFMNE.js.map} +0 -0
  180. /package/dist/{chunk-WBH2QU77.js.map → chunk-BV4DBGN7.js.map} +0 -0
  181. /package/dist/{chunk-BZ5CQFPH.js.map → chunk-C4MFZLJM.js.map} +0 -0
  182. /package/dist/{chunk-XAJ3KCC4.js.map → chunk-CSSZLFLO.js.map} +0 -0
  183. /package/dist/{chunk-UNK4MJVG.js.map → chunk-CVWSMUUB.js.map} +0 -0
  184. /package/dist/{chunk-DZB6HEVO.js.map → chunk-EQLC2QVN.js.map} +0 -0
  185. /package/dist/{chunk-PTSB3H5Q.js.map → chunk-I3D7KUGN.js.map} +0 -0
  186. /package/dist/{chunk-XC6BQ3RN.js.map → chunk-MXLITIGU.js.map} +0 -0
  187. /package/dist/{chunk-OER6ETT4.js.map → chunk-NCIQMRV3.js.map} +0 -0
  188. /package/dist/{chunk-WIRCIOLH.js.map → chunk-PBQV3B6O.js.map} +0 -0
  189. /package/dist/{chunk-I5QUZVU2.js.map → chunk-PWMMXRMC.js.map} +0 -0
  190. /package/dist/{chunk-7TIFCK5E.js.map → chunk-VKZZY2QD.js.map} +0 -0
  191. /package/dist/{chunk-VKTZD7UT.js.map → chunk-W5ILLSPK.js.map} +0 -0
  192. /package/dist/{chunk-XR4ZJDOV.js.map → chunk-WVTIKOII.js.map} +0 -0
  193. /package/dist/{chunk-7CSAGFBW.js.map → chunk-XDDALY4C.js.map} +0 -0
@@ -0,0 +1,473 @@
1
+ {
2
+ "name": "credit-usage",
3
+ "package": "@krizaka/charts",
4
+ "type": "chart",
5
+ "title": "Credit usage",
6
+ "summary": "What is left of an allowance: the remaining amount in large, a meter that turns to warning then danger, the use per day and the day it runs out.",
7
+ "description": "What is left of an allowance: the remaining amount in large, a meter that turns to warning then danger, the use per day and the day it runs out.",
8
+ "status": "beta",
9
+ "category": "charts",
10
+ "platforms": "both",
11
+ "engine": "svg",
12
+ "tier": "ready-made",
13
+ "whenToUse": [
14
+ "Orazaka's billing: the credits left this month and when they run out at the current pace.",
15
+ "A storage plan (Orochia's console): gigabytes used of the plan, with a unit format.",
16
+ "Any quota that renews: API calls, minutes of video."
17
+ ],
18
+ "whenNotToUse": [
19
+ {
20
+ "when": "Money raised towards a goal.",
21
+ "use": "goal-progress"
22
+ },
23
+ {
24
+ "when": "A value in a range with no notion of running out (a load, a score).",
25
+ "use": "gauge"
26
+ }
27
+ ],
28
+ "bestPractices": [
29
+ "Pass the use of the recent days: the projection and the sparkline need it.",
30
+ "Pass `now` from the server when the page is server-rendered: both sides write the same date.",
31
+ "Lead with what is left, not what is used: it is what people decide on."
32
+ ],
33
+ "accessibility": {
34
+ "keyboard": [],
35
+ "notes": [
36
+ "The meter is a `meter` named by the title, its value said in words (“3,120 used (62 %)”).",
37
+ "The warning and danger tones come with words: the projection says when it runs out."
38
+ ]
39
+ },
40
+ "related": [
41
+ "gauge",
42
+ "sparkline",
43
+ "goal-progress"
44
+ ],
45
+ "source": "packages/charts/src/meta/credit-usage.ts",
46
+ "install": {
47
+ "web": "npm install @krizaka/charts",
48
+ "native": "npx expo install react-native-svg\nnpm install @krizaka/charts"
49
+ },
50
+ "web": {
51
+ "entry": "@krizaka/charts/credits",
52
+ "import": "import { CreditUsage } from \"@krizaka/charts/credits\";",
53
+ "props": [
54
+ {
55
+ "component": "CreditUsage",
56
+ "description": "What is left of an allowance: the remaining amount, a meter in tones, the use per day and the run-out date.",
57
+ "props": [
58
+ {
59
+ "name": "limit",
60
+ "type": "number",
61
+ "default": null,
62
+ "description": "The allowance.",
63
+ "required": true
64
+ },
65
+ {
66
+ "name": "title",
67
+ "type": "string",
68
+ "default": null,
69
+ "description": "What the allowance is (“Credits this month”): the heading and the meter's name.",
70
+ "required": true
71
+ },
72
+ {
73
+ "name": "used",
74
+ "type": "number",
75
+ "default": null,
76
+ "description": "How much is used.",
77
+ "required": true
78
+ },
79
+ {
80
+ "name": "brand",
81
+ "type": "BrandId",
82
+ "default": null,
83
+ "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`).",
84
+ "required": false
85
+ },
86
+ {
87
+ "name": "className",
88
+ "type": "string",
89
+ "default": null,
90
+ "description": "A class on the figure (layout).",
91
+ "required": false
92
+ },
93
+ {
94
+ "name": "daily",
95
+ "type": "readonly (number | null)[]",
96
+ "default": null,
97
+ "description": "The use of each recent day, oldest first: the sparkline and the projection.",
98
+ "required": false
99
+ },
100
+ {
101
+ "name": "days",
102
+ "type": "readonly unknown[]",
103
+ "default": null,
104
+ "description": "The days of `daily` (ISO dates), for the sparkline's summary.",
105
+ "required": false
106
+ },
107
+ {
108
+ "name": "description",
109
+ "type": "ReactNode",
110
+ "default": null,
111
+ "description": "A line under the title: the plan, the period.",
112
+ "required": false
113
+ },
114
+ {
115
+ "name": "format",
116
+ "type": "ValueFormat",
117
+ "default": "integer",
118
+ "description": "How the amounts are written. Default `\"integer\"`; a `{ style: \"unit\", unit: \"gigabyte\" }` for storage.",
119
+ "required": false
120
+ },
121
+ {
122
+ "name": "hideTitle",
123
+ "type": "boolean",
124
+ "default": null,
125
+ "description": "Visually hide the title (it stays the accessible name).",
126
+ "required": false
127
+ },
128
+ {
129
+ "name": "labels",
130
+ "type": "Partial<CreditLabels>",
131
+ "default": null,
132
+ "description": "The words, passed translated; English by default.",
133
+ "required": false
134
+ },
135
+ {
136
+ "name": "levels",
137
+ "type": "readonly [number, number]",
138
+ "default": "[0.8, 0.95]",
139
+ "description": "The share where the meter turns to warning, then danger. Default `[0.8, 0.95]`.",
140
+ "required": false
141
+ },
142
+ {
143
+ "name": "loading",
144
+ "type": "boolean",
145
+ "default": null,
146
+ "description": "The data is on its way.",
147
+ "required": false
148
+ },
149
+ {
150
+ "name": "locale",
151
+ "type": "Locale",
152
+ "default": null,
153
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
154
+ "required": false
155
+ },
156
+ {
157
+ "name": "now",
158
+ "type": "Date",
159
+ "default": null,
160
+ "description": "Today, for the projection (pass it from the server to render the same date on both sides). Default: now.",
161
+ "required": false
162
+ },
163
+ {
164
+ "name": "renewsAt",
165
+ "type": "string | Date",
166
+ "default": null,
167
+ "description": "When the allowance renews (an ISO date or a `Date`).",
168
+ "required": false
169
+ },
170
+ {
171
+ "name": "style",
172
+ "type": "CSSProperties",
173
+ "default": null,
174
+ "description": "Inline style on the figure (layout only).",
175
+ "required": false
176
+ }
177
+ ]
178
+ }
179
+ ],
180
+ "examples": [
181
+ {
182
+ "name": "monthly-credits",
183
+ "title": "Monthly credits",
184
+ "description": "An Orazaka plan: credits left, the daily use, the run-out date.",
185
+ "path": "examples/credit-usage/monthly-credits.tsx",
186
+ "module": "@krizaka/charts/registry/examples/credit-usage/monthly-credits",
187
+ "code": "import { CreditUsage } from \"@krizaka/charts/credits\";\n\n// The credits used each day of the last two weeks (an Orazaka Pro plan of 5,000 credits).\nconst daily = [120, 180, 95, 210, 260, 140, 60, 75, 230, 310, 280, 190, 240, 300];\n\nexport default function MonthlyCredits() {\n return (\n <CreditUsage\n title=\"Credits this month\"\n description=\"Pro plan\"\n used={3_120}\n limit={5_000}\n daily={daily}\n renewsAt=\"2026-11-01\"\n now={new Date(\"2026-10-11T09:00:00Z\")}\n labels={{ remaining: \"credits left of {limit}\" }}\n />\n );\n}\n"
188
+ },
189
+ {
190
+ "name": "storage-plan",
191
+ "title": "Storage plan",
192
+ "description": "Orochia's console: gigabytes of the plan, past the warning level.",
193
+ "path": "examples/credit-usage/storage-plan.tsx",
194
+ "module": "@krizaka/charts/registry/examples/credit-usage/storage-plan",
195
+ "code": "import { CreditUsage } from \"@krizaka/charts/credits\";\n\n// Orochia's console: the platform's video storage, in gigabytes, past the warning level.\nexport default function StoragePlan() {\n return (\n <CreditUsage\n title=\"Platform storage\"\n description=\"Bunny Stream · Growth plan\"\n used={1_742}\n limit={2_000}\n format={{ style: \"unit\", unit: \"gigabyte\" }}\n labels={{ remaining: \"free of {limit}\" }}\n />\n );\n}\n"
196
+ }
197
+ ]
198
+ },
199
+ "native": {
200
+ "entry": "@krizaka/charts/native",
201
+ "import": "import { CreditUsage } from \"@krizaka/charts/native\";",
202
+ "differences": [
203
+ "No `description`, `loading` or `className`: lay it out with `style`.",
204
+ "The daily use is a native sparkline, read as one element."
205
+ ],
206
+ "props": [
207
+ {
208
+ "component": "CreditUsage",
209
+ "description": "What is left of an allowance (React Native): the remaining amount, a meter in tones, the use per day, the run-out date.",
210
+ "props": [
211
+ {
212
+ "name": "limit",
213
+ "type": "number",
214
+ "default": null,
215
+ "description": "The allowance.",
216
+ "required": true
217
+ },
218
+ {
219
+ "name": "title",
220
+ "type": "string",
221
+ "default": null,
222
+ "description": "What the allowance is: the heading and the meter's name.",
223
+ "required": true
224
+ },
225
+ {
226
+ "name": "used",
227
+ "type": "number",
228
+ "default": null,
229
+ "description": "How much is used.",
230
+ "required": true
231
+ },
232
+ {
233
+ "name": "brand",
234
+ "type": "BrandId",
235
+ "default": null,
236
+ "description": "The brand whose palette leads. Default Krizaka.",
237
+ "required": false
238
+ },
239
+ {
240
+ "name": "daily",
241
+ "type": "readonly (number | null)[]",
242
+ "default": null,
243
+ "description": "The use of each recent day, oldest first.",
244
+ "required": false
245
+ },
246
+ {
247
+ "name": "format",
248
+ "type": "ValueFormat",
249
+ "default": "integer",
250
+ "description": "How the amounts are written. Default `\"integer\"`.",
251
+ "required": false
252
+ },
253
+ {
254
+ "name": "hideTitle",
255
+ "type": "boolean",
256
+ "default": null,
257
+ "description": "Hide the heading (it stays the accessible name).",
258
+ "required": false
259
+ },
260
+ {
261
+ "name": "labels",
262
+ "type": "Partial<CreditLabels>",
263
+ "default": null,
264
+ "description": "The words, passed translated.",
265
+ "required": false
266
+ },
267
+ {
268
+ "name": "levels",
269
+ "type": "readonly [number, number]",
270
+ "default": "[0.8, 0.95]",
271
+ "description": "The shares where the meter turns to warning, then danger. Default `[0.8, 0.95]`.",
272
+ "required": false
273
+ },
274
+ {
275
+ "name": "locale",
276
+ "type": "Locale",
277
+ "default": null,
278
+ "description": "The locale of every figure and date. Default `\"en-US\"`.",
279
+ "required": false
280
+ },
281
+ {
282
+ "name": "now",
283
+ "type": "Date",
284
+ "default": null,
285
+ "description": "Today, for the projection. Default: now.",
286
+ "required": false
287
+ },
288
+ {
289
+ "name": "renewsAt",
290
+ "type": "string | Date",
291
+ "default": null,
292
+ "description": "When the allowance renews.",
293
+ "required": false
294
+ },
295
+ {
296
+ "name": "scheme",
297
+ "type": "Mode",
298
+ "default": null,
299
+ "description": "Dark or light. Default: the device's (pass `useTheme().scheme` of\n@krizaka /ui/native to follow the app).",
300
+ "required": false
301
+ },
302
+ {
303
+ "name": "style",
304
+ "type": "ViewStyle",
305
+ "default": null,
306
+ "description": "The style of the container (layout only).",
307
+ "required": false
308
+ },
309
+ {
310
+ "name": "theme",
311
+ "type": "Partial<ChartTheme>",
312
+ "default": null,
313
+ "description": "The app's colour roles (`useTheme().theme` of\n@krizaka /ui/native): a product's brand overrides apply.",
314
+ "required": false
315
+ }
316
+ ]
317
+ }
318
+ ],
319
+ "examples": [
320
+ {
321
+ "name": "monthly-credits",
322
+ "title": "Monthly credits",
323
+ "description": "The credits card of the mobile app.",
324
+ "path": "examples/credit-usage/native/monthly-credits.tsx",
325
+ "module": "@krizaka/charts/registry/examples/credit-usage/native/monthly-credits",
326
+ "code": "import { CreditUsage } from \"@krizaka/charts/native\";\n\nconst daily = [120, 180, 95, 210, 260, 140, 60, 75, 230, 310, 280, 190, 240, 300];\n\n// The credits card of the mobile app.\nexport default function NativeMonthlyCredits() {\n return (\n <CreditUsage\n title=\"Credits this month\"\n used={3_120}\n limit={5_000}\n daily={daily}\n renewsAt=\"2026-11-01\"\n now={new Date(\"2026-10-11T09:00:00Z\")}\n labels={{ remaining: \"credits left of {limit}\" }}\n />\n );\n}\n",
327
+ "screenshots": {
328
+ "dark": "examples/credit-usage/native/monthly-credits.dark.png",
329
+ "light": "examples/credit-usage/native/monthly-credits.light.png"
330
+ }
331
+ }
332
+ ]
333
+ },
334
+ "files": [],
335
+ "dependencies": [
336
+ "@krizaka/intl@workspace:^",
337
+ "d3-geo@^3.1.1",
338
+ "echarts@^6.1.0",
339
+ "topojson-client@^3.1.0"
340
+ ],
341
+ "registryDependencies": [],
342
+ "demo": {
343
+ "path": "examples/credit-usage/monthly-credits.tsx",
344
+ "content": "import { CreditUsage } from \"@krizaka/charts/credits\";\n\n// The credits used each day of the last two weeks (an Orazaka Pro plan of 5,000 credits).\nconst daily = [120, 180, 95, 210, 260, 140, 60, 75, 230, 310, 280, 190, 240, 300];\n\nexport default function MonthlyCredits() {\n return (\n <CreditUsage\n title=\"Credits this month\"\n description=\"Pro plan\"\n used={3_120}\n limit={5_000}\n daily={daily}\n renewsAt=\"2026-11-01\"\n now={new Date(\"2026-10-11T09:00:00Z\")}\n labels={{ remaining: \"credits left of {limit}\" }}\n />\n );\n}\n"
345
+ },
346
+ "props": [
347
+ {
348
+ "component": "CreditUsage",
349
+ "description": "What is left of an allowance: the remaining amount, a meter in tones, the use per day and the run-out date.",
350
+ "props": [
351
+ {
352
+ "name": "limit",
353
+ "type": "number",
354
+ "default": null,
355
+ "description": "The allowance.",
356
+ "required": true
357
+ },
358
+ {
359
+ "name": "title",
360
+ "type": "string",
361
+ "default": null,
362
+ "description": "What the allowance is (“Credits this month”): the heading and the meter's name.",
363
+ "required": true
364
+ },
365
+ {
366
+ "name": "used",
367
+ "type": "number",
368
+ "default": null,
369
+ "description": "How much is used.",
370
+ "required": true
371
+ },
372
+ {
373
+ "name": "brand",
374
+ "type": "BrandId",
375
+ "default": null,
376
+ "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`).",
377
+ "required": false
378
+ },
379
+ {
380
+ "name": "className",
381
+ "type": "string",
382
+ "default": null,
383
+ "description": "A class on the figure (layout).",
384
+ "required": false
385
+ },
386
+ {
387
+ "name": "daily",
388
+ "type": "readonly (number | null)[]",
389
+ "default": null,
390
+ "description": "The use of each recent day, oldest first: the sparkline and the projection.",
391
+ "required": false
392
+ },
393
+ {
394
+ "name": "days",
395
+ "type": "readonly unknown[]",
396
+ "default": null,
397
+ "description": "The days of `daily` (ISO dates), for the sparkline's summary.",
398
+ "required": false
399
+ },
400
+ {
401
+ "name": "description",
402
+ "type": "ReactNode",
403
+ "default": null,
404
+ "description": "A line under the title: the plan, the period.",
405
+ "required": false
406
+ },
407
+ {
408
+ "name": "format",
409
+ "type": "ValueFormat",
410
+ "default": "integer",
411
+ "description": "How the amounts are written. Default `\"integer\"`; a `{ style: \"unit\", unit: \"gigabyte\" }` for storage.",
412
+ "required": false
413
+ },
414
+ {
415
+ "name": "hideTitle",
416
+ "type": "boolean",
417
+ "default": null,
418
+ "description": "Visually hide the title (it stays the accessible name).",
419
+ "required": false
420
+ },
421
+ {
422
+ "name": "labels",
423
+ "type": "Partial<CreditLabels>",
424
+ "default": null,
425
+ "description": "The words, passed translated; English by default.",
426
+ "required": false
427
+ },
428
+ {
429
+ "name": "levels",
430
+ "type": "readonly [number, number]",
431
+ "default": "[0.8, 0.95]",
432
+ "description": "The share where the meter turns to warning, then danger. Default `[0.8, 0.95]`.",
433
+ "required": false
434
+ },
435
+ {
436
+ "name": "loading",
437
+ "type": "boolean",
438
+ "default": null,
439
+ "description": "The data is on its way.",
440
+ "required": false
441
+ },
442
+ {
443
+ "name": "locale",
444
+ "type": "Locale",
445
+ "default": null,
446
+ "description": "The locale of every figure and date (`\"fr-FR\"`). Default `\"en-US\"`.",
447
+ "required": false
448
+ },
449
+ {
450
+ "name": "now",
451
+ "type": "Date",
452
+ "default": null,
453
+ "description": "Today, for the projection (pass it from the server to render the same date on both sides). Default: now.",
454
+ "required": false
455
+ },
456
+ {
457
+ "name": "renewsAt",
458
+ "type": "string | Date",
459
+ "default": null,
460
+ "description": "When the allowance renews (an ISO date or a `Date`).",
461
+ "required": false
462
+ },
463
+ {
464
+ "name": "style",
465
+ "type": "CSSProperties",
466
+ "default": null,
467
+ "description": "Inline style on the figure (layout only).",
468
+ "required": false
469
+ }
470
+ ]
471
+ }
472
+ ]
473
+ }