@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
@@ -3,7 +3,7 @@ import {
3
3
  EChartHost,
4
4
  baseOption,
5
5
  tooltipHtml
6
- } from "./chunk-I5QUZVU2.js";
6
+ } from "./chunk-PWMMXRMC.js";
7
7
  import {
8
8
  normalizeSeries,
9
9
  summarize,
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  Legend,
18
18
  useSettings
19
- } from "./chunk-DWJPPEMC.js";
19
+ } from "./chunk-JTKR7ZWP.js";
20
20
  import {
21
21
  fill
22
22
  } from "./chunk-3CJHBJXA.js";
@@ -100,4 +100,4 @@ function RadarChart(props) {
100
100
  export {
101
101
  RadarChart
102
102
  };
103
- //# sourceMappingURL=chunk-7TIFCK5E.js.map
103
+ //# sourceMappingURL=chunk-VKZZY2QD.js.map
@@ -3,7 +3,7 @@ import {
3
3
  EChartHost,
4
4
  baseOption,
5
5
  tooltipHtml
6
- } from "./chunk-I5QUZVU2.js";
6
+ } from "./chunk-PWMMXRMC.js";
7
7
  import {
8
8
  describeParts
9
9
  } from "./chunk-ANUCSRUN.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-XLLYNNC6.js";
14
14
  import {
15
15
  useSettings
16
- } from "./chunk-DWJPPEMC.js";
16
+ } from "./chunk-JTKR7ZWP.js";
17
17
  import {
18
18
  contrast
19
19
  } from "./chunk-3CJHBJXA.js";
