@pibbl/core 0.0.2 → 0.0.3-alpha.85.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 (233) hide show
  1. package/THIRD_PARTY_NOTICES.txt +81 -0
  2. package/dist/features/textures/index.d.ts +12 -2
  3. package/dist/features/textures/index.js +33 -1
  4. package/dist/features/textures/index.js.map +2 -2
  5. package/dist/features/textures/lib/chemical-field.d.ts +56 -0
  6. package/dist/features/textures/lib/chemical-field.js +154 -0
  7. package/dist/features/textures/lib/chemical-field.js.map +7 -0
  8. package/dist/features/textures/lib/chemical-recipes.d.ts +119 -0
  9. package/dist/features/textures/lib/chemical-recipes.js +275 -0
  10. package/dist/features/textures/lib/chemical-recipes.js.map +7 -0
  11. package/dist/features/textures/lib/definitions.d.ts +3 -18
  12. package/dist/features/textures/lib/definitions.js +15 -20
  13. package/dist/features/textures/lib/definitions.js.map +2 -2
  14. package/dist/features/textures/lib/geometric-patterns.d.ts +149 -0
  15. package/dist/features/textures/lib/geometric-patterns.js +305 -0
  16. package/dist/features/textures/lib/geometric-patterns.js.map +7 -0
  17. package/dist/features/textures/lib/gray-scott.d.ts +55 -0
  18. package/dist/features/textures/lib/gray-scott.js +39 -0
  19. package/dist/features/textures/lib/gray-scott.js.map +7 -0
  20. package/dist/features/textures/lib/patterns.d.ts +123 -0
  21. package/dist/features/textures/lib/patterns.js +344 -0
  22. package/dist/features/textures/lib/patterns.js.map +7 -0
  23. package/dist/features/textures/lib/reaction-diffusion.d.ts +3 -2
  24. package/dist/features/textures/lib/reaction-diffusion.js +9 -20
  25. package/dist/features/textures/lib/reaction-diffusion.js.map +2 -2
  26. package/dist/features/textures/lib/simulation.d.ts +10 -4
  27. package/dist/features/textures/lib/simulation.js +23 -13
  28. package/dist/features/textures/lib/simulation.js.map +2 -2
  29. package/dist/features/viz/index.d.ts +55 -6
  30. package/dist/features/viz/index.js +107 -2
  31. package/dist/features/viz/index.js.map +2 -2
  32. package/dist/features/viz/inspection/bar.d.ts +79 -0
  33. package/dist/features/viz/inspection/bar.js +49 -0
  34. package/dist/features/viz/inspection/bar.js.map +7 -0
  35. package/dist/features/viz/inspection/candle.d.ts +156 -0
  36. package/dist/features/viz/inspection/candle.js +120 -0
  37. package/dist/features/viz/inspection/candle.js.map +7 -0
  38. package/dist/features/viz/inspection/capture-types.d.ts +65 -0
  39. package/dist/features/viz/inspection/capture.d.ts +16 -0
  40. package/dist/features/viz/inspection/capture.js +49 -0
  41. package/dist/features/viz/inspection/capture.js.map +7 -0
  42. package/dist/features/viz/inspection/handler.d.ts +36 -0
  43. package/dist/features/viz/inspection/handler.js +91 -0
  44. package/dist/features/viz/inspection/handler.js.map +7 -0
  45. package/dist/features/viz/inspection/ohlc-bar.d.ts +132 -0
  46. package/dist/features/viz/inspection/ohlc-bar.js +118 -0
  47. package/dist/features/viz/inspection/ohlc-bar.js.map +7 -0
  48. package/dist/features/viz/inspection/owned-ref.d.ts +16 -0
  49. package/dist/features/viz/inspection/owned-ref.js +99 -0
  50. package/dist/features/viz/inspection/owned-ref.js.map +7 -0
  51. package/dist/features/viz/inspection/painted-point.d.ts +22 -0
  52. package/dist/features/viz/inspection/painted-point.js +29 -0
  53. package/dist/features/viz/inspection/painted-point.js.map +7 -0
  54. package/dist/features/viz/inspection/queries.d.ts +100 -0
  55. package/dist/features/viz/inspection/queries.js +192 -0
  56. package/dist/features/viz/inspection/queries.js.map +7 -0
  57. package/dist/features/viz/inspection/query-types.d.ts +177 -0
  58. package/dist/features/viz/inspection/volume.d.ts +104 -0
  59. package/dist/features/viz/inspection/volume.js +95 -0
  60. package/dist/features/viz/inspection/volume.js.map +7 -0
  61. package/dist/features/viz/inspection.d.ts +19 -0
  62. package/dist/features/viz/inspection.js +54 -0
  63. package/dist/features/viz/inspection.js.map +7 -0
  64. package/dist/features/viz/inspection.mjs +1 -0
  65. package/dist/features/viz/lib/area-series.d.ts +62 -0
  66. package/dist/features/viz/lib/area-series.js +120 -0
  67. package/dist/features/viz/lib/area-series.js.map +7 -0
  68. package/dist/features/viz/lib/axis.js +1 -1
  69. package/dist/features/viz/lib/axis.js.map +2 -2
  70. package/dist/features/viz/lib/bar-series.d.ts +3 -1
  71. package/dist/features/viz/lib/bar-series.js +16 -1
  72. package/dist/features/viz/lib/bar-series.js.map +2 -2
  73. package/dist/features/viz/lib/baseline-series.d.ts +55 -0
  74. package/dist/features/viz/lib/baseline-series.js +136 -0
  75. package/dist/features/viz/lib/baseline-series.js.map +7 -0
  76. package/dist/features/viz/lib/candlestick-series.d.ts +62 -0
  77. package/dist/features/viz/lib/candlestick-series.js +150 -0
  78. package/dist/features/viz/lib/candlestick-series.js.map +7 -0
  79. package/dist/features/viz/lib/censored-point-series.d.ts +71 -0
  80. package/dist/features/viz/lib/censored-point-series.js +129 -0
  81. package/dist/features/viz/lib/censored-point-series.js.map +7 -0
  82. package/dist/features/viz/lib/color-context.d.ts +4 -0
  83. package/dist/features/viz/lib/color-context.js +41 -0
  84. package/dist/features/viz/lib/color-context.js.map +7 -0
  85. package/dist/features/viz/lib/color-math.d.ts +4 -0
  86. package/dist/features/viz/lib/color-math.js +31 -0
  87. package/dist/features/viz/lib/color-math.js.map +7 -0
  88. package/dist/features/viz/lib/color-types.d.ts +53 -0
  89. package/dist/features/viz/lib/curve-definition.d.ts +49 -0
  90. package/dist/features/viz/lib/curve-definition.js +148 -0
  91. package/dist/features/viz/lib/curve-definition.js.map +7 -0
  92. package/dist/features/viz/lib/diverging-color-scale.d.ts +11 -0
  93. package/dist/features/viz/lib/diverging-color-scale.js +51 -0
  94. package/dist/features/viz/lib/diverging-color-scale.js.map +7 -0
  95. package/dist/features/viz/lib/domain-navigation.d.ts +40 -0
  96. package/dist/features/viz/lib/domain-navigation.js +77 -0
  97. package/dist/features/viz/lib/domain-navigation.js.map +7 -0
  98. package/dist/features/viz/lib/editable-chart-elements.d.ts +178 -0
  99. package/dist/features/viz/lib/editable-chart-elements.js +733 -0
  100. package/dist/features/viz/lib/editable-chart-elements.js.map +7 -0
  101. package/dist/features/viz/lib/financial-aggregation.d.ts +127 -0
  102. package/dist/features/viz/lib/financial-aggregation.js +116 -0
  103. package/dist/features/viz/lib/financial-aggregation.js.map +7 -0
  104. package/dist/features/viz/lib/financial-autoscale.d.ts +64 -0
  105. package/dist/features/viz/lib/financial-autoscale.js +61 -0
  106. package/dist/features/viz/lib/financial-autoscale.js.map +7 -0
  107. package/dist/features/viz/lib/financial-comparison.d.ts +62 -0
  108. package/dist/features/viz/lib/financial-comparison.js +98 -0
  109. package/dist/features/viz/lib/financial-comparison.js.map +7 -0
  110. package/dist/features/viz/lib/financial-geometry.d.ts +77 -0
  111. package/dist/features/viz/lib/financial-geometry.js +67 -0
  112. package/dist/features/viz/lib/financial-geometry.js.map +7 -0
  113. package/dist/features/viz/lib/financial-indicators.d.ts +114 -0
  114. package/dist/features/viz/lib/financial-indicators.js +135 -0
  115. package/dist/features/viz/lib/financial-indicators.js.map +7 -0
  116. package/dist/features/viz/lib/financial-oscillators.d.ts +171 -0
  117. package/dist/features/viz/lib/financial-oscillators.js +265 -0
  118. package/dist/features/viz/lib/financial-oscillators.js.map +7 -0
  119. package/dist/features/viz/lib/hover-data.d.ts +1 -1
  120. package/dist/features/viz/lib/hover-data.js +5 -2
  121. package/dist/features/viz/lib/hover-data.js.map +2 -2
  122. package/dist/features/viz/lib/interval-band-series.d.ts +49 -0
  123. package/dist/features/viz/lib/interval-band-series.js +136 -0
  124. package/dist/features/viz/lib/interval-band-series.js.map +7 -0
  125. package/dist/features/viz/lib/interval-diamond-series.d.ts +43 -0
  126. package/dist/features/viz/lib/interval-diamond-series.js +124 -0
  127. package/dist/features/viz/lib/interval-diamond-series.js.map +7 -0
  128. package/dist/features/viz/lib/interval-series.d.ts +79 -0
  129. package/dist/features/viz/lib/interval-series.js +158 -0
  130. package/dist/features/viz/lib/interval-series.js.map +7 -0
  131. package/dist/features/viz/lib/line-series.d.ts +1 -1
  132. package/dist/features/viz/lib/line-series.js +47 -28
  133. package/dist/features/viz/lib/line-series.js.map +2 -2
  134. package/dist/features/viz/lib/linear-scale.js +1 -1
  135. package/dist/features/viz/lib/linear-scale.js.map +2 -2
  136. package/dist/features/viz/lib/monotone-curve.d.ts +11 -0
  137. package/dist/features/viz/lib/monotone-curve.js +63 -0
  138. package/dist/features/viz/lib/monotone-curve.js.map +7 -0
  139. package/dist/features/viz/lib/numeric-range-interpolation.d.ts +15 -0
  140. package/dist/features/viz/lib/numeric-range-interpolation.js +36 -0
  141. package/dist/features/viz/lib/numeric-range-interpolation.js.map +7 -0
  142. package/dist/features/viz/lib/ohlc-bar-series.d.ts +55 -0
  143. package/dist/features/viz/lib/ohlc-bar-series.js +168 -0
  144. package/dist/features/viz/lib/ohlc-bar-series.js.map +7 -0
  145. package/dist/features/viz/lib/paired-series.d.ts +44 -0
  146. package/dist/features/viz/lib/paired-series.js +93 -0
  147. package/dist/features/viz/lib/paired-series.js.map +7 -0
  148. package/dist/features/viz/lib/plot-series.js +11 -6
  149. package/dist/features/viz/lib/plot-series.js.map +2 -2
  150. package/dist/features/viz/lib/plot-types.d.ts +4 -3
  151. package/dist/features/viz/lib/point-series.d.ts +1 -1
  152. package/dist/features/viz/lib/point-series.js +36 -9
  153. package/dist/features/viz/lib/point-series.js.map +2 -2
  154. package/dist/features/viz/lib/point-types.d.ts +5 -2
  155. package/dist/features/viz/lib/scale-context.d.ts +1 -1
  156. package/dist/features/viz/lib/scale-ticks.js +21 -6
  157. package/dist/features/viz/lib/scale-ticks.js.map +2 -2
  158. package/dist/features/viz/lib/sequential-color-scale.d.ts +11 -0
  159. package/dist/features/viz/lib/sequential-color-scale.js +49 -0
  160. package/dist/features/viz/lib/sequential-color-scale.js.map +7 -0
  161. package/dist/features/viz/lib/series-position.d.ts +12 -0
  162. package/dist/features/viz/lib/series-position.js +44 -0
  163. package/dist/features/viz/lib/series-position.js.map +7 -0
  164. package/dist/features/viz/lib/step-curves.d.ts +19 -0
  165. package/dist/features/viz/lib/step-curves.js +53 -0
  166. package/dist/features/viz/lib/step-curves.js.map +7 -0
  167. package/dist/features/viz/lib/threshold-color-scale.d.ts +43 -0
  168. package/dist/features/viz/lib/threshold-color-scale.js +59 -0
  169. package/dist/features/viz/lib/threshold-color-scale.js.map +7 -0
  170. package/dist/features/viz/lib/trading-time-mapping.d.ts +32 -0
  171. package/dist/features/viz/lib/trading-time-mapping.js +89 -0
  172. package/dist/features/viz/lib/trading-time-mapping.js.map +7 -0
  173. package/dist/features/viz/lib/trading-time-scale.d.ts +83 -0
  174. package/dist/features/viz/lib/trading-time-scale.js +96 -0
  175. package/dist/features/viz/lib/trading-time-scale.js.map +7 -0
  176. package/dist/features/viz/lib/trajectory-series.d.ts +71 -0
  177. package/dist/features/viz/lib/trajectory-series.js +111 -0
  178. package/dist/features/viz/lib/trajectory-series.js.map +7 -0
  179. package/dist/features/viz/lib/types.d.ts +20 -4
  180. package/dist/features/viz/lib/use-continuous-scale.js +6 -1
  181. package/dist/features/viz/lib/use-continuous-scale.js.map +2 -2
  182. package/dist/features/viz/lib/volume-series.d.ts +59 -0
  183. package/dist/features/viz/lib/volume-series.js +117 -0
  184. package/dist/features/viz/lib/volume-series.js.map +7 -0
  185. package/dist/features/viz/lib/weighted-point-series.d.ts +71 -0
  186. package/dist/features/viz/lib/weighted-point-series.js +169 -0
  187. package/dist/features/viz/lib/weighted-point-series.js.map +7 -0
  188. package/dist/filters/emboss-gpu.d.ts +4 -0
  189. package/dist/filters/emboss-gpu.js +39 -0
  190. package/dist/filters/emboss-gpu.js.map +7 -0
  191. package/dist/filters/emboss.d.ts +32 -0
  192. package/dist/filters/emboss.js +106 -0
  193. package/dist/filters/emboss.js.map +7 -0
  194. package/dist/filters/reflection-gpu.d.ts +3 -1
  195. package/dist/filters/reflection-gpu.js +5 -2
  196. package/dist/filters/reflection-gpu.js.map +2 -2
  197. package/dist/filters/render-emboss-boundary.d.ts +13 -0
  198. package/dist/filters/render-emboss-boundary.js +131 -0
  199. package/dist/filters/render-emboss-boundary.js.map +7 -0
  200. package/dist/filters.d.ts +2 -0
  201. package/dist/filters.js +2 -0
  202. package/dist/filters.js.map +2 -2
  203. package/dist/index.d.ts +2 -0
  204. package/dist/index.js +3 -0
  205. package/dist/index.js.map +2 -2
  206. package/dist/internal.d.ts +2 -0
  207. package/dist/internal.js +4 -0
  208. package/dist/internal.js.map +2 -2
  209. package/dist/lib/events/event-facade.d.ts +13 -0
  210. package/dist/lib/events/event-facade.js +23 -0
  211. package/dist/lib/events/event-facade.js.map +2 -2
  212. package/dist/lib/events/propagation.js +19 -14
  213. package/dist/lib/events/propagation.js.map +2 -2
  214. package/dist/lib/execute-render.js +13 -0
  215. package/dist/lib/execute-render.js.map +2 -2
  216. package/dist/lib/recording/recording.d.ts +43 -0
  217. package/dist/lib/recording/recording.js +555 -0
  218. package/dist/lib/recording/recording.js.map +7 -0
  219. package/dist/lib/recording/types.d.ts +118 -0
  220. package/dist/lib/recording/wasm-bytes.d.ts +1 -0
  221. package/dist/lib/recording/wasm-bytes.js +5 -0
  222. package/dist/lib/recording/wasm-bytes.js.map +7 -0
  223. package/dist/lib/recording/worker-source.d.ts +1 -0
  224. package/dist/lib/recording/worker-source.js +5 -0
  225. package/dist/lib/recording/worker-source.js.map +7 -0
  226. package/dist/lib/render-transaction.d.ts +5 -2
  227. package/dist/lib/render-transaction.js +23 -1
  228. package/dist/lib/render-transaction.js.map +2 -2
  229. package/dist/lib/series-inspection-frame.d.ts +18 -0
  230. package/dist/lib/series-inspection-frame.js +70 -0
  231. package/dist/lib/series-inspection-frame.js.map +7 -0
  232. package/dist/lib/types.d.ts +6 -0
  233. package/package.json +10 -2
