@vielzeug/prism 1.1.1

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/README.md +83 -0
  2. package/dist/_dev.cjs +2 -0
  3. package/dist/_dev.cjs.map +1 -0
  4. package/dist/_dev.d.ts +2 -0
  5. package/dist/_dev.d.ts.map +1 -0
  6. package/dist/_dev.js +12 -0
  7. package/dist/_dev.js.map +1 -0
  8. package/dist/animation/easing.cjs +2 -0
  9. package/dist/animation/easing.cjs.map +1 -0
  10. package/dist/animation/easing.d.ts +4 -0
  11. package/dist/animation/easing.d.ts.map +1 -0
  12. package/dist/animation/easing.js +14 -0
  13. package/dist/animation/easing.js.map +1 -0
  14. package/dist/animation/index.d.ts +6 -0
  15. package/dist/animation/index.d.ts.map +1 -0
  16. package/dist/animation/transition.cjs +2 -0
  17. package/dist/animation/transition.cjs.map +1 -0
  18. package/dist/animation/transition.d.ts +15 -0
  19. package/dist/animation/transition.d.ts.map +1 -0
  20. package/dist/animation/transition.js +28 -0
  21. package/dist/animation/transition.js.map +1 -0
  22. package/dist/animation/tween.cjs +2 -0
  23. package/dist/animation/tween.cjs.map +1 -0
  24. package/dist/animation/tween.d.ts +3 -0
  25. package/dist/animation/tween.d.ts.map +1 -0
  26. package/dist/animation/tween.js +8 -0
  27. package/dist/animation/tween.js.map +1 -0
  28. package/dist/axes/axis.cjs +2 -0
  29. package/dist/axes/axis.cjs.map +1 -0
  30. package/dist/axes/axis.d.ts +15 -0
  31. package/dist/axes/axis.d.ts.map +1 -0
  32. package/dist/axes/axis.js +60 -0
  33. package/dist/axes/axis.js.map +1 -0
  34. package/dist/axes/grid.cjs +2 -0
  35. package/dist/axes/grid.cjs.map +1 -0
  36. package/dist/axes/grid.d.ts +4 -0
  37. package/dist/axes/grid.d.ts.map +1 -0
  38. package/dist/axes/grid.js +30 -0
  39. package/dist/axes/grid.js.map +1 -0
  40. package/dist/axes/index.d.ts +3 -0
  41. package/dist/axes/index.d.ts.map +1 -0
  42. package/dist/axes/scale-utils.cjs +2 -0
  43. package/dist/axes/scale-utils.cjs.map +1 -0
  44. package/dist/axes/scale-utils.d.ts +17 -0
  45. package/dist/axes/scale-utils.d.ts.map +1 -0
  46. package/dist/axes/scale-utils.js +11 -0
  47. package/dist/axes/scale-utils.js.map +1 -0
  48. package/dist/axes/types.d.ts +2 -0
  49. package/dist/axes/types.d.ts.map +1 -0
  50. package/dist/charts/area/area-chart.cjs +2 -0
  51. package/dist/charts/area/area-chart.cjs.map +1 -0
  52. package/dist/charts/area/area-chart.d.ts +3 -0
  53. package/dist/charts/area/area-chart.d.ts.map +1 -0
  54. package/dist/charts/area/area-chart.js +58 -0
  55. package/dist/charts/area/area-chart.js.map +1 -0
  56. package/dist/charts/area/area-renderer.cjs +2 -0
  57. package/dist/charts/area/area-renderer.cjs.map +1 -0
  58. package/dist/charts/area/area-renderer.d.ts +14 -0
  59. package/dist/charts/area/area-renderer.d.ts.map +1 -0
  60. package/dist/charts/area/area-renderer.js +73 -0
  61. package/dist/charts/area/area-renderer.js.map +1 -0
  62. package/dist/charts/area/area-types.d.ts +2 -0
  63. package/dist/charts/area/area-types.d.ts.map +1 -0
  64. package/dist/charts/area/index.d.ts +2 -0
  65. package/dist/charts/area/index.d.ts.map +1 -0
  66. package/dist/charts/bar/bar-chart.cjs +2 -0
  67. package/dist/charts/bar/bar-chart.cjs.map +1 -0
  68. package/dist/charts/bar/bar-chart.d.ts +3 -0
  69. package/dist/charts/bar/bar-chart.d.ts.map +1 -0
  70. package/dist/charts/bar/bar-chart.js +151 -0
  71. package/dist/charts/bar/bar-chart.js.map +1 -0
  72. package/dist/charts/bar/bar-hit-test.cjs +2 -0
  73. package/dist/charts/bar/bar-hit-test.cjs.map +1 -0
  74. package/dist/charts/bar/bar-hit-test.d.ts +12 -0
  75. package/dist/charts/bar/bar-hit-test.d.ts.map +1 -0
  76. package/dist/charts/bar/bar-hit-test.js +29 -0
  77. package/dist/charts/bar/bar-hit-test.js.map +1 -0
  78. package/dist/charts/bar/bar-renderer.cjs +2 -0
  79. package/dist/charts/bar/bar-renderer.cjs.map +1 -0
  80. package/dist/charts/bar/bar-renderer.d.ts +19 -0
  81. package/dist/charts/bar/bar-renderer.d.ts.map +1 -0
  82. package/dist/charts/bar/bar-renderer.js +107 -0
  83. package/dist/charts/bar/bar-renderer.js.map +1 -0
  84. package/dist/charts/bar/bar-scale-context.d.ts +11 -0
  85. package/dist/charts/bar/bar-scale-context.d.ts.map +1 -0
  86. package/dist/charts/bar/bar-types.d.ts +2 -0
  87. package/dist/charts/bar/bar-types.d.ts.map +1 -0
  88. package/dist/charts/bar/index.d.ts +2 -0
  89. package/dist/charts/bar/index.d.ts.map +1 -0
  90. package/dist/charts/index.d.ts +6 -0
  91. package/dist/charts/index.d.ts.map +1 -0
  92. package/dist/charts/line/index.d.ts +2 -0
  93. package/dist/charts/line/index.d.ts.map +1 -0
  94. package/dist/charts/line/line-chart.cjs +2 -0
  95. package/dist/charts/line/line-chart.cjs.map +1 -0
  96. package/dist/charts/line/line-chart.d.ts +3 -0
  97. package/dist/charts/line/line-chart.d.ts.map +1 -0
  98. package/dist/charts/line/line-chart.js +59 -0
  99. package/dist/charts/line/line-chart.js.map +1 -0
  100. package/dist/charts/line/line-renderer.cjs +2 -0
  101. package/dist/charts/line/line-renderer.cjs.map +1 -0
  102. package/dist/charts/line/line-renderer.d.ts +15 -0
  103. package/dist/charts/line/line-renderer.d.ts.map +1 -0
  104. package/dist/charts/line/line-renderer.js +100 -0
  105. package/dist/charts/line/line-renderer.js.map +1 -0
  106. package/dist/charts/line/line-types.d.ts +2 -0
  107. package/dist/charts/line/line-types.d.ts.map +1 -0
  108. package/dist/charts/pie/index.d.ts +2 -0
  109. package/dist/charts/pie/index.d.ts.map +1 -0
  110. package/dist/charts/pie/pie-chart.cjs +2 -0
  111. package/dist/charts/pie/pie-chart.cjs.map +1 -0
  112. package/dist/charts/pie/pie-chart.d.ts +3 -0
  113. package/dist/charts/pie/pie-chart.d.ts.map +1 -0
  114. package/dist/charts/pie/pie-chart.js +156 -0
  115. package/dist/charts/pie/pie-chart.js.map +1 -0
  116. package/dist/charts/pie/pie-renderer.cjs +2 -0
  117. package/dist/charts/pie/pie-renderer.cjs.map +1 -0
  118. package/dist/charts/pie/pie-renderer.d.ts +23 -0
  119. package/dist/charts/pie/pie-renderer.d.ts.map +1 -0
  120. package/dist/charts/pie/pie-renderer.js +77 -0
  121. package/dist/charts/pie/pie-renderer.js.map +1 -0
  122. package/dist/charts/sparkline/index.d.ts +2 -0
  123. package/dist/charts/sparkline/index.d.ts.map +1 -0
  124. package/dist/charts/sparkline/sparkline.cjs +2 -0
  125. package/dist/charts/sparkline/sparkline.cjs.map +1 -0
  126. package/dist/charts/sparkline/sparkline.d.ts +3 -0
  127. package/dist/charts/sparkline/sparkline.d.ts.map +1 -0
  128. package/dist/charts/sparkline/sparkline.js +187 -0
  129. package/dist/charts/sparkline/sparkline.js.map +1 -0
  130. package/dist/core/cartesian-scales.cjs +2 -0
  131. package/dist/core/cartesian-scales.cjs.map +1 -0
  132. package/dist/core/cartesian-scales.d.ts +4 -0
  133. package/dist/core/cartesian-scales.d.ts.map +1 -0
  134. package/dist/core/cartesian-scales.js +54 -0
  135. package/dist/core/cartesian-scales.js.map +1 -0
  136. package/dist/core/chart-base.cjs +2 -0
  137. package/dist/core/chart-base.cjs.map +1 -0
  138. package/dist/core/chart-base.d.ts +14 -0
  139. package/dist/core/chart-base.d.ts.map +1 -0
  140. package/dist/core/chart-base.js +60 -0
  141. package/dist/core/chart-base.js.map +1 -0
  142. package/dist/core/chart-scaffold.cjs +2 -0
  143. package/dist/core/chart-scaffold.cjs.map +1 -0
  144. package/dist/core/chart-scaffold.d.ts +54 -0
  145. package/dist/core/chart-scaffold.d.ts.map +1 -0
  146. package/dist/core/chart-scaffold.js +104 -0
  147. package/dist/core/chart-scaffold.js.map +1 -0
  148. package/dist/core/index.d.ts +7 -0
  149. package/dist/core/index.d.ts.map +1 -0
  150. package/dist/core/layout.cjs +2 -0
  151. package/dist/core/layout.cjs.map +1 -0
  152. package/dist/core/layout.d.ts +7 -0
  153. package/dist/core/layout.d.ts.map +1 -0
  154. package/dist/core/layout.js +23 -0
  155. package/dist/core/layout.js.map +1 -0
  156. package/dist/core/responsive.cjs +2 -0
  157. package/dist/core/responsive.cjs.map +1 -0
  158. package/dist/core/responsive.d.ts +2 -0
  159. package/dist/core/responsive.d.ts.map +1 -0
  160. package/dist/core/responsive.js +20 -0
  161. package/dist/core/responsive.js.map +1 -0
  162. package/dist/devtools/index.d.ts +52 -0
  163. package/dist/devtools/index.d.ts.map +1 -0
  164. package/dist/devtools.cjs +2 -0
  165. package/dist/devtools.cjs.map +1 -0
  166. package/dist/devtools.js +19 -0
  167. package/dist/devtools.js.map +1 -0
  168. package/dist/errors.cjs +2 -0
  169. package/dist/errors.cjs.map +1 -0
  170. package/dist/errors.d.ts +16 -0
  171. package/dist/errors.d.ts.map +1 -0
  172. package/dist/errors.js +13 -0
  173. package/dist/errors.js.map +1 -0
  174. package/dist/index.cjs +1 -0
  175. package/dist/index.d.ts +19 -0
  176. package/dist/index.d.ts.map +1 -0
  177. package/dist/index.js +12 -0
  178. package/dist/interaction/crosshair.cjs +2 -0
  179. package/dist/interaction/crosshair.cjs.map +1 -0
  180. package/dist/interaction/crosshair.d.ts +13 -0
  181. package/dist/interaction/crosshair.d.ts.map +1 -0
  182. package/dist/interaction/crosshair.js +46 -0
  183. package/dist/interaction/crosshair.js.map +1 -0
  184. package/dist/interaction/events.cjs +2 -0
  185. package/dist/interaction/events.cjs.map +1 -0
  186. package/dist/interaction/events.d.ts +3 -0
  187. package/dist/interaction/events.d.ts.map +1 -0
  188. package/dist/interaction/events.js +12 -0
  189. package/dist/interaction/events.js.map +1 -0
  190. package/dist/interaction/hit-test.cjs +2 -0
  191. package/dist/interaction/hit-test.cjs.map +1 -0
  192. package/dist/interaction/hit-test.d.ts +3 -0
  193. package/dist/interaction/hit-test.d.ts.map +1 -0
  194. package/dist/interaction/hit-test.js +14 -0
  195. package/dist/interaction/hit-test.js.map +1 -0
  196. package/dist/interaction/index.d.ts +9 -0
  197. package/dist/interaction/index.d.ts.map +1 -0
  198. package/dist/interaction/legend.cjs +2 -0
  199. package/dist/interaction/legend.cjs.map +1 -0
  200. package/dist/interaction/legend.d.ts +12 -0
  201. package/dist/interaction/legend.d.ts.map +1 -0
  202. package/dist/interaction/legend.js +31 -0
  203. package/dist/interaction/legend.js.map +1 -0
  204. package/dist/interaction/series-interaction.cjs +2 -0
  205. package/dist/interaction/series-interaction.cjs.map +1 -0
  206. package/dist/interaction/series-interaction.d.ts +18 -0
  207. package/dist/interaction/series-interaction.d.ts.map +1 -0
  208. package/dist/interaction/series-interaction.js +58 -0
  209. package/dist/interaction/series-interaction.js.map +1 -0
  210. package/dist/interaction/tooltip.cjs +2 -0
  211. package/dist/interaction/tooltip.cjs.map +1 -0
  212. package/dist/interaction/tooltip.d.ts +10 -0
  213. package/dist/interaction/tooltip.d.ts.map +1 -0
  214. package/dist/interaction/tooltip.js +53 -0
  215. package/dist/interaction/tooltip.js.map +1 -0
  216. package/dist/prism.cjs +2 -0
  217. package/dist/prism.cjs.map +1 -0
  218. package/dist/prism.iife.js +2 -0
  219. package/dist/prism.iife.js.map +1 -0
  220. package/dist/prism.js +2 -0
  221. package/dist/prism.js.map +1 -0
  222. package/dist/scales/band.cjs +2 -0
  223. package/dist/scales/band.cjs.map +1 -0
  224. package/dist/scales/band.d.ts +3 -0
  225. package/dist/scales/band.d.ts.map +1 -0
  226. package/dist/scales/band.js +40 -0
  227. package/dist/scales/band.js.map +1 -0
  228. package/dist/scales/index.d.ts +4 -0
  229. package/dist/scales/index.d.ts.map +1 -0
  230. package/dist/scales/linear.cjs +2 -0
  231. package/dist/scales/linear.cjs.map +1 -0
  232. package/dist/scales/linear.d.ts +4 -0
  233. package/dist/scales/linear.d.ts.map +1 -0
  234. package/dist/scales/linear.js +44 -0
  235. package/dist/scales/linear.js.map +1 -0
  236. package/dist/scales/time.cjs +2 -0
  237. package/dist/scales/time.cjs.map +1 -0
  238. package/dist/scales/time.d.ts +4 -0
  239. package/dist/scales/time.d.ts.map +1 -0
  240. package/dist/scales/time.js +62 -0
  241. package/dist/scales/time.js.map +1 -0
  242. package/dist/scales/types.d.ts +19 -0
  243. package/dist/scales/types.d.ts.map +1 -0
  244. package/dist/svg/element.cjs +2 -0
  245. package/dist/svg/element.cjs.map +1 -0
  246. package/dist/svg/element.d.ts +4 -0
  247. package/dist/svg/element.d.ts.map +1 -0
  248. package/dist/svg/element.js +23 -0
  249. package/dist/svg/element.js.map +1 -0
  250. package/dist/svg/index.d.ts +5 -0
  251. package/dist/svg/index.d.ts.map +1 -0
  252. package/dist/svg/path.cjs +2 -0
  253. package/dist/svg/path.cjs.map +1 -0
  254. package/dist/svg/path.d.ts +9 -0
  255. package/dist/svg/path.d.ts.map +1 -0
  256. package/dist/svg/path.js +49 -0
  257. package/dist/svg/path.js.map +1 -0
  258. package/dist/svg/text.cjs +2 -0
  259. package/dist/svg/text.cjs.map +1 -0
  260. package/dist/svg/text.d.ts +7 -0
  261. package/dist/svg/text.d.ts.map +1 -0
  262. package/dist/svg/text.js +10 -0
  263. package/dist/svg/text.js.map +1 -0
  264. package/dist/theme/index.cjs +2 -0
  265. package/dist/theme/index.cjs.map +1 -0
  266. package/dist/theme/index.d.ts +6 -0
  267. package/dist/theme/index.d.ts.map +1 -0
  268. package/dist/theme/index.js +20 -0
  269. package/dist/theme/index.js.map +1 -0
  270. package/dist/theme/prism.css +342 -0
  271. package/dist/types.d.ts +204 -0
  272. package/dist/types.d.ts.map +1 -0
  273. package/package.json +79 -0
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # @vielzeug/prism
2
+
3
+ > Reactive SVG charting library — line, bar, area, pie, and sparkline charts. Zero external dependencies, signal-driven updates.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@vielzeug/prism)](https://www.npmjs.com/package/@vielzeug/prism) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ <details>
8
+ <summary>Quick Reference</summary>
9
+
10
+ **Package:** `@vielzeug/prism` &nbsp;·&nbsp; **Category:** UI / Visualization
11
+
12
+ **Key exports:** `createLineChart`, `createBarChart`, `createAreaChart`, `createPieChart`, `createSparkline`, `linearScale`, `timeScale`, `bandScale`, `seriesColor`, `setTheme`
13
+
14
+ **When to use:** Data visualization with reactive charts that auto-update when signal-based data sources change. Renders accessible SVG, themeable via CSS custom properties.
15
+
16
+ **Related:** [@vielzeug/ripple](https://vielzeug.dev/ripple/) · [@vielzeug/refine](https://vielzeug.dev/refine/) · [@vielzeug/orbit](https://vielzeug.dev/orbit/)
17
+
18
+ </details>
19
+
20
+ `@vielzeug/prism` is part of Vielzeug. It depends on `@vielzeug/ripple` for reactivity and ships as a TypeScript package with ESM+CJS output.
21
+
22
+ ## Installation
23
+
24
+ ```sh
25
+ # pnpm
26
+ pnpm add @vielzeug/prism
27
+ # npm
28
+ npm install @vielzeug/prism
29
+ # yarn
30
+ yarn add @vielzeug/prism
31
+ ```
32
+
33
+ ## Sub-paths
34
+
35
+ | Import | Purpose |
36
+ | -------------------------- | -------------------------------------------------------------- |
37
+ | `@vielzeug/prism` | Chart factories, scales, and types |
38
+ | `@vielzeug/prism/theme` | Default CSS custom properties (light + dark mode) |
39
+ | `@vielzeug/prism/devtools` | `warn` / `issue` helpers (dev-only, tree-shaken in production) |
40
+
41
+ ## Quick Start
42
+
43
+ ```ts
44
+ import { createLineChart, setTheme } from '@vielzeug/prism';
45
+ import { signal } from '@vielzeug/ripple';
46
+ import '@vielzeug/prism/theme';
47
+
48
+ // Optional: apply a custom color palette at startup
49
+ setTheme({ colors: ['#6366f1', '#22d3ee', '#f59e0b', '#10b981'] });
50
+
51
+ const data = signal([
52
+ { x: 1, y: 10 },
53
+ { x: 2, y: 25 },
54
+ { x: 3, y: 18 },
55
+ { x: 4, y: 32 },
56
+ ]);
57
+
58
+ const chart = createLineChart(document.getElementById('chart')!, {
59
+ series: [{ name: 'Revenue', data, color: '#3b82f6' }],
60
+ xAxis: { position: 'bottom' },
61
+ yAxis: { position: 'left', grid: true },
62
+ tooltip: true,
63
+ crosshair: true,
64
+ onHover: (event) => console.log(event?.point),
65
+ });
66
+
67
+ // Data updates → chart re-renders automatically
68
+ data.value = [...data.value, { x: 5, y: 28 }];
69
+
70
+ // Cleanup (also works with TC39 `using` declarations)
71
+ chart.dispose();
72
+ ```
73
+
74
+ ## Documentation
75
+
76
+ - [Overview](https://vielzeug.dev/prism/)
77
+ - [Usage Guide](https://vielzeug.dev/prism/usage)
78
+ - [API Reference](https://vielzeug.dev/prism/api)
79
+ - [Examples](https://vielzeug.dev/prism/examples)
80
+
81
+ ## License
82
+
83
+ MIT © [Helmuth Saatkamp](https://github.com/helmuthdu) — part of the [Vielzeug](https://github.com/helmuthdu/vielzeug) monorepo.
package/dist/_dev.cjs ADDED
@@ -0,0 +1,2 @@
1
+ var e=!globalThis.__PRISM_PROD__;function t(t){e&&console.warn(`[@vielzeug/prism] ${t}`)}function n(t,...n){e&&console.error(`[@vielzeug/prism] ${t}`,...n)}exports.error=n,exports.warn=t;
2
+ //# sourceMappingURL=_dev.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dev.cjs","names":[],"sources":["../src/_dev.ts"],"sourcesContent":["/** @internal */\nconst isDev = !(globalThis as { __PRISM_PROD__?: boolean }).__PRISM_PROD__;\n\n/**\n * Emits a `console.warn` in development builds only.\n * @internal\n * @security Messages may include user-supplied data (e.g. category names, x-values).\n * Never pass PII, tokens, or secrets as chart data labels.\n */\nexport function warn(msg: string): void {\n if (isDev) console.warn(`[@vielzeug/prism] ${msg}`);\n}\n\n/**\n * Emits a `console.error` in development builds only.\n * @internal\n */\nexport function error(msg: string, ...args: unknown[]): void {\n if (isDev) console.error(`[@vielzeug/prism] ${msg}`, ...args);\n}\n\n/** @internal — Run fn only in dev builds. Use when dev-only logic goes beyond a single warn() / error() call. */\nexport function devOnly(fn: () => void): void {\n if (isDev) fn();\n}\n"],"mappings":"AACA,IAAM,EAAQ,CAAE,WAA4C,eAQ5D,SAAgB,EAAK,EAAmB,CAClC,GAAO,QAAQ,KAAK,qBAAqB,GAAK,CACpD,CAMA,SAAgB,EAAM,EAAa,GAAG,EAAuB,CACvD,GAAO,QAAQ,MAAM,qBAAqB,IAAO,GAAG,CAAI,CAC9D"}
package/dist/_dev.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=_dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dev.d.ts","sourceRoot":"","sources":["../src/_dev.ts"],"names":[],"mappings":""}
package/dist/_dev.js ADDED
@@ -0,0 +1,12 @@
1
+ //#region src/_dev.ts
2
+ var e = !globalThis.__PRISM_PROD__;
3
+ function t(t) {
4
+ e && console.warn(`[@vielzeug/prism] ${t}`);
5
+ }
6
+ function n(t, ...n) {
7
+ e && console.error(`[@vielzeug/prism] ${t}`, ...n);
8
+ }
9
+ //#endregion
10
+ export { n as error, t as warn };
11
+
12
+ //# sourceMappingURL=_dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dev.js","names":[],"sources":["../src/_dev.ts"],"sourcesContent":["/** @internal */\nconst isDev = !(globalThis as { __PRISM_PROD__?: boolean }).__PRISM_PROD__;\n\n/**\n * Emits a `console.warn` in development builds only.\n * @internal\n * @security Messages may include user-supplied data (e.g. category names, x-values).\n * Never pass PII, tokens, or secrets as chart data labels.\n */\nexport function warn(msg: string): void {\n if (isDev) console.warn(`[@vielzeug/prism] ${msg}`);\n}\n\n/**\n * Emits a `console.error` in development builds only.\n * @internal\n */\nexport function error(msg: string, ...args: unknown[]): void {\n if (isDev) console.error(`[@vielzeug/prism] ${msg}`, ...args);\n}\n\n/** @internal — Run fn only in dev builds. Use when dev-only logic goes beyond a single warn() / error() call. */\nexport function devOnly(fn: () => void): void {\n if (isDev) fn();\n}\n"],"mappings":";AACA,IAAM,IAAQ,CAAE,WAA4C;AAQ5D,SAAgB,EAAK,GAAmB;CACtC,AAAI,KAAO,QAAQ,KAAK,qBAAqB,GAAK;AACpD;AAMA,SAAgB,EAAM,GAAa,GAAG,GAAuB;CAC3D,AAAI,KAAO,QAAQ,MAAM,qBAAqB,KAAO,GAAG,CAAI;AAC9D"}
@@ -0,0 +1,2 @@
1
+ var e={"ease-in":e=>e*e,"ease-in-out":e=>e<.5?2*e*e:1-(-2*e+2)**2/2,"ease-out":e=>1-(1-e)*(1-e),linear:e=>e};function t(t){return typeof t==`function`?t:t!==void 0&&Object.hasOwn(e,t)?e[t]:e[`ease-out`]}exports.easings=e,exports.resolveEasing=t;
2
+ //# sourceMappingURL=easing.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easing.cjs","names":[],"sources":["../../src/animation/easing.ts"],"sourcesContent":["export type EasingFn = (t: number) => number;\n\nexport const easings: Record<string, EasingFn> = {\n 'ease-in': (t) => t * t,\n 'ease-in-out': (t) => (t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2),\n 'ease-out': (t) => 1 - (1 - t) * (1 - t),\n linear: (t) => t,\n};\n\nexport function resolveEasing(easing: string | ((t: number) => number) | undefined): EasingFn {\n if (typeof easing === 'function') return easing;\n\n // `Object.hasOwn` guards against `easing` being a prototype-chain key (e.g. `'__proto__'`,\n // `'constructor'`) — a plain bracket lookup on those would silently resolve to an\n // `Object.prototype` value instead of `undefined`, which is either not callable (throws)\n // or callable but not an easing function (produces garbage interpolation).\n if (easing !== undefined && Object.hasOwn(easings, easing)) return easings[easing];\n\n return easings['ease-out'];\n}\n"],"mappings":"AAEA,IAAa,EAAoC,CAC/C,UAAY,GAAM,EAAI,EACtB,cAAgB,GAAO,EAAI,GAAM,EAAI,EAAI,EAAI,GAAa,GAAK,EAAI,IAAG,EAAK,EAC3E,WAAa,GAAM,GAAK,EAAI,IAAM,EAAI,GACtC,OAAS,GAAM,CACjB,EAEA,SAAgB,EAAc,EAAgE,CAS5F,OARI,OAAO,GAAW,WAAmB,EAMrC,IAAW,IAAA,IAAa,OAAO,OAAO,EAAS,CAAM,EAAU,EAAQ,GAEpE,EAAQ,WACjB"}
@@ -0,0 +1,4 @@
1
+ export type EasingFn = (t: number) => number;
2
+ export declare const easings: Record<string, EasingFn>;
3
+ export declare function resolveEasing(easing: string | ((t: number) => number) | undefined): EasingFn;
4
+ //# sourceMappingURL=easing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easing.d.ts","sourceRoot":"","sources":["../../src/animation/easing.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAK5C,CAAC;AAEF,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,GAAG,QAAQ,CAU5F"}
@@ -0,0 +1,14 @@
1
+ //#region src/animation/easing.ts
2
+ var e = {
3
+ "ease-in": (e) => e * e,
4
+ "ease-in-out": (e) => e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2,
5
+ "ease-out": (e) => 1 - (1 - e) * (1 - e),
6
+ linear: (e) => e
7
+ };
8
+ function t(t) {
9
+ return typeof t == "function" ? t : t !== void 0 && Object.hasOwn(e, t) ? e[t] : e["ease-out"];
10
+ }
11
+ //#endregion
12
+ export { e as easings, t as resolveEasing };
13
+
14
+ //# sourceMappingURL=easing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easing.js","names":[],"sources":["../../src/animation/easing.ts"],"sourcesContent":["export type EasingFn = (t: number) => number;\n\nexport const easings: Record<string, EasingFn> = {\n 'ease-in': (t) => t * t,\n 'ease-in-out': (t) => (t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2),\n 'ease-out': (t) => 1 - (1 - t) * (1 - t),\n linear: (t) => t,\n};\n\nexport function resolveEasing(easing: string | ((t: number) => number) | undefined): EasingFn {\n if (typeof easing === 'function') return easing;\n\n // `Object.hasOwn` guards against `easing` being a prototype-chain key (e.g. `'__proto__'`,\n // `'constructor'`) — a plain bracket lookup on those would silently resolve to an\n // `Object.prototype` value instead of `undefined`, which is either not callable (throws)\n // or callable but not an easing function (produces garbage interpolation).\n if (easing !== undefined && Object.hasOwn(easings, easing)) return easings[easing];\n\n return easings['ease-out'];\n}\n"],"mappings":";AAEA,IAAa,IAAoC;CAC/C,YAAY,MAAM,IAAI;CACtB,gBAAgB,MAAO,IAAI,KAAM,IAAI,IAAI,IAAI,KAAa,KAAK,IAAI,MAAG,IAAK;CAC3E,aAAa,MAAM,KAAK,IAAI,MAAM,IAAI;CACtC,SAAS,MAAM;AACjB;AAEA,SAAgB,EAAc,GAAgE;CAS5F,OARI,OAAO,KAAW,aAAmB,IAMrC,MAAW,KAAA,KAAa,OAAO,OAAO,GAAS,CAAM,IAAU,EAAQ,KAEpE,EAAQ;AACjB"}
@@ -0,0 +1,6 @@
1
+ export { resolveEasing } from './easing';
2
+ export type { EasingFn } from './easing';
3
+ export { animate } from './transition';
4
+ export type { AnimationTarget } from './transition';
5
+ export { tweenColor, tweenNumber } from './tween';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ const e=require("./easing.cjs"),t=require("./tween.cjs");function n(n,r,i,a){let o=r?.duration??300,s=e.resolveEasing(r?.easing),c=Math.max(0,r?.stagger??0);if(o===0||n.length===0){for(let e of n)for(let[t,{to:n}]of Object.entries(e.attrs))e.el.setAttribute(t,String(n));return i?.(),()=>{}}let l=null,u=!1,d=Math.max(o,o+c*(n.length-1));function f(e){if(u||a?.aborted)return;l===null&&(l=e);let r=e-l;for(let e=0;e<n.length;e++){let i=n[e],a=c*e,l=Math.max(0,r-a),u=Math.min(1,l/o),d=s(u);for(let[e,{from:n,to:r}]of Object.entries(i.attrs))i.el.setAttribute(e,String(t.tweenNumber(n,r,d)))}r<d?requestAnimationFrame(f):i?.()}return requestAnimationFrame(f),()=>{u=!0}}exports.animate=n;
2
+ //# sourceMappingURL=transition.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition.cjs","names":[],"sources":["../../src/animation/transition.ts"],"sourcesContent":["import type { TransitionConfig } from '../types';\n\nimport { resolveEasing } from './easing';\nimport { tweenNumber } from './tween';\n\nexport interface AnimationTarget {\n attrs: Record<string, { from: number; to: number }>;\n el: SVGElement;\n}\n\n/**\n * Runs a batch of attribute tweens, sharing one `requestAnimationFrame` loop.\n * Returns a `cancel()` function the caller can invoke to stop the loop early\n * (e.g. a fresh render superseding this batch, or `signal` aborting).\n */\nexport function animate(\n targets: AnimationTarget[],\n config?: TransitionConfig,\n onComplete?: () => void,\n signal?: AbortSignal,\n): () => void {\n const duration = config?.duration ?? 300;\n const easing = resolveEasing(config?.easing);\n const stagger = Math.max(0, config?.stagger ?? 0);\n\n if (duration === 0 || targets.length === 0) {\n for (const target of targets) {\n for (const [attr, { to }] of Object.entries(target.attrs)) {\n target.el.setAttribute(attr, String(to));\n }\n }\n\n onComplete?.();\n\n return () => {};\n }\n\n let startTime: number | null = null;\n let cancelled = false;\n const totalDuration = Math.max(duration, duration + stagger * (targets.length - 1));\n\n function frame(timestamp: number) {\n if (cancelled || signal?.aborted) return;\n\n if (startTime === null) startTime = timestamp;\n\n const elapsed = timestamp - startTime;\n\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i];\n const delay = stagger * i;\n const localElapsed = Math.max(0, elapsed - delay);\n const t = Math.min(1, localElapsed / duration);\n const eased = easing(t);\n\n for (const [attr, { from, to }] of Object.entries(target.attrs)) {\n target.el.setAttribute(attr, String(tweenNumber(from, to, eased)));\n }\n }\n\n if (elapsed < totalDuration) {\n requestAnimationFrame(frame);\n } else {\n onComplete?.();\n }\n }\n\n requestAnimationFrame(frame);\n\n return () => {\n cancelled = true;\n };\n}\n"],"mappings":"yDAeA,SAAgB,EACd,EACA,EACA,EACA,EACY,CACZ,IAAM,EAAW,GAAQ,UAAY,IAC/B,EAAS,EAAA,cAAc,GAAQ,MAAM,EACrC,EAAU,KAAK,IAAI,EAAG,GAAQ,SAAW,CAAC,EAEhD,GAAI,IAAa,GAAK,EAAQ,SAAW,EAAG,CAC1C,IAAK,IAAM,KAAU,EACnB,IAAK,GAAM,CAAC,EAAM,CAAE,SAAS,OAAO,QAAQ,EAAO,KAAK,EACtD,EAAO,GAAG,aAAa,EAAM,OAAO,CAAE,CAAC,EAM3C,OAFA,IAAa,MAEA,CAAC,CAChB,CAEA,IAAI,EAA2B,KAC3B,EAAY,GACV,EAAgB,KAAK,IAAI,EAAU,EAAW,GAAW,EAAQ,OAAS,EAAE,EAElF,SAAS,EAAM,EAAmB,CAChC,GAAI,GAAa,GAAQ,QAAS,OAE9B,IAAc,OAAM,EAAY,GAEpC,IAAM,EAAU,EAAY,EAE5B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAAK,CACvC,IAAM,EAAS,EAAQ,GACjB,EAAQ,EAAU,EAClB,EAAe,KAAK,IAAI,EAAG,EAAU,CAAK,EAC1C,EAAI,KAAK,IAAI,EAAG,EAAe,CAAQ,EACvC,EAAQ,EAAO,CAAC,EAEtB,IAAK,GAAM,CAAC,EAAM,CAAE,OAAM,SAAS,OAAO,QAAQ,EAAO,KAAK,EAC5D,EAAO,GAAG,aAAa,EAAM,OAAO,EAAA,YAAY,EAAM,EAAI,CAAK,CAAC,CAAC,CAErE,CAEI,EAAU,EACZ,sBAAsB,CAAK,EAE3B,IAAa,CAEjB,CAIA,OAFA,sBAAsB,CAAK,MAEd,CACX,EAAY,EACd,CACF"}
@@ -0,0 +1,15 @@
1
+ import type { TransitionConfig } from '../types';
2
+ export interface AnimationTarget {
3
+ attrs: Record<string, {
4
+ from: number;
5
+ to: number;
6
+ }>;
7
+ el: SVGElement;
8
+ }
9
+ /**
10
+ * Runs a batch of attribute tweens, sharing one `requestAnimationFrame` loop.
11
+ * Returns a `cancel()` function the caller can invoke to stop the loop early
12
+ * (e.g. a fresh render superseding this batch, or `signal` aborting).
13
+ */
14
+ export declare function animate(targets: AnimationTarget[], config?: TransitionConfig, onComplete?: () => void, signal?: AbortSignal): () => void;
15
+ //# sourceMappingURL=transition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/animation/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAKjD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,EAAE,EAAE,UAAU,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,eAAe,EAAE,EAC1B,MAAM,CAAC,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,MAAM,IAAI,EACvB,MAAM,CAAC,EAAE,WAAW,GACnB,MAAM,IAAI,CAoDZ"}
@@ -0,0 +1,28 @@
1
+ import { resolveEasing as e } from "./easing.js";
2
+ import { tweenNumber as t } from "./tween.js";
3
+ //#region src/animation/transition.ts
4
+ function n(n, r, i, a) {
5
+ let o = r?.duration ?? 300, s = e(r?.easing), c = Math.max(0, r?.stagger ?? 0);
6
+ if (o === 0 || n.length === 0) {
7
+ for (let e of n) for (let [t, { to: n }] of Object.entries(e.attrs)) e.el.setAttribute(t, String(n));
8
+ return i?.(), () => {};
9
+ }
10
+ let l = null, u = !1, d = Math.max(o, o + c * (n.length - 1));
11
+ function f(e) {
12
+ if (u || a?.aborted) return;
13
+ l === null && (l = e);
14
+ let r = e - l;
15
+ for (let e = 0; e < n.length; e++) {
16
+ let i = n[e], a = c * e, l = Math.max(0, r - a), u = Math.min(1, l / o), d = s(u);
17
+ for (let [e, { from: n, to: r }] of Object.entries(i.attrs)) i.el.setAttribute(e, String(t(n, r, d)));
18
+ }
19
+ r < d ? requestAnimationFrame(f) : i?.();
20
+ }
21
+ return requestAnimationFrame(f), () => {
22
+ u = !0;
23
+ };
24
+ }
25
+ //#endregion
26
+ export { n as animate };
27
+
28
+ //# sourceMappingURL=transition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition.js","names":[],"sources":["../../src/animation/transition.ts"],"sourcesContent":["import type { TransitionConfig } from '../types';\n\nimport { resolveEasing } from './easing';\nimport { tweenNumber } from './tween';\n\nexport interface AnimationTarget {\n attrs: Record<string, { from: number; to: number }>;\n el: SVGElement;\n}\n\n/**\n * Runs a batch of attribute tweens, sharing one `requestAnimationFrame` loop.\n * Returns a `cancel()` function the caller can invoke to stop the loop early\n * (e.g. a fresh render superseding this batch, or `signal` aborting).\n */\nexport function animate(\n targets: AnimationTarget[],\n config?: TransitionConfig,\n onComplete?: () => void,\n signal?: AbortSignal,\n): () => void {\n const duration = config?.duration ?? 300;\n const easing = resolveEasing(config?.easing);\n const stagger = Math.max(0, config?.stagger ?? 0);\n\n if (duration === 0 || targets.length === 0) {\n for (const target of targets) {\n for (const [attr, { to }] of Object.entries(target.attrs)) {\n target.el.setAttribute(attr, String(to));\n }\n }\n\n onComplete?.();\n\n return () => {};\n }\n\n let startTime: number | null = null;\n let cancelled = false;\n const totalDuration = Math.max(duration, duration + stagger * (targets.length - 1));\n\n function frame(timestamp: number) {\n if (cancelled || signal?.aborted) return;\n\n if (startTime === null) startTime = timestamp;\n\n const elapsed = timestamp - startTime;\n\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i];\n const delay = stagger * i;\n const localElapsed = Math.max(0, elapsed - delay);\n const t = Math.min(1, localElapsed / duration);\n const eased = easing(t);\n\n for (const [attr, { from, to }] of Object.entries(target.attrs)) {\n target.el.setAttribute(attr, String(tweenNumber(from, to, eased)));\n }\n }\n\n if (elapsed < totalDuration) {\n requestAnimationFrame(frame);\n } else {\n onComplete?.();\n }\n }\n\n requestAnimationFrame(frame);\n\n return () => {\n cancelled = true;\n };\n}\n"],"mappings":";;;AAeA,SAAgB,EACd,GACA,GACA,GACA,GACY;CACZ,IAAM,IAAW,GAAQ,YAAY,KAC/B,IAAS,EAAc,GAAQ,MAAM,GACrC,IAAU,KAAK,IAAI,GAAG,GAAQ,WAAW,CAAC;CAEhD,IAAI,MAAa,KAAK,EAAQ,WAAW,GAAG;EAC1C,KAAK,IAAM,KAAU,GACnB,KAAK,IAAM,CAAC,GAAM,EAAE,YAAS,OAAO,QAAQ,EAAO,KAAK,GACtD,EAAO,GAAG,aAAa,GAAM,OAAO,CAAE,CAAC;EAM3C,OAFA,IAAa,SAEA,CAAC;CAChB;CAEA,IAAI,IAA2B,MAC3B,IAAY,IACV,IAAgB,KAAK,IAAI,GAAU,IAAW,KAAW,EAAQ,SAAS,EAAE;CAElF,SAAS,EAAM,GAAmB;EAChC,IAAI,KAAa,GAAQ,SAAS;EAElC,AAAI,MAAc,SAAM,IAAY;EAEpC,IAAM,IAAU,IAAY;EAE5B,KAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,KAAK;GACvC,IAAM,IAAS,EAAQ,IACjB,IAAQ,IAAU,GAClB,IAAe,KAAK,IAAI,GAAG,IAAU,CAAK,GAC1C,IAAI,KAAK,IAAI,GAAG,IAAe,CAAQ,GACvC,IAAQ,EAAO,CAAC;GAEtB,KAAK,IAAM,CAAC,GAAM,EAAE,SAAM,YAAS,OAAO,QAAQ,EAAO,KAAK,GAC5D,EAAO,GAAG,aAAa,GAAM,OAAO,EAAY,GAAM,GAAI,CAAK,CAAC,CAAC;EAErE;EAEA,AAAI,IAAU,IACZ,sBAAsB,CAAK,IAE3B,IAAa;CAEjB;CAIA,OAFA,sBAAsB,CAAK,SAEd;EACX,IAAY;CACd;AACF"}
@@ -0,0 +1,2 @@
1
+ function e(e,t,n){return e+(t-e)*n}exports.tweenNumber=e;
2
+ //# sourceMappingURL=tween.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tween.cjs","names":[],"sources":["../../src/animation/tween.ts"],"sourcesContent":["export function tweenNumber(from: number, to: number, t: number): number {\n return from + (to - from) * t;\n}\n\nexport function tweenColor(from: string, to: string, t: number): string {\n const f = parseColor(from);\n const toC = parseColor(to);\n\n if (!f || !toC) return t < 0.5 ? from : to;\n\n const r = Math.round(tweenNumber(f.r, toC.r, t));\n const g = Math.round(tweenNumber(f.g, toC.g, t));\n const b = Math.round(tweenNumber(f.b, toC.b, t));\n\n return `rgb(${r},${g},${b})`;\n}\n\ninterface RGB {\n b: number;\n g: number;\n r: number;\n}\n\nfunction parseColor(color: string): RGB | null {\n if (color.startsWith('#')) {\n const hex = color.slice(1);\n\n if (hex.length === 3) {\n return {\n b: parseInt(hex[2] + hex[2], 16),\n g: parseInt(hex[1] + hex[1], 16),\n r: parseInt(hex[0] + hex[0], 16),\n };\n }\n\n if (hex.length === 6) {\n return {\n b: parseInt(hex.slice(4, 6), 16),\n g: parseInt(hex.slice(2, 4), 16),\n r: parseInt(hex.slice(0, 2), 16),\n };\n }\n }\n\n const rgbMatch = color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);\n\n if (rgbMatch) {\n return { b: +rgbMatch[3], g: +rgbMatch[2], r: +rgbMatch[1] };\n }\n\n return null;\n}\n"],"mappings":"AAAA,SAAgB,EAAY,EAAc,EAAY,EAAmB,CACvE,OAAO,GAAQ,EAAK,GAAQ,CAC9B"}
@@ -0,0 +1,3 @@
1
+ export declare function tweenNumber(from: number, to: number, t: number): number;
2
+ export declare function tweenColor(from: string, to: string, t: number): string;
3
+ //# sourceMappingURL=tween.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tween.d.ts","sourceRoot":"","sources":["../../src/animation/tween.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAWtE"}
@@ -0,0 +1,8 @@
1
+ //#region src/animation/tween.ts
2
+ function e(e, t, n) {
3
+ return e + (t - e) * n;
4
+ }
5
+ //#endregion
6
+ export { e as tweenNumber };
7
+
8
+ //# sourceMappingURL=tween.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tween.js","names":[],"sources":["../../src/animation/tween.ts"],"sourcesContent":["export function tweenNumber(from: number, to: number, t: number): number {\n return from + (to - from) * t;\n}\n\nexport function tweenColor(from: string, to: string, t: number): string {\n const f = parseColor(from);\n const toC = parseColor(to);\n\n if (!f || !toC) return t < 0.5 ? from : to;\n\n const r = Math.round(tweenNumber(f.r, toC.r, t));\n const g = Math.round(tweenNumber(f.g, toC.g, t));\n const b = Math.round(tweenNumber(f.b, toC.b, t));\n\n return `rgb(${r},${g},${b})`;\n}\n\ninterface RGB {\n b: number;\n g: number;\n r: number;\n}\n\nfunction parseColor(color: string): RGB | null {\n if (color.startsWith('#')) {\n const hex = color.slice(1);\n\n if (hex.length === 3) {\n return {\n b: parseInt(hex[2] + hex[2], 16),\n g: parseInt(hex[1] + hex[1], 16),\n r: parseInt(hex[0] + hex[0], 16),\n };\n }\n\n if (hex.length === 6) {\n return {\n b: parseInt(hex.slice(4, 6), 16),\n g: parseInt(hex.slice(2, 4), 16),\n r: parseInt(hex.slice(0, 2), 16),\n };\n }\n }\n\n const rgbMatch = color.match(/rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/);\n\n if (rgbMatch) {\n return { b: +rgbMatch[3], g: +rgbMatch[2], r: +rgbMatch[1] };\n }\n\n return null;\n}\n"],"mappings":";AAAA,SAAgB,EAAY,GAAc,GAAY,GAAmB;CACvE,OAAO,KAAQ,IAAK,KAAQ;AAC9B"}
@@ -0,0 +1,2 @@
1
+ const e=require("../svg/element.cjs"),t=require("../svg/text.cjs"),n=require("./scale-utils.cjs");var r=e=>e instanceof Date?e.toLocaleDateString(void 0,{month:`short`,year:`numeric`}):String(e);function i(e,t,n){let r=e.position??n,i=r===`bottom`||r===`top`?Math.max(2,Math.floor(t/80)):Math.max(2,Math.floor(t/50));return e.tickCount??i}function a(a,o,s,c,l=`bottom`){e.removeChildren(a);let u=s.position??l,d=u===`bottom`||u===`top`,f=u===`top`||u===`left`,p=f?-1:1,m=e.createSvgElement(`line`,{"aria-hidden":`true`,class:`prism-axis-line`,x1:0,x2:d?c:0,y1:0,y2:d?0:c});a.appendChild(m);let h=o.ticks(i(s,c,l)),g=s.tickFormat??r;for(let r of h){let i=n.mapTick(o,r),s=e.createSvgElement(`line`,{"aria-hidden":`true`,class:`prism-axis-tick`,x1:d?i:0,x2:d?i:6*p,y1:d?0:i,y2:d?6*p:i});a.appendChild(s);let c=t.createTextElement(g(r),{"aria-hidden":`true`,class:`prism-axis-label`,"dominant-baseline":d?f?`auto`:`hanging`:`middle`,"text-anchor":d?`middle`:f?`end`:`start`,x:d?i:6*p*1.5,y:d?6*p*1.5:i});a.appendChild(c)}if(s.label){let n=t.createTextElement(s.label,{class:`prism-axis-title`,"dominant-baseline":`middle`,"text-anchor":`middle`});d?e.setAttributes(n,{x:c/2,y:6*p*3.5}):e.setAttributes(n,{transform:`translate(${6*p*4}, ${c/2}) rotate(-90)`}),a.appendChild(n)}}exports.renderAxis=a,exports.resolveTickCount=i;
2
+ //# sourceMappingURL=axis.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axis.cjs","names":[],"sources":["../../src/axes/axis.ts"],"sourcesContent":["import type { AxisConfig, AxisPosition } from '../types';\n\nimport { createSvgElement, removeChildren, setAttributes } from '../svg/element';\nimport { createTextElement } from '../svg/text';\nimport { type AnyScale, mapTick } from './scale-utils';\n\nconst defaultTickFormat = (v: Date | number | string): string =>\n v instanceof Date ? v.toLocaleDateString(undefined, { month: 'short', year: 'numeric' }) : String(v);\n\n/**\n * Resolves the tick count an axis will render for a given scale/length — shared with\n * `renderGrid` so gridlines line up with axis ticks. `defaultPosition` must match the\n * one passed to the corresponding `renderAxis` call ('bottom' for xAxis, 'left' for yAxis).\n */\nexport function resolveTickCount(config: AxisConfig, length: number, defaultPosition: AxisPosition): number {\n const position = config.position ?? defaultPosition;\n const isHorizontal = position === 'bottom' || position === 'top';\n const defaultTickCount = isHorizontal ? Math.max(2, Math.floor(length / 80)) : Math.max(2, Math.floor(length / 50));\n\n return config.tickCount ?? defaultTickCount;\n}\n\n/**\n * `defaultPosition` is applied when `config.position` is unset — pass `'bottom'` for an\n * xAxis call and `'left'` for a yAxis call so an unconfigured axis renders on its\n * conventional side instead of always defaulting to a horizontal bottom axis.\n */\nexport function renderAxis(\n parent: SVGGElement,\n scale: AnyScale,\n config: AxisConfig,\n length: number,\n defaultPosition: AxisPosition = 'bottom',\n): void {\n removeChildren(parent);\n\n const position = config.position ?? defaultPosition;\n const isHorizontal = position === 'bottom' || position === 'top';\n const isInverted = position === 'top' || position === 'left';\n const tickSize = 6;\n const tickDirection = isInverted ? -1 : 1;\n\n const axisLine = createSvgElement('line', {\n 'aria-hidden': 'true',\n class: 'prism-axis-line',\n x1: isHorizontal ? 0 : 0,\n x2: isHorizontal ? length : 0,\n y1: isHorizontal ? 0 : 0,\n y2: isHorizontal ? 0 : length,\n });\n\n parent.appendChild(axisLine);\n\n const ticks = scale.ticks(resolveTickCount(config, length, defaultPosition));\n const format = config.tickFormat ?? defaultTickFormat;\n\n for (const tick of ticks) {\n const pos = mapTick(scale, tick);\n const tickLine = createSvgElement('line', {\n 'aria-hidden': 'true',\n class: 'prism-axis-tick',\n x1: isHorizontal ? pos : 0,\n x2: isHorizontal ? pos : tickSize * tickDirection,\n y1: isHorizontal ? 0 : pos,\n y2: isHorizontal ? tickSize * tickDirection : pos,\n });\n\n parent.appendChild(tickLine);\n\n const label = createTextElement(format(tick), {\n 'aria-hidden': 'true',\n class: 'prism-axis-label',\n 'dominant-baseline': isHorizontal ? (isInverted ? 'auto' : 'hanging') : 'middle',\n 'text-anchor': isHorizontal ? 'middle' : isInverted ? 'end' : 'start',\n x: isHorizontal ? pos : tickSize * tickDirection * 1.5,\n y: isHorizontal ? tickSize * tickDirection * 1.5 : pos,\n });\n\n parent.appendChild(label);\n }\n\n if (config.label) {\n const labelEl = createTextElement(config.label, {\n class: 'prism-axis-title',\n 'dominant-baseline': 'middle',\n 'text-anchor': 'middle',\n });\n\n if (isHorizontal) {\n setAttributes(labelEl, { x: length / 2, y: tickSize * tickDirection * 3.5 });\n } else {\n setAttributes(labelEl, {\n transform: `translate(${tickSize * tickDirection * 4}, ${length / 2}) rotate(-90)`,\n });\n }\n\n parent.appendChild(labelEl);\n }\n}\n"],"mappings":"kGAMA,IAAM,EAAqB,GACzB,aAAa,KAAO,EAAE,mBAAmB,IAAA,GAAW,CAAE,MAAO,QAAS,KAAM,SAAU,CAAC,EAAI,OAAO,CAAC,EAOrG,SAAgB,EAAiB,EAAoB,EAAgB,EAAuC,CAC1G,IAAM,EAAW,EAAO,UAAY,EAE9B,EADe,IAAa,UAAY,IAAa,MACnB,KAAK,IAAI,EAAG,KAAK,MAAM,EAAS,EAAE,CAAC,EAAI,KAAK,IAAI,EAAG,KAAK,MAAM,EAAS,EAAE,CAAC,EAElH,OAAO,EAAO,WAAa,CAC7B,CAOA,SAAgB,EACd,EACA,EACA,EACA,EACA,EAAgC,SAC1B,CACN,EAAA,eAAe,CAAM,EAErB,IAAM,EAAW,EAAO,UAAY,EAC9B,EAAe,IAAa,UAAY,IAAa,MACrD,EAAa,IAAa,OAAS,IAAa,OAEhD,EAAgB,EAAa,GAAK,EAElC,EAAW,EAAA,iBAAiB,OAAQ,CACxC,cAAe,OACf,MAAO,kBACP,GAAmB,EACnB,GAAI,EAAe,EAAS,EAC5B,GAAmB,EACnB,GAAI,EAAe,EAAI,CACzB,CAAC,EAED,EAAO,YAAY,CAAQ,EAE3B,IAAM,EAAQ,EAAM,MAAM,EAAiB,EAAQ,EAAQ,CAAe,CAAC,EACrE,EAAS,EAAO,YAAc,EAEpC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAA,QAAQ,EAAO,CAAI,EACzB,EAAW,EAAA,iBAAiB,OAAQ,CACxC,cAAe,OACf,MAAO,kBACP,GAAI,EAAe,EAAM,EACzB,GAAI,EAAe,EAAM,EAAW,EACpC,GAAI,EAAe,EAAI,EACvB,GAAI,EAAe,EAAW,EAAgB,CAChD,CAAC,EAED,EAAO,YAAY,CAAQ,EAE3B,IAAM,EAAQ,EAAA,kBAAkB,EAAO,CAAI,EAAG,CAC5C,cAAe,OACf,MAAO,mBACP,oBAAqB,EAAgB,EAAa,OAAS,UAAa,SACxE,cAAe,EAAe,SAAW,EAAa,MAAQ,QAC9D,EAAG,EAAe,EAAM,EAAW,EAAgB,IACnD,EAAG,EAAe,EAAW,EAAgB,IAAM,CACrD,CAAC,EAED,EAAO,YAAY,CAAK,CAC1B,CAEA,GAAI,EAAO,MAAO,CAChB,IAAM,EAAU,EAAA,kBAAkB,EAAO,MAAO,CAC9C,MAAO,mBACP,oBAAqB,SACrB,cAAe,QACjB,CAAC,EAEG,EACF,EAAA,cAAc,EAAS,CAAE,EAAG,EAAS,EAAG,EAAG,EAAW,EAAgB,GAAI,CAAC,EAE3E,EAAA,cAAc,EAAS,CACrB,UAAW,aAAa,EAAW,EAAgB,EAAE,IAAI,EAAS,EAAE,cACtE,CAAC,EAGH,EAAO,YAAY,CAAO,CAC5B,CACF"}
@@ -0,0 +1,15 @@
1
+ import type { AxisConfig, AxisPosition } from '../types';
2
+ import { type AnyScale } from './scale-utils';
3
+ /**
4
+ * Resolves the tick count an axis will render for a given scale/length — shared with
5
+ * `renderGrid` so gridlines line up with axis ticks. `defaultPosition` must match the
6
+ * one passed to the corresponding `renderAxis` call ('bottom' for xAxis, 'left' for yAxis).
7
+ */
8
+ export declare function resolveTickCount(config: AxisConfig, length: number, defaultPosition: AxisPosition): number;
9
+ /**
10
+ * `defaultPosition` is applied when `config.position` is unset — pass `'bottom'` for an
11
+ * xAxis call and `'left'` for a yAxis call so an unconfigured axis renders on its
12
+ * conventional side instead of always defaulting to a horizontal bottom axis.
13
+ */
14
+ export declare function renderAxis(parent: SVGGElement, scale: AnyScale, config: AxisConfig, length: number, defaultPosition?: AxisPosition): void;
15
+ //# sourceMappingURL=axis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/axes/axis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIzD,OAAO,EAAE,KAAK,QAAQ,EAAW,MAAM,eAAe,CAAC;AAKvD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,GAAG,MAAM,CAM1G;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,EACd,eAAe,GAAE,YAAuB,GACvC,IAAI,CAiEN"}
@@ -0,0 +1,60 @@
1
+ import { createSvgElement as e, removeChildren as t, setAttributes as n } from "../svg/element.js";
2
+ import { createTextElement as r } from "../svg/text.js";
3
+ import { mapTick as i } from "./scale-utils.js";
4
+ //#region src/axes/axis.ts
5
+ var a = (e) => e instanceof Date ? e.toLocaleDateString(void 0, {
6
+ month: "short",
7
+ year: "numeric"
8
+ }) : String(e);
9
+ function o(e, t, n) {
10
+ let r = e.position ?? n, i = r === "bottom" || r === "top" ? Math.max(2, Math.floor(t / 80)) : Math.max(2, Math.floor(t / 50));
11
+ return e.tickCount ?? i;
12
+ }
13
+ function s(s, c, l, u, d = "bottom") {
14
+ t(s);
15
+ let f = l.position ?? d, p = f === "bottom" || f === "top", m = f === "top" || f === "left", h = m ? -1 : 1, g = e("line", {
16
+ "aria-hidden": "true",
17
+ class: "prism-axis-line",
18
+ x1: 0,
19
+ x2: p ? u : 0,
20
+ y1: 0,
21
+ y2: p ? 0 : u
22
+ });
23
+ s.appendChild(g);
24
+ let _ = c.ticks(o(l, u, d)), v = l.tickFormat ?? a;
25
+ for (let t of _) {
26
+ let n = i(c, t), a = e("line", {
27
+ "aria-hidden": "true",
28
+ class: "prism-axis-tick",
29
+ x1: p ? n : 0,
30
+ x2: p ? n : 6 * h,
31
+ y1: p ? 0 : n,
32
+ y2: p ? 6 * h : n
33
+ });
34
+ s.appendChild(a);
35
+ let o = r(v(t), {
36
+ "aria-hidden": "true",
37
+ class: "prism-axis-label",
38
+ "dominant-baseline": p ? m ? "auto" : "hanging" : "middle",
39
+ "text-anchor": p ? "middle" : m ? "end" : "start",
40
+ x: p ? n : 6 * h * 1.5,
41
+ y: p ? 6 * h * 1.5 : n
42
+ });
43
+ s.appendChild(o);
44
+ }
45
+ if (l.label) {
46
+ let e = r(l.label, {
47
+ class: "prism-axis-title",
48
+ "dominant-baseline": "middle",
49
+ "text-anchor": "middle"
50
+ });
51
+ p ? n(e, {
52
+ x: u / 2,
53
+ y: 6 * h * 3.5
54
+ }) : n(e, { transform: `translate(${6 * h * 4}, ${u / 2}) rotate(-90)` }), s.appendChild(e);
55
+ }
56
+ }
57
+ //#endregion
58
+ export { s as renderAxis, o as resolveTickCount };
59
+
60
+ //# sourceMappingURL=axis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axis.js","names":[],"sources":["../../src/axes/axis.ts"],"sourcesContent":["import type { AxisConfig, AxisPosition } from '../types';\n\nimport { createSvgElement, removeChildren, setAttributes } from '../svg/element';\nimport { createTextElement } from '../svg/text';\nimport { type AnyScale, mapTick } from './scale-utils';\n\nconst defaultTickFormat = (v: Date | number | string): string =>\n v instanceof Date ? v.toLocaleDateString(undefined, { month: 'short', year: 'numeric' }) : String(v);\n\n/**\n * Resolves the tick count an axis will render for a given scale/length — shared with\n * `renderGrid` so gridlines line up with axis ticks. `defaultPosition` must match the\n * one passed to the corresponding `renderAxis` call ('bottom' for xAxis, 'left' for yAxis).\n */\nexport function resolveTickCount(config: AxisConfig, length: number, defaultPosition: AxisPosition): number {\n const position = config.position ?? defaultPosition;\n const isHorizontal = position === 'bottom' || position === 'top';\n const defaultTickCount = isHorizontal ? Math.max(2, Math.floor(length / 80)) : Math.max(2, Math.floor(length / 50));\n\n return config.tickCount ?? defaultTickCount;\n}\n\n/**\n * `defaultPosition` is applied when `config.position` is unset — pass `'bottom'` for an\n * xAxis call and `'left'` for a yAxis call so an unconfigured axis renders on its\n * conventional side instead of always defaulting to a horizontal bottom axis.\n */\nexport function renderAxis(\n parent: SVGGElement,\n scale: AnyScale,\n config: AxisConfig,\n length: number,\n defaultPosition: AxisPosition = 'bottom',\n): void {\n removeChildren(parent);\n\n const position = config.position ?? defaultPosition;\n const isHorizontal = position === 'bottom' || position === 'top';\n const isInverted = position === 'top' || position === 'left';\n const tickSize = 6;\n const tickDirection = isInverted ? -1 : 1;\n\n const axisLine = createSvgElement('line', {\n 'aria-hidden': 'true',\n class: 'prism-axis-line',\n x1: isHorizontal ? 0 : 0,\n x2: isHorizontal ? length : 0,\n y1: isHorizontal ? 0 : 0,\n y2: isHorizontal ? 0 : length,\n });\n\n parent.appendChild(axisLine);\n\n const ticks = scale.ticks(resolveTickCount(config, length, defaultPosition));\n const format = config.tickFormat ?? defaultTickFormat;\n\n for (const tick of ticks) {\n const pos = mapTick(scale, tick);\n const tickLine = createSvgElement('line', {\n 'aria-hidden': 'true',\n class: 'prism-axis-tick',\n x1: isHorizontal ? pos : 0,\n x2: isHorizontal ? pos : tickSize * tickDirection,\n y1: isHorizontal ? 0 : pos,\n y2: isHorizontal ? tickSize * tickDirection : pos,\n });\n\n parent.appendChild(tickLine);\n\n const label = createTextElement(format(tick), {\n 'aria-hidden': 'true',\n class: 'prism-axis-label',\n 'dominant-baseline': isHorizontal ? (isInverted ? 'auto' : 'hanging') : 'middle',\n 'text-anchor': isHorizontal ? 'middle' : isInverted ? 'end' : 'start',\n x: isHorizontal ? pos : tickSize * tickDirection * 1.5,\n y: isHorizontal ? tickSize * tickDirection * 1.5 : pos,\n });\n\n parent.appendChild(label);\n }\n\n if (config.label) {\n const labelEl = createTextElement(config.label, {\n class: 'prism-axis-title',\n 'dominant-baseline': 'middle',\n 'text-anchor': 'middle',\n });\n\n if (isHorizontal) {\n setAttributes(labelEl, { x: length / 2, y: tickSize * tickDirection * 3.5 });\n } else {\n setAttributes(labelEl, {\n transform: `translate(${tickSize * tickDirection * 4}, ${length / 2}) rotate(-90)`,\n });\n }\n\n parent.appendChild(labelEl);\n }\n}\n"],"mappings":";;;;AAMA,IAAM,KAAqB,MACzB,aAAa,OAAO,EAAE,mBAAmB,KAAA,GAAW;CAAE,OAAO;CAAS,MAAM;AAAU,CAAC,IAAI,OAAO,CAAC;AAOrG,SAAgB,EAAiB,GAAoB,GAAgB,GAAuC;CAC1G,IAAM,IAAW,EAAO,YAAY,GAE9B,IADe,MAAa,YAAY,MAAa,QACnB,KAAK,IAAI,GAAG,KAAK,MAAM,IAAS,EAAE,CAAC,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,IAAS,EAAE,CAAC;CAElH,OAAO,EAAO,aAAa;AAC7B;AAOA,SAAgB,EACd,GACA,GACA,GACA,GACA,IAAgC,UAC1B;CACN,EAAe,CAAM;CAErB,IAAM,IAAW,EAAO,YAAY,GAC9B,IAAe,MAAa,YAAY,MAAa,OACrD,IAAa,MAAa,SAAS,MAAa,QAEhD,IAAgB,IAAa,KAAK,GAElC,IAAW,EAAiB,QAAQ;EACxC,eAAe;EACf,OAAO;EACP,IAAmB;EACnB,IAAI,IAAe,IAAS;EAC5B,IAAmB;EACnB,IAAI,IAAe,IAAI;CACzB,CAAC;CAED,EAAO,YAAY,CAAQ;CAE3B,IAAM,IAAQ,EAAM,MAAM,EAAiB,GAAQ,GAAQ,CAAe,CAAC,GACrE,IAAS,EAAO,cAAc;CAEpC,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAM,EAAQ,GAAO,CAAI,GACzB,IAAW,EAAiB,QAAQ;GACxC,eAAe;GACf,OAAO;GACP,IAAI,IAAe,IAAM;GACzB,IAAI,IAAe,IAAM,IAAW;GACpC,IAAI,IAAe,IAAI;GACvB,IAAI,IAAe,IAAW,IAAgB;EAChD,CAAC;EAED,EAAO,YAAY,CAAQ;EAE3B,IAAM,IAAQ,EAAkB,EAAO,CAAI,GAAG;GAC5C,eAAe;GACf,OAAO;GACP,qBAAqB,IAAgB,IAAa,SAAS,YAAa;GACxE,eAAe,IAAe,WAAW,IAAa,QAAQ;GAC9D,GAAG,IAAe,IAAM,IAAW,IAAgB;GACnD,GAAG,IAAe,IAAW,IAAgB,MAAM;EACrD,CAAC;EAED,EAAO,YAAY,CAAK;CAC1B;CAEA,IAAI,EAAO,OAAO;EAChB,IAAM,IAAU,EAAkB,EAAO,OAAO;GAC9C,OAAO;GACP,qBAAqB;GACrB,eAAe;EACjB,CAAC;EAUD,AARI,IACF,EAAc,GAAS;GAAE,GAAG,IAAS;GAAG,GAAG,IAAW,IAAgB;EAAI,CAAC,IAE3E,EAAc,GAAS,EACrB,WAAW,aAAa,IAAW,IAAgB,EAAE,IAAI,IAAS,EAAE,eACtE,CAAC,GAGH,EAAO,YAAY,CAAO;CAC5B;AACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("../svg/element.cjs"),t=require("./scale-utils.cjs");function n(n,r,i,a,o,s=10){e.removeChildren(n);let c=i!==!0&&i.color||void 0,l=i!==!0&&i.dash||void 0,u=r.ticks(s);for(let i of u){let s=t.mapTick(r,i),u={class:`prism-grid-line`,stroke:c??`var(--prism-grid-color)`,"stroke-dasharray":l,"stroke-opacity":`var(--prism-grid-opacity)`};o===`vertical`?Object.assign(u,{x1:s,x2:s,y1:0,y2:a}):Object.assign(u,{x1:0,x2:a,y1:s,y2:s}),n.appendChild(e.createSvgElement(`line`,u))}}exports.renderGrid=n;
2
+ //# sourceMappingURL=grid.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.cjs","names":[],"sources":["../../src/axes/grid.ts"],"sourcesContent":["import type { GridConfig } from '../types';\n\nimport { createSvgElement, removeChildren } from '../svg/element';\nimport { type AnyScale, mapTick } from './scale-utils';\n\nexport function renderGrid(\n parent: SVGGElement,\n scale: AnyScale,\n config: GridConfig | true,\n crossLength: number,\n direction: 'horizontal' | 'vertical',\n tickCount = 10,\n): void {\n removeChildren(parent);\n\n const color = (config !== true && config.color) || undefined;\n const dash = (config !== true && config.dash) || undefined;\n const ticks = scale.ticks(tickCount);\n\n for (const tick of ticks) {\n const pos = mapTick(scale, tick);\n const attrs: Record<string, number | string | undefined> = {\n class: 'prism-grid-line',\n stroke: color ?? 'var(--prism-grid-color)',\n 'stroke-dasharray': dash,\n 'stroke-opacity': 'var(--prism-grid-opacity)',\n };\n\n if (direction === 'vertical') {\n Object.assign(attrs, { x1: pos, x2: pos, y1: 0, y2: crossLength });\n } else {\n Object.assign(attrs, { x1: 0, x2: crossLength, y1: pos, y2: pos });\n }\n\n parent.appendChild(createSvgElement('line', attrs));\n }\n}\n"],"mappings":"qEAKA,SAAgB,EACd,EACA,EACA,EACA,EACA,EACA,EAAY,GACN,CACN,EAAA,eAAe,CAAM,EAErB,IAAM,EAAS,IAAW,IAAQ,EAAO,OAAU,IAAA,GAC7C,EAAQ,IAAW,IAAQ,EAAO,MAAS,IAAA,GAC3C,EAAQ,EAAM,MAAM,CAAS,EAEnC,IAAK,IAAM,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAA,QAAQ,EAAO,CAAI,EACzB,EAAqD,CACzD,MAAO,kBACP,OAAQ,GAAS,0BACjB,mBAAoB,EACpB,iBAAkB,2BACpB,EAEI,IAAc,WAChB,OAAO,OAAO,EAAO,CAAE,GAAI,EAAK,GAAI,EAAK,GAAI,EAAG,GAAI,CAAY,CAAC,EAEjE,OAAO,OAAO,EAAO,CAAE,GAAI,EAAG,GAAI,EAAa,GAAI,EAAK,GAAI,CAAI,CAAC,EAGnE,EAAO,YAAY,EAAA,iBAAiB,OAAQ,CAAK,CAAC,CACpD,CACF"}
@@ -0,0 +1,4 @@
1
+ import type { GridConfig } from '../types';
2
+ import { type AnyScale } from './scale-utils';
3
+ export declare function renderGrid(parent: SVGGElement, scale: AnyScale, config: GridConfig | true, crossLength: number, direction: 'horizontal' | 'vertical', tickCount?: number): void;
4
+ //# sourceMappingURL=grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/axes/grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,EAAE,KAAK,QAAQ,EAAW,MAAM,eAAe,CAAC;AAEvD,wBAAgB,UAAU,CACxB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,YAAY,GAAG,UAAU,EACpC,SAAS,SAAK,GACb,IAAI,CAwBN"}
@@ -0,0 +1,30 @@
1
+ import { createSvgElement as e, removeChildren as t } from "../svg/element.js";
2
+ import { mapTick as n } from "./scale-utils.js";
3
+ //#region src/axes/grid.ts
4
+ function r(r, i, a, o, s, c = 10) {
5
+ t(r);
6
+ let l = a !== !0 && a.color || void 0, u = a !== !0 && a.dash || void 0, d = i.ticks(c);
7
+ for (let t of d) {
8
+ let a = n(i, t), c = {
9
+ class: "prism-grid-line",
10
+ stroke: l ?? "var(--prism-grid-color)",
11
+ "stroke-dasharray": u,
12
+ "stroke-opacity": "var(--prism-grid-opacity)"
13
+ };
14
+ s === "vertical" ? Object.assign(c, {
15
+ x1: a,
16
+ x2: a,
17
+ y1: 0,
18
+ y2: o
19
+ }) : Object.assign(c, {
20
+ x1: 0,
21
+ x2: o,
22
+ y1: a,
23
+ y2: a
24
+ }), r.appendChild(e("line", c));
25
+ }
26
+ }
27
+ //#endregion
28
+ export { r as renderGrid };
29
+
30
+ //# sourceMappingURL=grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.js","names":[],"sources":["../../src/axes/grid.ts"],"sourcesContent":["import type { GridConfig } from '../types';\n\nimport { createSvgElement, removeChildren } from '../svg/element';\nimport { type AnyScale, mapTick } from './scale-utils';\n\nexport function renderGrid(\n parent: SVGGElement,\n scale: AnyScale,\n config: GridConfig | true,\n crossLength: number,\n direction: 'horizontal' | 'vertical',\n tickCount = 10,\n): void {\n removeChildren(parent);\n\n const color = (config !== true && config.color) || undefined;\n const dash = (config !== true && config.dash) || undefined;\n const ticks = scale.ticks(tickCount);\n\n for (const tick of ticks) {\n const pos = mapTick(scale, tick);\n const attrs: Record<string, number | string | undefined> = {\n class: 'prism-grid-line',\n stroke: color ?? 'var(--prism-grid-color)',\n 'stroke-dasharray': dash,\n 'stroke-opacity': 'var(--prism-grid-opacity)',\n };\n\n if (direction === 'vertical') {\n Object.assign(attrs, { x1: pos, x2: pos, y1: 0, y2: crossLength });\n } else {\n Object.assign(attrs, { x1: 0, x2: crossLength, y1: pos, y2: pos });\n }\n\n parent.appendChild(createSvgElement('line', attrs));\n }\n}\n"],"mappings":";;;AAKA,SAAgB,EACd,GACA,GACA,GACA,GACA,GACA,IAAY,IACN;CACN,EAAe,CAAM;CAErB,IAAM,IAAS,MAAW,MAAQ,EAAO,SAAU,KAAA,GAC7C,IAAQ,MAAW,MAAQ,EAAO,QAAS,KAAA,GAC3C,IAAQ,EAAM,MAAM,CAAS;CAEnC,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAM,EAAQ,GAAO,CAAI,GACzB,IAAqD;GACzD,OAAO;GACP,QAAQ,KAAS;GACjB,oBAAoB;GACpB,kBAAkB;EACpB;EAQA,AANI,MAAc,aAChB,OAAO,OAAO,GAAO;GAAE,IAAI;GAAK,IAAI;GAAK,IAAI;GAAG,IAAI;EAAY,CAAC,IAEjE,OAAO,OAAO,GAAO;GAAE,IAAI;GAAG,IAAI;GAAa,IAAI;GAAK,IAAI;EAAI,CAAC,GAGnE,EAAO,YAAY,EAAiB,QAAQ,CAAK,CAAC;CACpD;AACF"}
@@ -0,0 +1,3 @@
1
+ export { renderAxis } from './axis';
2
+ export { renderGrid } from './grid';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/axes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ function e(e){return typeof e.bandwidth==`function`}function t(t,n){return e(t)?t.map(n)+t.bandwidth()/2:t.map(n)}exports.mapTick=t;
2
+ //# sourceMappingURL=scale-utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale-utils.cjs","names":[],"sources":["../../src/axes/scale-utils.ts"],"sourcesContent":["import type { BandScale, Scale } from '../types';\n\nexport type AnyScale = BandScale | Scale<Date> | Scale<number>;\n\nfunction isBandScale(scale: AnyScale): scale is BandScale {\n return typeof (scale as BandScale).bandwidth === 'function';\n}\n\n/**\n * Maps a tick value through any of prism's three scale kinds, centering band-scale\n * ticks on their band (bandScale.map() returns a band's left edge by design).\n *\n * Overloaded so a caller's `tick` type must match the scale kind it's paired with —\n * `AxisConfig`/`GridConfig` accept any scale kind, so the runtime discrimination\n * inside the implementation is unavoidable, but the overload set keeps that a single\n * isolated cast here instead of an unchecked `Date | number | string` accepted at\n * every call site.\n */\nexport function mapTick(scale: BandScale, tick: string): number;\nexport function mapTick(scale: Scale<Date>, tick: Date): number;\nexport function mapTick(scale: Scale<number>, tick: number): number;\n// Fallback overload for callers (axis.ts/grid.ts) holding an already-erased `AnyScale`\n// union — the type-correlated overloads above are what protect a caller with a\n// narrower, known scale type from mismatching it with the wrong tick type.\nexport function mapTick(scale: AnyScale, tick: Date | number | string): number;\nexport function mapTick(scale: AnyScale, tick: Date | number | string): number {\n if (isBandScale(scale)) return scale.map(tick as string) + scale.bandwidth() / 2;\n\n return (scale as Scale<Date | number>).map(tick as Date | number);\n}\n"],"mappings":"AAIA,SAAS,EAAY,EAAqC,CACxD,OAAO,OAAQ,EAAoB,WAAc,UACnD,CAmBA,SAAgB,EAAQ,EAAiB,EAAsC,CAG7E,OAFI,EAAY,CAAK,EAAU,EAAM,IAAI,CAAc,EAAI,EAAM,UAAU,EAAI,EAEvE,EAA+B,IAAI,CAAqB,CAClE"}
@@ -0,0 +1,17 @@
1
+ import type { BandScale, Scale } from '../types';
2
+ export type AnyScale = BandScale | Scale<Date> | Scale<number>;
3
+ /**
4
+ * Maps a tick value through any of prism's three scale kinds, centering band-scale
5
+ * ticks on their band (bandScale.map() returns a band's left edge by design).
6
+ *
7
+ * Overloaded so a caller's `tick` type must match the scale kind it's paired with —
8
+ * `AxisConfig`/`GridConfig` accept any scale kind, so the runtime discrimination
9
+ * inside the implementation is unavoidable, but the overload set keeps that a single
10
+ * isolated cast here instead of an unchecked `Date | number | string` accepted at
11
+ * every call site.
12
+ */
13
+ export declare function mapTick(scale: BandScale, tick: string): number;
14
+ export declare function mapTick(scale: Scale<Date>, tick: Date): number;
15
+ export declare function mapTick(scale: Scale<number>, tick: number): number;
16
+ export declare function mapTick(scale: AnyScale, tick: Date | number | string): number;
17
+ //# sourceMappingURL=scale-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale-utils.d.ts","sourceRoot":"","sources":["../../src/axes/scale-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAM/D;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;AAChE,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;AAChE,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;AAIpE,wBAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC"}
@@ -0,0 +1,11 @@
1
+ //#region src/axes/scale-utils.ts
2
+ function e(e) {
3
+ return typeof e.bandwidth == "function";
4
+ }
5
+ function t(t, n) {
6
+ return e(t) ? t.map(n) + t.bandwidth() / 2 : t.map(n);
7
+ }
8
+ //#endregion
9
+ export { t as mapTick };
10
+
11
+ //# sourceMappingURL=scale-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scale-utils.js","names":[],"sources":["../../src/axes/scale-utils.ts"],"sourcesContent":["import type { BandScale, Scale } from '../types';\n\nexport type AnyScale = BandScale | Scale<Date> | Scale<number>;\n\nfunction isBandScale(scale: AnyScale): scale is BandScale {\n return typeof (scale as BandScale).bandwidth === 'function';\n}\n\n/**\n * Maps a tick value through any of prism's three scale kinds, centering band-scale\n * ticks on their band (bandScale.map() returns a band's left edge by design).\n *\n * Overloaded so a caller's `tick` type must match the scale kind it's paired with —\n * `AxisConfig`/`GridConfig` accept any scale kind, so the runtime discrimination\n * inside the implementation is unavoidable, but the overload set keeps that a single\n * isolated cast here instead of an unchecked `Date | number | string` accepted at\n * every call site.\n */\nexport function mapTick(scale: BandScale, tick: string): number;\nexport function mapTick(scale: Scale<Date>, tick: Date): number;\nexport function mapTick(scale: Scale<number>, tick: number): number;\n// Fallback overload for callers (axis.ts/grid.ts) holding an already-erased `AnyScale`\n// union — the type-correlated overloads above are what protect a caller with a\n// narrower, known scale type from mismatching it with the wrong tick type.\nexport function mapTick(scale: AnyScale, tick: Date | number | string): number;\nexport function mapTick(scale: AnyScale, tick: Date | number | string): number {\n if (isBandScale(scale)) return scale.map(tick as string) + scale.bandwidth() / 2;\n\n return (scale as Scale<Date | number>).map(tick as Date | number);\n}\n"],"mappings":";AAIA,SAAS,EAAY,GAAqC;CACxD,OAAO,OAAQ,EAAoB,aAAc;AACnD;AAmBA,SAAgB,EAAQ,GAAiB,GAAsC;CAG7E,OAFI,EAAY,CAAK,IAAU,EAAM,IAAI,CAAc,IAAI,EAAM,UAAU,IAAI,IAEvE,EAA+B,IAAI,CAAqB;AAClE"}
@@ -0,0 +1,2 @@
1
+ export type { AxisConfig, AxisPosition, GridConfig } from '../types';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/axes/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ const e=require("../../_dev.cjs"),t=require("../../svg/element.cjs"),n=require("../../axes/axis.cjs"),r=require("../../axes/grid.cjs"),i=require("../../core/cartesian-scales.cjs"),a=require("../../core/layout.cjs"),o=require("../../core/chart-scaffold.cjs"),s=require("../../interaction/crosshair.cjs"),c=require("../../interaction/series-interaction.cjs"),l=require("../../theme/index.cjs"),u=require("./area-renderer.cjs");let d=require("@vielzeug/ripple");function f(f,p){let m=null;return o.createChartScaffold(f,p,f=>{let{groups:h,legend:g,tooltip:_}=f,v=f.dimensions.value,y=a.chartArea(v.width,v.height,v.margin),b=(0,d.isReactive)(p.series)?p.series.value:p.series,x=b.map(e=>(0,d.isReactive)(e.data)?e.data.value:e.data),S=x.flat().map(e=>e.key),C=x.flat().map(e=>e.value);if(S.length===0){e.warn(`createAreaChart: no data`),o.clearCartesianDom(h,g,_,m);return}p.crosshair&&!m&&(m=s.createCrosshair(f.chartArea,p.crosshair));let w=i.buildXScale(S,y.width),T=i.buildYScale(C,y.height),E=T.map(0);for(p.yAxis?.grid&&r.renderGrid(h.grid,T,p.yAxis.grid,y.width,`horizontal`,n.resolveTickCount(p.yAxis,y.height,`left`)),p.xAxis?.grid&&r.renderGrid(h.grid,w,p.xAxis.grid,y.height,`vertical`,n.resolveTickCount(p.xAxis,y.width,`bottom`)),p.xAxis&&(h.xAxis.setAttribute(`transform`,`translate(0,${y.height})`),n.renderAxis(h.xAxis,w,p.xAxis,y.width,`bottom`)),p.yAxis&&n.renderAxis(h.yAxis,T,p.yAxis,y.height,`left`);h.series.children.length>b.length;)h.series.removeChild(h.series.lastChild);let D=[];for(let e=0;e<b.length;e++){let n=b[e],r=h.series.children[e];r||(r=t.createSvgElement(`g`,{class:`prism-area-series`}),h.series.appendChild(r));let i=u.computeAreaPoints(x[e],w,T);D.push(i),u.renderArea(r,i,E,{color:l.seriesColor(e,n.color),curve:n.curve??`linear`,disposalSignal:f.disposalSignal,fillOpacity:n.fillOpacity??.3,showLine:n.showLine!==!1,transition:p.transition})}return g?.update(b.map((e,t)=>({color:l.seriesColor(t,e.color),name:e.name}))),_?.hide(),c.createSeriesInteraction({crosshair:m,dims:()=>f.dimensions.value,getData:()=>x,getPoints:()=>D,getSeriesList:()=>(0,d.isReactive)(p.series)?p.series.value:p.series,onClick:p.onClick,onHover:p.onHover,svg:f.svg,tooltip:_})})}exports.createAreaChart=f;
2
+ //# sourceMappingURL=area-chart.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area-chart.cjs","names":[],"sources":["../../../src/charts/area/area-chart.ts"],"sourcesContent":["import { isReactive } from '@vielzeug/ripple';\n\nimport type { Point } from '../../svg/path';\nimport type { AreaChartConfig, ChartHandle } from '../../types';\n\nimport { warn } from '../../_dev';\nimport { renderAxis, resolveTickCount } from '../../axes/axis';\nimport { renderGrid } from '../../axes/grid';\nimport { buildXScale, buildYScale } from '../../core/cartesian-scales';\nimport { clearCartesianDom, createChartScaffold } from '../../core/chart-scaffold';\nimport { chartArea } from '../../core/layout';\nimport { createCrosshair } from '../../interaction/crosshair';\nimport { createSeriesInteraction } from '../../interaction/series-interaction';\nimport { createSvgElement } from '../../svg/element';\nimport { seriesColor } from '../../theme';\nimport { computeAreaPoints, renderArea } from './area-renderer';\n\nexport function createAreaChart(container: HTMLElement, config: AreaChartConfig): ChartHandle {\n let crosshair: ReturnType<typeof createCrosshair> | null = null;\n\n return createChartScaffold(container, config, (ctx) => {\n const { groups, legend, tooltip } = ctx;\n const dims = ctx.dimensions.value;\n const area = chartArea(dims.width, dims.height, dims.margin);\n const seriesList = isReactive(config.series) ? config.series.value : config.series;\n const allData = seriesList.map((s) => (isReactive(s.data) ? s.data.value : s.data));\n const allX = allData.flat().map((d) => d.key as Date | number);\n const allY = allData.flat().map((d) => d.value);\n\n if (allX.length === 0) {\n warn('createAreaChart: no data');\n clearCartesianDom(groups, legend, tooltip, crosshair);\n\n return;\n }\n\n if (config.crosshair && !crosshair) {\n crosshair = createCrosshair(ctx.chartArea, config.crosshair);\n }\n\n const xScale = buildXScale(allX as (Date | number)[], area.width);\n const yScale = buildYScale(allY, area.height);\n const baselineY = yScale.map(0);\n\n if (config.yAxis?.grid) {\n renderGrid(\n groups.grid,\n yScale,\n config.yAxis.grid,\n area.width,\n 'horizontal',\n resolveTickCount(config.yAxis, area.height, 'left'),\n );\n }\n\n if (config.xAxis?.grid) {\n renderGrid(\n groups.grid,\n xScale,\n config.xAxis.grid,\n area.height,\n 'vertical',\n resolveTickCount(config.xAxis, area.width, 'bottom'),\n );\n }\n\n if (config.xAxis) {\n groups.xAxis.setAttribute('transform', `translate(0,${area.height})`);\n renderAxis(groups.xAxis, xScale, config.xAxis, area.width, 'bottom');\n }\n\n if (config.yAxis) renderAxis(groups.yAxis, yScale, config.yAxis, area.height, 'left');\n\n while (groups.series.children.length > seriesList.length) {\n groups.series.removeChild(groups.series.lastChild!);\n }\n\n const allPoints: Point[][] = [];\n\n for (let i = 0; i < seriesList.length; i++) {\n const series = seriesList[i];\n let group = groups.series.children[i] as SVGGElement | undefined;\n\n if (!group) {\n group = createSvgElement('g', { class: 'prism-area-series' });\n groups.series.appendChild(group);\n }\n\n const points = computeAreaPoints(allData[i], xScale, yScale);\n\n allPoints.push(points);\n\n renderArea(group, points, baselineY, {\n color: seriesColor(i, series.color),\n curve: series.curve ?? 'linear',\n disposalSignal: ctx.disposalSignal,\n fillOpacity: series.fillOpacity ?? 0.3,\n showLine: series.showLine !== false,\n transition: config.transition,\n });\n }\n\n legend?.update(seriesList.map((s, i) => ({ color: seriesColor(i, s.color), name: s.name })));\n tooltip?.hide();\n\n return createSeriesInteraction({\n crosshair,\n dims: () => ctx.dimensions.value,\n getData: () => allData,\n getPoints: () => allPoints,\n getSeriesList: () => (isReactive(config.series) ? config.series.value : config.series),\n onClick: config.onClick,\n onHover: config.onHover,\n svg: ctx.svg,\n tooltip,\n });\n });\n}\n"],"mappings":"2cAiBA,SAAgB,EAAgB,EAAwB,EAAsC,CAC5F,IAAI,EAAuD,KAE3D,OAAO,EAAA,oBAAoB,EAAW,EAAS,GAAQ,CACrD,GAAM,CAAE,SAAQ,SAAQ,WAAY,EAC9B,EAAO,EAAI,WAAW,MACtB,EAAO,EAAA,UAAU,EAAK,MAAO,EAAK,OAAQ,EAAK,MAAM,EACrD,GAAA,EAAA,EAAA,WAAA,CAAwB,EAAO,MAAM,EAAI,EAAO,OAAO,MAAQ,EAAO,OACtE,EAAU,EAAW,IAAK,IAAA,EAAA,EAAA,WAAA,CAAkB,EAAE,IAAI,EAAI,EAAE,KAAK,MAAQ,EAAE,IAAK,EAC5E,EAAO,EAAQ,KAAK,CAAC,CAAC,IAAK,GAAM,EAAE,GAAoB,EACvD,EAAO,EAAQ,KAAK,CAAC,CAAC,IAAK,GAAM,EAAE,KAAK,EAE9C,GAAI,EAAK,SAAW,EAAG,CACrB,EAAA,KAAK,0BAA0B,EAC/B,EAAA,kBAAkB,EAAQ,EAAQ,EAAS,CAAS,EAEpD,MACF,CAEI,EAAO,WAAa,CAAC,IACvB,EAAY,EAAA,gBAAgB,EAAI,UAAW,EAAO,SAAS,GAG7D,IAAM,EAAS,EAAA,YAAY,EAA2B,EAAK,KAAK,EAC1D,EAAS,EAAA,YAAY,EAAM,EAAK,MAAM,EACtC,EAAY,EAAO,IAAI,CAAC,EA+B9B,IA7BI,EAAO,OAAO,MAChB,EAAA,WACE,EAAO,KACP,EACA,EAAO,MAAM,KACb,EAAK,MACL,aACA,EAAA,iBAAiB,EAAO,MAAO,EAAK,OAAQ,MAAM,CACpD,EAGE,EAAO,OAAO,MAChB,EAAA,WACE,EAAO,KACP,EACA,EAAO,MAAM,KACb,EAAK,OACL,WACA,EAAA,iBAAiB,EAAO,MAAO,EAAK,MAAO,QAAQ,CACrD,EAGE,EAAO,QACT,EAAO,MAAM,aAAa,YAAa,eAAe,EAAK,OAAO,EAAE,EACpE,EAAA,WAAW,EAAO,MAAO,EAAQ,EAAO,MAAO,EAAK,MAAO,QAAQ,GAGjE,EAAO,OAAO,EAAA,WAAW,EAAO,MAAO,EAAQ,EAAO,MAAO,EAAK,OAAQ,MAAM,EAE7E,EAAO,OAAO,SAAS,OAAS,EAAW,QAChD,EAAO,OAAO,YAAY,EAAO,OAAO,SAAU,EAGpD,IAAM,EAAuB,CAAC,EAE9B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAW,OAAQ,IAAK,CAC1C,IAAM,EAAS,EAAW,GACtB,EAAQ,EAAO,OAAO,SAAS,GAE9B,IACH,EAAQ,EAAA,iBAAiB,IAAK,CAAE,MAAO,mBAAoB,CAAC,EAC5D,EAAO,OAAO,YAAY,CAAK,GAGjC,IAAM,EAAS,EAAA,kBAAkB,EAAQ,GAAI,EAAQ,CAAM,EAE3D,EAAU,KAAK,CAAM,EAErB,EAAA,WAAW,EAAO,EAAQ,EAAW,CACnC,MAAO,EAAA,YAAY,EAAG,EAAO,KAAK,EAClC,MAAO,EAAO,OAAS,SACvB,eAAgB,EAAI,eACpB,YAAa,EAAO,aAAe,GACnC,SAAU,EAAO,WAAa,GAC9B,WAAY,EAAO,UACrB,CAAC,CACH,CAKA,OAHA,GAAQ,OAAO,EAAW,KAAK,EAAG,KAAO,CAAE,MAAO,EAAA,YAAY,EAAG,EAAE,KAAK,EAAG,KAAM,EAAE,IAAK,EAAE,CAAC,EAC3F,GAAS,KAAK,EAEP,EAAA,wBAAwB,CAC7B,YACA,SAAY,EAAI,WAAW,MAC3B,YAAe,EACf,cAAiB,EACjB,mBAAA,EAAA,EAAA,WAAA,CAAiC,EAAO,MAAM,EAAI,EAAO,OAAO,MAAQ,EAAO,OAC/E,QAAS,EAAO,QAChB,QAAS,EAAO,QAChB,IAAK,EAAI,IACT,SACF,CAAC,CACH,CAAC,CACH"}
@@ -0,0 +1,3 @@
1
+ import type { AreaChartConfig, ChartHandle } from '../../types';
2
+ export declare function createAreaChart(container: HTMLElement, config: AreaChartConfig): ChartHandle;
3
+ //# sourceMappingURL=area-chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area-chart.d.ts","sourceRoot":"","sources":["../../../src/charts/area/area-chart.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAchE,wBAAgB,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,GAAG,WAAW,CAoG5F"}