@@ -104,4 +104,4 @@ ${fmt.value(p.value)}` },
104
104
  export {
105
105
  Treemap
106
106
  };
107
- //# sourceMappingURL=chunk-VKTZD7UT.js.map
107
+ //# sourceMappingURL=chunk-W5ILLSPK.js.map
@@ -0,0 +1,25 @@
1
+ "use client";
2
+
3
+ // src/needs/kpi.tsx
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ var ARROW = { up: "M7 17 17 7M8 7h9v9", down: "M7 7l10 10M17 8v9H8", flat: "M5 12h14M13 6l6 6-6 6" };
6
+ function Kpi({ value, label, delta, direction, tone = "neutral" }) {
7
+ return /* @__PURE__ */ jsxs("span", { className: "kzc-kpi", children: [
8
+ /* @__PURE__ */ jsx("span", { className: "kzc-kpi-value", children: value }),
9
+ label ? /* @__PURE__ */ jsx("span", { className: "kzc-kpi-label", children: label }) : null,
10
+ delta ? /* @__PURE__ */ jsxs("span", { className: "kzc-kpi-delta", "data-tone": tone, children: [
11
+ direction ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: ARROW[direction] }) }) : null,
12
+ delta
13
+ ] }) : null
14
+ ] });
15
+ }
16
+ function toneOf(direction, good) {
17
+ if (!direction || direction === "flat") return "neutral";
18
+ return direction === good ? "success" : "danger";
19
+ }
20
+
21
+ export {
22
+ Kpi,
23
+ toneOf
24
+ };
25
+ //# sourceMappingURL=chunk-WBHFVBSK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/needs/kpi.tsx"],"sourcesContent":["// The key figure of a ready-made chart, written under its title: the value, what it is, and the change in words with\n// a decorative arrow in the direction's tone (the words carry the meaning: colour is never alone). Spans only — it\n// sits in the chart's description paragraph.\nimport type { ReactNode } from \"react\";\n\nimport type { Tone } from \"../core/types\";\n\nconst ARROW = { up: \"M7 17 17 7M8 7h9v9\", down: \"M7 7l10 10M17 8v9H8\", flat: \"M5 12h14M13 6l6 6-6 6\" } as const;\n\nexport interface KpiProps {\n readonly value: ReactNode;\n readonly label?: ReactNode;\n /** The change, in words (`+12 % vs September`). */\n readonly delta?: ReactNode;\n readonly direction?: \"up\" | \"down\" | \"flat\" | null;\n /** The arrow's tone: a rise of earnings is good (`success`), a rise of latency is not (`danger`). */\n readonly tone?: Tone;\n}\n\nexport function Kpi({ value, label, delta, direction, tone = \"neutral\" }: KpiProps) {\n return (\n <span className=\"kzc-kpi\">\n <span className=\"kzc-kpi-value\">{value}</span>\n {label ? <span className=\"kzc-kpi-label\">{label}</span> : null}\n {delta ? (\n <span className=\"kzc-kpi-delta\" data-tone={tone}>\n {direction ? (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d={ARROW[direction]} />\n </svg>\n ) : null}\n {delta}\n </span>\n ) : null}\n </span>\n );\n}\n\n/** The tone of a change: `good` says which direction is good news (earnings up, latency down). */\nexport function toneOf(direction: \"up\" | \"down\" | \"flat\" | null, good: \"up\" | \"down\"): Tone {\n if (!direction || direction === \"flat\") return \"neutral\";\n return direction === good ? \"success\" : \"danger\";\n}\n"],"mappings":";;;AAsBM,cAGE,YAHF;AAfN,IAAM,QAAQ,EAAE,IAAI,sBAAsB,MAAM,uBAAuB,MAAM,wBAAwB;AAY9F,SAAS,IAAI,EAAE,OAAO,OAAO,OAAO,WAAW,OAAO,UAAU,GAAa;AAClF,SACE,qBAAC,UAAK,WAAU,WACd;AAAA,wBAAC,UAAK,WAAU,iBAAiB,iBAAM;AAAA,IACtC,QAAQ,oBAAC,UAAK,WAAU,iBAAiB,iBAAM,IAAU;AAAA,IACzD,QACC,qBAAC,UAAK,WAAU,iBAAgB,aAAW,MACxC;AAAA,kBACC,oBAAC,SAAI,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,OAAM,eAAc,SAAQ,gBAAe,SAAQ,eAAW,MACnI,8BAAC,UAAK,GAAG,MAAM,SAAS,GAAG,GAC7B,IACE;AAAA,MACH;AAAA,OACH,IACE;AAAA,KACN;AAEJ;AAGO,SAAS,OAAO,WAA0C,MAA2B;AAC1F,MAAI,CAAC,aAAa,cAAc,OAAQ,QAAO;AAC/C,SAAO,cAAc,OAAO,YAAY;AAC1C;","names":[]}
@@ -0,0 +1,113 @@
1
+ "use client";
2
+
3
+ // src/needs/labels.ts
4
+ var EARNINGS_LABELS = {
5
+ total: "earned over {count} periods",
6
+ change: "{change} vs the previous period",
7
+ gross: "Gross",
8
+ net: "Net"
9
+ };
10
+ var THROUGHPUT_LABELS = { total: "jobs over {count} periods", success: "{rate} succeeded" };
11
+ var LATENCY_LABELS = {
12
+ p50: "Median (p50)",
13
+ p95: "p95",
14
+ slowest: "p95 of {name}, the slowest",
15
+ over: "{count} over the objective",
16
+ within: "all within the objective"
17
+ };
18
+ var CREDIT_LABELS = {
19
+ remaining: "left of {limit}",
20
+ used: "{used} used ({percent})",
21
+ runsOut: "At this pace, runs out on {date}",
22
+ steady: "No use lately",
23
+ renews: "Renews on {date}",
24
+ daily: "Use per day"
25
+ };
26
+ var GOAL_LABELS = { raised: "raised of {goal}", reached: "Goal reached", supporters: "{count} supporters", left: "{time} left" };
27
+ var TICKER_LABELS = {
28
+ current: "current bid",
29
+ change: "{change} since the opening \xB7 {count} bids",
30
+ opening: "opening price, no bid yet",
31
+ reserve: "Reserve price",
32
+ price: "Price"
33
+ };
34
+
35
+ // src/needs/model.ts
36
+ import { currencyDigits, getNumberFormat } from "@krizaka/intl";
37
+ function numberOf(row, accessor, index) {
38
+ const value = typeof accessor === "function" ? accessor(row, index) : row[accessor];
39
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
40
+ }
41
+ function total(rows, accessor) {
42
+ return rows.reduce((sum, row, i) => sum + (numberOf(row, accessor, i) ?? 0), 0);
43
+ }
44
+ function lastChange(values) {
45
+ if (values.length < 2) return null;
46
+ const last = values[values.length - 1];
47
+ const previous = values[values.length - 2];
48
+ if (last == null || previous == null || previous === 0) return null;
49
+ return last / previous - 1;
50
+ }
51
+ function direction(change) {
52
+ if (change == null) return null;
53
+ return Math.abs(change) < 5e-3 ? "flat" : change > 0 ? "up" : "down";
54
+ }
55
+ function successRate(succeeded, failed) {
56
+ const finished = succeeded + failed;
57
+ return finished > 0 ? succeeded / finished : null;
58
+ }
59
+ function daysLeft(remaining, daily, days = 7) {
60
+ const recent = daily.slice(-days).filter((v) => v != null && v >= 0);
61
+ if (recent.length === 0) return null;
62
+ const pace = recent.reduce((a, b) => a + b, 0) / recent.length;
63
+ if (pace <= 0) return null;
64
+ return Math.max(0, Math.floor(remaining / pace));
65
+ }
66
+ var addDays = (from, days) => new Date(from.getTime() + days * 864e5);
67
+ function quotaLevel(ratio, warning = 0.8, danger = 0.95) {
68
+ return ratio >= danger ? "danger" : ratio >= warning ? "warning" : "ok";
69
+ }
70
+ function fillIn(template, values) {
71
+ return template.replace(/\{(\w+)\}/g, (match, key) => key in values ? String(values[key]) : match);
72
+ }
73
+ function signedPercent(change, locale) {
74
+ return getNumberFormat(locale, { style: "percent", signDisplay: "exceptZero", maximumFractionDigits: Math.abs(change) < 0.1 ? 1 : 0 }).format(change);
75
+ }
76
+ function formatDuration(ms, locale) {
77
+ const unit = (value, name, digits) => getNumberFormat(locale, { style: "unit", unit: name, unitDisplay: "short", maximumFractionDigits: digits }).format(value);
78
+ const abs = Math.abs(ms);
79
+ if (abs < 1e3) return unit(Math.round(ms), "millisecond", 0);
80
+ if (abs < 6e4) return unit(ms / 1e3, "second", abs < 1e4 ? 1 : 0);
81
+ if (abs < 36e5) return unit(ms / 6e4, "minute", 1);
82
+ return unit(ms / 36e5, "hour", 1);
83
+ }
84
+ function roundMoney(currency) {
85
+ const digits = currencyDigits(currency);
86
+ return (value, locale) => {
87
+ const minor = Math.round(value);
88
+ const whole = minor % 10 ** digits === 0;
89
+ return getNumberFormat(locale, { style: "currency", currency, minimumFractionDigits: whole ? 0 : digits, maximumFractionDigits: whole ? 0 : digits }).format(minor / 10 ** digits);
90
+ };
91
+ }
92
+
93
+ export {
94
+ EARNINGS_LABELS,
95
+ THROUGHPUT_LABELS,
96
+ LATENCY_LABELS,
97
+ CREDIT_LABELS,
98
+ GOAL_LABELS,
99
+ TICKER_LABELS,
100
+ numberOf,
101
+ total,
102
+ lastChange,
103
+ direction,
104
+ successRate,
105
+ daysLeft,
106
+ addDays,
107
+ quotaLevel,
108
+ fillIn,
109
+ signedPercent,
110
+ formatDuration,
111
+ roundMoney
112
+ };
113
+ //# sourceMappingURL=chunk-WNUFGMS7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/needs/labels.ts","../src/needs/model.ts"],"sourcesContent":["// The words of the ready-made charts: English by default, an app passes its own (translated) through `labels`.\n// Placeholders are written `{name}`.\n\nexport interface EarningsLabels {\n /** Under the total: `earned over {count} months`. `{count}` is the number of periods. */\n total: string;\n /** The change of the last period: `{change} vs the previous month`. */\n change: string;\n /** The gross series' name. */\n gross: string;\n /** The net series' name. */\n net: string;\n}\n\nexport const EARNINGS_LABELS: EarningsLabels = {\n total: \"earned over {count} periods\",\n change: \"{change} vs the previous period\",\n gross: \"Gross\",\n net: \"Net\",\n};\n\nexport interface ThroughputLabels {\n /** Under the total: `jobs over {count} days`. */\n total: string;\n /** The success rate of the finished jobs: `{rate} succeeded`. */\n success: string;\n}\n\nexport const THROUGHPUT_LABELS: ThroughputLabels = { total: \"jobs over {count} periods\", success: \"{rate} succeeded\" };\n\nexport interface LatencyLabels {\n /** The median series. */\n p50: string;\n /** The 95th percentile series. */\n p95: string;\n /** The slowest p95: `slowest: {name}`. */\n slowest: string;\n /** How many go past the objective: `{count} over the objective`. */\n over: string;\n /** All within the objective. */\n within: string;\n}\n\nexport const LATENCY_LABELS: LatencyLabels = {\n p50: \"Median (p50)\",\n p95: \"p95\",\n slowest: \"p95 of {name}, the slowest\",\n over: \"{count} over the objective\",\n within: \"all within the objective\",\n};\n\nexport interface CreditLabels {\n /** Under the remaining amount: `left of {limit}`. */\n remaining: string;\n /** The used part: `{used} used ({percent})`. */\n used: string;\n /** The projection: `at this pace, runs out on {date}`. */\n runsOut: string;\n /** No use lately: it does not run out. */\n steady: string;\n /** The renewal: `renews on {date}`. */\n renews: string;\n /** The daily use sparkline's title. */\n daily: string;\n}\n\nexport const CREDIT_LABELS: CreditLabels = {\n remaining: \"left of {limit}\",\n used: \"{used} used ({percent})\",\n runsOut: \"At this pace, runs out on {date}\",\n steady: \"No use lately\",\n renews: \"Renews on {date}\",\n daily: \"Use per day\",\n};\n\nexport interface GoalLabels {\n /** Under the amount: `raised of {goal}`. */\n raised: string;\n /** Reached: `goal reached`. */\n reached: string;\n /** The supporters: `{count} supporters`. */\n supporters: string;\n /** The time left: `{time} left`. */\n left: string;\n}\n\nexport const GOAL_LABELS: GoalLabels = { raised: \"raised of {goal}\", reached: \"Goal reached\", supporters: \"{count} supporters\", left: \"{time} left\" };\n\nexport interface TickerLabels {\n /** Under the price: `current bid`. */\n current: string;\n /** The change since the opening: `{change} since the opening ({count} bids)`. */\n change: string;\n /** No bid yet: `opening price`. */\n opening: string;\n /** The reserve line. */\n reserve: string;\n /** The series' name. */\n price: string;\n}\n\nexport const TICKER_LABELS: TickerLabels = {\n current: \"current bid\",\n change: \"{change} since the opening · {count} bids\",\n opening: \"opening price, no bid yet\",\n reserve: \"Reserve price\",\n price: \"Price\",\n};\n","// The arithmetic of the ready-made charts (EarningsChart, JobThroughput, LatencyChart, CreditUsage, GoalProgress,\n// PriceTicker), shared by the web and React Native: totals, the change between the last two periods, a success rate,\n// the day a balance runs out at the current pace. Pure functions: no React, no DOM.\nimport { currencyDigits, getNumberFormat } from \"@krizaka/intl\";\n\nimport type { Accessor, Datum, Locale } from \"../core/types\";\n\n/** Reads a field (or calls a function) of a row; `null` for anything that is not a finite number. */\nexport function numberOf<T extends Datum>(row: T, accessor: Accessor<T, number | null | undefined>, index: number): number | null {\n const value = typeof accessor === \"function\" ? accessor(row, index) : (row as Record<string, unknown>)[accessor];\n return typeof value === \"number\" && Number.isFinite(value) ? value : null;\n}\n\n/** The sum of a column, `null` values left out. */\nexport function total<T extends Datum>(rows: readonly T[], accessor: Accessor<T, number | null | undefined>): number {\n return rows.reduce((sum, row, i) => sum + (numberOf(row, accessor, i) ?? 0), 0);\n}\n\n/**\n * The change of the last period against the one before, as a ratio (`0.12` = +12 %): `null` when it cannot be said\n * (fewer than two periods, a previous period at zero or missing).\n */\nexport function lastChange(values: readonly (number | null)[]): number | null {\n if (values.length < 2) return null;\n const last = values[values.length - 1];\n const previous = values[values.length - 2];\n if (last == null || previous == null || previous === 0) return null;\n return last / previous - 1;\n}\n\n/** `up`, `down` or `flat` (within ±0.5 %): the direction of a change, `null` when there is none. */\nexport function direction(change: number | null): \"up\" | \"down\" | \"flat\" | null {\n if (change == null) return null;\n return Math.abs(change) < 0.005 ? \"flat\" : change > 0 ? \"up\" : \"down\";\n}\n\n/** Succeeded out of finished (succeeded + failed); `null` when nothing finished. */\nexport function successRate(succeeded: number, failed: number): number | null {\n const finished = succeeded + failed;\n return finished > 0 ? succeeded / finished : null;\n}\n\n/**\n * When a balance runs out at the pace of the last `days` days of use (oldest first): the number of whole days left,\n * or `null` when nothing is being used (it never runs out) or there is no history.\n */\nexport function daysLeft(remaining: number, daily: readonly (number | null)[], days = 7): number | null {\n const recent = daily.slice(-days).filter((v): v is number => v != null && v >= 0);\n if (recent.length === 0) return null;\n const pace = recent.reduce((a, b) => a + b, 0) / recent.length;\n if (pace <= 0) return null;\n return Math.max(0, Math.floor(remaining / pace));\n}\n\n/** `from` + `days` days, at the same time of day. */\nexport const addDays = (from: Date, days: number) => new Date(from.getTime() + days * 86_400_000);\n\n/** The level of a quota: `ok` below `warning` (default 0.8), `warning` below `danger` (0.95), then `danger`. */\nexport function quotaLevel(ratio: number, warning = 0.8, danger = 0.95): \"ok\" | \"warning\" | \"danger\" {\n return ratio >= danger ? \"danger\" : ratio >= warning ? \"warning\" : \"ok\";\n}\n\n/** Replaces `{name}` placeholders. */\nexport function fillIn(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (match, key: string) => (key in values ? String(values[key]) : match));\n}\n\n/** A signed ratio as a percentage for a change (`+12 %`, `−3 %`), in the locale's way. */\nexport function signedPercent(change: number, locale: Locale): string {\n return getNumberFormat(locale, { style: \"percent\", signDisplay: \"exceptZero\", maximumFractionDigits: Math.abs(change) < 0.1 ? 1 : 0 }).format(change);\n}\n\n/** Milliseconds as a duration: `840 ms`, `1.2 s`, `2.5 min` — the unit follows the size, through Intl. */\nexport function formatDuration(ms: number, locale: Locale): string {\n const unit = (value: number, name: string, digits: number) =>\n getNumberFormat(locale, { style: \"unit\", unit: name, unitDisplay: \"short\", maximumFractionDigits: digits }).format(value);\n const abs = Math.abs(ms);\n if (abs < 1000) return unit(Math.round(ms), \"millisecond\", 0);\n if (abs < 60_000) return unit(ms / 1000, \"second\", abs < 10_000 ? 1 : 0);\n if (abs < 3_600_000) return unit(ms / 60_000, \"minute\", 1);\n return unit(ms / 3_600_000, \"hour\", 1);\n}\n\n/** Money in minor units, without the cents of a round amount (`$500`, `$262.50`): a goal reads as people say it. */\nexport function roundMoney(currency: string): (value: number, locale: Locale) => string {\n const digits = currencyDigits(currency);\n return (value, locale) => {\n const minor = Math.round(value);\n const whole = minor % 10 ** digits === 0;\n return getNumberFormat(locale, { style: \"currency\", currency, minimumFractionDigits: whole ? 0 : digits, maximumFractionDigits: whole ? 0 : digits }).format(minor / 10 ** digits);\n };\n}\n"],"mappings":"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","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Cartesian
4
- } from "./chunk-UNK4MJVG.js";
4
+ } from "./chunk-CVWSMUUB.js";
5
5
 
6
6
  // src/bar/bar-chart.tsx
7
7
  import { jsx } from "react/jsx-runtime";
@@ -12,4 +12,4 @@ function BarChart({ stacked, horizontal, valueLabels = true, ...props }) {
12
12
  export {
13
13
  BarChart
14
14
  };
15
- //# sourceMappingURL=chunk-XR4ZJDOV.js.map
15
+ //# sourceMappingURL=chunk-WVTIKOII.js.map
@@ -4,7 +4,7 @@ import {
4
4
  baseOption,
5
5
  categoryAxis,
6
6
  tooltipHtml
7
- } from "./chunk-I5QUZVU2.js";
7
+ } from "./chunk-PWMMXRMC.js";
8
8
  import {
9
9
  read
10
10
  } from "./chunk-W5FX4TU3.js";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  RampLegend,
18
18
  useSettings
19
- } from "./chunk-DWJPPEMC.js";
19
+ } from "./chunk-JTKR7ZWP.js";
20
20
  import {
21
21
  capitalize,
22
22
  fill
@@ -163,4 +163,4 @@ export {
163
163
  Heatmap,
164
164
  CalendarHeatmap
165
165
  };
166
- //# sourceMappingURL=chunk-7CSAGFBW.js.map
166
+ //# sourceMappingURL=chunk-XDDALY4C.js.map
@@ -0,0 +1,42 @@
1
+ import { a as CreditLabels } from './labels-DE_743fQ.js';
2
+ export { C as CREDIT_LABELS } from './labels-DE_743fQ.js';
3
+ import * as react from 'react';
4
+ import { ReactNode, CSSProperties } from 'react';
5
+ import { f as ChartsSettings, V as ValueFormat } from './context-BgYUymEO.js';
6
+
7
+ interface CreditUsageProps extends Omit<ChartsSettings, "labels"> {
8
+ /** What the allowance is (“Credits this month”): the heading and the meter's name. */
9
+ title: string;
10
+ /** A line under the title: the plan, the period. */
11
+ description?: ReactNode;
12
+ /** Visually hide the title (it stays the accessible name). */
13
+ hideTitle?: boolean;
14
+ /** How much is used. */
15
+ used: number;
16
+ /** The allowance. */
17
+ limit: number;
18
+ /** How the amounts are written. Default `"integer"`; a `{ style: "unit", unit: "gigabyte" }` for storage. */
19
+ format?: ValueFormat;
20
+ /** The use of each recent day, oldest first: the sparkline and the projection. */
21
+ daily?: readonly (number | null)[];
22
+ /** The days of `daily` (ISO dates), for the sparkline's summary. */
23
+ days?: readonly unknown[];
24
+ /** When the allowance renews (an ISO date or a `Date`). */
25
+ renewsAt?: string | Date;
26
+ /** Today, for the projection (pass it from the server to render the same date on both sides). Default: now. */
27
+ now?: Date;
28
+ /** The share where the meter turns to warning, then danger. Default `[0.8, 0.95]`. */
29
+ levels?: readonly [number, number];
30
+ /** The data is on its way. */
31
+ loading?: boolean;
32
+ /** The words, passed translated; English by default. */
33
+ labels?: Partial<CreditLabels>;
34
+ /** A class on the figure (layout). */
35
+ className?: string;
36
+ /** Inline style on the figure (layout only). */
37
+ style?: CSSProperties;
38
+ }
39
+ /** What is left of an allowance: the remaining amount, a meter in tones, the use per day and the run-out date. */
40
+ declare function CreditUsage({ title, description, hideTitle, used, limit, format, daily, days, renewsAt, now, levels, loading, labels: given, className, style, ...settings }: CreditUsageProps): react.JSX.Element;
41
+
42
+ export { CreditLabels, CreditUsage, type CreditUsageProps };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import {
3
+ CreditUsage
4
+ } from "./chunk-L2EKYWVI.js";
5
+ import "./chunk-ARARFMNE.js";
6
+ import "./chunk-WBHFVBSK.js";
7
+ import "./chunk-BISL7DYW.js";
8
+ import "./chunk-ANUCSRUN.js";
9
+ import "./chunk-W5FX4TU3.js";
10
+ import {
11
+ CREDIT_LABELS
12
+ } from "./chunk-WNUFGMS7.js";
13
+ import "./chunk-OB5EFDDH.js";
14
+ import "./chunk-XLLYNNC6.js";
15
+ import "./chunk-JTKR7ZWP.js";
16
+ import "./chunk-3CJHBJXA.js";
17
+ export {
18
+ CREDIT_LABELS,
19
+ CreditUsage
20
+ };
21
+ //# sourceMappingURL=credits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,29 @@
1
+ import { b as EarningsLabels } from './labels-DE_743fQ.js';
2
+ export { E as EARNINGS_LABELS } from './labels-DE_743fQ.js';
3
+ import * as react from 'react';
4
+ import { C as CartesianProps } from './cartesian-BRhNQ3ib.js';
5
+ import { g as Datum, A as Accessor, C as CategoryFormat, T as Threshold } from './context-BgYUymEO.js';
6
+ import './frame-I7_xYGy5.js';
7
+
8
+ interface EarningsChartProps<T extends Datum> extends Omit<CartesianProps<T>, "y" | "yLabel" | "series" | "format" | "x" | "xFormat" | "thresholds" | "labels"> {
9
+ /** The field (or function) of the period: an ISO month (`"2026-04"`), a day. Default `"month"`. */
10
+ x?: Accessor<T, unknown>;
11
+ /** The net amount of each period, in **minor units** (cents), as the ledger stores it. */
12
+ net: Accessor<T, number | null | undefined>;
13
+ /** The gross amount (before fees), drawn beside the net when given. */
14
+ gross?: Accessor<T, number | null | undefined>;
15
+ /** The ISO 4217 currency (`"USD"`, `"EUR"`). */
16
+ currency: string;
17
+ /** How the periods are written. Default `"month"` (`Apr 2026`). */
18
+ period?: CategoryFormat;
19
+ /** The minimum to withdraw, drawn as a line: `{ value: 5000, label: "Payout threshold" }`. */
20
+ payoutThreshold?: Threshold;
21
+ /** Hide the total and the change above the bars. */
22
+ hideSummary?: boolean;
23
+ /** The words, passed translated; English by default. */
24
+ labels?: Partial<EarningsLabels>;
25
+ }
26
+ /** Earnings per period in money — the total, the change of the last period, the payout threshold. */
27
+ declare function EarningsChart<T extends Datum>({ x, net, gross, currency, period, payoutThreshold, hideSummary, labels: given, description, data, ...props }: EarningsChartProps<T>): react.JSX.Element;
28
+
29
+ export { EarningsChart, type EarningsChartProps, EarningsLabels };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import {
3
+ EarningsChart
4
+ } from "./chunk-OIRHLJBC.js";
5
+ import "./chunk-WVTIKOII.js";
6
+ import "./chunk-CVWSMUUB.js";
7
+ import "./chunk-WBHFVBSK.js";
8
+ import "./chunk-BISL7DYW.js";
9
+ import "./chunk-ANUCSRUN.js";
10
+ import "./chunk-W5FX4TU3.js";
11
+ import {
12
+ EARNINGS_LABELS
13
+ } from "./chunk-WNUFGMS7.js";
14
+ import "./chunk-OB5EFDDH.js";
15
+ import "./chunk-XLLYNNC6.js";
16
+ import "./chunk-JTKR7ZWP.js";
17
+ import "./chunk-3CJHBJXA.js";
18
+ export {
19
+ EARNINGS_LABELS,
20
+ EarningsChart
21
+ };
22
+ //# sourceMappingURL=earnings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/funnel.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Funnel
4
- } from "./chunk-XAJ3KCC4.js";
5
- import "./chunk-I5QUZVU2.js";
4
+ } from "./chunk-CSSZLFLO.js";
5
+ import "./chunk-PWMMXRMC.js";
6
6
  import "./chunk-W5FX4TU3.js";
7
7
  import "./chunk-XLLYNNC6.js";
8
- import "./chunk-DWJPPEMC.js";
8
+ import "./chunk-JTKR7ZWP.js";
9
9
  import "./chunk-3CJHBJXA.js";
10
10
  export {
11
11
  Funnel
package/dist/gauge.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use client";
2
+ import "./chunk-G2KF2WL4.js";
2
3
  import {
3
4
  Gauge
4
- } from "./chunk-DZB6HEVO.js";
5
+ } from "./chunk-EQLC2QVN.js";
5
6
  import "./chunk-OB5EFDDH.js";
6
7
  import "./chunk-XLLYNNC6.js";
7
- import "./chunk-DWJPPEMC.js";
8
+ import "./chunk-JTKR7ZWP.js";
8
9
  import "./chunk-3CJHBJXA.js";
9
10
  export {
10
11
  Gauge
package/dist/geo.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  GeoMap
4
- } from "./chunk-WBH2QU77.js";
4
+ } from "./chunk-BV4DBGN7.js";
5
5
  import "./chunk-6FINSUOS.js";
6
6
  import "./chunk-W5FX4TU3.js";
7
7
  import "./chunk-XLLYNNC6.js";
8
- import "./chunk-DWJPPEMC.js";
8
+ import "./chunk-JTKR7ZWP.js";
9
9
  import "./chunk-3CJHBJXA.js";
10
10
  export {
11
11
  GeoMap
package/dist/globe.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  Globe3D
4
- } from "./chunk-PTSB3H5Q.js";
4
+ } from "./chunk-I3D7KUGN.js";
5
5
  import "./chunk-6FINSUOS.js";
6
6
  import "./chunk-XLLYNNC6.js";
7
- import "./chunk-DWJPPEMC.js";
7
+ import "./chunk-JTKR7ZWP.js";
8
8
  import "./chunk-3CJHBJXA.js";
9
9
  export {
10
10
  Globe3D
package/dist/goal.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { c as GoalLabels } from './labels-DE_743fQ.js';
2
+ export { G as GOAL_LABELS } from './labels-DE_743fQ.js';
3
+ import * as react from 'react';
4
+ import { ReactNode } from 'react';
5
+ import { GaugeProps } from './gauge.js';
6
+ import './context-BgYUymEO.js';
7
+ import './frame-I7_xYGy5.js';
8
+
9
+ interface GoalProgressProps extends Omit<GaugeProps, "value" | "min" | "max" | "format" | "caption" | "target" | "zones" | "tone" | "labels"> {
10
+ /** The amount raised, in **minor units** (cents). */
11
+ raised: number;
12
+ /** The goal, in minor units. */
13
+ goal: number;
14
+ /** The ISO 4217 currency. */
15
+ currency: string;
16
+ /** How many people chipped in. */
17
+ supporters?: number;
18
+ /** The time left, written by the app (a `Countdown`, “2 days”). */
19
+ timeLeft?: ReactNode;
20
+ /** The words, passed translated; English by default. */
21
+ labels?: Partial<GoalLabels>;
22
+ }
23
+ /** A pot towards its goal, in money: the arc fills, the words say how much of what, and who chipped in. */
24
+ declare function GoalProgress({ raised, goal, currency, supporters, timeLeft, labels: given, description, ...props }: GoalProgressProps): react.JSX.Element;
25
+
26
+ export { GoalLabels, GoalProgress, type GoalProgressProps };
package/dist/goal.js ADDED
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import {
3
+ GoalProgress
4
+ } from "./chunk-EEP7PS2L.js";
5
+ import "./chunk-EQLC2QVN.js";
6
+ import {
7
+ GOAL_LABELS
8
+ } from "./chunk-WNUFGMS7.js";
9
+ import "./chunk-OB5EFDDH.js";
10
+ import "./chunk-XLLYNNC6.js";
11
+ import "./chunk-JTKR7ZWP.js";
12
+ import "./chunk-3CJHBJXA.js";
13
+ export {
14
+ GOAL_LABELS,
15
+ GoalProgress
16
+ };
17
+ //# sourceMappingURL=goal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/heatmap.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  CalendarHeatmap,
4
4
  Heatmap
5
- } from "./chunk-7CSAGFBW.js";
6
- import "./chunk-I5QUZVU2.js";
5
+ } from "./chunk-XDDALY4C.js";
6
+ import "./chunk-PWMMXRMC.js";
7
7
  import "./chunk-W5FX4TU3.js";
8
8
  import "./chunk-XLLYNNC6.js";
9
- import "./chunk-DWJPPEMC.js";
9
+ import "./chunk-JTKR7ZWP.js";
10
10
  import "./chunk-3CJHBJXA.js";
11
11
  export {
12
12
  CalendarHeatmap,
package/dist/index.d.ts CHANGED
@@ -4,11 +4,16 @@ export { Candlestick, CandlestickProps } from './candlestick.js';
4
4
  export { W as WalkItem } from './host-_F8RgiIz.js';
5
5
  export { T as TableModel } from './frame-I7_xYGy5.js';
6
6
  export { Chart, ChartProps, ResolvedTheme } from './chart.js';
7
+ export { C as CREDIT_LABELS, a as CreditLabels, E as EARNINGS_LABELS, b as EarningsLabels, G as GOAL_LABELS, c as GoalLabels, L as LATENCY_LABELS, d as LatencyLabels, T as THROUGHPUT_LABELS, e as TICKER_LABELS, f as ThroughputLabels, g as TickerLabels } from './labels-DE_743fQ.js';
8
+ export { CreditUsage, CreditUsageProps } from './credits.js';
9
+ export { EarningsChart, EarningsChartProps } from './earnings.js';
7
10
  export { Funnel, FunnelProps } from './funnel.js';
8
11
  export { Gauge, GaugeProps, GaugeZone } from './gauge.js';
9
12
  export { GeoMap, GeoMapProps, GeoPoint } from './geo.js';
10
13
  export { Globe3D, Globe3DProps, GlobeArc, GlobePoint } from './globe.js';
14
+ export { GoalProgress, GoalProgressProps } from './goal.js';
11
15
  export { CalendarHeatmap, CalendarHeatmapProps, Heatmap, HeatmapProps } from './heatmap.js';
16
+ export { LatencyChart, LatencyChartProps, formatDuration } from './latency.js';
12
17
  export { AreaChart, AreaChartProps, LineChart, LineChartProps } from './line.js';
13
18
  export { DonutChart, PieChart, PieChartProps } from './pie.js';
14
19
  export { A as Accessor, B as BrandId, C as CategoryFormat, a as ChartKind, b as ChartLabels, c as ChartLabelsInput, d as ChartsProvider, e as ChartsProviderProps, f as ChartsSettings, D as DEFAULT_LABELS, g as Datum, L as Locale, M as Marker, S as SeriesColor, h as SeriesSpec, i as SeriesSummary, T as Threshold, j as Tone, V as ValueFormat } from './context-BgYUymEO.js';
@@ -17,6 +22,8 @@ export { RadarChart, RadarChartProps } from './radar.js';
17
22
  export { Sankey, SankeyProps } from './sankey.js';
18
23
  export { ScatterChart, ScatterChartProps, correlation } from './scatter.js';
19
24
  export { Sparkline, SparklineProps } from './sparkline.js';
25
+ export { DEFAULT_STATUSES, JobStatus, JobThroughput, JobThroughputProps } from './throughput.js';
26
+ export { Bid, PriceTicker, PriceTickerProps } from './ticker.js';
20
27
  export { Treemap, TreemapNode, TreemapProps } from './treemap.js';
21
28
  import 'react';
22
29
  import 'echarts/core';