@@ -1,11 +1,28 @@
1
+ import {
2
+ grayScottConfig
3
+ } from "./gray-scott.js";
1
4
  import { FieldMemory, lazyKernel } from "./wasm/memory.js";
2
5
  import { bytes } from "./wasm/ink-bytes.js";
3
6
  const module = /* @__PURE__ */ lazyKernel(bytes);
4
7
  class InkSimulation {
5
- constructor(width, height, seed, preset) {
8
+ a;
9
+ b;
10
+ owner;
11
+ parity = 0;
12
+ steps = 0;
13
+ width;
14
+ height;
15
+ preset;
16
+ feed;
17
+ kill;
18
+ constructor(options) {
19
+ const { width, height } = options;
20
+ const config = grayScottConfig(options);
6
21
  this.width = width;
7
22
  this.height = height;
8
- this.preset = preset;
23
+ this.preset = config.preset;
24
+ this.feed = config.feed;
25
+ this.kill = config.kill;
9
26
  const owner = this.owner = new FieldMemory(module(), width, height, 4);
10
27
  [this.a, this.b] = owner.fields;
11
28
  owner.kernel.initialize(
@@ -13,17 +30,10 @@ class InkSimulation {
13
30
  this.b.byteOffset,
14
31
  width,
15
32
  height,
16
- seed
33
+ config.seed
17
34
  );
35
+ if (config.warmupSteps) this.advance(config.warmupSteps);
18
36
  }
19
- width;
20
- height;
21
- preset;
22
- a;
23
- b;
24
- owner;
25
- parity = 0;
26
- steps = 0;
27
37
  paint(x, y, radius, strength) {
28
38
  const owner = this.owner;
29
39
  owner.stamps[0] = x;
@@ -65,8 +75,8 @@ class InkSimulation {
65
75
  this.width,
66
76
  this.height,
67
77
  count,
68
- this.preset === "spots" ? 0.0367 : 0.029,
69
- this.preset === "spots" ? 0.0649 : 0.057
78
+ this.feed,
79
+ this.kill
70
80
  );
71
81
  if (count % 2) this.parity = next;
72
82
  this.a = owner.fields[this.parity];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/features/textures/lib/simulation.ts"],
4
- "sourcesContent": ["import { FieldMemory, lazyKernel } from \"./wasm/memory.js\";\nimport { bytes } from \"./wasm/ink-bytes.js\";\nconst module = /* @__PURE__ */ lazyKernel(bytes);\n/** Private WASM Gray\u2013Scott state. Pibbl owns the clock and resource lifetime. */\nexport class InkSimulation {\n a: Float32Array;\n b: Float32Array;\n private owner?: FieldMemory;\n private parity = 0;\n steps = 0;\n constructor(\n readonly width: number,\n readonly height: number,\n seed: number,\n readonly preset: \"spots\" | \"stripes\",\n ) {\n const owner = (this.owner = new FieldMemory(module(), width, height, 4));\n [this.a, this.b] = owner.fields;\n owner.kernel.initialize(\n this.a.byteOffset,\n this.b.byteOffset,\n width,\n height,\n seed,\n );\n }\n paint(x: number, y: number, radius: number, strength: number) {\n const owner = this.owner!;\n owner.stamps[0] = x;\n owner.stamps[1] = y;\n owner.stamps[2] = radius;\n owner.stamps[3] = strength;\n owner.kernel.paintBatch(\n this.a.byteOffset,\n this.b.byteOffset,\n this.width,\n this.height,\n owner.stamps.byteOffset,\n 1,\n );\n }\n stir(x: number, y: number, dx: number, dy: number, radius: number) {\n const owner = this.owner!,\n next = 2 - this.parity;\n owner.kernel.stir(\n this.a.byteOffset,\n this.b.byteOffset,\n owner.fields[next].byteOffset,\n owner.fields[next + 1].byteOffset,\n this.width,\n this.height,\n x,\n y,\n dx,\n dy,\n radius,\n );\n }\n advance(count: number) {\n const owner = this.owner!,\n next = 2 - this.parity;\n owner.kernel.advance(\n this.a.byteOffset,\n this.b.byteOffset,\n owner.fields[next].byteOffset,\n owner.fields[next + 1].byteOffset,\n this.width,\n this.height,\n count,\n this.preset === \"spots\" ? 0.0367 : 0.029,\n this.preset === \"spots\" ? 0.0649 : 0.057,\n );\n if (count % 2) this.parity = next;\n this.a = owner.fields[this.parity];\n this.b = owner.fields[this.parity + 1];\n this.steps += count;\n }\n dispose() {\n this.owner?.dispose();\n this.owner = undefined;\n this.a = this.b = new Float32Array(0);\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,aAAa,kBAAkB;AACxC,SAAS,aAAa;AACtB,MAAM,SAAyB,2BAAW,KAAK;AAExC,MAAM,cAAc;AAAA,EAMzB,YACW,OACA,QACT,MACS,QACT;AAJS;AACA;AAEA;AAET,UAAM,QAAS,KAAK,QAAQ,IAAI,YAAY,OAAO,GAAG,OAAO,QAAQ,CAAC;AACtE,KAAC,KAAK,GAAG,KAAK,CAAC,IAAI,MAAM;AACzB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAdW;AAAA,EACA;AAAA,EAEA;AAAA,EATX;AAAA,EACA;AAAA,EACQ;AAAA,EACA,SAAS;AAAA,EACjB,QAAQ;AAAA,EAiBR,MAAM,GAAW,GAAW,QAAgB,UAAkB;AAC5D,UAAM,QAAQ,KAAK;AACnB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP,KAAK;AAAA,MACL,KAAK;AAAA,MACL,MAAM,OAAO;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,GAAW,GAAW,IAAY,IAAY,QAAgB;AACjE,UAAM,QAAQ,KAAK,OACjB,OAAO,IAAI,KAAK;AAClB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP,MAAM,OAAO,IAAI,EAAE;AAAA,MACnB,MAAM,OAAO,OAAO,CAAC,EAAE;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAQ,OAAe;AACrB,UAAM,QAAQ,KAAK,OACjB,OAAO,IAAI,KAAK;AAClB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP,MAAM,OAAO,IAAI,EAAE;AAAA,MACnB,MAAM,OAAO,OAAO,CAAC,EAAE;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AAAA,MACL;AAAA,MACA,KAAK,WAAW,UAAU,SAAS;AAAA,MACnC,KAAK,WAAW,UAAU,SAAS;AAAA,IACrC;AACA,QAAI,QAAQ,EAAG,MAAK,SAAS;AAC7B,SAAK,IAAI,MAAM,OAAO,KAAK,MAAM;AACjC,SAAK,IAAI,MAAM,OAAO,KAAK,SAAS,CAAC;AACrC,SAAK,SAAS;AAAA,EAChB;AAAA,EACA,UAAU;AACR,SAAK,OAAO,QAAQ;AACpB,SAAK,QAAQ;AACb,SAAK,IAAI,KAAK,IAAI,IAAI,aAAa,CAAC;AAAA,EACtC;AACF;",
4
+ "sourcesContent": ["import {\n grayScottConfig,\n type ReactionDiffusionOptions,\n} from \"./gray-scott.js\";\nimport { FieldMemory, lazyKernel } from \"./wasm/memory.js\";\nimport { bytes } from \"./wasm/ink-bytes.js\";\nconst module = /* @__PURE__ */ lazyKernel(bytes);\n/** Private WASM Gray\u2013Scott state. Pibbl owns the clock and resource lifetime. */\nexport class InkSimulation {\n a: Float32Array;\n b: Float32Array;\n private owner?: FieldMemory;\n private parity = 0;\n steps = 0;\n readonly width: number;\n readonly height: number;\n readonly preset: ReturnType<typeof grayScottConfig>[\"preset\"];\n private readonly feed: number;\n private readonly kill: number;\n constructor(\n options: ReactionDiffusionOptions & { width: number; height: number },\n ) {\n const { width, height } = options;\n const config = grayScottConfig(options);\n this.width = width;\n this.height = height;\n this.preset = config.preset;\n this.feed = config.feed;\n this.kill = config.kill;\n const owner = (this.owner = new FieldMemory(module(), width, height, 4));\n [this.a, this.b] = owner.fields;\n owner.kernel.initialize(\n this.a.byteOffset,\n this.b.byteOffset,\n width,\n height,\n config.seed,\n );\n if (config.warmupSteps) this.advance(config.warmupSteps);\n }\n paint(x: number, y: number, radius: number, strength: number) {\n const owner = this.owner!;\n owner.stamps[0] = x;\n owner.stamps[1] = y;\n owner.stamps[2] = radius;\n owner.stamps[3] = strength;\n owner.kernel.paintBatch(\n this.a.byteOffset,\n this.b.byteOffset,\n this.width,\n this.height,\n owner.stamps.byteOffset,\n 1,\n );\n }\n stir(x: number, y: number, dx: number, dy: number, radius: number) {\n const owner = this.owner!,\n next = 2 - this.parity;\n owner.kernel.stir(\n this.a.byteOffset,\n this.b.byteOffset,\n owner.fields[next].byteOffset,\n owner.fields[next + 1].byteOffset,\n this.width,\n this.height,\n x,\n y,\n dx,\n dy,\n radius,\n );\n }\n advance(count: number) {\n const owner = this.owner!,\n next = 2 - this.parity;\n owner.kernel.advance(\n this.a.byteOffset,\n this.b.byteOffset,\n owner.fields[next].byteOffset,\n owner.fields[next + 1].byteOffset,\n this.width,\n this.height,\n count,\n this.feed,\n this.kill,\n );\n if (count % 2) this.parity = next;\n this.a = owner.fields[this.parity];\n this.b = owner.fields[this.parity + 1];\n this.steps += count;\n }\n dispose() {\n this.owner?.dispose();\n this.owner = undefined;\n this.a = this.b = new Float32Array(0);\n }\n}\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,OAEK;AACP,SAAS,aAAa,kBAAkB;AACxC,SAAS,aAAa;AACtB,MAAM,SAAyB,2BAAW,KAAK;AAExC,MAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACQ;AAAA,EACA,SAAS;AAAA,EACjB,QAAQ;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACQ;AAAA,EACA;AAAA,EACjB,YACE,SACA;AACA,UAAM,EAAE,OAAO,OAAO,IAAI;AAC1B,UAAM,SAAS,gBAAgB,OAAO;AACtC,SAAK,QAAQ;AACb,SAAK,SAAS;AACd,SAAK,SAAS,OAAO;AACrB,SAAK,OAAO,OAAO;AACnB,SAAK,OAAO,OAAO;AACnB,UAAM,QAAS,KAAK,QAAQ,IAAI,YAAY,OAAO,GAAG,OAAO,QAAQ,CAAC;AACtE,KAAC,KAAK,GAAG,KAAK,CAAC,IAAI,MAAM;AACzB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP;AAAA,MACA;AAAA,MACA,OAAO;AAAA,IACT;AACA,QAAI,OAAO,YAAa,MAAK,QAAQ,OAAO,WAAW;AAAA,EACzD;AAAA,EACA,MAAM,GAAW,GAAW,QAAgB,UAAkB;AAC5D,UAAM,QAAQ,KAAK;AACnB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO,CAAC,IAAI;AAClB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP,KAAK;AAAA,MACL,KAAK;AAAA,MACL,MAAM,OAAO;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK,GAAW,GAAW,IAAY,IAAY,QAAgB;AACjE,UAAM,QAAQ,KAAK,OACjB,OAAO,IAAI,KAAK;AAClB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP,MAAM,OAAO,IAAI,EAAE;AAAA,MACnB,MAAM,OAAO,OAAO,CAAC,EAAE;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,QAAQ,OAAe;AACrB,UAAM,QAAQ,KAAK,OACjB,OAAO,IAAI,KAAK;AAClB,UAAM,OAAO;AAAA,MACX,KAAK,EAAE;AAAA,MACP,KAAK,EAAE;AAAA,MACP,MAAM,OAAO,IAAI,EAAE;AAAA,MACnB,MAAM,OAAO,OAAO,CAAC,EAAE;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AAAA,MACL;AAAA,MACA,KAAK;AAAA,MACL,KAAK;AAAA,IACP;AACA,QAAI,QAAQ,EAAG,MAAK,SAAS;AAC7B,SAAK,IAAI,MAAM,OAAO,KAAK,MAAM;AACjC,SAAK,IAAI,MAAM,OAAO,KAAK,SAAS,CAAC;AACrC,SAAK,SAAS;AAAA,EAChB;AAAA,EACA,UAAU;AACR,SAAK,OAAO,QAAQ;AACpB,SAAK,QAAQ;AACb,SAAK,IAAI,KAAK,IAAI,IAAI,aAAa,CAAC;AAAA,EACtC;AACF;",
6
6
  "names": []
7
7
  }
@@ -7,8 +7,17 @@ export { useUTCScale } from "./lib/use-utc-scale.js";
7
7
  export type { ScaleId, LinearDomain, BandCategory, BandDomain, BarScaleProps, BandScaleRange, ResolvedBandScale, ScaleRange, ScaleLayoutStyle, LinearScaleProps, ResolvedLinearScale, ResolvedScale, } from "./lib/types.js";
8
8
  export { Axis } from "./lib/axis.js";
9
9
  export { LineSeries } from "./lib/line-series.js";
10
+ export { AreaSeries } from "./lib/area-series.js";
11
+ export type { AreaSeriesProps, AreaSeriesStyle } from "./lib/area-series.js";
12
+ export { IntervalBandSeries } from "./lib/interval-band-series.js";
13
+ export type { IntervalBandSeriesProps } from "./lib/interval-band-series.js";
14
+ export { HorizontalIntervalSeries, VerticalIntervalSeries, } from "./lib/interval-series.js";
15
+ export type { IntervalSeriesStyle, IntervalSeriesProps, HorizontalIntervalSeriesProps, VerticalIntervalSeriesProps, } from "./lib/interval-series.js";
16
+ export type { SeriesCurve } from "./lib/curve-definition.js";
17
+ export { stepBefore, stepAfter, stepMidpoint } from "./lib/step-curves.js";
18
+ export { monotoneX } from "./lib/monotone-curve.js";
10
19
  export { ScaleAdjust } from "./lib/scale-adjust.js";
11
- export type { AxisStyle, AxisProps, LineCoordinate, LineAccessor, LineCurve, LineSeriesStyle, LineSeriesProps, ScaleAdjustProps, } from "./lib/types.js";
20
+ export type { AxisStyle, AxisProps, LineCoordinate, LineAccessor, SeriesAccessor, SeriesCoordinate, LineCurve, LineSeriesStyle, LineSeriesProps, ScaleAdjustProps, } from "./lib/types.js";
12
21
  export { PointSeries } from "./lib/point-series.js";
13
22
  export type { PointAccessor, PointMarkStyle, PointSeriesStyle, PointStyleResolver, PointSeriesProps, } from "./lib/point-types.js";
14
23
  export { PlotSeries } from "./lib/plot-series.js";
@@ -29,11 +38,24 @@ export type { BarThresholdFill, BarCategoryAccessor, BarSeriesStyle, BarStyleRes
29
38
  export { pieSlices } from "./lib/pie-slices.js";
30
39
  export type { PieOptions, PieSliceGeometry } from "./lib/pie-slices.js";
31
40
  export { PieLayout, PieSlice, PieLabel } from "./lib/pie-layout.js";
32
- export type { PieLayoutProps, PieLayoutStyle, PieLayoutSlice, PieLabelPlacement, PieLabelLayout, PieSliceProps, PieSliceStyle, PieLabelProps, PieLabelStyle } from "./lib/pie-types.js";
41
+ export type { PieLayoutProps, PieLayoutStyle, PieLayoutSlice, PieLabelPlacement, PieLabelLayout, PieSliceProps, PieSliceStyle, PieLabelProps, PieLabelStyle, } from "./lib/pie-types.js";
33
42
  export { extent, niceUTCDomain } from "./lib/utc-scale.js";
34
- export type { NumericDomain, UtcDomain, UTCScaleProps, ResolvedUtcScale, ResolvedContinuousScale } from "./lib/types.js";
35
- export { linearTicks, niceLinearDomain, formatNumber } from "./lib/numeric-ticks.js";
36
- export type { LinearTickOptions, NumberFormatOptions } from "./lib/numeric-ticks.js";
43
+ export type { NumericDomain, UtcDomain, UTCScaleProps, ResolvedUtcScale, ResolvedContinuousScale, } from "./lib/types.js";
44
+ export { linearTicks, niceLinearDomain, formatNumber, } from "./lib/numeric-ticks.js";
45
+ export type { LinearTickOptions, NumberFormatOptions, } from "./lib/numeric-ticks.js";
46
+ export { interpolateNumericRange } from "./lib/numeric-range-interpolation.js";
47
+ export { visibleOhlcPriceExtent, padLinearDomain, } from "./lib/financial-autoscale.js";
48
+ export type { VisibleOhlcPriceExtentOptions, PadLinearDomainOptions, } from "./lib/financial-autoscale.js";
49
+ export { percentageReturns, indexTo100 } from "./lib/financial-comparison.js";
50
+ export type { ComparisonBaseOptions, PercentageReturnPoint, IndexedValuePoint, } from "./lib/financial-comparison.js";
51
+ export { aggregateOhlcv, sessionVwap } from "./lib/financial-aggregation.js";
52
+ export type { OhlcvBucket, OhlcvSource, AggregatedOhlcvPoint, AggregateOhlcvOptions, SessionIdentifier, SessionAccessor, SessionVwapOptions, SessionVwapPoint, } from "./lib/financial-aggregation.js";
53
+ export { RangeNavigator, EditableReferenceLine, EditableReferenceBand, EditableTrendLine, } from "./lib/editable-chart-elements.js";
54
+ export type { ChartAnchor, RangeNavigatorProps, RangeNavigatorStyle, EditableReferenceLineProps, EditableReferenceLineStyle, EditableReferenceBandProps, EditableReferenceBandStyle, EditableTrendLineProps, EditableTrendLineStyle, } from "./lib/editable-chart-elements.js";
55
+ export { simpleMovingAverage, exponentialMovingAverage, bollingerBands, } from "./lib/financial-indicators.js";
56
+ export type { MovingAverageOptions, BollingerBandsOptions, MovingAveragePoint, BollingerBandPoint, } from "./lib/financial-indicators.js";
57
+ export { relativeStrengthIndex, movingAverageConvergenceDivergence, stochasticOscillator, } from "./lib/financial-oscillators.js";
58
+ export type { OscillatorOptions, RelativeStrengthIndexOptions, MovingAverageConvergenceDivergenceOptions, StochasticOscillatorOptions, RelativeStrengthIndexPoint, MovingAverageConvergenceDivergencePoint, StochasticOscillatorPoint, } from "./lib/financial-oscillators.js";
37
59
  export { utcTickLabels } from "./lib/utc-labels.js";
38
60
  export type { UTCTickLabelOptions } from "./lib/utc-labels.js";
39
61
  export { LogScale } from "./lib/log-scale-component.js";
@@ -46,8 +68,35 @@ export { PointScale } from "./lib/point-scale-component.js";
46
68
  export { usePointScale } from "./lib/use-point-scale.js";
47
69
  export type { PointScaleProps, ResolvedPointScale } from "./lib/types.js";
48
70
  export { GridLines, ReferenceLine } from "./lib/chart-lines.js";
49
- export type { ChartLineProps, GridLinesProps, ReferenceLineProps } from "./lib/chart-lines.js";
71
+ export type { ChartLineProps, GridLinesProps, ReferenceLineProps, } from "./lib/chart-lines.js";
50
72
  export { ReferenceBand } from "./lib/reference-band.js";
51
73
  export type { ReferenceBandProps } from "./lib/reference-band.js";
52
74
  export { AxisTitle } from "./lib/axis-title.js";
53
75
  export type { AxisTitleProps } from "./lib/axis-title.js";
76
+ export { panDomain, zoomDomain } from "./lib/domain-navigation.js";
77
+ export type { DomainNavigationConstraints, PanDomainOptions, ZoomDomainOptions, } from "./lib/domain-navigation.js";
78
+ export { SequentialColorScale, useSequentialColorScale, } from "./lib/sequential-color-scale.js";
79
+ export { DivergingColorScale, useDivergingColorScale, } from "./lib/diverging-color-scale.js";
80
+ export type { ColorScaleStop, SequentialColorScaleProps, DivergingColorScaleProps, ResolvedSequentialColorScale, ResolvedDivergingColorScale, } from "./lib/color-types.js";
81
+ export { ThresholdColorScale, useThresholdColorScale, } from "./lib/threshold-color-scale.js";
82
+ export type { ThresholdColorBand, ThresholdColorScaleProps, ResolvedThresholdColorScale, } from "./lib/threshold-color-scale.js";
83
+ export { VolumeSeries } from "./lib/volume-series.js";
84
+ export type { VolumeSeriesProps, VolumeSeriesStyle, } from "./lib/volume-series.js";
85
+ export { TradingTimeScale, useTradingTimeScale, } from "./lib/trading-time-scale.js";
86
+ export type { TradingTimeScaleProps, ResolvedTradingTimeScale, } from "./lib/trading-time-scale.js";
87
+ export { CandlestickSeries } from "./lib/candlestick-series.js";
88
+ export type { CandlestickSeriesProps, CandlestickSeriesStyle, CandleBodyStyle, CandleWickStyle, } from "./lib/candlestick-series.js";
89
+ export { OhlcBarSeries } from "./lib/ohlc-bar-series.js";
90
+ export type { OhlcBarSeriesProps, OhlcBarSeriesStyle, } from "./lib/ohlc-bar-series.js";
91
+ export { BaselineSeries } from "./lib/baseline-series.js";
92
+ export type { BaselineSeriesProps, BaselineSeriesStyle, BaselineSideStyle, } from "./lib/baseline-series.js";
93
+ export { IntervalDiamondSeries } from "./lib/interval-diamond-series.js";
94
+ export type { IntervalDiamondSeriesProps, IntervalDiamondSeriesStyle, } from "./lib/interval-diamond-series.js";
95
+ export { CensoredPointSeries } from "./lib/censored-point-series.js";
96
+ export type { CensoringStatus, CensoringAccessor, CensoredPointSeriesProps, CensoredPointSeriesStyle, } from "./lib/censored-point-series.js";
97
+ export { WeightedPointSeries } from "./lib/weighted-point-series.js";
98
+ export type { WeightedPointSeriesProps, WeightedPointSeriesStyle, WeightAccessor, } from "./lib/weighted-point-series.js";
99
+ export { TrajectorySeries } from "./lib/trajectory-series.js";
100
+ export type { TrajectorySeriesProps, TrajectorySeriesStyle, TrajectoryGroupAccessor, } from "./lib/trajectory-series.js";
101
+ export { PairedSeries } from "./lib/paired-series.js";
102
+ export type { PairedSeriesProps, PairedSeriesStyle, } from "./lib/paired-series.js";
@@ -6,6 +6,14 @@ import { useBarScale } from "./lib/use-bar-scale.js";
6
6
  import { useUTCScale } from "./lib/use-utc-scale.js";
7
7
  import { Axis } from "./lib/axis.js";
8
8
  import { LineSeries } from "./lib/line-series.js";
9
+ import { AreaSeries } from "./lib/area-series.js";
10
+ import { IntervalBandSeries } from "./lib/interval-band-series.js";
11
+ import {
12
+ HorizontalIntervalSeries,
13
+ VerticalIntervalSeries
14
+ } from "./lib/interval-series.js";
15
+ import { stepBefore, stepAfter, stepMidpoint } from "./lib/step-curves.js";
16
+ import { monotoneX } from "./lib/monotone-curve.js";
9
17
  import { ScaleAdjust } from "./lib/scale-adjust.js";
10
18
  import { PointSeries } from "./lib/point-series.js";
11
19
  import { PlotSeries } from "./lib/plot-series.js";
@@ -23,7 +31,34 @@ import { BarSeries } from "./lib/bar-series.js";
23
31
  import { pieSlices } from "./lib/pie-slices.js";
24
32
  import { PieLayout, PieSlice, PieLabel } from "./lib/pie-layout.js";
25
33
  import { extent, niceUTCDomain } from "./lib/utc-scale.js";
26
- import { linearTicks, niceLinearDomain, formatNumber } from "./lib/numeric-ticks.js";
34
+ import {
35
+ linearTicks,
36
+ niceLinearDomain,
37
+ formatNumber
38
+ } from "./lib/numeric-ticks.js";
39
+ import { interpolateNumericRange } from "./lib/numeric-range-interpolation.js";
40
+ import {
41
+ visibleOhlcPriceExtent,
42
+ padLinearDomain
43
+ } from "./lib/financial-autoscale.js";
44
+ import { percentageReturns, indexTo100 } from "./lib/financial-comparison.js";
45
+ import { aggregateOhlcv, sessionVwap } from "./lib/financial-aggregation.js";
46
+ import {
47
+ RangeNavigator,
48
+ EditableReferenceLine,
49
+ EditableReferenceBand,
50
+ EditableTrendLine
51
+ } from "./lib/editable-chart-elements.js";
52
+ import {
53
+ simpleMovingAverage,
54
+ exponentialMovingAverage,
55
+ bollingerBands
56
+ } from "./lib/financial-indicators.js";
57
+ import {
58
+ relativeStrengthIndex,
59
+ movingAverageConvergenceDivergence,
60
+ stochasticOscillator
61
+ } from "./lib/financial-oscillators.js";
27
62
  import { utcTickLabels } from "./lib/utc-labels.js";
28
63
  import { LogScale } from "./lib/log-scale-component.js";
29
64
  import { useLogScale } from "./lib/use-log-scale.js";
@@ -34,48 +69,118 @@ import { usePointScale } from "./lib/use-point-scale.js";
34
69
  import { GridLines, ReferenceLine } from "./lib/chart-lines.js";
35
70
  import { ReferenceBand } from "./lib/reference-band.js";
36
71
  import { AxisTitle } from "./lib/axis-title.js";
72
+ import { panDomain, zoomDomain } from "./lib/domain-navigation.js";
73
+ import {
74
+ SequentialColorScale,
75
+ useSequentialColorScale
76
+ } from "./lib/sequential-color-scale.js";
77
+ import {
78
+ DivergingColorScale,
79
+ useDivergingColorScale
80
+ } from "./lib/diverging-color-scale.js";
81
+ import {
82
+ ThresholdColorScale,
83
+ useThresholdColorScale
84
+ } from "./lib/threshold-color-scale.js";
85
+ import { VolumeSeries } from "./lib/volume-series.js";
86
+ import {
87
+ TradingTimeScale,
88
+ useTradingTimeScale
89
+ } from "./lib/trading-time-scale.js";
90
+ import { CandlestickSeries } from "./lib/candlestick-series.js";
91
+ import { OhlcBarSeries } from "./lib/ohlc-bar-series.js";
92
+ import { BaselineSeries } from "./lib/baseline-series.js";
93
+ import { IntervalDiamondSeries } from "./lib/interval-diamond-series.js";
94
+ import { CensoredPointSeries } from "./lib/censored-point-series.js";
95
+ import { WeightedPointSeries } from "./lib/weighted-point-series.js";
96
+ import { TrajectorySeries } from "./lib/trajectory-series.js";
97
+ import { PairedSeries } from "./lib/paired-series.js";
37
98
  export {
38
99
  AnchoredLayout,
100
+ AreaSeries,
39
101
  Axis,
40
102
  AxisTitle,
41
103
  BarScale,
42
104
  BarSeries,
105
+ BaselineSeries,
106
+ CandlestickSeries,
107
+ CensoredPointSeries,
108
+ DivergingColorScale,
109
+ EditableReferenceBand,
110
+ EditableReferenceLine,
111
+ EditableTrendLine,
43
112
  GridLines,
113
+ HorizontalIntervalSeries,
44
114
  HoverCard,
45
115
  HoverData,
116
+ IntervalBandSeries,
117
+ IntervalDiamondSeries,
46
118
  LineSeries,
47
119
  LinearScale,
48
120
  LogScale,
121
+ OhlcBarSeries,
122
+ PairedSeries,
49
123
  PieLabel,
50
124
  PieLayout,
51
125
  PieSlice,
52
126
  PlotSeries,
53
127
  PointScale,
54
128
  PointSeries,
129
+ RangeNavigator,
55
130
  ReferenceBand,
56
131
  ReferenceLine,
57
132
  ScaleAdjust,
133
+ SequentialColorScale,
58
134
  SymlogScale,
135
+ ThresholdColorScale,
136
+ TradingTimeScale,
137
+ TrajectorySeries,
59
138
  UTCScale,
139
+ VerticalIntervalSeries,
140
+ VolumeSeries,
141
+ WeightedPointSeries,
142
+ aggregateOhlcv,
143
+ bollingerBands,
60
144
  closestPoint,
61
145
  closestX,
62
146
  defineSeries,
147
+ exponentialMovingAverage,
63
148
  extent,
64
149
  formatNumber,
150
+ indexTo100,
151
+ interpolateNumericRange,
65
152
  interpolateX,
66
153
  linearInterpolation,
67
154
  linearTicks,
155
+ monotoneX,
156
+ movingAverageConvergenceDivergence,
68
157
  nearestDomainValue,
69
158
  nearestPoint,
70
159
  niceLinearDomain,
71
160
  niceUTCDomain,
161
+ padLinearDomain,
162
+ panDomain,
163
+ percentageReturns,
72
164
  pieSlices,
165
+ relativeStrengthIndex,
166
+ sessionVwap,
167
+ simpleMovingAverage,
168
+ stepAfter,
169
+ stepBefore,
170
+ stepMidpoint,
171
+ stochasticOscillator,
73
172
  useBarScale,
173
+ useDivergingColorScale,
74
174
  useLinearScale,
75
175
  useLogScale,
76
176
  usePointScale,
177
+ useSequentialColorScale,
77
178
  useSymlogScale,
179
+ useThresholdColorScale,
180
+ useTradingTimeScale,
78
181
  useUTCScale,
79
- utcTickLabels
182
+ utcTickLabels,
183
+ visibleOhlcPriceExtent,
184
+ zoomDomain
80
185
  };
81
186
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/features/viz/index.ts"],
4
- "sourcesContent": ["export { LinearScale } from \"./lib/linear-scale-component.js\";\nexport { BarScale } from \"./lib/bar-scale.js\";\nexport { UTCScale } from \"./lib/utc-scale-component.js\";\nexport { useLinearScale } from \"./lib/use-linear-scale.js\";\nexport { useBarScale } from \"./lib/use-bar-scale.js\";\nexport { useUTCScale } from \"./lib/use-utc-scale.js\";\nexport type {\n ScaleId,\n LinearDomain,\n BandCategory,\n BandDomain,\n BarScaleProps,\n BandScaleRange,\n ResolvedBandScale,\n ScaleRange,\n ScaleLayoutStyle,\n LinearScaleProps,\n ResolvedLinearScale,\n ResolvedScale,\n} from \"./lib/types.js\";\nexport { Axis } from \"./lib/axis.js\";\nexport { LineSeries } from \"./lib/line-series.js\";\nexport { ScaleAdjust } from \"./lib/scale-adjust.js\";\nexport type {\n AxisStyle,\n AxisProps,\n LineCoordinate,\n LineAccessor,\n LineCurve,\n LineSeriesStyle,\n LineSeriesProps,\n ScaleAdjustProps,\n} from \"./lib/types.js\";\nexport { PointSeries } from \"./lib/point-series.js\";\nexport type {\n PointAccessor,\n PointMarkStyle,\n PointSeriesStyle,\n PointStyleResolver,\n PointSeriesProps,\n} from \"./lib/point-types.js\";\nexport { PlotSeries } from \"./lib/plot-series.js\";\nexport type { PlotSeriesProps, PlotKeyAccessor } from \"./lib/plot-types.js\";\nexport { nearestDomainValue, nearestPoint } from \"./lib/nearest.js\";\nexport type { NearestPointOptions, NearestPoint } from \"./lib/nearest.js\";\n\nexport { HoverData } from \"./lib/hover-data.js\";\nexport { defineSeries, closestPoint } from \"./lib/hover-queries.js\";\nexport type {\n HoverQueryContext,\n HoverQuery,\n HoverDataProps,\n HoverSeries,\n HoverPoint,\n HoverHit,\n HoverSeriesMap,\n ClosestPointHit,\n ClosestPointOptions,\n} from \"./lib/hover-types.js\";\n\nexport { HoverCard } from \"./lib/hover-card.js\";\nexport type {\n HoverCardProps,\n HoverCardStyle,\n HoverBounds,\n HoverPlacement,\n} from \"./lib/hover-card.js\";\n\nexport {\n closestX,\n interpolateX,\n linearInterpolation,\n} from \"./lib/hover-queries.js\";\nexport type {\n ClosestXOptions,\n ClosestXHit,\n HoverInterpolation,\n InterpolateXOptions,\n HoverSample,\n} from \"./lib/hover-types.js\";\n\nexport { AnchoredLayout } from \"./lib/anchored-layout.js\";\nexport type {\n AnchoredItem,\n AnchoredPlacement,\n AnchoredLayoutProps,\n} from \"./lib/anchored-layout.js\";\n\nexport { BarSeries } from \"./lib/bar-series.js\";\nexport type {\n BarThresholdFill,\n BarCategoryAccessor,\n BarSeriesStyle,\n BarStyleResolver,\n BarSeriesProps,\n} from \"./lib/bar-series.js\";\n\nexport { pieSlices } from \"./lib/pie-slices.js\";\nexport type { PieOptions, PieSliceGeometry } from \"./lib/pie-slices.js\";\n\nexport { PieLayout, PieSlice, PieLabel } from \"./lib/pie-layout.js\";\nexport type { PieLayoutProps, PieLayoutStyle, PieLayoutSlice, PieLabelPlacement, PieLabelLayout, PieSliceProps, PieSliceStyle, PieLabelProps, PieLabelStyle } from \"./lib/pie-types.js\";\n\nexport { extent, niceUTCDomain } from \"./lib/utc-scale.js\";\nexport type { NumericDomain, UtcDomain, UTCScaleProps, ResolvedUtcScale, ResolvedContinuousScale } from \"./lib/types.js\";\n\nexport { linearTicks, niceLinearDomain, formatNumber } from \"./lib/numeric-ticks.js\";\nexport type { LinearTickOptions, NumberFormatOptions } from \"./lib/numeric-ticks.js\";\n\nexport { utcTickLabels } from \"./lib/utc-labels.js\";\nexport type { UTCTickLabelOptions } from \"./lib/utc-labels.js\";\n\nexport { LogScale } from \"./lib/log-scale-component.js\";\nexport { useLogScale } from \"./lib/use-log-scale.js\";\nexport type { LogScaleProps, ResolvedLogScale } from \"./lib/types.js\";\n\nexport { SymlogScale } from \"./lib/symlog-scale-component.js\";\nexport { useSymlogScale } from \"./lib/use-symlog-scale.js\";\nexport type { SymlogScaleProps, ResolvedSymlogScale } from \"./lib/types.js\";\n\nexport { PointScale } from \"./lib/point-scale-component.js\";\nexport { usePointScale } from \"./lib/use-point-scale.js\";\nexport type { PointScaleProps, ResolvedPointScale } from \"./lib/types.js\";\nexport { GridLines, ReferenceLine } from \"./lib/chart-lines.js\";\nexport type { ChartLineProps, GridLinesProps, ReferenceLineProps } from \"./lib/chart-lines.js\";\nexport { ReferenceBand } from \"./lib/reference-band.js\";\nexport type { ReferenceBandProps } from \"./lib/reference-band.js\";\nexport { AxisTitle } from \"./lib/axis-title.js\";\nexport type { AxisTitleProps } from \"./lib/axis-title.js\";\n"],
5
- "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAe5B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAW5B,SAAS,mBAAmB;AAQ5B,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB,oBAAoB;AAGjD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,oBAAoB;AAa3C,SAAS,iBAAiB;AAQ1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,sBAAsB;AAO/B,SAAS,iBAAiB;AAS1B,SAAS,iBAAiB;AAG1B,SAAS,WAAW,UAAU,gBAAgB;AAG9C,SAAS,QAAQ,qBAAqB;AAGtC,SAAS,aAAa,kBAAkB,oBAAoB;AAG5D,SAAS,qBAAqB;AAG9B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAG5B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAG/B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAE9B,SAAS,WAAW,qBAAqB;AAEzC,SAAS,qBAAqB;AAE9B,SAAS,iBAAiB;",
4
+ "sourcesContent": ["export { LinearScale } from \"./lib/linear-scale-component.js\";\nexport { BarScale } from \"./lib/bar-scale.js\";\nexport { UTCScale } from \"./lib/utc-scale-component.js\";\nexport { useLinearScale } from \"./lib/use-linear-scale.js\";\nexport { useBarScale } from \"./lib/use-bar-scale.js\";\nexport { useUTCScale } from \"./lib/use-utc-scale.js\";\nexport type {\n ScaleId,\n LinearDomain,\n BandCategory,\n BandDomain,\n BarScaleProps,\n BandScaleRange,\n ResolvedBandScale,\n ScaleRange,\n ScaleLayoutStyle,\n LinearScaleProps,\n ResolvedLinearScale,\n ResolvedScale,\n} from \"./lib/types.js\";\nexport { Axis } from \"./lib/axis.js\";\nexport { LineSeries } from \"./lib/line-series.js\";\nexport { AreaSeries } from \"./lib/area-series.js\";\nexport type { AreaSeriesProps, AreaSeriesStyle } from \"./lib/area-series.js\";\nexport { IntervalBandSeries } from \"./lib/interval-band-series.js\";\nexport type { IntervalBandSeriesProps } from \"./lib/interval-band-series.js\";\nexport {\n HorizontalIntervalSeries,\n VerticalIntervalSeries,\n} from \"./lib/interval-series.js\";\nexport type {\n IntervalSeriesStyle,\n IntervalSeriesProps,\n HorizontalIntervalSeriesProps,\n VerticalIntervalSeriesProps,\n} from \"./lib/interval-series.js\";\nexport type { SeriesCurve } from \"./lib/curve-definition.js\";\nexport { stepBefore, stepAfter, stepMidpoint } from \"./lib/step-curves.js\";\nexport { monotoneX } from \"./lib/monotone-curve.js\";\nexport { ScaleAdjust } from \"./lib/scale-adjust.js\";\nexport type {\n AxisStyle,\n AxisProps,\n LineCoordinate,\n LineAccessor,\n SeriesAccessor,\n SeriesCoordinate,\n LineCurve,\n LineSeriesStyle,\n LineSeriesProps,\n ScaleAdjustProps,\n} from \"./lib/types.js\";\nexport { PointSeries } from \"./lib/point-series.js\";\nexport type {\n PointAccessor,\n PointMarkStyle,\n PointSeriesStyle,\n PointStyleResolver,\n PointSeriesProps,\n} from \"./lib/point-types.js\";\nexport { PlotSeries } from \"./lib/plot-series.js\";\nexport type { PlotSeriesProps, PlotKeyAccessor } from \"./lib/plot-types.js\";\nexport { nearestDomainValue, nearestPoint } from \"./lib/nearest.js\";\nexport type { NearestPointOptions, NearestPoint } from \"./lib/nearest.js\";\n\nexport { HoverData } from \"./lib/hover-data.js\";\nexport { defineSeries, closestPoint } from \"./lib/hover-queries.js\";\nexport type {\n HoverQueryContext,\n HoverQuery,\n HoverDataProps,\n HoverSeries,\n HoverPoint,\n HoverHit,\n HoverSeriesMap,\n ClosestPointHit,\n ClosestPointOptions,\n} from \"./lib/hover-types.js\";\n\nexport { HoverCard } from \"./lib/hover-card.js\";\nexport type {\n HoverCardProps,\n HoverCardStyle,\n HoverBounds,\n HoverPlacement,\n} from \"./lib/hover-card.js\";\n\nexport {\n closestX,\n interpolateX,\n linearInterpolation,\n} from \"./lib/hover-queries.js\";\nexport type {\n ClosestXOptions,\n ClosestXHit,\n HoverInterpolation,\n InterpolateXOptions,\n HoverSample,\n} from \"./lib/hover-types.js\";\n\nexport { AnchoredLayout } from \"./lib/anchored-layout.js\";\nexport type {\n AnchoredItem,\n AnchoredPlacement,\n AnchoredLayoutProps,\n} from \"./lib/anchored-layout.js\";\n\nexport { BarSeries } from \"./lib/bar-series.js\";\nexport type {\n BarThresholdFill,\n BarCategoryAccessor,\n BarSeriesStyle,\n BarStyleResolver,\n BarSeriesProps,\n} from \"./lib/bar-series.js\";\n\nexport { pieSlices } from \"./lib/pie-slices.js\";\nexport type { PieOptions, PieSliceGeometry } from \"./lib/pie-slices.js\";\n\nexport { PieLayout, PieSlice, PieLabel } from \"./lib/pie-layout.js\";\nexport type {\n PieLayoutProps,\n PieLayoutStyle,\n PieLayoutSlice,\n PieLabelPlacement,\n PieLabelLayout,\n PieSliceProps,\n PieSliceStyle,\n PieLabelProps,\n PieLabelStyle,\n} from \"./lib/pie-types.js\";\n\nexport { extent, niceUTCDomain } from \"./lib/utc-scale.js\";\nexport type {\n NumericDomain,\n UtcDomain,\n UTCScaleProps,\n ResolvedUtcScale,\n ResolvedContinuousScale,\n} from \"./lib/types.js\";\n\nexport {\n linearTicks,\n niceLinearDomain,\n formatNumber,\n} from \"./lib/numeric-ticks.js\";\nexport type {\n LinearTickOptions,\n NumberFormatOptions,\n} from \"./lib/numeric-ticks.js\";\nexport { interpolateNumericRange } from \"./lib/numeric-range-interpolation.js\";\nexport {\n visibleOhlcPriceExtent,\n padLinearDomain,\n} from \"./lib/financial-autoscale.js\";\nexport type {\n VisibleOhlcPriceExtentOptions,\n PadLinearDomainOptions,\n} from \"./lib/financial-autoscale.js\";\nexport { percentageReturns, indexTo100 } from \"./lib/financial-comparison.js\";\nexport type {\n ComparisonBaseOptions,\n PercentageReturnPoint,\n IndexedValuePoint,\n} from \"./lib/financial-comparison.js\";\nexport { aggregateOhlcv, sessionVwap } from \"./lib/financial-aggregation.js\";\nexport type {\n OhlcvBucket,\n OhlcvSource,\n AggregatedOhlcvPoint,\n AggregateOhlcvOptions,\n SessionIdentifier,\n SessionAccessor,\n SessionVwapOptions,\n SessionVwapPoint,\n} from \"./lib/financial-aggregation.js\";\nexport {\n RangeNavigator,\n EditableReferenceLine,\n EditableReferenceBand,\n EditableTrendLine,\n} from \"./lib/editable-chart-elements.js\";\nexport type {\n ChartAnchor,\n RangeNavigatorProps,\n RangeNavigatorStyle,\n EditableReferenceLineProps,\n EditableReferenceLineStyle,\n EditableReferenceBandProps,\n EditableReferenceBandStyle,\n EditableTrendLineProps,\n EditableTrendLineStyle,\n} from \"./lib/editable-chart-elements.js\";\nexport {\n simpleMovingAverage,\n exponentialMovingAverage,\n bollingerBands,\n} from \"./lib/financial-indicators.js\";\nexport type {\n MovingAverageOptions,\n BollingerBandsOptions,\n MovingAveragePoint,\n BollingerBandPoint,\n} from \"./lib/financial-indicators.js\";\nexport {\n relativeStrengthIndex,\n movingAverageConvergenceDivergence,\n stochasticOscillator,\n} from \"./lib/financial-oscillators.js\";\nexport type {\n OscillatorOptions,\n RelativeStrengthIndexOptions,\n MovingAverageConvergenceDivergenceOptions,\n StochasticOscillatorOptions,\n RelativeStrengthIndexPoint,\n MovingAverageConvergenceDivergencePoint,\n StochasticOscillatorPoint,\n} from \"./lib/financial-oscillators.js\";\n\nexport { utcTickLabels } from \"./lib/utc-labels.js\";\nexport type { UTCTickLabelOptions } from \"./lib/utc-labels.js\";\n\nexport { LogScale } from \"./lib/log-scale-component.js\";\nexport { useLogScale } from \"./lib/use-log-scale.js\";\nexport type { LogScaleProps, ResolvedLogScale } from \"./lib/types.js\";\n\nexport { SymlogScale } from \"./lib/symlog-scale-component.js\";\nexport { useSymlogScale } from \"./lib/use-symlog-scale.js\";\nexport type { SymlogScaleProps, ResolvedSymlogScale } from \"./lib/types.js\";\n\nexport { PointScale } from \"./lib/point-scale-component.js\";\nexport { usePointScale } from \"./lib/use-point-scale.js\";\nexport type { PointScaleProps, ResolvedPointScale } from \"./lib/types.js\";\nexport { GridLines, ReferenceLine } from \"./lib/chart-lines.js\";\nexport type {\n ChartLineProps,\n GridLinesProps,\n ReferenceLineProps,\n} from \"./lib/chart-lines.js\";\nexport { ReferenceBand } from \"./lib/reference-band.js\";\nexport type { ReferenceBandProps } from \"./lib/reference-band.js\";\nexport { AxisTitle } from \"./lib/axis-title.js\";\nexport type { AxisTitleProps } from \"./lib/axis-title.js\";\n\nexport { panDomain, zoomDomain } from \"./lib/domain-navigation.js\";\nexport type {\n DomainNavigationConstraints,\n PanDomainOptions,\n ZoomDomainOptions,\n} from \"./lib/domain-navigation.js\";\n\nexport {\n SequentialColorScale,\n useSequentialColorScale,\n} from \"./lib/sequential-color-scale.js\";\nexport {\n DivergingColorScale,\n useDivergingColorScale,\n} from \"./lib/diverging-color-scale.js\";\nexport type {\n ColorScaleStop,\n SequentialColorScaleProps,\n DivergingColorScaleProps,\n ResolvedSequentialColorScale,\n ResolvedDivergingColorScale,\n} from \"./lib/color-types.js\";\n\nexport {\n ThresholdColorScale,\n useThresholdColorScale,\n} from \"./lib/threshold-color-scale.js\";\nexport type {\n ThresholdColorBand,\n ThresholdColorScaleProps,\n ResolvedThresholdColorScale,\n} from \"./lib/threshold-color-scale.js\";\n\nexport { VolumeSeries } from \"./lib/volume-series.js\";\nexport type {\n VolumeSeriesProps,\n VolumeSeriesStyle,\n} from \"./lib/volume-series.js\";\n\nexport {\n TradingTimeScale,\n useTradingTimeScale,\n} from \"./lib/trading-time-scale.js\";\nexport type {\n TradingTimeScaleProps,\n ResolvedTradingTimeScale,\n} from \"./lib/trading-time-scale.js\";\nexport { CandlestickSeries } from \"./lib/candlestick-series.js\";\nexport type {\n CandlestickSeriesProps,\n CandlestickSeriesStyle,\n CandleBodyStyle,\n CandleWickStyle,\n} from \"./lib/candlestick-series.js\";\nexport { OhlcBarSeries } from \"./lib/ohlc-bar-series.js\";\nexport type {\n OhlcBarSeriesProps,\n OhlcBarSeriesStyle,\n} from \"./lib/ohlc-bar-series.js\";\n\nexport { BaselineSeries } from \"./lib/baseline-series.js\";\nexport type {\n BaselineSeriesProps,\n BaselineSeriesStyle,\n BaselineSideStyle,\n} from \"./lib/baseline-series.js\";\nexport { IntervalDiamondSeries } from \"./lib/interval-diamond-series.js\";\nexport type {\n IntervalDiamondSeriesProps,\n IntervalDiamondSeriesStyle,\n} from \"./lib/interval-diamond-series.js\";\nexport { CensoredPointSeries } from \"./lib/censored-point-series.js\";\nexport type {\n CensoringStatus,\n CensoringAccessor,\n CensoredPointSeriesProps,\n CensoredPointSeriesStyle,\n} from \"./lib/censored-point-series.js\";\nexport { WeightedPointSeries } from \"./lib/weighted-point-series.js\";\nexport type {\n WeightedPointSeriesProps,\n WeightedPointSeriesStyle,\n WeightAccessor,\n} from \"./lib/weighted-point-series.js\";\nexport { TrajectorySeries } from \"./lib/trajectory-series.js\";\nexport type {\n TrajectorySeriesProps,\n TrajectorySeriesStyle,\n TrajectoryGroupAccessor,\n} from \"./lib/trajectory-series.js\";\nexport { PairedSeries } from \"./lib/paired-series.js\";\nexport type {\n PairedSeriesProps,\n PairedSeriesStyle,\n} from \"./lib/paired-series.js\";\n"],
5
+ "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAe5B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAE3B,SAAS,0BAA0B;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAQP,SAAS,YAAY,WAAW,oBAAoB;AACpD,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAa5B,SAAS,mBAAmB;AAQ5B,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB,oBAAoB;AAGjD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,oBAAoB;AAa3C,SAAS,iBAAiB;AAQ1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,sBAAsB;AAO/B,SAAS,iBAAiB;AAS1B,SAAS,iBAAiB;AAG1B,SAAS,WAAW,UAAU,gBAAgB;AAa9C,SAAS,QAAQ,qBAAqB;AAStC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAKP,SAAS,mBAAmB,kBAAkB;AAM9C,SAAS,gBAAgB,mBAAmB;AAW5C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAWP,SAAS,qBAAqB;AAG9B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAG5B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAG/B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAE9B,SAAS,WAAW,qBAAqB;AAMzC,SAAS,qBAAqB;AAE9B,SAAS,iBAAiB;AAG1B,SAAS,WAAW,kBAAkB;AAOtC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AASP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAOP,SAAS,oBAAoB;AAM7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAKP,SAAS,yBAAyB;AAOlC,SAAS,qBAAqB;AAM9B,SAAS,sBAAsB;AAM/B,SAAS,6BAA6B;AAKtC,SAAS,2BAA2B;AAOpC,SAAS,2BAA2B;AAMpC,SAAS,wBAAwB;AAMjC,SAAS,oBAAoB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,79 @@
1
+ import type { LayoutBox } from "@pibbl/core";
2
+ import type { BarSeriesProps } from "../lib/bar-series.js";
3
+ import type { BandCategory } from "../lib/types.js";
4
+ import type { RenderedSeriesPoint } from "./query-types.js";
5
+ /** Original range/value/grouped bar with its captured endpoints and local paint bounds.
6
+ * @see {@link BarRenderedSeries}
7
+ */
8
+ export interface PaintedBarHit<D> {
9
+ /** Caller-owned original record. */
10
+ readonly datum: D;
11
+ /** Original zero-based source position. */
12
+ readonly sourceIndex: number;
13
+ /** Original discrete category, without numeric coercion. */
14
+ readonly category: BandCategory;
15
+ /** Original subgroup when grouping is enabled. */
16
+ readonly group: BandCategory | undefined;
17
+ /** Data-space starting endpoint, including an ordinary bar's baseline. */
18
+ readonly valueStart: number;
19
+ /** Data-space ending endpoint. */
20
+ readonly valueEnd: number;
21
+ /** Logical rectangle bounds before world transforms. */
22
+ readonly boundsLocal: Readonly<LayoutBox>;
23
+ }
24
+ /** @internal Captured rectangle paint flags used only for geometric lookup. */
25
+ export interface CapturedBarMark<D> extends PaintedBarHit<D> {
26
+ /** Whether this rectangle paints its interior. */
27
+ readonly fill: boolean;
28
+ /** Painted stroke width in local logical units. */
29
+ readonly strokeWidthLocal: number;
30
+ }
31
+ /** A borrowed committed categorical bar generation; contains no numeric category mapping.
32
+ * @see {@link PaintedBarHit}
33
+ */
34
+ export interface BarRenderedSeries<D> {
35
+ /** Original records and geometry in source paint order. */
36
+ readonly marks: readonly CapturedBarMark<D>[];
37
+ /** Throws after replacement or disposal. */
38
+ assertLive(): void;
39
+ /** Converts root logical units into this generation's local geometry.
40
+ * @param point - Root-logical Canvas point.
41
+ * @returns Local point or undefined for a singular transform.
42
+ */
43
+ localAtRoot(point: Readonly<RenderedSeriesPoint>): Readonly<RenderedSeriesPoint> | undefined;
44
+ /** Tests a local point against every committed clip/layer bound.
45
+ * @param point - Local-logical Canvas point.
46
+ * @returns Whether the point is inside every clip and layer bound.
47
+ */
48
+ anchorInsideClips(point: Readonly<RenderedSeriesPoint>): boolean;
49
+ }
50
+ /** Mount-owned optional categorical-bar capture.
51
+ * @see {@link BarRenderedSeries}
52
+ */
53
+ export interface BarInspectionRef<D> {
54
+ /** Returns the last successful generation.
55
+ * @returns Borrowed bar geometry or undefined before paint/after disposal.
56
+ */
57
+ rendered(): BarRenderedSeries<D> | undefined;
58
+ /** @internal Records candidate values and paint geometry without executing a search.
59
+ * @param input - Source-ordered captured rectangle marks.
60
+ */
61
+ capture(input: readonly CapturedBarMark<D>[]): void;
62
+ }
63
+ /**
64
+ * Owns opt-in capture for ordinary, range or grouped categorical bars.
65
+ * @param _inputs - Bar inputs used for datum inference; no data is read or subscribed here.
66
+ * @returns A stable ref to pass to one BarSeries inspection prop; captured endpoints share one fixed contract.
67
+ * @see {@link BarInspectionRef}
68
+ */
69
+ export declare function useBarInspection<D>(_inputs: Pick<BarSeriesProps<D>, "data" | "category">): BarInspectionRef<D>;
70
+ /**
71
+ * Finds the last-painted bar covering a root-logical point in this explicit series.
72
+ * @param rendered - Borrowed committed categorical bar values and rectangle geometry.
73
+ * @param options - Root-logical query point; respects every clip, fill/stroke and source order.
74
+ * @returns Original record, category/group, endpoints and local bounds, or undefined for gaps and singular transforms.
75
+ * @see {@link PaintedBarHit}
76
+ */
77
+ export declare function paintedBarAt<D>(rendered: BarRenderedSeries<D>, options: {
78
+ rootPoint: Readonly<RenderedSeriesPoint>;
79
+ }): PaintedBarHit<D> | undefined;
@@ -0,0 +1,49 @@
1
+ import { useRenderedRef } from "./owned-ref.js";
2
+ function useBarInspection(_inputs) {
3
+ return useRenderedRef(
4
+ "barSeriesInspection",
5
+ (marks, geometry) => Object.freeze({
6
+ marks: Object.freeze(marks.slice()),
7
+ assertLive: geometry.assertLive,
8
+ localAtRoot: geometry.localAtRoot,
9
+ anchorInsideClips: geometry.anchorInsideClips
10
+ })
11
+ );
12
+ }
13
+ function paintedBarAt(rendered, options) {
14
+ rendered.assertLive();
15
+ if (!Number.isFinite(options.rootPoint.x) || !Number.isFinite(options.rootPoint.y))
16
+ throw new RangeError("paintedBarAt rootPoint must be finite.");
17
+ const point = rendered.localAtRoot(options.rootPoint);
18
+ if (!point || !rendered.anchorInsideClips(point)) return void 0;
19
+ for (let index = rendered.marks.length - 1; index >= 0; index--) {
20
+ const mark = rendered.marks[index], b = mark.boundsLocal, half = mark.strokeWidthLocal / 2;
21
+ const inside = point.x >= b.x && point.x <= b.x + b.width && point.y >= b.y && point.y <= b.y + b.height;
22
+ const outline = half > 0 && point.x >= b.x - half && point.x <= b.x + b.width + half && point.y >= b.y - half && point.y <= b.y + b.height + half && !(point.x > b.x + half && point.x < b.x + b.width - half && point.y > b.y + half && point.y < b.y + b.height - half);
23
+ if (!(mark.fill && inside || outline)) continue;
24
+ const {
25
+ datum,
26
+ sourceIndex,
27
+ category,
28
+ group,
29
+ valueStart,
30
+ valueEnd,
31
+ boundsLocal
32
+ } = mark;
33
+ return Object.freeze({
34
+ datum,
35
+ sourceIndex,
36
+ category,
37
+ group,
38
+ valueStart,
39
+ valueEnd,
40
+ boundsLocal
41
+ });
42
+ }
43
+ return void 0;
44
+ }
45
+ export {
46
+ paintedBarAt,
47
+ useBarInspection
48
+ };
49
+ //# sourceMappingURL=bar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/features/viz/inspection/bar.ts"],
4
+ "sourcesContent": ["import type { LayoutBox } from \"@pibbl/core\";\nimport type { BarSeriesProps } from \"../lib/bar-series.js\";\nimport type { BandCategory } from \"../lib/types.js\";\nimport type { RenderedSeriesPoint } from \"./query-types.js\";\nimport { useRenderedRef } from \"./owned-ref.js\";\n\n/** Original range/value/grouped bar with its captured endpoints and local paint bounds.\n * @see {@link BarRenderedSeries}\n */\nexport interface PaintedBarHit<D> {\n /** Caller-owned original record. */\n readonly datum: D;\n /** Original zero-based source position. */\n readonly sourceIndex: number;\n /** Original discrete category, without numeric coercion. */\n readonly category: BandCategory;\n /** Original subgroup when grouping is enabled. */\n readonly group: BandCategory | undefined;\n /** Data-space starting endpoint, including an ordinary bar's baseline. */\n readonly valueStart: number;\n /** Data-space ending endpoint. */\n readonly valueEnd: number;\n /** Logical rectangle bounds before world transforms. */\n readonly boundsLocal: Readonly<LayoutBox>;\n}\n/** @internal Captured rectangle paint flags used only for geometric lookup. */\nexport interface CapturedBarMark<D> extends PaintedBarHit<D> {\n /** Whether this rectangle paints its interior. */\n readonly fill: boolean;\n /** Painted stroke width in local logical units. */\n readonly strokeWidthLocal: number;\n}\n/** A borrowed committed categorical bar generation; contains no numeric category mapping.\n * @see {@link PaintedBarHit}\n */\nexport interface BarRenderedSeries<D> {\n /** Original records and geometry in source paint order. */\n readonly marks: readonly CapturedBarMark<D>[];\n /** Throws after replacement or disposal. */\n assertLive(): void;\n /** Converts root logical units into this generation's local geometry.\n * @param point - Root-logical Canvas point.\n * @returns Local point or undefined for a singular transform.\n */\n localAtRoot(\n point: Readonly<RenderedSeriesPoint>,\n ): Readonly<RenderedSeriesPoint> | undefined;\n /** Tests a local point against every committed clip/layer bound.\n * @param point - Local-logical Canvas point.\n * @returns Whether the point is inside every clip and layer bound.\n */\n anchorInsideClips(point: Readonly<RenderedSeriesPoint>): boolean;\n}\n/** Mount-owned optional categorical-bar capture.\n * @see {@link BarRenderedSeries}\n */\nexport interface BarInspectionRef<D> {\n /** Returns the last successful generation.\n * @returns Borrowed bar geometry or undefined before paint/after disposal.\n */\n rendered(): BarRenderedSeries<D> | undefined;\n /** @internal Records candidate values and paint geometry without executing a search.\n * @param input - Source-ordered captured rectangle marks.\n */\n capture(input: readonly CapturedBarMark<D>[]): void;\n}\n\n/**\n * Owns opt-in capture for ordinary, range or grouped categorical bars.\n * @param _inputs - Bar inputs used for datum inference; no data is read or subscribed here.\n * @returns A stable ref to pass to one BarSeries inspection prop; captured endpoints share one fixed contract.\n * @see {@link BarInspectionRef}\n */\nexport function useBarInspection<D>(\n _inputs: Pick<BarSeriesProps<D>, \"data\" | \"category\">,\n): BarInspectionRef<D> {\n return useRenderedRef<readonly CapturedBarMark<D>[], BarRenderedSeries<D>>(\n \"barSeriesInspection\",\n (marks, geometry) =>\n Object.freeze({\n marks: Object.freeze(marks.slice()),\n assertLive: geometry.assertLive,\n localAtRoot: geometry.localAtRoot,\n anchorInsideClips: geometry.anchorInsideClips,\n }),\n );\n}\n\n/**\n * Finds the last-painted bar covering a root-logical point in this explicit series.\n * @param rendered - Borrowed committed categorical bar values and rectangle geometry.\n * @param options - Root-logical query point; respects every clip, fill/stroke and source order.\n * @returns Original record, category/group, endpoints and local bounds, or undefined for gaps and singular transforms.\n * @see {@link PaintedBarHit}\n */\nexport function paintedBarAt<D>(\n rendered: BarRenderedSeries<D>,\n options: { rootPoint: Readonly<RenderedSeriesPoint> },\n): PaintedBarHit<D> | undefined {\n rendered.assertLive();\n if (\n !Number.isFinite(options.rootPoint.x) ||\n !Number.isFinite(options.rootPoint.y)\n )\n throw new RangeError(\"paintedBarAt rootPoint must be finite.\");\n const point = rendered.localAtRoot(options.rootPoint);\n if (!point || !rendered.anchorInsideClips(point)) return undefined;\n for (let index = rendered.marks.length - 1; index >= 0; index--) {\n const mark = rendered.marks[index],\n b = mark.boundsLocal,\n half = mark.strokeWidthLocal / 2;\n const inside =\n point.x >= b.x &&\n point.x <= b.x + b.width &&\n point.y >= b.y &&\n point.y <= b.y + b.height;\n const outline =\n half > 0 &&\n point.x >= b.x - half &&\n point.x <= b.x + b.width + half &&\n point.y >= b.y - half &&\n point.y <= b.y + b.height + half &&\n !(\n point.x > b.x + half &&\n point.x < b.x + b.width - half &&\n point.y > b.y + half &&\n point.y < b.y + b.height - half\n );\n if (!((mark.fill && inside) || outline)) continue;\n const {\n datum,\n sourceIndex,\n category,\n group,\n valueStart,\n valueEnd,\n boundsLocal,\n } = mark;\n return Object.freeze({\n datum,\n sourceIndex,\n category,\n group,\n valueStart,\n valueEnd,\n boundsLocal,\n });\n }\n return undefined;\n}\n"],
5
+ "mappings": "AAIA,SAAS,sBAAsB;AAqExB,SAAS,iBACd,SACqB;AACrB,SAAO;AAAA,IACL;AAAA,IACA,CAAC,OAAO,aACN,OAAO,OAAO;AAAA,MACZ,OAAO,OAAO,OAAO,MAAM,MAAM,CAAC;AAAA,MAClC,YAAY,SAAS;AAAA,MACrB,aAAa,SAAS;AAAA,MACtB,mBAAmB,SAAS;AAAA,IAC9B,CAAC;AAAA,EACL;AACF;AASO,SAAS,aACd,UACA,SAC8B;AAC9B,WAAS,WAAW;AACpB,MACE,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC,KACpC,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC;AAEpC,UAAM,IAAI,WAAW,wCAAwC;AAC/D,QAAM,QAAQ,SAAS,YAAY,QAAQ,SAAS;AACpD,MAAI,CAAC,SAAS,CAAC,SAAS,kBAAkB,KAAK,EAAG,QAAO;AACzD,WAAS,QAAQ,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS;AAC/D,UAAM,OAAO,SAAS,MAAM,KAAK,GAC/B,IAAI,KAAK,aACT,OAAO,KAAK,mBAAmB;AACjC,UAAM,SACJ,MAAM,KAAK,EAAE,KACb,MAAM,KAAK,EAAE,IAAI,EAAE,SACnB,MAAM,KAAK,EAAE,KACb,MAAM,KAAK,EAAE,IAAI,EAAE;AACrB,UAAM,UACJ,OAAO,KACP,MAAM,KAAK,EAAE,IAAI,QACjB,MAAM,KAAK,EAAE,IAAI,EAAE,QAAQ,QAC3B,MAAM,KAAK,EAAE,IAAI,QACjB,MAAM,KAAK,EAAE,IAAI,EAAE,SAAS,QAC5B,EACE,MAAM,IAAI,EAAE,IAAI,QAChB,MAAM,IAAI,EAAE,IAAI,EAAE,QAAQ,QAC1B,MAAM,IAAI,EAAE,IAAI,QAChB,MAAM,IAAI,EAAE,IAAI,EAAE,SAAS;AAE/B,QAAI,EAAG,KAAK,QAAQ,UAAW,SAAU;AACzC,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI;AACJ,WAAO,OAAO,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }