@pibbl/core 0.0.2 → 0.0.3-alpha.109.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 (549) hide show
  1. package/THIRD_PARTY_NOTICES.txt +81 -0
  2. package/dist/features/physics/2d-testing.d.ts +1 -1
  3. package/dist/features/physics/2d-testing.js +2 -2
  4. package/dist/features/physics/2d-testing.js.map +2 -2
  5. package/dist/features/physics/lib/2d/canvas/components.js +25 -21
  6. package/dist/features/physics/lib/2d/canvas/components.js.map +2 -2
  7. package/dist/features/physics/lib/2d/canvas/presentation.js +1 -2
  8. package/dist/features/physics/lib/2d/canvas/presentation.js.map +2 -2
  9. package/dist/features/physics/lib/2d/collision/casts.js +4 -2
  10. package/dist/features/physics/lib/2d/collision/casts.js.map +2 -2
  11. package/dist/features/physics/lib/2d/runtime/controller.js +1 -1
  12. package/dist/features/physics/lib/2d/runtime/controller.js.map +2 -2
  13. package/dist/features/physics/lib/2d/runtime/obstacles.js +9 -11
  14. package/dist/features/physics/lib/2d/runtime/obstacles.js.map +2 -2
  15. package/dist/features/physics/lib/2d/shapes.js +8 -9
  16. package/dist/features/physics/lib/2d/shapes.js.map +2 -2
  17. package/dist/features/physics/lib/2d/world/rapier.js +22 -26
  18. package/dist/features/physics/lib/2d/world/rapier.js.map +2 -2
  19. package/dist/features/sprites/loader.js +6 -3
  20. package/dist/features/sprites/loader.js.map +2 -2
  21. package/dist/features/textures/index.d.ts +12 -2
  22. package/dist/features/textures/index.js +33 -1
  23. package/dist/features/textures/index.js.map +2 -2
  24. package/dist/features/textures/lib/chemical-field.d.ts +56 -0
  25. package/dist/features/textures/lib/chemical-field.js +154 -0
  26. package/dist/features/textures/lib/chemical-field.js.map +7 -0
  27. package/dist/features/textures/lib/chemical-recipes.d.ts +119 -0
  28. package/dist/features/textures/lib/chemical-recipes.js +275 -0
  29. package/dist/features/textures/lib/chemical-recipes.js.map +7 -0
  30. package/dist/features/textures/lib/definitions.d.ts +3 -18
  31. package/dist/features/textures/lib/definitions.js +17 -24
  32. package/dist/features/textures/lib/definitions.js.map +2 -2
  33. package/dist/features/textures/lib/geometric-patterns.d.ts +149 -0
  34. package/dist/features/textures/lib/geometric-patterns.js +305 -0
  35. package/dist/features/textures/lib/geometric-patterns.js.map +7 -0
  36. package/dist/features/textures/lib/gray-scott.d.ts +55 -0
  37. package/dist/features/textures/lib/gray-scott.js +37 -0
  38. package/dist/features/textures/lib/gray-scott.js.map +7 -0
  39. package/dist/features/textures/lib/palette.js +1 -3
  40. package/dist/features/textures/lib/palette.js.map +2 -2
  41. package/dist/features/textures/lib/patterns.d.ts +123 -0
  42. package/dist/features/textures/lib/patterns.js +344 -0
  43. package/dist/features/textures/lib/patterns.js.map +7 -0
  44. package/dist/features/textures/lib/rain-drops.js +2 -1
  45. package/dist/features/textures/lib/rain-drops.js.map +2 -2
  46. package/dist/features/textures/lib/reaction-diffusion.d.ts +3 -2
  47. package/dist/features/textures/lib/reaction-diffusion.js +9 -20
  48. package/dist/features/textures/lib/reaction-diffusion.js.map +2 -2
  49. package/dist/features/textures/lib/simulation.d.ts +10 -4
  50. package/dist/features/textures/lib/simulation.js +23 -13
  51. package/dist/features/textures/lib/simulation.js.map +2 -2
  52. package/dist/features/textures/lib/wasm/electric.js +8 -1
  53. package/dist/features/textures/lib/wasm/electric.js.map +2 -2
  54. package/dist/features/textures/lib/water-surface.js +1 -3
  55. package/dist/features/textures/lib/water-surface.js.map +2 -2
  56. package/dist/features/viz/index.d.ts +68 -6
  57. package/dist/features/viz/index.js +164 -2
  58. package/dist/features/viz/index.js.map +2 -2
  59. package/dist/features/viz/inspection/bar.d.ts +79 -0
  60. package/dist/features/viz/inspection/bar.js +49 -0
  61. package/dist/features/viz/inspection/bar.js.map +7 -0
  62. package/dist/features/viz/inspection/candle.d.ts +156 -0
  63. package/dist/features/viz/inspection/candle.js +120 -0
  64. package/dist/features/viz/inspection/candle.js.map +7 -0
  65. package/dist/features/viz/inspection/capture-types.d.ts +65 -0
  66. package/dist/features/viz/inspection/capture.d.ts +16 -0
  67. package/dist/features/viz/inspection/capture.js +49 -0
  68. package/dist/features/viz/inspection/capture.js.map +7 -0
  69. package/dist/features/viz/inspection/handler.d.ts +36 -0
  70. package/dist/features/viz/inspection/handler.js +91 -0
  71. package/dist/features/viz/inspection/handler.js.map +7 -0
  72. package/dist/features/viz/inspection/ohlc-bar.d.ts +132 -0
  73. package/dist/features/viz/inspection/ohlc-bar.js +118 -0
  74. package/dist/features/viz/inspection/ohlc-bar.js.map +7 -0
  75. package/dist/features/viz/inspection/owned-ref.d.ts +16 -0
  76. package/dist/features/viz/inspection/owned-ref.js +99 -0
  77. package/dist/features/viz/inspection/owned-ref.js.map +7 -0
  78. package/dist/features/viz/inspection/painted-point.d.ts +22 -0
  79. package/dist/features/viz/inspection/painted-point.js +29 -0
  80. package/dist/features/viz/inspection/painted-point.js.map +7 -0
  81. package/dist/features/viz/inspection/queries.d.ts +100 -0
  82. package/dist/features/viz/inspection/queries.js +192 -0
  83. package/dist/features/viz/inspection/queries.js.map +7 -0
  84. package/dist/features/viz/inspection/query-types.d.ts +177 -0
  85. package/dist/features/viz/inspection/volume.d.ts +104 -0
  86. package/dist/features/viz/inspection/volume.js +95 -0
  87. package/dist/features/viz/inspection/volume.js.map +7 -0
  88. package/dist/features/viz/inspection.d.ts +19 -0
  89. package/dist/features/viz/inspection.js +54 -0
  90. package/dist/features/viz/inspection.js.map +7 -0
  91. package/dist/features/viz/inspection.mjs +1 -0
  92. package/dist/features/viz/lib/area-series.d.ts +62 -0
  93. package/dist/features/viz/lib/area-series.js +120 -0
  94. package/dist/features/viz/lib/area-series.js.map +7 -0
  95. package/dist/features/viz/lib/axis-title.js +2 -1
  96. package/dist/features/viz/lib/axis-title.js.map +2 -2
  97. package/dist/features/viz/lib/axis.js +1 -1
  98. package/dist/features/viz/lib/axis.js.map +2 -2
  99. package/dist/features/viz/lib/bar-series.d.ts +3 -1
  100. package/dist/features/viz/lib/bar-series.js +16 -1
  101. package/dist/features/viz/lib/bar-series.js.map +2 -2
  102. package/dist/features/viz/lib/baseline-series.d.ts +55 -0
  103. package/dist/features/viz/lib/baseline-series.js +136 -0
  104. package/dist/features/viz/lib/baseline-series.js.map +7 -0
  105. package/dist/features/viz/lib/candlestick-series.d.ts +62 -0
  106. package/dist/features/viz/lib/candlestick-series.js +150 -0
  107. package/dist/features/viz/lib/candlestick-series.js.map +7 -0
  108. package/dist/features/viz/lib/censored-point-series.d.ts +71 -0
  109. package/dist/features/viz/lib/censored-point-series.js +129 -0
  110. package/dist/features/viz/lib/censored-point-series.js.map +7 -0
  111. package/dist/features/viz/lib/color-context.d.ts +4 -0
  112. package/dist/features/viz/lib/color-context.js +41 -0
  113. package/dist/features/viz/lib/color-context.js.map +7 -0
  114. package/dist/features/viz/lib/color-math.d.ts +4 -0
  115. package/dist/features/viz/lib/color-math.js +31 -0
  116. package/dist/features/viz/lib/color-math.js.map +7 -0
  117. package/dist/features/viz/lib/color-types.d.ts +53 -0
  118. package/dist/features/viz/lib/curve-definition.d.ts +49 -0
  119. package/dist/features/viz/lib/curve-definition.js +142 -0
  120. package/dist/features/viz/lib/curve-definition.js.map +7 -0
  121. package/dist/features/viz/lib/diverging-color-scale.d.ts +11 -0
  122. package/dist/features/viz/lib/diverging-color-scale.js +51 -0
  123. package/dist/features/viz/lib/diverging-color-scale.js.map +7 -0
  124. package/dist/features/viz/lib/domain-navigation.d.ts +40 -0
  125. package/dist/features/viz/lib/domain-navigation.js +77 -0
  126. package/dist/features/viz/lib/domain-navigation.js.map +7 -0
  127. package/dist/features/viz/lib/editable-chart-elements.d.ts +178 -0
  128. package/dist/features/viz/lib/editable-chart-elements.js +733 -0
  129. package/dist/features/viz/lib/editable-chart-elements.js.map +7 -0
  130. package/dist/features/viz/lib/financial-aggregation.d.ts +127 -0
  131. package/dist/features/viz/lib/financial-aggregation.js +116 -0
  132. package/dist/features/viz/lib/financial-aggregation.js.map +7 -0
  133. package/dist/features/viz/lib/financial-autoscale.d.ts +64 -0
  134. package/dist/features/viz/lib/financial-autoscale.js +61 -0
  135. package/dist/features/viz/lib/financial-autoscale.js.map +7 -0
  136. package/dist/features/viz/lib/financial-comparison.d.ts +62 -0
  137. package/dist/features/viz/lib/financial-comparison.js +98 -0
  138. package/dist/features/viz/lib/financial-comparison.js.map +7 -0
  139. package/dist/features/viz/lib/financial-geometry.d.ts +77 -0
  140. package/dist/features/viz/lib/financial-geometry.js +67 -0
  141. package/dist/features/viz/lib/financial-geometry.js.map +7 -0
  142. package/dist/features/viz/lib/financial-indicators.d.ts +114 -0
  143. package/dist/features/viz/lib/financial-indicators.js +135 -0
  144. package/dist/features/viz/lib/financial-indicators.js.map +7 -0
  145. package/dist/features/viz/lib/financial-oscillators.d.ts +171 -0
  146. package/dist/features/viz/lib/financial-oscillators.js +265 -0
  147. package/dist/features/viz/lib/financial-oscillators.js.map +7 -0
  148. package/dist/features/viz/lib/graph/bipartite.d.ts +14 -0
  149. package/dist/features/viz/lib/graph/bipartite.js +250 -0
  150. package/dist/features/viz/lib/graph/bipartite.js.map +7 -0
  151. package/dist/features/viz/lib/graph/chord.d.ts +44 -0
  152. package/dist/features/viz/lib/graph/chord.js +348 -0
  153. package/dist/features/viz/lib/graph/chord.js.map +7 -0
  154. package/dist/features/viz/lib/graph/dependency.d.ts +26 -0
  155. package/dist/features/viz/lib/graph/dependency.js +140 -0
  156. package/dist/features/viz/lib/graph/dependency.js.map +7 -0
  157. package/dist/features/viz/lib/graph/force.d.ts +28 -0
  158. package/dist/features/viz/lib/graph/force.js +580 -0
  159. package/dist/features/viz/lib/graph/force.js.map +7 -0
  160. package/dist/features/viz/lib/graph/hierarchy.d.ts +21 -0
  161. package/dist/features/viz/lib/graph/hierarchy.js +112 -0
  162. package/dist/features/viz/lib/graph/hierarchy.js.map +7 -0
  163. package/dist/features/viz/lib/graph/icicle.d.ts +16 -0
  164. package/dist/features/viz/lib/graph/icicle.js +153 -0
  165. package/dist/features/viz/lib/graph/icicle.js.map +7 -0
  166. package/dist/features/viz/lib/graph/matrix.d.ts +30 -0
  167. package/dist/features/viz/lib/graph/matrix.js +243 -0
  168. package/dist/features/viz/lib/graph/matrix.js.map +7 -0
  169. package/dist/features/viz/lib/graph/neighborhood.d.ts +11 -0
  170. package/dist/features/viz/lib/graph/neighborhood.js +281 -0
  171. package/dist/features/viz/lib/graph/neighborhood.js.map +7 -0
  172. package/dist/features/viz/lib/graph/routes.d.ts +35 -0
  173. package/dist/features/viz/lib/graph/routes.js +101 -0
  174. package/dist/features/viz/lib/graph/routes.js.map +7 -0
  175. package/dist/features/viz/lib/graph/sankey.d.ts +44 -0
  176. package/dist/features/viz/lib/graph/sankey.js +341 -0
  177. package/dist/features/viz/lib/graph/sankey.js.map +7 -0
  178. package/dist/features/viz/lib/graph/shared.d.ts +59 -0
  179. package/dist/features/viz/lib/graph/shared.js +301 -0
  180. package/dist/features/viz/lib/graph/shared.js.map +7 -0
  181. package/dist/features/viz/lib/graph/tree.d.ts +11 -0
  182. package/dist/features/viz/lib/graph/tree.js +232 -0
  183. package/dist/features/viz/lib/graph/tree.js.map +7 -0
  184. package/dist/features/viz/lib/graph/treemap.d.ts +20 -0
  185. package/dist/features/viz/lib/graph/treemap.js +227 -0
  186. package/dist/features/viz/lib/graph/treemap.js.map +7 -0
  187. package/dist/features/viz/lib/graph/types.d.ts +1097 -0
  188. package/dist/features/viz/lib/hover-card.js +8 -9
  189. package/dist/features/viz/lib/hover-card.js.map +2 -2
  190. package/dist/features/viz/lib/hover-data.d.ts +1 -1
  191. package/dist/features/viz/lib/hover-data.js +5 -2
  192. package/dist/features/viz/lib/hover-data.js.map +2 -2
  193. package/dist/features/viz/lib/interval-band-series.d.ts +49 -0
  194. package/dist/features/viz/lib/interval-band-series.js +136 -0
  195. package/dist/features/viz/lib/interval-band-series.js.map +7 -0
  196. package/dist/features/viz/lib/interval-diamond-series.d.ts +43 -0
  197. package/dist/features/viz/lib/interval-diamond-series.js +122 -0
  198. package/dist/features/viz/lib/interval-diamond-series.js.map +7 -0
  199. package/dist/features/viz/lib/interval-series.d.ts +79 -0
  200. package/dist/features/viz/lib/interval-series.js +158 -0
  201. package/dist/features/viz/lib/interval-series.js.map +7 -0
  202. package/dist/features/viz/lib/layout-pie.js +9 -13
  203. package/dist/features/viz/lib/layout-pie.js.map +2 -2
  204. package/dist/features/viz/lib/line-series.d.ts +1 -1
  205. package/dist/features/viz/lib/line-series.js +47 -28
  206. package/dist/features/viz/lib/line-series.js.map +2 -2
  207. package/dist/features/viz/lib/linear-scale.js +1 -1
  208. package/dist/features/viz/lib/linear-scale.js.map +2 -2
  209. package/dist/features/viz/lib/monotone-curve.d.ts +11 -0
  210. package/dist/features/viz/lib/monotone-curve.js +63 -0
  211. package/dist/features/viz/lib/monotone-curve.js.map +7 -0
  212. package/dist/features/viz/lib/numeric-range-interpolation.d.ts +15 -0
  213. package/dist/features/viz/lib/numeric-range-interpolation.js +36 -0
  214. package/dist/features/viz/lib/numeric-range-interpolation.js.map +7 -0
  215. package/dist/features/viz/lib/ohlc-bar-series.d.ts +55 -0
  216. package/dist/features/viz/lib/ohlc-bar-series.js +168 -0
  217. package/dist/features/viz/lib/ohlc-bar-series.js.map +7 -0
  218. package/dist/features/viz/lib/paired-series.d.ts +44 -0
  219. package/dist/features/viz/lib/paired-series.js +93 -0
  220. package/dist/features/viz/lib/paired-series.js.map +7 -0
  221. package/dist/features/viz/lib/pie-layout.js +2 -1
  222. package/dist/features/viz/lib/pie-layout.js.map +2 -2
  223. package/dist/features/viz/lib/plot-series.js +11 -6
  224. package/dist/features/viz/lib/plot-series.js.map +2 -2
  225. package/dist/features/viz/lib/plot-types.d.ts +4 -3
  226. package/dist/features/viz/lib/point-series.d.ts +1 -1
  227. package/dist/features/viz/lib/point-series.js +36 -9
  228. package/dist/features/viz/lib/point-series.js.map +2 -2
  229. package/dist/features/viz/lib/point-types.d.ts +5 -2
  230. package/dist/features/viz/lib/reference-band.js +4 -1
  231. package/dist/features/viz/lib/reference-band.js.map +2 -2
  232. package/dist/features/viz/lib/scale-context.d.ts +1 -1
  233. package/dist/features/viz/lib/scale-ticks.js +21 -6
  234. package/dist/features/viz/lib/scale-ticks.js.map +2 -2
  235. package/dist/features/viz/lib/sequential-color-scale.d.ts +11 -0
  236. package/dist/features/viz/lib/sequential-color-scale.js +49 -0
  237. package/dist/features/viz/lib/sequential-color-scale.js.map +7 -0
  238. package/dist/features/viz/lib/series-position.d.ts +12 -0
  239. package/dist/features/viz/lib/series-position.js +44 -0
  240. package/dist/features/viz/lib/series-position.js.map +7 -0
  241. package/dist/features/viz/lib/step-curves.d.ts +19 -0
  242. package/dist/features/viz/lib/step-curves.js +53 -0
  243. package/dist/features/viz/lib/step-curves.js.map +7 -0
  244. package/dist/features/viz/lib/threshold-color-scale.d.ts +43 -0
  245. package/dist/features/viz/lib/threshold-color-scale.js +59 -0
  246. package/dist/features/viz/lib/threshold-color-scale.js.map +7 -0
  247. package/dist/features/viz/lib/trading-time-mapping.d.ts +32 -0
  248. package/dist/features/viz/lib/trading-time-mapping.js +89 -0
  249. package/dist/features/viz/lib/trading-time-mapping.js.map +7 -0
  250. package/dist/features/viz/lib/trading-time-scale.d.ts +83 -0
  251. package/dist/features/viz/lib/trading-time-scale.js +96 -0
  252. package/dist/features/viz/lib/trading-time-scale.js.map +7 -0
  253. package/dist/features/viz/lib/trajectory-series.d.ts +71 -0
  254. package/dist/features/viz/lib/trajectory-series.js +111 -0
  255. package/dist/features/viz/lib/trajectory-series.js.map +7 -0
  256. package/dist/features/viz/lib/types.d.ts +20 -4
  257. package/dist/features/viz/lib/use-continuous-scale.js +6 -1
  258. package/dist/features/viz/lib/use-continuous-scale.js.map +2 -2
  259. package/dist/features/viz/lib/utc-scale.js +11 -10
  260. package/dist/features/viz/lib/utc-scale.js.map +2 -2
  261. package/dist/features/viz/lib/volume-series.d.ts +59 -0
  262. package/dist/features/viz/lib/volume-series.js +117 -0
  263. package/dist/features/viz/lib/volume-series.js.map +7 -0
  264. package/dist/features/viz/lib/weighted-point-series.d.ts +71 -0
  265. package/dist/features/viz/lib/weighted-point-series.js +169 -0
  266. package/dist/features/viz/lib/weighted-point-series.js.map +7 -0
  267. package/dist/filters/backdrop-contrast-gpu.d.ts +5 -0
  268. package/dist/filters/backdrop-contrast-gpu.js +33 -0
  269. package/dist/filters/backdrop-contrast-gpu.js.map +7 -0
  270. package/dist/filters/backdrop-contrast.d.ts +21 -0
  271. package/dist/filters/backdrop-contrast.js +61 -0
  272. package/dist/filters/backdrop-contrast.js.map +7 -0
  273. package/dist/filters/displacement.js +1 -1
  274. package/dist/filters/displacement.js.map +2 -2
  275. package/dist/filters/emboss-gpu.d.ts +4 -0
  276. package/dist/filters/emboss-gpu.js +39 -0
  277. package/dist/filters/emboss-gpu.js.map +7 -0
  278. package/dist/filters/emboss.d.ts +32 -0
  279. package/dist/filters/emboss.js +104 -0
  280. package/dist/filters/emboss.js.map +7 -0
  281. package/dist/filters/filter-executor.d.ts +11 -4
  282. package/dist/filters/filter-executor.js +104 -49
  283. package/dist/filters/filter-executor.js.map +2 -2
  284. package/dist/filters/reflected-light.js +1 -1
  285. package/dist/filters/reflected-light.js.map +2 -2
  286. package/dist/filters/reflection-gpu.d.ts +3 -1
  287. package/dist/filters/reflection-gpu.js +5 -2
  288. package/dist/filters/reflection-gpu.js.map +2 -2
  289. package/dist/filters/render-backdrop-contrast-boundary.d.ts +31 -0
  290. package/dist/filters/render-backdrop-contrast-boundary.js +116 -0
  291. package/dist/filters/render-backdrop-contrast-boundary.js.map +7 -0
  292. package/dist/filters/render-emboss-boundary.d.ts +13 -0
  293. package/dist/filters/render-emboss-boundary.js +131 -0
  294. package/dist/filters/render-emboss-boundary.js.map +7 -0
  295. package/dist/filters.d.ts +9 -5
  296. package/dist/filters.js +4 -0
  297. package/dist/filters.js.map +2 -2
  298. package/dist/index.d.ts +9 -5
  299. package/dist/index.js +18 -2
  300. package/dist/index.js.map +2 -2
  301. package/dist/internal.d.ts +4 -0
  302. package/dist/internal.js +6 -0
  303. package/dist/internal.js.map +2 -2
  304. package/dist/layout-kernel.d.ts +12 -0
  305. package/dist/layout-kernel.js +11 -0
  306. package/dist/layout-kernel.js.map +7 -0
  307. package/dist/layout-kernel.mjs +1 -0
  308. package/dist/lib/backend/types.d.ts +13 -1
  309. package/dist/lib/backend/types.js.map +2 -2
  310. package/dist/lib/components/arc-geometry.js +2 -1
  311. package/dist/lib/components/arc-geometry.js.map +2 -2
  312. package/dist/lib/components/g.js +2 -0
  313. package/dist/lib/components/g.js.map +2 -2
  314. package/dist/lib/components/html-box.js +2 -1
  315. package/dist/lib/components/html-box.js.map +2 -2
  316. package/dist/lib/components/img.js +3 -3
  317. package/dist/lib/components/img.js.map +2 -2
  318. package/dist/lib/components/layer.js +98 -16
  319. package/dist/lib/components/layer.js.map +3 -3
  320. package/dist/lib/components/text.d.ts +16 -0
  321. package/dist/lib/components/text.js +131 -24
  322. package/dist/lib/components/text.js.map +2 -2
  323. package/dist/lib/define-primitive.d.ts +4 -2
  324. package/dist/lib/define-primitive.js +3 -1
  325. package/dist/lib/define-primitive.js.map +2 -2
  326. package/dist/lib/element/metadata.d.ts +9 -0
  327. package/dist/lib/element/metadata.js +19 -0
  328. package/dist/lib/element/metadata.js.map +2 -2
  329. package/dist/lib/element/resolve-primitive-inputs.d.ts +2 -0
  330. package/dist/lib/element/resolve-primitive-inputs.js +17 -4
  331. package/dist/lib/element/resolve-primitive-inputs.js.map +2 -2
  332. package/dist/lib/events/event-facade.d.ts +18 -0
  333. package/dist/lib/events/event-facade.js +28 -2
  334. package/dist/lib/events/event-facade.js.map +2 -2
  335. package/dist/lib/events/hit-test.js +2 -1
  336. package/dist/lib/events/hit-test.js.map +2 -2
  337. package/dist/lib/events/propagation.d.ts +2 -1
  338. package/dist/lib/events/propagation.js +22 -16
  339. package/dist/lib/events/propagation.js.map +2 -2
  340. package/dist/lib/events/registrations.d.ts +10 -0
  341. package/dist/lib/events/registrations.js +160 -5
  342. package/dist/lib/events/registrations.js.map +2 -2
  343. package/dist/lib/execute-render.js +25 -1
  344. package/dist/lib/execute-render.js.map +2 -2
  345. package/dist/lib/filter/filter-region.js +3 -10
  346. package/dist/lib/filter/filter-region.js.map +2 -2
  347. package/dist/lib/focus/focus-manager.d.ts +8 -1
  348. package/dist/lib/focus/focus-manager.js +87 -43
  349. package/dist/lib/focus/focus-manager.js.map +2 -2
  350. package/dist/lib/focus/geometry.d.ts +2 -0
  351. package/dist/lib/focus/geometry.js +6 -0
  352. package/dist/lib/focus/geometry.js.map +2 -2
  353. package/dist/lib/geometry/path-bend-guide.js +1 -1
  354. package/dist/lib/geometry/path-bend-guide.js.map +2 -2
  355. package/dist/lib/geometry/path-geometry.js +12 -11
  356. package/dist/lib/geometry/path-geometry.js.map +2 -2
  357. package/dist/lib/geometry/path-transforms.js +17 -21
  358. package/dist/lib/geometry/path-transforms.js.map +2 -2
  359. package/dist/lib/geometry/path-warp-bezier.js +3 -1
  360. package/dist/lib/geometry/path-warp-bezier.js.map +2 -2
  361. package/dist/lib/geometry/path-warp.js +1 -1
  362. package/dist/lib/geometry/path-warp.js.map +2 -2
  363. package/dist/lib/global-state.js +2 -0
  364. package/dist/lib/global-state.js.map +2 -2
  365. package/dist/lib/html/html-events.d.ts +32 -0
  366. package/dist/lib/html/html-events.js +179 -0
  367. package/dist/lib/html/html-events.js.map +7 -0
  368. package/dist/lib/html/html-service.d.ts +8 -2
  369. package/dist/lib/html/html-service.js +198 -65
  370. package/dist/lib/html/html-service.js.map +2 -2
  371. package/dist/lib/html/overlay-config.js +7 -6
  372. package/dist/lib/html/overlay-config.js.map +2 -2
  373. package/dist/lib/html/types.d.ts +29 -2
  374. package/dist/lib/layout/absolute.d.ts +11 -5
  375. package/dist/lib/layout/absolute.js +329 -55
  376. package/dist/lib/layout/absolute.js.map +3 -3
  377. package/dist/lib/layout/allocation-checkpoint-owner.d.ts +11 -0
  378. package/dist/lib/layout/allocation-checkpoint-owner.js +86 -0
  379. package/dist/lib/layout/allocation-checkpoint-owner.js.map +7 -0
  380. package/dist/lib/layout/allocation-checkpoint.d.ts +53 -0
  381. package/dist/lib/layout/allocation-checkpoint.js +463 -0
  382. package/dist/lib/layout/allocation-checkpoint.js.map +7 -0
  383. package/dist/lib/layout/allocation-dependencies.d.ts +30 -0
  384. package/dist/lib/layout/allocation-dependencies.js +90 -0
  385. package/dist/lib/layout/allocation-dependencies.js.map +7 -0
  386. package/dist/lib/layout/allocation-revision.d.ts +13 -0
  387. package/dist/lib/layout/allocation-revision.js +67 -0
  388. package/dist/lib/layout/allocation-revision.js.map +7 -0
  389. package/dist/lib/layout/box-insets.d.ts +17 -0
  390. package/dist/lib/layout/box-insets.js +138 -0
  391. package/dist/lib/layout/box-insets.js.map +7 -0
  392. package/dist/lib/layout/box-sizing.d.ts +16 -0
  393. package/dist/lib/layout/box-sizing.js +77 -0
  394. package/dist/lib/layout/box-sizing.js.map +7 -0
  395. package/dist/lib/layout/box.js +42 -12
  396. package/dist/lib/layout/box.js.map +2 -2
  397. package/dist/lib/layout/canvas-measurement.d.ts +13 -0
  398. package/dist/lib/layout/canvas-measurement.js +57 -0
  399. package/dist/lib/layout/canvas-measurement.js.map +7 -0
  400. package/dist/lib/layout/context.d.ts +35 -6
  401. package/dist/lib/layout/context.js +72 -3
  402. package/dist/lib/layout/context.js.map +2 -2
  403. package/dist/lib/layout/define-layout-component.d.ts +23 -0
  404. package/dist/lib/layout/define-layout-component.js +84 -0
  405. package/dist/lib/layout/define-layout-component.js.map +7 -0
  406. package/dist/lib/layout/flex-allocation-cache.d.ts +42 -0
  407. package/dist/lib/layout/flex-baseline-mode.d.ts +2 -0
  408. package/dist/lib/layout/flex-baseline-mode.js +7 -0
  409. package/dist/lib/layout/flex-baseline-mode.js.map +7 -0
  410. package/dist/lib/layout/flex.d.ts +50 -15
  411. package/dist/lib/layout/flex.js +2124 -195
  412. package/dist/lib/layout/flex.js.map +3 -3
  413. package/dist/lib/layout/flow.js +225 -49
  414. package/dist/lib/layout/flow.js.map +2 -2
  415. package/dist/lib/layout/geometry-publication.d.ts +53 -0
  416. package/dist/lib/layout/geometry-publication.js +244 -0
  417. package/dist/lib/layout/geometry-publication.js.map +7 -0
  418. package/dist/lib/layout/grid-kernel.d.ts +63 -0
  419. package/dist/lib/layout/grid-kernel.js +168 -0
  420. package/dist/lib/layout/grid-kernel.js.map +7 -0
  421. package/dist/lib/layout/grid.d.ts +63 -4
  422. package/dist/lib/layout/grid.js +767 -171
  423. package/dist/lib/layout/grid.js.map +3 -3
  424. package/dist/lib/layout/measure.d.ts +55 -3
  425. package/dist/lib/layout/measure.js +448 -15
  426. package/dist/lib/layout/measure.js.map +2 -2
  427. package/dist/lib/layout/overlay.js +81 -23
  428. package/dist/lib/layout/overlay.js.map +2 -2
  429. package/dist/lib/layout/participation.d.ts +27 -0
  430. package/dist/lib/layout/participation.js +188 -0
  431. package/dist/lib/layout/participation.js.map +7 -0
  432. package/dist/lib/layout/place-child.js +1 -1
  433. package/dist/lib/layout/place-child.js.map +2 -2
  434. package/dist/lib/layout/positioning-diagnostics.d.ts +1 -1
  435. package/dist/lib/layout/positioning-diagnostics.js +13 -2
  436. package/dist/lib/layout/positioning-diagnostics.js.map +2 -2
  437. package/dist/lib/layout/prepared-root.d.ts +121 -0
  438. package/dist/lib/layout/prepared-root.js +360 -0
  439. package/dist/lib/layout/prepared-root.js.map +7 -0
  440. package/dist/lib/layout/standalone-kernel.d.ts +60 -0
  441. package/dist/lib/layout/standalone-kernel.js +722 -0
  442. package/dist/lib/layout/standalone-kernel.js.map +7 -0
  443. package/dist/lib/layout/topology.d.ts +21 -0
  444. package/dist/lib/layout/topology.js +113 -0
  445. package/dist/lib/layout/topology.js.map +7 -0
  446. package/dist/lib/layout/types.d.ts +5 -0
  447. package/dist/lib/layout/wasm/artifact.d.ts +1 -0
  448. package/dist/lib/layout/wasm/artifact.js +5 -0
  449. package/dist/lib/layout/wasm/artifact.js.map +7 -0
  450. package/dist/lib/layout/wasm/bytes.d.ts +1 -0
  451. package/dist/lib/layout/wasm/bytes.js +5 -0
  452. package/dist/lib/layout/wasm/bytes.js.map +7 -0
  453. package/dist/lib/layout/wasm/embedded.d.ts +2 -0
  454. package/dist/lib/layout/wasm/embedded.js +12 -0
  455. package/dist/lib/layout/wasm/embedded.js.map +7 -0
  456. package/dist/lib/layout/wasm/layout.wasm +0 -0
  457. package/dist/lib/layout/wasm/module.d.ts +8 -0
  458. package/dist/lib/layout/wasm/module.js +70 -0
  459. package/dist/lib/layout/wasm/module.js.map +7 -0
  460. package/dist/lib/layout/wasm/region.d.ts +267 -0
  461. package/dist/lib/layout/wasm/region.js +1018 -0
  462. package/dist/lib/layout/wasm/region.js.map +7 -0
  463. package/dist/lib/manipulation/controller.js +4 -7
  464. package/dist/lib/manipulation/controller.js.map +2 -2
  465. package/dist/lib/manipulation/frame.js +1 -1
  466. package/dist/lib/manipulation/frame.js.map +2 -2
  467. package/dist/lib/manipulation/handles.js +32 -33
  468. package/dist/lib/manipulation/handles.js.map +2 -2
  469. package/dist/lib/manipulation/solve.js +12 -10
  470. package/dist/lib/manipulation/solve.js.map +2 -2
  471. package/dist/lib/mount-pibbl.js +1 -0
  472. package/dist/lib/mount-pibbl.js.map +2 -2
  473. package/dist/lib/mount-prepared-pibbl.d.ts +5 -0
  474. package/dist/lib/mount-prepared-pibbl.js +29 -0
  475. package/dist/lib/mount-prepared-pibbl.js.map +7 -0
  476. package/dist/lib/mount-request.d.ts +8 -0
  477. package/dist/lib/mount-request.js +41 -0
  478. package/dist/lib/mount-request.js.map +7 -0
  479. package/dist/lib/pibbl.d.ts +21 -13
  480. package/dist/lib/pibbl.js +18 -16
  481. package/dist/lib/pibbl.js.map +2 -2
  482. package/dist/lib/recording/recording.d.ts +43 -0
  483. package/dist/lib/recording/recording.js +555 -0
  484. package/dist/lib/recording/recording.js.map +7 -0
  485. package/dist/lib/recording/types.d.ts +118 -0
  486. package/dist/lib/recording/wasm-bytes.d.ts +1 -0
  487. package/dist/lib/recording/wasm-bytes.js +5 -0
  488. package/dist/lib/recording/wasm-bytes.js.map +7 -0
  489. package/dist/lib/recording/worker-source.d.ts +1 -0
  490. package/dist/lib/recording/worker-source.js +5 -0
  491. package/dist/lib/recording/worker-source.js.map +7 -0
  492. package/dist/lib/render-layer/controller.d.ts +9 -3
  493. package/dist/lib/render-layer/controller.js +259 -110
  494. package/dist/lib/render-layer/controller.js.map +2 -2
  495. package/dist/lib/render-transaction.d.ts +12 -2
  496. package/dist/lib/render-transaction.js +69 -1
  497. package/dist/lib/render-transaction.js.map +2 -2
  498. package/dist/lib/render.js +32 -8
  499. package/dist/lib/render.js.map +2 -2
  500. package/dist/lib/scheduler/realm-scheduler.d.ts +2 -0
  501. package/dist/lib/scheduler/realm-scheduler.js +55 -26
  502. package/dist/lib/scheduler/realm-scheduler.js.map +2 -2
  503. package/dist/lib/scheduler/renderer-participant.js +1 -0
  504. package/dist/lib/scheduler/renderer-participant.js.map +2 -2
  505. package/dist/lib/series-inspection-frame.d.ts +18 -0
  506. package/dist/lib/series-inspection-frame.js +70 -0
  507. package/dist/lib/series-inspection-frame.js.map +7 -0
  508. package/dist/lib/signals/edge.d.ts +7 -4
  509. package/dist/lib/signals/edge.js +25 -3
  510. package/dist/lib/signals/edge.js.map +2 -2
  511. package/dist/lib/signals/graph.d.ts +16 -2
  512. package/dist/lib/signals/graph.js +54 -12
  513. package/dist/lib/signals/graph.js.map +2 -2
  514. package/dist/lib/signals/input-provision.d.ts +15 -0
  515. package/dist/lib/signals/input-provision.js +53 -3
  516. package/dist/lib/signals/input-provision.js.map +2 -2
  517. package/dist/lib/signals/render-consumer.d.ts +3 -0
  518. package/dist/lib/signals/render-consumer.js +22 -14
  519. package/dist/lib/signals/render-consumer.js.map +2 -2
  520. package/dist/lib/style/positioning.d.ts +50 -2
  521. package/dist/lib/style/positioning.js +28 -4
  522. package/dist/lib/style/positioning.js.map +2 -2
  523. package/dist/lib/style/resolve-built-in.d.ts +4 -3
  524. package/dist/lib/style/resolve-built-in.js +17 -3
  525. package/dist/lib/style/resolve-built-in.js.map +2 -2
  526. package/dist/lib/style/resolve-dispatch.d.ts +3 -0
  527. package/dist/lib/style/resolve-dispatch.js +77 -4
  528. package/dist/lib/style/resolve-dispatch.js.map +2 -2
  529. package/dist/lib/style/resolve-length.d.ts +2 -0
  530. package/dist/lib/style/resolve-length.js +13 -9
  531. package/dist/lib/style/resolve-length.js.map +2 -2
  532. package/dist/lib/style/sizing-length.d.ts +51 -0
  533. package/dist/lib/style/sizing-length.js +77 -0
  534. package/dist/lib/style/sizing-length.js.map +7 -0
  535. package/dist/lib/style/types.d.ts +63 -25
  536. package/dist/lib/surface/root-surface.js +10 -6
  537. package/dist/lib/surface/root-surface.js.map +2 -2
  538. package/dist/lib/textures/texture.js +10 -8
  539. package/dist/lib/textures/texture.js.map +2 -2
  540. package/dist/lib/transitions/capture.js +4 -1
  541. package/dist/lib/transitions/capture.js.map +2 -2
  542. package/dist/lib/transitions/embers-physics.js +17 -10
  543. package/dist/lib/transitions/embers-physics.js.map +2 -2
  544. package/dist/lib/types.d.ts +110 -1
  545. package/dist/sync.d.ts +16 -0
  546. package/dist/sync.js +13 -0
  547. package/dist/sync.js.map +7 -0
  548. package/dist/sync.mjs +1 -0
  549. package/package.json +26 -3
@@ -0,0 +1,95 @@
1
+ import {
2
+ invertNumericPosition
3
+ } from "../lib/series-position.js";
4
+ import { useRenderedRef } from "./owned-ref.js";
5
+ import { nearestRecordedX } from "./queries.js";
6
+ function useVolumeInspection(_inputs) {
7
+ return useRenderedRef("volumeInspection", (candidate, geometry) => {
8
+ const observations = Object.freeze(
9
+ candidate.marks.map(
10
+ (mark) => Object.freeze({
11
+ datum: mark.datum,
12
+ sourceIndex: mark.sourceIndex,
13
+ time: mark.time,
14
+ volume: mark.volume,
15
+ baseline: mark.baseline,
16
+ anchorLocal: mark.anchorLocal,
17
+ anchorRoot: geometry.rootAtLocal(mark.anchorLocal),
18
+ boundsLocal: mark.boundsLocal
19
+ })
20
+ )
21
+ );
22
+ const numeric = Object.freeze({
23
+ observations: Object.freeze(
24
+ observations.map(
25
+ (row) => Object.freeze({
26
+ ...row,
27
+ domainX: row.time,
28
+ domainY: row.volume,
29
+ run: 0
30
+ })
31
+ )
32
+ ),
33
+ assertLive: geometry.assertLive,
34
+ domainXAtRoot(point) {
35
+ const local = geometry.localAtRoot(point);
36
+ return local ? invertNumericPosition(candidate.xScale, local.x) : void 0;
37
+ },
38
+ anchorInsideClips: geometry.anchorInsideClips,
39
+ anchorAtDomain(point) {
40
+ geometry.assertLive();
41
+ const anchorLocal = Object.freeze({
42
+ x: candidate.xScale.map(point.domainX),
43
+ y: candidate.yScale.map(point.domainY)
44
+ });
45
+ return Object.freeze({
46
+ anchorLocal,
47
+ anchorRoot: geometry.rootAtLocal(anchorLocal)
48
+ });
49
+ }
50
+ });
51
+ return Object.freeze({
52
+ observations,
53
+ marks: Object.freeze(candidate.marks.slice()),
54
+ numeric,
55
+ assertLive: geometry.assertLive,
56
+ localAtRoot: geometry.localAtRoot,
57
+ anchorInsideClips: geometry.anchorInsideClips,
58
+ timeAtRoot: numeric.domainXAtRoot
59
+ });
60
+ });
61
+ }
62
+ function nearestRecordedVolumeX(rendered, options) {
63
+ const hit = nearestRecordedX(rendered.numeric, {
64
+ domainX: options.time,
65
+ filter: options.filter ? (candidate) => options.filter(
66
+ candidate
67
+ ) : void 0
68
+ });
69
+ if (!hit) return void 0;
70
+ const row = rendered.observations.find(
71
+ (row2) => row2.sourceIndex === hit.sourceIndex
72
+ );
73
+ return Object.freeze({ ...row, timeDelta: hit.domainDelta });
74
+ }
75
+ function paintedVolumeAt(rendered, options) {
76
+ rendered.assertLive();
77
+ if (!Number.isFinite(options.rootPoint.x) || !Number.isFinite(options.rootPoint.y))
78
+ throw new RangeError("paintedVolumeAt rootPoint must be finite.");
79
+ const p = rendered.localAtRoot(options.rootPoint);
80
+ if (!p || !rendered.anchorInsideClips(p)) return void 0;
81
+ for (let i = rendered.marks.length - 1; i >= 0; i--) {
82
+ const mark = rendered.marks[i], b = mark.boundsLocal, h = mark.strokeWidthLocal / 2;
83
+ if (b.height === 0) continue;
84
+ const inside = p.x >= b.x && p.x <= b.x + b.width && p.y >= b.y && p.y <= b.y + b.height;
85
+ const outline = h > 0 && p.x >= b.x - h && p.x <= b.x + b.width + h && p.y >= b.y - h && p.y <= b.y + b.height + h && !(p.x > b.x + h && p.x < b.x + b.width - h && p.y > b.y + h && p.y < b.y + b.height - h);
86
+ if (mark.fill && inside || outline) return rendered.observations[i];
87
+ }
88
+ return void 0;
89
+ }
90
+ export {
91
+ nearestRecordedVolumeX,
92
+ paintedVolumeAt,
93
+ useVolumeInspection
94
+ };
95
+ //# sourceMappingURL=volume.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/features/viz/inspection/volume.ts"],
4
+ "sourcesContent": ["import {\n invertNumericPosition,\n type NumericPositionScale,\n} from \"../lib/series-position.js\";\nimport type { LayoutBox } from \"@pibbl/core\";\nimport type { VolumeSeriesProps } from \"../lib/volume-series.js\";\nimport type { ResolvedContinuousScale } from \"../lib/types.js\";\nimport type {\n RenderedSeriesPoint,\n NumericRenderedSeries,\n} from \"./query-types.js\";\nimport { useRenderedRef } from \"./owned-ref.js\";\nimport { nearestRecordedX } from \"./queries.js\";\n\n/** One original volume record and the values/geometry evaluated during paint.\n * @see {@link useVolumeInspection}\n */\nexport interface VolumeObservation<D> {\n /** Caller-owned original record. */ readonly datum: D;\n /** Original index including skipped rows. */ readonly sourceIndex: number;\n /** Evaluated UTC milliseconds. */ readonly time: number;\n /** Evaluated nonnegative volume. */ readonly volume: number;\n /** Zero-volume baseline. */ readonly baseline: 0;\n /** Volume endpoint in series-local logical coordinates. */ readonly anchorLocal: Readonly<RenderedSeriesPoint>;\n /** Volume endpoint in root-logical coordinates. */ readonly anchorRoot: Readonly<RenderedSeriesPoint>;\n /** Column bounds in series-local logical coordinates. */ readonly boundsLocal: Readonly<LayoutBox>;\n}\n/** A nearest-time candidate with an explicit optional clip predicate.\n * @see {@link useVolumeInspection}\n */\nexport interface VolumeInspectionCandidate<D> extends VolumeObservation<D> {\n /** @returns Whether the endpoint lies inside every committed clip. */ anchorInsideClips(): boolean;\n}\n/** A recorded volume selected by timestamp proximity.\n * @see {@link useVolumeInspection}\n */\nexport interface NearestVolumeHit<D> extends VolumeObservation<D> {\n /** Absolute UTC-millisecond distance from the requested time. */ readonly timeDelta: number;\n}\n/** A recorded volume whose painted column covers the query point.\n * @see {@link useVolumeInspection}\n */\nexport interface PaintedVolumeHit<D> extends VolumeObservation<D> {}\n/** @internal Immutable local renderer capture, without queries or transformed allocation.\n * @see {@link useVolumeInspection}\n */\nexport interface CapturedVolumeMark<D> extends Omit<\n VolumeObservation<D>,\n \"anchorRoot\"\n> {\n /** Whether the rectangle paints its interior. */ readonly fill: boolean;\n /** Outline width when painted, zero otherwise. */ readonly strokeWidthLocal: number;\n}\n/** Borrowed committed volume values; expires after a new root generation or disposal.\n * @see {@link useVolumeInspection}\n */\nexport interface VolumeRenderedSeries<D> {\n /** Original observations and evaluated values in source order. */ readonly observations: readonly VolumeObservation<D>[];\n /** Throws when borrowed values are stale or disposed. */ assertLive(): void;\n /** Inverts a root-logical point to UTC milliseconds.\n * @param pointRoot - Root-logical Canvas position.\n * @returns Timestamp or undefined for unavailable inversion.\n */ timeAtRoot(pointRoot: Readonly<RenderedSeriesPoint>): number | undefined;\n /** Tests a local point against the committed clip stack.\n * @param pointLocal - Series-local position.\n * @returns Whether every clip includes it.\n */ anchorInsideClips(pointLocal: Readonly<RenderedSeriesPoint>): boolean;\n /** @internal Committed paint flags. */ readonly marks: readonly CapturedVolumeMark<D>[];\n /** @internal Shared numeric query view. */ readonly numeric: NumericRenderedSeries<D>;\n /** @internal Converts root coordinates to local coordinates.\n * @param point - Root-logical position.\n * @returns Local position or undefined for a singular transform.\n */ localAtRoot(\n point: Readonly<RenderedSeriesPoint>,\n ): Readonly<RenderedSeriesPoint> | undefined;\n}\n/** Mount-owned optional volume capture.\n * @see {@link useVolumeInspection}\n */\nexport interface VolumeInspectionRef<D> {\n /** @returns Borrowed committed values, or undefined before paint/after disposal. */ rendered():\n VolumeRenderedSeries<D> | undefined;\n /** @internal Records local values without executing a query.\n * @param input - Immutable local marks and committed time mapping.\n */ capture(input: {\n /** Captured local paint marks. */ marks: readonly CapturedVolumeMark<D>[];\n /** Committed horizontal mapping. */ xScale: NumericPositionScale;\n /** Committed volume mapping. */ yScale: ResolvedContinuousScale;\n }): void;\n}\n/**\n * Creates a stable optional volume receiver without reading data or subscribing.\n * @param _inputs - Data/accessors used only for original datum inference.\n * @returns Ref to pass to exactly one VolumeSeries inspection prop.\n * @see {@link VolumeInspectionRef}\n */\nexport function useVolumeInspection<D>(\n _inputs: Pick<VolumeSeriesProps<D>, \"data\" | \"time\" | \"volume\">,\n): VolumeInspectionRef<D> {\n return useRenderedRef<\n {\n marks: readonly CapturedVolumeMark<D>[];\n xScale: NumericPositionScale;\n yScale: ResolvedContinuousScale;\n },\n VolumeRenderedSeries<D>\n >(\"volumeInspection\", (candidate, geometry) => {\n const observations = Object.freeze(\n candidate.marks.map((mark) =>\n Object.freeze({\n datum: mark.datum,\n sourceIndex: mark.sourceIndex,\n time: mark.time,\n volume: mark.volume,\n baseline: mark.baseline,\n anchorLocal: mark.anchorLocal,\n anchorRoot: geometry.rootAtLocal(mark.anchorLocal),\n boundsLocal: mark.boundsLocal,\n }),\n ),\n );\n const numeric: NumericRenderedSeries<D> = Object.freeze({\n observations: Object.freeze(\n observations.map((row) =>\n Object.freeze({\n ...row,\n domainX: row.time,\n domainY: row.volume,\n run: 0,\n }),\n ),\n ),\n assertLive: geometry.assertLive,\n domainXAtRoot(point: Readonly<RenderedSeriesPoint>) {\n const local = geometry.localAtRoot(point);\n return local\n ? invertNumericPosition(candidate.xScale, local.x)\n : undefined;\n },\n anchorInsideClips: geometry.anchorInsideClips,\n anchorAtDomain(point: Readonly<{ domainX: number; domainY: number }>) {\n geometry.assertLive();\n const anchorLocal = Object.freeze({\n x: candidate.xScale.map(point.domainX),\n y: candidate.yScale.map(point.domainY),\n });\n return Object.freeze({\n anchorLocal,\n anchorRoot: geometry.rootAtLocal(anchorLocal),\n });\n },\n });\n return Object.freeze({\n observations,\n marks: Object.freeze(candidate.marks.slice()),\n numeric,\n assertLive: geometry.assertLive,\n localAtRoot: geometry.localAtRoot,\n anchorInsideClips: geometry.anchorInsideClips,\n timeAtRoot: numeric.domainXAtRoot,\n });\n });\n}\n/**\n * Selects a recorded volume by timestamp; equal distances choose first source index.\n * @param rendered - Borrowed committed volume values.\n * @param options - UTC-millisecond request and optional pure candidate filter.\n * @returns Captured original volume and time delta, or undefined when no candidate survives.\n * @see {@link NearestVolumeHit}\n */\nexport function nearestRecordedVolumeX<D>(\n rendered: VolumeRenderedSeries<D>,\n options: {\n time: number;\n filter?: (observation: VolumeInspectionCandidate<D>) => boolean;\n },\n): NearestVolumeHit<D> | undefined {\n const hit = nearestRecordedX(rendered.numeric, {\n domainX: options.time,\n filter: options.filter\n ? (candidate) =>\n options.filter!(\n candidate as typeof candidate & VolumeInspectionCandidate<D>,\n )\n : undefined,\n });\n if (!hit) return undefined;\n const row = rendered.observations.find(\n (row) => row.sourceIndex === hit.sourceIndex,\n )!;\n return Object.freeze({ ...row, timeDelta: hit.domainDelta });\n}\n/**\n * Finds the last-painted volume column covering a root-logical point.\n * @param rendered - Borrowed committed volume values and paint geometry.\n * @param options - Root-logical point; respects clips, zero height and source paint order.\n * @returns Captured original volume, or undefined for gaps/singular transforms.\n * @see {@link PaintedVolumeHit}\n */\nexport function paintedVolumeAt<D>(\n rendered: VolumeRenderedSeries<D>,\n options: { rootPoint: Readonly<RenderedSeriesPoint> },\n): PaintedVolumeHit<D> | undefined {\n rendered.assertLive();\n if (\n !Number.isFinite(options.rootPoint.x) ||\n !Number.isFinite(options.rootPoint.y)\n )\n throw new RangeError(\"paintedVolumeAt rootPoint must be finite.\");\n const p = rendered.localAtRoot(options.rootPoint);\n if (!p || !rendered.anchorInsideClips(p)) return undefined;\n for (let i = rendered.marks.length - 1; i >= 0; i--) {\n const mark = rendered.marks[i],\n b = mark.boundsLocal,\n h = mark.strokeWidthLocal / 2;\n if (b.height === 0) continue;\n const inside =\n p.x >= b.x && p.x <= b.x + b.width && p.y >= b.y && p.y <= b.y + b.height;\n const outline =\n h > 0 &&\n p.x >= b.x - h &&\n p.x <= b.x + b.width + h &&\n p.y >= b.y - h &&\n p.y <= b.y + b.height + h &&\n !(\n p.x > b.x + h &&\n p.x < b.x + b.width - h &&\n p.y > b.y + h &&\n p.y < b.y + b.height - h\n );\n if ((mark.fill && inside) || outline) return rendered.observations[i];\n }\n return undefined;\n}\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,OAEK;AAQP,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAoF1B,SAAS,oBACd,SACwB;AACxB,SAAO,eAOL,oBAAoB,CAAC,WAAW,aAAa;AAC7C,UAAM,eAAe,OAAO;AAAA,MAC1B,UAAU,MAAM;AAAA,QAAI,CAAC,SACnB,OAAO,OAAO;AAAA,UACZ,OAAO,KAAK;AAAA,UACZ,aAAa,KAAK;AAAA,UAClB,MAAM,KAAK;AAAA,UACX,QAAQ,KAAK;AAAA,UACb,UAAU,KAAK;AAAA,UACf,aAAa,KAAK;AAAA,UAClB,YAAY,SAAS,YAAY,KAAK,WAAW;AAAA,UACjD,aAAa,KAAK;AAAA,QACpB,CAAC;AAAA,MACH;AAAA,IACF;AACA,UAAM,UAAoC,OAAO,OAAO;AAAA,MACtD,cAAc,OAAO;AAAA,QACnB,aAAa;AAAA,UAAI,CAAC,QAChB,OAAO,OAAO;AAAA,YACZ,GAAG;AAAA,YACH,SAAS,IAAI;AAAA,YACb,SAAS,IAAI;AAAA,YACb,KAAK;AAAA,UACP,CAAC;AAAA,QACH;AAAA,MACF;AAAA,MACA,YAAY,SAAS;AAAA,MACrB,cAAc,OAAsC;AAClD,cAAM,QAAQ,SAAS,YA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AAQ,SAAS;AAChD,MAAI,CAAC,KAAK,CAAC,SAAS,kBAAkB,CAAC,EAAG,QAAO;AACjD,WAAS,IAAI,SAAS,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK;AACnD,UAAM,OAAO,SAAS,MAAM,CAAC,GAC3B,IAAI,KAAK,aACT,IAAI,KAAK,mBAAmB;AAC9B,QAAI,EAAE,WAAW,EAAG;AACpB,UAAM,SACJ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;AACrE,UAAM,UACJ,IAAI,KACJ,EAAE,KAAK,EAAE,IAAI,KACb,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,KACvB,EAAE,KAAK,EAAE,IAAI,KACb,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KACxB,EACE,EAAE,IAAI,EAAE,IAAI,KACZ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,KACtB,EAAE,IAAI,EAAE,IAAI,KACZ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS;AAE3B,QAAK,KAAK,QAAQ,UAAW,QAAS,QAAO,SAAS,aAAa,CAAC;AAAA,EACtE;AACA,SAAO;AACT;",
6
+ "names": ["row"]
7
+ }
@@ -0,0 +1,19 @@
1
+ /** Optional committed-render inspection. Rendering entries do not import these algorithms. */
2
+ export { useNumericInspection, usePointInspection, } from "./inspection/capture.js";
3
+ export { withInspection } from "./inspection/handler.js";
4
+ export { paintedPointAt } from "./inspection/painted-point.js";
5
+ export { useBarInspection, paintedBarAt } from "./inspection/bar.js";
6
+ export type { BarInspectionRef, BarRenderedSeries, PaintedBarHit, } from "./inspection/bar.js";
7
+ export type { PaintedPointHit } from "./inspection/painted-point.js";
8
+ export type { InspectionContext, InspectionRef } from "./inspection/handler.js";
9
+ export type { NumericInspectionRef, PointInspectionRef, PointRenderedSeries, } from "./inspection/capture-types.js";
10
+ export { nearestRecordedX, nearestRecordedPoint, sampleRecordedX, firstSourceObservation, lastSourceObservation, anchorInsideClips, } from "./inspection/queries.js";
11
+ export type { NumericRenderedSeries, NumericRenderedObservation, RecordedNumericHit, NearestRecordedXHit, NearestRecordedPointHit, RecordedXSample, NumericRenderedFilter, NumericDuplicateResolver, NumericDomainInterpolation, RenderedSeriesPoint, } from "./inspection/query-types.js";
12
+ export type { NumericRenderedSeries as RenderedSeries, InspectionCandidate, NumericRenderedAnchors, } from "./inspection/query-types.js";
13
+ export type { NearestRecordedXOptions, NearestRecordedPointOptions, SampleRecordedXOptions, } from "./inspection/queries.js";
14
+ export { useVolumeInspection, nearestRecordedVolumeX, paintedVolumeAt, } from "./inspection/volume.js";
15
+ export type { VolumeObservation, VolumeInspectionCandidate, NearestVolumeHit, PaintedVolumeHit, VolumeInspectionRef, VolumeRenderedSeries, } from "./inspection/volume.js";
16
+ export { useCandleInspection, nearestRecordedCandleX, paintedCandleAt, } from "./inspection/candle.js";
17
+ export type { CandleObservation, CandleInspectionCandidate, NearestCandleHit, PaintedCandleHit, CandleInspectionRef, CandleRenderedSeries, } from "./inspection/candle.js";
18
+ export { useOhlcBarInspection, nearestRecordedOhlcBarX, paintedOhlcBarAt, } from "./inspection/ohlc-bar.js";
19
+ export type { OhlcBarObservation, OhlcBarInspectionCandidate, NearestOhlcBarHit, PaintedOhlcBarHit, OhlcBarInspectionRef, OhlcBarRenderedSeries, } from "./inspection/ohlc-bar.js";
@@ -0,0 +1,54 @@
1
+ import {
2
+ useNumericInspection,
3
+ usePointInspection
4
+ } from "./inspection/capture.js";
5
+ import { withInspection } from "./inspection/handler.js";
6
+ import { paintedPointAt } from "./inspection/painted-point.js";
7
+ import { useBarInspection, paintedBarAt } from "./inspection/bar.js";
8
+ import {
9
+ nearestRecordedX,
10
+ nearestRecordedPoint,
11
+ sampleRecordedX,
12
+ firstSourceObservation,
13
+ lastSourceObservation,
14
+ anchorInsideClips
15
+ } from "./inspection/queries.js";
16
+ import {
17
+ useVolumeInspection,
18
+ nearestRecordedVolumeX,
19
+ paintedVolumeAt
20
+ } from "./inspection/volume.js";
21
+ import {
22
+ useCandleInspection,
23
+ nearestRecordedCandleX,
24
+ paintedCandleAt
25
+ } from "./inspection/candle.js";
26
+ import {
27
+ useOhlcBarInspection,
28
+ nearestRecordedOhlcBarX,
29
+ paintedOhlcBarAt
30
+ } from "./inspection/ohlc-bar.js";
31
+ export {
32
+ anchorInsideClips,
33
+ firstSourceObservation,
34
+ lastSourceObservation,
35
+ nearestRecordedCandleX,
36
+ nearestRecordedOhlcBarX,
37
+ nearestRecordedPoint,
38
+ nearestRecordedVolumeX,
39
+ nearestRecordedX,
40
+ paintedBarAt,
41
+ paintedCandleAt,
42
+ paintedOhlcBarAt,
43
+ paintedPointAt,
44
+ paintedVolumeAt,
45
+ sampleRecordedX,
46
+ useBarInspection,
47
+ useCandleInspection,
48
+ useNumericInspection,
49
+ useOhlcBarInspection,
50
+ usePointInspection,
51
+ useVolumeInspection,
52
+ withInspection
53
+ };
54
+ //# sourceMappingURL=inspection.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/viz/inspection.ts"],
4
+ "sourcesContent": ["/** Optional committed-render inspection. Rendering entries do not import these algorithms. */\nexport {\n useNumericInspection,\n usePointInspection,\n} from \"./inspection/capture.js\";\nexport { withInspection } from \"./inspection/handler.js\";\nexport { paintedPointAt } from \"./inspection/painted-point.js\";\nexport { useBarInspection, paintedBarAt } from \"./inspection/bar.js\";\nexport type {\n BarInspectionRef,\n BarRenderedSeries,\n PaintedBarHit,\n} from \"./inspection/bar.js\";\nexport type { PaintedPointHit } from \"./inspection/painted-point.js\";\nexport type { InspectionContext, InspectionRef } from \"./inspection/handler.js\";\nexport type {\n NumericInspectionRef,\n PointInspectionRef,\n PointRenderedSeries,\n} from \"./inspection/capture-types.js\";\nexport {\n nearestRecordedX,\n nearestRecordedPoint,\n sampleRecordedX,\n firstSourceObservation,\n lastSourceObservation,\n anchorInsideClips,\n} from \"./inspection/queries.js\";\nexport type {\n NumericRenderedSeries,\n NumericRenderedObservation,\n RecordedNumericHit,\n NearestRecordedXHit,\n NearestRecordedPointHit,\n RecordedXSample,\n NumericRenderedFilter,\n NumericDuplicateResolver,\n NumericDomainInterpolation,\n RenderedSeriesPoint,\n} from \"./inspection/query-types.js\";\n\nexport type {\n NumericRenderedSeries as RenderedSeries,\n InspectionCandidate,\n NumericRenderedAnchors,\n} from \"./inspection/query-types.js\";\nexport type {\n NearestRecordedXOptions,\n NearestRecordedPointOptions,\n SampleRecordedXOptions,\n} from \"./inspection/queries.js\";\nexport {\n useVolumeInspection,\n nearestRecordedVolumeX,\n paintedVolumeAt,\n} from \"./inspection/volume.js\";\nexport type {\n VolumeObservation,\n VolumeInspectionCandidate,\n NearestVolumeHit,\n PaintedVolumeHit,\n VolumeInspectionRef,\n VolumeRenderedSeries,\n} from \"./inspection/volume.js\";\nexport {\n useCandleInspection,\n nearestRecordedCandleX,\n paintedCandleAt,\n} from \"./inspection/candle.js\";\nexport type {\n CandleObservation,\n CandleInspectionCandidate,\n NearestCandleHit,\n PaintedCandleHit,\n CandleInspectionRef,\n CandleRenderedSeries,\n} from \"./inspection/candle.js\";\nexport {\n useOhlcBarInspection,\n nearestRecordedOhlcBarX,\n paintedOhlcBarAt,\n} from \"./inspection/ohlc-bar.js\";\nexport type {\n OhlcBarObservation,\n OhlcBarInspectionCandidate,\n NearestOhlcBarHit,\n PaintedOhlcBarHit,\n OhlcBarInspectionRef,\n OhlcBarRenderedSeries,\n} from \"./inspection/ohlc-bar.js\";\n"],
5
+ "mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB,oBAAoB;AAa/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAwBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ export * from './inspection.js';
@@ -0,0 +1,62 @@
1
+ import type { Path } from "@pibbl/core";
2
+ import type { FillStyle, PibblEventHandlers, PibblEventParticipationOptions, SignalValue } from "@pibbl/core";
3
+ import type { SignalStyle } from "@pibbl/core/internal";
4
+ import type { LineAccessor, LineSeriesProps } from "./types.js";
5
+ /**
6
+ * Presentation properties for an {@link AreaSeries}.
7
+ *
8
+ * @see {@link FillStyle}
9
+ * @see {@link AreaSeriesProps}
10
+ */
11
+ export interface AreaSeriesStyle {
12
+ /** Paint used for the area interior. */
13
+ readonly fill?: FillStyle;
14
+ /** Opacity of the painted area, from zero through one. */
15
+ readonly opacity?: number;
16
+ /** Cursor shown while the area target owns pointer presentation. */
17
+ readonly cursor?: string;
18
+ }
19
+ /**
20
+ * Authored inputs for {@link AreaSeries}.
21
+ *
22
+ * The data, coordinate accessors, scales, and defined predicate use the same
23
+ * contract as {@link LineSeriesProps}. Each contiguous run of at least two
24
+ * valid observations is closed to `baseline` in data space.
25
+ *
26
+ * @see {@link LineSeriesProps}
27
+ * @see {@link AreaSeriesStyle}
28
+ */
29
+ export interface AreaSeriesProps<D> extends PibblEventHandlers, PibblEventParticipationOptions {
30
+ /** Application data supplied directly or through a signal. */
31
+ readonly data: LineSeriesProps<D>["data"];
32
+ /** Property key or callback extracting the horizontal coordinate. */
33
+ readonly x: LineAccessor<D>;
34
+ /** Property key or callback extracting the vertical coordinate. */
35
+ readonly y: LineAccessor<D>;
36
+ /** Continuous scale used to map horizontal data coordinates. */
37
+ readonly xScale: LineSeriesProps<D>["xScale"];
38
+ /** Continuous scale used to map vertical data coordinates and baseline. */
39
+ readonly yScale: LineSeriesProps<D>["yScale"];
40
+ /** Selects records that participate in an observed run. */
41
+ readonly defined?: LineSeriesProps<D>["defined"];
42
+ /** Curve used to connect successive observed samples. */
43
+ readonly curve?: LineSeriesProps<D>["curve"];
44
+ /** Finite data-space value to which each observed run closes. */
45
+ readonly baseline: SignalValue<number>;
46
+ /** Shared area presentation. Individual datum styling is not supported. */
47
+ readonly style?: SignalValue<SignalStyle<AreaSeriesStyle>>;
48
+ }
49
+ /**
50
+ * Draws each contiguous observed run as a filled polygon closed to an explicit baseline.
51
+ *
52
+ * Missing, non-finite, and excluded coordinates split runs. A lone observation has no area.
53
+ * The component owns one ordinary {@link Path} target, so event participation follows the
54
+ * standard Path defaults; callers may wrap it in `Clip` when clipping is needed.
55
+ *
56
+ * @param props - Data, coordinate accessors, continuous scales, baseline, and presentation.
57
+ * @returns A Pibbl path node containing all drawable area runs.
58
+ * @throws When `data` is not an array, the baseline is not finite, or presentation is invalid.
59
+ *
60
+ * @see {@link AreaSeriesProps}
61
+ */
62
+ export declare function AreaSeries<D>({ data: dataInput, x: xInput, y: yInput, xScale: xId, yScale: yId, baseline: baselineInput, defined, curve, style: styleInput, ...eventProps }: AreaSeriesProps<D>): import("../../../jsx-runtime.js").JSX.Element;
@@ -0,0 +1,120 @@
1
+ import { jsx } from "@pibbl/core/jsx-runtime";
2
+ import { useNumericPosition } from "./series-position.js";
3
+ import { Path, resolveSignalValue } from "@pibbl/core";
4
+ import {
5
+ useInternalValueMemoSlot,
6
+ validateTexturePaint
7
+ } from "@pibbl/core/internal";
8
+ import {
9
+ appendCurveForward,
10
+ curveGeometry,
11
+ resolveSeriesCurve
12
+ } from "./curve-definition.js";
13
+ import { opacity } from "./paint.js";
14
+ import { useContinuousScale } from "./use-continuous-scale.js";
15
+ function accessor(input) {
16
+ return typeof input === "function" ? input : (datum) => datum[input];
17
+ }
18
+ function fill(value) {
19
+ if (typeof value === "string" || value instanceof CanvasGradient || value instanceof CanvasPattern)
20
+ return value;
21
+ try {
22
+ validateTexturePaint(value);
23
+ return value;
24
+ } catch {
25
+ throw new TypeError("AreaSeries: invalid fill.");
26
+ }
27
+ }
28
+ function AreaSeries({
29
+ data: dataInput,
30
+ x: xInput,
31
+ y: yInput,
32
+ xScale: xId,
33
+ yScale: yId,
34
+ baseline: baselineInput,
35
+ defined,
36
+ curve,
37
+ style: styleInput,
38
+ ...eventProps
39
+ }) {
40
+ const xScale = useNumericPosition(xId);
41
+ const yScale = useContinuousScale(yId).get();
42
+ const curveDefinition = resolveSeriesCurve(curve);
43
+ const x = useInternalValueMemoSlot(
44
+ "vizAreaXAccessor",
45
+ () => accessor(xInput),
46
+ [xInput]
47
+ );
48
+ const y = useInternalValueMemoSlot(
49
+ "vizAreaYAccessor",
50
+ () => accessor(yInput),
51
+ [yInput]
52
+ );
53
+ const data = resolveSignalValue(dataInput);
54
+ if (!Array.isArray(data))
55
+ throw new TypeError(
56
+ "AreaSeries data must be an array or a signal containing an array."
57
+ );
58
+ const baseline = resolveSignalValue(baselineInput);
59
+ if (typeof baseline !== "number" || !Number.isFinite(baseline))
60
+ throw new RangeError("AreaSeries baseline must be finite.");
61
+ const baselineY = yScale.map(baseline);
62
+ if (!Number.isFinite(baselineY))
63
+ throw new RangeError(
64
+ "AreaSeries baseline must map to a finite coordinate."
65
+ );
66
+ const style = resolveSignalValue(styleInput) ?? {};
67
+ if (style === null || typeof style !== "object" || Array.isArray(style))
68
+ throw new TypeError("AreaSeries: style must be an object.");
69
+ const areaFill = fill(resolveSignalValue(style.fill) ?? "#2563eb");
70
+ const alpha = opacity(resolveSignalValue(style.opacity) ?? 0.2, "AreaSeries");
71
+ const cursor = resolveSignalValue(style.cursor);
72
+ if (cursor !== void 0 && typeof cursor !== "string")
73
+ throw new TypeError("AreaSeries: cursor must be a string.");
74
+ const path = new Path2D();
75
+ let run = [];
76
+ const closeRun = () => {
77
+ if (run.length >= 2) {
78
+ const first = run[0];
79
+ const last = run[run.length - 1];
80
+ const geometry = curveGeometry(curveDefinition, run);
81
+ path.moveTo(geometry.start[0], geometry.start[1]);
82
+ appendCurveForward(path, geometry);
83
+ path.lineTo(last[0], baselineY);
84
+ path.lineTo(first[0], baselineY);
85
+ path.closePath();
86
+ }
87
+ run = [];
88
+ };
89
+ for (let i = 0; i < data.length; i++) {
90
+ const datum = data[i];
91
+ if (defined && !defined(datum, i, data)) {
92
+ closeRun();
93
+ continue;
94
+ }
95
+ const xv = x(datum, i, data);
96
+ const yv = y(datum, i, data);
97
+ if (typeof xv !== "number" || typeof yv !== "number" || !Number.isFinite(xv) || !Number.isFinite(yv)) {
98
+ closeRun();
99
+ continue;
100
+ }
101
+ const point = [xScale.map(xv), yScale.map(yv)];
102
+ if (!Number.isFinite(point[0]) || !Number.isFinite(point[1])) {
103
+ closeRun();
104
+ continue;
105
+ }
106
+ run.push(point);
107
+ }
108
+ closeRun();
109
+ return /* @__PURE__ */ jsx(
110
+ Path,
111
+ {
112
+ ...eventProps,
113
+ style: { d: path, fill: areaFill, opacity: alpha, cursor }
114
+ }
115
+ );
116
+ }
117
+ export {
118
+ AreaSeries
119
+ };
120
+ //# sourceMappingURL=area-series.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/features/viz/lib/area-series.tsx"],
4
+ "sourcesContent": ["import { useNumericPosition } from \"./series-position.js\";\nimport { Path, resolveSignalValue } from \"@pibbl/core\";\nimport type {\n FillStyle,\n PibblEventHandlers,\n PibblEventParticipationOptions,\n SignalValue,\n} from \"@pibbl/core\";\nimport {\n useInternalValueMemoSlot,\n validateTexturePaint,\n} from \"@pibbl/core/internal\";\nimport type { SignalStyle } from \"@pibbl/core/internal\";\nimport type { LineAccessor, LineCoordinate, LineSeriesProps } from \"./types.js\";\nimport {\n appendCurveForward,\n curveGeometry,\n resolveSeriesCurve,\n} from \"./curve-definition.js\";\nimport { opacity } from \"./paint.js\";\nimport { useContinuousScale } from \"./use-continuous-scale.js\";\n\n/**\n * Presentation properties for an {@link AreaSeries}.\n *\n * @see {@link FillStyle}\n * @see {@link AreaSeriesProps}\n */\nexport interface AreaSeriesStyle {\n /** Paint used for the area interior. */\n readonly fill?: FillStyle;\n /** Opacity of the painted area, from zero through one. */\n readonly opacity?: number;\n /** Cursor shown while the area target owns pointer presentation. */\n readonly cursor?: string;\n}\n\n/**\n * Authored inputs for {@link AreaSeries}.\n *\n * The data, coordinate accessors, scales, and defined predicate use the same\n * contract as {@link LineSeriesProps}. Each contiguous run of at least two\n * valid observations is closed to `baseline` in data space.\n *\n * @see {@link LineSeriesProps}\n * @see {@link AreaSeriesStyle}\n */\nexport interface AreaSeriesProps<D>\n extends PibblEventHandlers, PibblEventParticipationOptions {\n /** Application data supplied directly or through a signal. */\n readonly data: LineSeriesProps<D>[\"data\"];\n /** Property key or callback extracting the horizontal coordinate. */\n readonly x: LineAccessor<D>;\n /** Property key or callback extracting the vertical coordinate. */\n readonly y: LineAccessor<D>;\n /** Continuous scale used to map horizontal data coordinates. */\n readonly xScale: LineSeriesProps<D>[\"xScale\"];\n /** Continuous scale used to map vertical data coordinates and baseline. */\n readonly yScale: LineSeriesProps<D>[\"yScale\"];\n /** Selects records that participate in an observed run. */\n readonly defined?: LineSeriesProps<D>[\"defined\"];\n /** Curve used to connect successive observed samples. */\n readonly curve?: LineSeriesProps<D>[\"curve\"];\n /** Finite data-space value to which each observed run closes. */\n readonly baseline: SignalValue<number>;\n /** Shared area presentation. Individual datum styling is not supported. */\n readonly style?: SignalValue<SignalStyle<AreaSeriesStyle>>;\n}\n\nfunction accessor<D>(\n input: LineAccessor<D>,\n): (datum: D, index: number, data: readonly D[]) => LineCoordinate {\n return typeof input === \"function\"\n ? input\n : (datum) => datum[input] as LineCoordinate;\n}\n\nfunction fill(value: unknown): FillStyle {\n if (\n typeof value === \"string\" ||\n value instanceof CanvasGradient ||\n value instanceof CanvasPattern\n )\n return value;\n try {\n validateTexturePaint(value as never);\n return value as FillStyle;\n } catch {\n throw new TypeError(\"AreaSeries: invalid fill.\");\n }\n}\n\n/**\n * Draws each contiguous observed run as a filled polygon closed to an explicit baseline.\n *\n * Missing, non-finite, and excluded coordinates split runs. A lone observation has no area.\n * The component owns one ordinary {@link Path} target, so event participation follows the\n * standard Path defaults; callers may wrap it in `Clip` when clipping is needed.\n *\n * @param props - Data, coordinate accessors, continuous scales, baseline, and presentation.\n * @returns A Pibbl path node containing all drawable area runs.\n * @throws When `data` is not an array, the baseline is not finite, or presentation is invalid.\n *\n * @see {@link AreaSeriesProps}\n */\nexport function AreaSeries<D>({\n data: dataInput,\n x: xInput,\n y: yInput,\n xScale: xId,\n yScale: yId,\n baseline: baselineInput,\n defined,\n curve,\n style: styleInput,\n ...eventProps\n}: AreaSeriesProps<D>) {\n const xScale = useNumericPosition(xId);\n const yScale = useContinuousScale(yId).get();\n const curveDefinition = resolveSeriesCurve(curve);\n const x = useInternalValueMemoSlot(\n \"vizAreaXAccessor\",\n () => accessor(xInput),\n [xInput],\n );\n const y = useInternalValueMemoSlot(\n \"vizAreaYAccessor\",\n () => accessor(yInput),\n [yInput],\n );\n const data = resolveSignalValue(dataInput);\n if (!Array.isArray(data))\n throw new TypeError(\n \"AreaSeries data must be an array or a signal containing an array.\",\n );\n const baseline = resolveSignalValue(baselineInput);\n if (typeof baseline !== \"number\" || !Number.isFinite(baseline))\n throw new RangeError(\"AreaSeries baseline must be finite.\");\n const baselineY = yScale.map(baseline);\n if (!Number.isFinite(baselineY))\n throw new RangeError(\n \"AreaSeries baseline must map to a finite coordinate.\",\n );\n const style = resolveSignalValue(styleInput) ?? {};\n if (style === null || typeof style !== \"object\" || Array.isArray(style))\n throw new TypeError(\"AreaSeries: style must be an object.\");\n const areaFill = fill(resolveSignalValue(style.fill) ?? \"#2563eb\");\n const alpha = opacity(resolveSignalValue(style.opacity) ?? 0.2, \"AreaSeries\");\n const cursor = resolveSignalValue(style.cursor);\n if (cursor !== undefined && typeof cursor !== \"string\")\n throw new TypeError(\"AreaSeries: cursor must be a string.\");\n\n const path = new Path2D();\n let run: (readonly [number, number])[] = [];\n const closeRun = () => {\n if (run.length >= 2) {\n const first = run[0];\n const last = run[run.length - 1];\n const geometry = curveGeometry(curveDefinition, run);\n path.moveTo(geometry.start[0], geometry.start[1]);\n appendCurveForward(path, geometry);\n path.lineTo(last[0], baselineY);\n path.lineTo(first[0], baselineY);\n path.closePath();\n }\n run = [];\n };\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n if (defined && !defined(datum, i, data)) {\n closeRun();\n continue;\n }\n const xv = x(datum, i, data);\n const yv = y(datum, i, data);\n if (\n typeof xv !== \"number\" ||\n typeof yv !== \"number\" ||\n !Number.isFinite(xv) ||\n !Number.isFinite(yv)\n ) {\n closeRun();\n continue;\n }\n const point = [xScale.map(xv), yScale.map(yv)] as const;\n if (!Number.isFinite(point[0]) || !Number.isFinite(point[1])) {\n closeRun();\n continue;\n }\n run.push(point);\n }\n closeRun();\n return (\n <Path\n {...eventProps}\n style={{ d: path, fill: areaFill, opacity: alpha, cursor }}\n />\n );\n}\n"],
5
+ "mappings": "AAiMI;AAjMJ,SAAS,0BAA0B;AACnC,SAAS,MAAM,0BAA0B;AAOzC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAiDnC,SAAS,SACP,OACiE;AACjE,SAAO,OAAO,UAAU,aACpB,QACA,CAAC,UAAU,MAAM,KAAK;AAC5B;AAEA,SAAS,KAAK,OAA2B;AACvC,MACE,OAAO,UAAU,YACjB,iBAAiB,kBACjB,iBAAiB;AAEjB,WAAO;AACT,MAAI;AACF,yBAAqB,KAAc;AACnC,WAAO;AAAA,EACT,QAAQ;AACN,UAAM,IAAI,UAAU,2BAA2B;AAAA,EACjD;AACF;AAeO,SAAS,WAAc;AAAA,EAC5B,MAAM;AAAA,EACN,GAAG;AAAA,EACH,GAAG;AAAA,EACH,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,G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BAAiB,GAAG;AACnD,WAAK,OAAO,SAAS,MAAM,CAAC,GAAG,SAAS,MAAM,CAAC,CAAC;AAChD,yBAAmB,MAAM,QAAQ;AACjC,WAAK,OAAO,KAAK,CAAC,GAAG,SAAS;AAC9B,WAAK,OAAO,MAAM,CAAC,GAAG,SAAS;AAC/B,WAAK,UAAU;AAAA,IACjB;AACA,UAAM,CAAC;AAAA,EACT;AACA,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,QAAQ,KAAK,CAAC;AACpB,QAAI,WAAW,CAAC,QAAQ,OAAO,GAAG,IAAI,GAAG;AACvC,eAAS;AACT;AAAA,IACF;AACA,UAAM,KAAK,EAAE,OAAO,GAAG,IAAI;AAC3B,UAAM,KAAK,EAAE,OAAO,GAAG,IAAI;AAC3B,QACE,OAAO,OAAO,YACd,OAAO,OAAO,YACd,CAAC,OAAO,SAAS,EAAE,KACnB,CAAC,OAAO,SAAS,EAAE,GACnB;AACA,eAAS;AACT;AAAA,IACF;AACA,UAAM,QAAQ,CAAC,OAAO,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;AAC7C,QAAI,CAAC,OAAO,SAAS,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,MAAM,CAAC,CAAC,GAAG;AAC5D,eAAS;AACT;AAAA,IACF;AACA,QAAI,KAAK,KAAK;AAAA,EAChB;AACA,WAAS;AACT,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO,EAAE,GAAG,MAAM,MAAM,UAAU,SAAS,OAAO,OAAO;AAAA;AAAA,EAC3D;AAEJ;",
6
+ "names": []
7
+ }
@@ -7,7 +7,8 @@ function AxisTitle(props) {
7
7
  const source = lookupScale(props.scale, "AxisTitle");
8
8
  if (!source) throw new TypeError("AxisTitle requires a scale ID.");
9
9
  const scale = source.get(), label = resolveSignalValue(props.label), unit = resolveSignalValue(props.unit) ?? "";
10
- if ([label, unit].some((value) => typeof value !== "string" || /[\r\n]/.test(value))) throw new TypeError("AxisTitle label and unit must be single-line strings.");
10
+ if (typeof label !== "string" || /[\r\n]/.test(label) || typeof unit !== "string" || /[\r\n]/.test(unit))
11
+ throw new TypeError("AxisTitle label and unit must be single-line strings.");
11
12
  const offset = resolveSignalValue(props.offset) ?? 40;
12
13
  if (typeof offset !== "number" || !Number.isFinite(offset) || offset < 0) throw new RangeError("AxisTitle offset must be finite and nonnegative.");
13
14
  const horizontal = props.position === "top" || props.position === "bottom";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/features/viz/lib/axis-title.tsx"],
4
- "sourcesContent": ["import { Group, Text, resolveSignalValue, type SignalValue } from \"@pibbl/core\";\nimport type { SignalStyle } from \"@pibbl/core/internal\";\nimport type { AxisProps, AxisStyle, ScaleId } from \"./types.js\";\nimport { lookupScale } from \"./scale-context.js\";\nimport { opacity } from \"./paint.js\";\n/** Scale-aligned axis text; callers reserve the margin outside the plot. See {@link AxisTitle}. */\nexport interface AxisTitleProps {\n /** Ancestor scale whose range supplies the title midpoint. */\n readonly scale: ScaleId;\n /** Plot edge; left/right titles rotate along the axis. */\n readonly position: AxisProps[\"position\"];\n /** Single-line title. */\n readonly label: SignalValue<string>;\n /** Optional unit appended in parentheses; empty string omits it. */\n readonly unit?: SignalValue<string>;\n /** Nonnegative finite distance outside the plot edge, default 40 pixels. */\n readonly offset?: SignalValue<number>;\n /** Font defaults to 12px sans-serif, fill to #617783, opacity to 1. */\n readonly style?: SignalValue<SignalStyle<Pick<AxisStyle, \"font\" | \"fill\" | \"opacity\">>>;\n}\n/** Paint an axis title with optional units, without allocating margins or changing ticks.\n * @param props - Scale geometry and presentation. See {@link AxisTitleProps}.\n * @returns Decorative chart content in the caller's coordinate space.\n */\nexport function AxisTitle(props: AxisTitleProps) {\n if (![\"top\", \"bottom\", \"left\", \"right\"].includes(props.position)) throw new TypeError(\"AxisTitle position must be top, bottom, left, or right.\");\n const source = lookupScale(props.scale, \"AxisTitle\");\n if (!source) throw new TypeError(\"AxisTitle requires a scale ID.\");\n const scale = source.get(), label = resolveSignalValue(props.label), unit = resolveSignalValue(props.unit) ?? \"\";\n if ([label, unit].some(value => typeof value !== \"string\" || /[\\r\\n]/.test(value))) throw new TypeError(\"AxisTitle label and unit must be single-line strings.\");\n const offset = resolveSignalValue(props.offset) ?? 40;\n if (typeof offset !== \"number\" || !Number.isFinite(offset) || offset < 0) throw new RangeError(\"AxisTitle offset must be finite and nonnegative.\");\n const horizontal = props.position === \"top\" || props.position === \"bottom\";\n const midpoint = scale.range[0] / 2 + scale.range[1] / 2;\n const x = horizontal ? midpoint : props.position === \"left\" ? -offset : scale.frame.width + offset;\n const y = horizontal ? props.position === \"top\" ? -offset : scale.frame.height + offset : midpoint;\n const style = resolveSignalValue(props.style) ?? {};\n return <Group style={{ translateX: x, translateY: y }}><Group style={{ rotationDegrees: horizontal ? 0 : props.position === \"left\" ? -90 : 90 }}>\n <Text pointerEvents=\"none\" style={{ textAlign: \"center\", textBaseline: \"middle\", font: resolveSignalValue(style.font) ?? \"12px sans-serif\", fill: resolveSignalValue(style.fill) ?? \"#617783\", opacity: opacity(resolveSignalValue(style.opacity) ?? 1, \"AxisTitle\") }}>{unit ? `${label} (${unit})` : label}</Text>\n </Group></Group>;\n}\n"],
5
- "mappings": "AAsCI;AAtCJ,SAAS,OAAO,MAAM,0BAA4C;AAGlE,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AAoBjB,SAAS,UAAU,OAAuB;AAC/C,MAAI,CAAC,CAAC,OAAO,UAAU,QAAQ,OAAO,EAAE,SAAS,MAAM,QAAQ,EAAG,OAAM,IAAI,UAAU,yDAAyD;AAC/I,QAAM,SAAS,YAAY,MAAM,OAAO,WAAW;AACnD,MAAI,CAAC,OAAQ,OAAM,IAAI,UAAU,gCAAgC;AACjE,QAAM,QAAQ,OAAO,IAAI,GAAG,QAAQ,mBAAmB,MAAM,KAAK,GAAG,OAAO,mBAAmB,MAAM,IAAI,KAAK;AAC9G,MAAI,CAAC,OAAO,IAAI,EAAE,KAAK,WAAS,OAAO,UAAU,YAAY,SAAS,KAAK,KAAK,CAAC,EAAG,OAAM,IAAI,UAAU,uDAAuD;AAC/J,QAAM,SAAS,mBAAmB,MAAM,MAAM,KAAK;AACnD,MAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,MAAM,KAAK,SAAS,EAAG,OAAM,IAAI,WAAW,kDAAkD;AACjJ,QAAM,aAAa,MAAM,aAAa,SAAS,MAAM,aAAa;AAClE,QAAM,WAAW,MAAM,MAAM,CAAC,IAAI,IAAI,MAAM,MAAM,CAAC,IAAI;AACvD,QAAM,IAAI,aAAa,WAAW,MAAM,aAAa,SAAS,CAAC,SAAS,MAAM,MAAM,QAAQ;AAC5F,QAAM,IAAI,aAAa,MAAM,aAAa,QAAQ,CAAC,SAAS,MAAM,MAAM,SAAS,SAAS;AAC1F,QAAM,QAAQ,mBAAmB,MAAM,KAAK,KAAK,CAAC;AAClD,SAAO,oBAAC,SAAM,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,8BAAC,SAAM,OAAO,EAAE,iBAAiB,aAAa,IAAI,MAAM,aAAa,SAAS,MAAM,GAAG,GAC5I,8BAAC,QAAK,eAAc,QAAO,OAAO,EAAE,WAAW,UAAU,cAAc,UAAU,MAAM,mBAAmB,MAAM,IAAI,KAAK,mBAAmB,MAAM,mBAAmB,MAAM,IAAI,KAAK,WAAW,SAAS,QAAQ,mBAAmB,MAAM,OAAO,KAAK,GAAG,WAAW,EAAE,GAAI,iBAAO,GAAG,KAAK,KAAK,IAAI,MAAM,OAAM,GAC/S,GAAQ;AACV;",
4
+ "sourcesContent": ["import { Group, Text, resolveSignalValue, type SignalValue } from \"@pibbl/core\";\nimport type { SignalStyle } from \"@pibbl/core/internal\";\nimport type { AxisProps, AxisStyle, ScaleId } from \"./types.js\";\nimport { lookupScale } from \"./scale-context.js\";\nimport { opacity } from \"./paint.js\";\n/** Scale-aligned axis text; callers reserve the margin outside the plot. See {@link AxisTitle}. */\nexport interface AxisTitleProps {\n /** Ancestor scale whose range supplies the title midpoint. */\n readonly scale: ScaleId;\n /** Plot edge; left/right titles rotate along the axis. */\n readonly position: AxisProps[\"position\"];\n /** Single-line title. */\n readonly label: SignalValue<string>;\n /** Optional unit appended in parentheses; empty string omits it. */\n readonly unit?: SignalValue<string>;\n /** Nonnegative finite distance outside the plot edge, default 40 pixels. */\n readonly offset?: SignalValue<number>;\n /** Font defaults to 12px sans-serif, fill to #617783, opacity to 1. */\n readonly style?: SignalValue<SignalStyle<Pick<AxisStyle, \"font\" | \"fill\" | \"opacity\">>>;\n}\n/** Paint an axis title with optional units, without allocating margins or changing ticks.\n * @param props - Scale geometry and presentation. See {@link AxisTitleProps}.\n * @returns Decorative chart content in the caller's coordinate space.\n */\nexport function AxisTitle(props: AxisTitleProps) {\n if (![\"top\", \"bottom\", \"left\", \"right\"].includes(props.position)) throw new TypeError(\"AxisTitle position must be top, bottom, left, or right.\");\n const source = lookupScale(props.scale, \"AxisTitle\");\n if (!source) throw new TypeError(\"AxisTitle requires a scale ID.\");\n const scale = source.get(), label = resolveSignalValue(props.label), unit = resolveSignalValue(props.unit) ?? \"\";\n if (\n typeof label !== \"string\" ||\n /[\\r\\n]/.test(label) ||\n typeof unit !== \"string\" ||\n /[\\r\\n]/.test(unit)\n )\n throw new TypeError(\"AxisTitle label and unit must be single-line strings.\");\n const offset = resolveSignalValue(props.offset) ?? 40;\n if (typeof offset !== \"number\" || !Number.isFinite(offset) || offset < 0) throw new RangeError(\"AxisTitle offset must be finite and nonnegative.\");\n const horizontal = props.position === \"top\" || props.position === \"bottom\";\n const midpoint = scale.range[0] / 2 + scale.range[1] / 2;\n const x = horizontal ? midpoint : props.position === \"left\" ? -offset : scale.frame.width + offset;\n const y = horizontal ? props.position === \"top\" ? -offset : scale.frame.height + offset : midpoint;\n const style = resolveSignalValue(props.style) ?? {};\n return (\n <Group style={{ translateX: x, translateY: y }}>\n <Group style={{ rotationDegrees: horizontal ? 0 : props.position === \"left\" ? -90 : 90 }}>\n <Text pointerEvents=\"none\" style={{ textAlign: \"center\", textBaseline: \"middle\", font: resolveSignalValue(style.font) ?? \"12px sans-serif\", fill: resolveSignalValue(style.fill) ?? \"#617783\", opacity: opacity(resolveSignalValue(style.opacity) ?? 1, \"AxisTitle\") }}>\n {unit ? `${label} (${unit})` : label}\n </Text>\n </Group>\n </Group>\n );\n}\n"],
5
+ "mappings": "AA8CQ;AA9CR,SAAS,OAAO,MAAM,0BAA4C;AAGlE,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AAoBjB,SAAS,UAAU,OAAuB;AAC/C,MAAI,CAAC,CAAC,OAAO,UAAU,QAAQ,OAAO,EAAE,SAAS,MAAM,QAAQ,EAAG,OAAM,IAAI,UAAU,yDAAyD;AAC/I,QAAM,SAAS,YAAY,MAAM,OAAO,WAAW;AACnD,MAAI,CAAC,OAAQ,OAAM,IAAI,UAAU,gCAAgC;AACjE,QAAM,QAAQ,OAAO,IAAI,GAAG,QAAQ,mBAAmB,MAAM,KAAK,GAAG,OAAO,mBAAmB,MAAM,IAAI,KAAK;AAC9G,MACE,OAAO,UAAU,YACjB,SAAS,KAAK,KAAK,KACnB,OAAO,SAAS,YAChB,SAAS,KAAK,IAAI;AAElB,UAAM,IAAI,UAAU,uDAAuD;AAC7E,QAAM,SAAS,mBAAmB,MAAM,MAAM,KAAK;AACnD,MAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,MAAM,KAAK,SAAS,EAAG,OAAM,IAAI,WAAW,kDAAkD;AACjJ,QAAM,aAAa,MAAM,aAAa,SAAS,MAAM,aAAa;AAClE,QAAM,WAAW,MAAM,MAAM,CAAC,IAAI,IAAI,MAAM,MAAM,CAAC,IAAI;AACvD,QAAM,IAAI,aAAa,WAAW,MAAM,aAAa,SAAS,CAAC,SAAS,MAAM,MAAM,QAAQ;AAC5F,QAAM,IAAI,aAAa,MAAM,aAAa,QAAQ,CAAC,SAAS,MAAM,MAAM,SAAS,SAAS;AAC1F,QAAM,QAAQ,mBAAmB,MAAM,KAAK,KAAK,CAAC;AAClD,SACE,oBAAC,SAAM,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE,GAC3C,8BAAC,SAAM,OAAO,EAAE,iBAAiB,aAAa,IAAI,MAAM,aAAa,SAAS,MAAM,GAAG,GACrF,8BAAC,QAAK,eAAc,QAAO,OAAO,EAAE,WAAW,UAAU,cAAc,UAAU,MAAM,mBAAmB,MAAM,IAAI,KAAK,mBAAmB,MAAM,mBAAmB,MAAM,IAAI,KAAK,WAAW,SAAS,QAAQ,mBAAmB,MAAM,OAAO,KAAK,GAAG,WAAW,EAAE,GAClQ,iBAAO,GAAG,KAAK,KAAK,IAAI,MAAM,OACjC,GACF,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -38,7 +38,7 @@ function Axis(props) {
38
38
  const occupied = [];
39
39
  const visible = /* @__PURE__ */ new Set();
40
40
  const texts = selected.map((value, index) => {
41
- const label = props.tickFormat ? props.tickFormat(value, index) : scale.type === "utc" ? scale.formatTick(value) : typeof value === "number" ? String(Number(value.toPrecision(6))) : value;
41
+ const label = props.tickFormat ? props.tickFormat(value, index) : scale.type === "utc" || scale.type === "trading-time" ? scale.formatTick(value) : typeof value === "number" ? String(Number(value.toPrecision(6))) : value;
42
42
  if (typeof label !== "string") throw new TypeError("Axis tickFormat must return a string.");
43
43
  return label;
44
44
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/features/viz/lib/axis.tsx"],
4
- "sourcesContent": ["import { Path, Text, resolveSignalValue, useCanvasContext } from \"@pibbl/core\";\nimport type { AxisProps } from \"./types.js\";\nimport { lookupScale } from \"./scale-context.js\";\nimport { width, opacity } from \"./paint.js\";\n\nimport { fitAxisLabel } from \"./axis-labels.js\";\n\nimport { ticks, position } from \"./scale-ticks.js\";\n\n/**\n * Draws ticks and labels using a named scale and the configured orientation and style.\n *\n * @param props - Scale, orientation, tick, label, and styling options. See {@link AxisProps}.\n * @returns Pibbl nodes drawing the axis.\n *\n * @see {@link AxisProps}\n */\nexport function Axis(props: AxisProps) {\n if (\n props.position !== \"bottom\" &&\n props.position !== \"left\" &&\n props.position !== \"top\" &&\n props.position !== \"right\"\n )\n throw new TypeError(\"Axis position must be bottom, left, top, or right.\");\n const source = lookupScale(props.scale, \"Axis\");\n if (!source) throw new TypeError(\"Axis requires a scale ID.\");\n const scale = source.get();\n const style = resolveSignalValue(props.style) ?? {};\n const stroke = resolveSignalValue(style.stroke) ?? \"#64748b\";\n const strokeWidth = width(resolveSignalValue(style.strokeWidth) ?? 1, \"Axis\");\n const fill = resolveSignalValue(style.fill) ?? \"#64748b\";\n const font = resolveSignalValue(style.font) ?? \"12px sans-serif\";\n const alpha = opacity(resolveSignalValue(style.opacity) ?? 1, \"Axis\");\n const horizontal = props.position === \"bottom\" || props.position === \"top\";\n const outward = props.position === \"bottom\" || props.position === \"right\" ? 1 : -1;\n const baseline = horizontal\n ? props.position === \"bottom\" ? scale.frame.height : 0\n : props.position === \"right\" ? scale.frame.width : 0;\n const selected = ticks(scale, props);\n const context = useCanvasContext();\n const overlap = resolveSignalValue(props.labelOverlap ?? \"allow\");\n const gap = resolveSignalValue(props.labelGap ?? 8);\n if (overlap !== \"allow\" && overlap !== \"skip\") throw new TypeError(\"Axis labelOverlap must be allow or skip.\");\n if (!Number.isFinite(gap) || gap < 0) throw new RangeError(\"Axis labelGap must be finite and nonnegative.\");\n const overflow = resolveSignalValue(props.labelOverflow ?? \"allow\");\n const maxWidth = props.labelMaxWidth === undefined ? undefined : resolveSignalValue(props.labelMaxWidth);\n const maxLines = resolveSignalValue(props.labelMaxLines ?? 2);\n const lineHeightInput = props.labelLineHeight === undefined ? undefined : resolveSignalValue(props.labelLineHeight);\n if (![\"allow\", \"wrap\", \"truncate\"].includes(overflow)) throw new TypeError(\"Axis labelOverflow must be allow, wrap, or truncate.\");\n if ((overflow !== \"allow\" && maxWidth === undefined) || (maxWidth !== undefined && (!Number.isFinite(maxWidth) || maxWidth <= 0))) throw new RangeError(\"Axis labelMaxWidth must be positive and finite for wrap/truncate.\");\n if (!Number.isInteger(maxLines) || maxLines < 1 || maxLines > 20) throw new RangeError(\"Axis labelMaxLines must be an integer from 1 to 20.\");\n if (lineHeightInput !== undefined && (!Number.isFinite(lineHeightInput) || lineHeightInput <= 0)) throw new RangeError(\"Axis labelLineHeight must be positive and finite.\");\n let lineHeight = 0;\n const lines: (readonly string[])[] = [];\n const occupied: { start: number; end: number }[] = [];\n const visible = new Set<number>();\n const texts = selected.map((value, index) => {\n const label = props.tickFormat ? props.tickFormat(value, index)\n : scale.type === \"utc\" ? scale.formatTick(value as number)\n : typeof value === \"number\" ? String(Number(value.toPrecision(6))) : value;\n if (typeof label !== \"string\") throw new TypeError(\"Axis tickFormat must return a string.\");\n return label;\n });\n // Endpoints have priority; sort by physical position for reversed ranges too.\n const order = selected.map((value, index) => ({ index, p: position(scale, value) })).sort((a, b) => a.p - b.p);\n const priority = order.length > 1 ? [order[0], order[order.length - 1], ...order.slice(1, -1)] : order;\n context.save();\n try {\n context.font = font;\n const fontMetrics = context.measureText(\"Mg\");\n lineHeight = lineHeightInput ?? Math.ceil(fontMetrics.actualBoundingBoxAscent + fontMetrics.actualBoundingBoxDescent + 4);\n for (const text of texts) lines.push(fitAxisLabel(context, text, maxWidth ?? Infinity, overflow, maxLines));\n for (const { index, p } of priority) {\n const metrics = lines[index].map(text => context.measureText(text));\n const size = horizontal ? Math.max(...metrics.map(m => m.width)) : (lines[index].length - 1) * lineHeight + Math.max(...metrics.map(m => m.actualBoundingBoxAscent + m.actualBoundingBoxDescent));\n const interval = { start: p - size / 2, end: p + size / 2 };\n if (overlap === \"allow\" || occupied.every(other => interval.end + gap <= other.start || interval.start >= other.end + gap)) {\n visible.add(index); occupied.push(interval);\n }\n }\n } finally { context.restore(); }\n const path = new Path2D();\n if (horizontal) {\n path.moveTo(scale.range[0], baseline);\n path.lineTo(scale.range[1], baseline);\n } else {\n path.moveTo(baseline, scale.range[0]);\n path.lineTo(baseline, scale.range[1]);\n }\n const labels = selected.map((value, index) => {\n const p = position(scale, value);\n if (horizontal) {\n path.moveTo(p, baseline);\n path.lineTo(p, baseline + outward * 6);\n } else {\n path.moveTo(baseline, p);\n path.lineTo(baseline + outward * 6, p);\n }\n if (!visible.has(index)) return null;\n return lines[index].map((label, lineIndex) => (\n <Text\n key={`${index}:${lineIndex}`}\n pointerEvents=\"none\"\n style={{\n left: horizontal ? p : baseline + outward * 10,\n top: horizontal ? baseline + outward * 10 + (outward > 0 ? lineIndex : lineIndex - lines[index].length + 1) * lineHeight : p + (lineIndex - (lines[index].length - 1) / 2) * lineHeight,\n fill,\n font,\n opacity: alpha,\n textAlign: horizontal ? \"center\" : outward < 0 ? \"right\" : \"left\",\n textBaseline: horizontal ? outward > 0 ? \"top\" : \"bottom\" : \"middle\",\n }}\n >\n {label}\n </Text>\n ));\n });\n return [\n <Path\n key=\"axis\"\n pointerEvents=\"none\"\n style={{ d: path, stroke, strokeWidth, opacity: alpha }}\n />,\n labels,\n ];\n}\n"],
5
- "mappings": "AAqGM;AArGN,SAAS,MAAM,MAAM,oBAAoB,wBAAwB;AAEjE,SAAS,mBAAmB;AAC5B,SAAS,OAAO,eAAe;AAE/B,SAAS,oBAAoB;AAE7B,SAAS,OAAO,gBAAgB;AAUzB,SAAS,KAAK,OAAkB;AACrC,MACE,MAAM,aAAa,YACnB,MAAM,aAAa,UACnB,MAAM,aAAa,SACnB,MAAM,aAAa;AAEnB,UAAM,IAAI,UAAU,oDAAoD;AAC1E,QAAM,SAAS,YAAY,MAAM,OAAO,MAAM;AAC9C,MAAI,CAAC,OAAQ,OAAM,IAAI,UAAU,2BAA2B;AAC5D,QAAM,QAAQ,OAAO,IAAI;AACzB,QAAM,QAAQ,mBAAmB,MAAM,KAAK,KAAK,CAAC;AAClD,QAAM,SAAS,mBAAmB,MAAM,MAAM,KAAK;AACnD,QAA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AAM,UAAU,IAAI,YAAY,YAAY,MAAM,KAAK,EAAE,SAAS,KAAK,aAAa,KAAK,aAAa,MAAM,KAAK,EAAE,SAAS,KAAK,KAAK;AAAA,UAC7K;AAAA,UACA;AAAA,UACA,SAAS;AAAA,UACT,WAAW,aAAa,WAAW,UAAU,IAAI,UAAU;AAAA,UAC3D,cAAc,aAAa,UAAU,IAAI,QAAQ,WAAW;AAAA,QAC9D;AAAA,QAEC;AAAA;AAAA,MAZI,GAAG,KAAK,IAAI,SAAS;AAAA,IAa5B,CACD;AAAA,EACH,CAAC;AACD,SAAO;AAAA,IACL;AAAA,MAAC;AAAA;AAAA,QAEC,eAAc;AAAA,QACd,OAAO,EAAE,GAAG,MAAM,QAAQ,aAAa,SAAS,MAAM;AAAA;AAAA,MAFlD;AAAA,IAGN;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { Path, Text, resolveSignalValue, useCanvasContext } from \"@pibbl/core\";\nimport type { AxisProps } from \"./types.js\";\nimport { lookupScale } from \"./scale-context.js\";\nimport { width, opacity } from \"./paint.js\";\n\nimport { fitAxisLabel } from \"./axis-labels.js\";\n\nimport { ticks, position } from \"./scale-ticks.js\";\n\n/**\n * Draws ticks and labels using a named scale and the configured orientation and style.\n *\n * @param props - Scale, orientation, tick, label, and styling options. See {@link AxisProps}.\n * @returns Pibbl nodes drawing the axis.\n *\n * @see {@link AxisProps}\n */\nexport function Axis(props: AxisProps) {\n if (\n props.position !== \"bottom\" &&\n props.position !== \"left\" &&\n props.position !== \"top\" &&\n props.position !== \"right\"\n )\n throw new TypeError(\"Axis position must be bottom, left, top, or right.\");\n const source = lookupScale(props.scale, \"Axis\");\n if (!source) throw new TypeError(\"Axis requires a scale ID.\");\n const scale = source.get();\n const style = resolveSignalValue(props.style) ?? {};\n const stroke = resolveSignalValue(style.stroke) ?? \"#64748b\";\n const strokeWidth = width(resolveSignalValue(style.strokeWidth) ?? 1, \"Axis\");\n const fill = resolveSignalValue(style.fill) ?? \"#64748b\";\n const font = resolveSignalValue(style.font) ?? \"12px sans-serif\";\n const alpha = opacity(resolveSignalValue(style.opacity) ?? 1, \"Axis\");\n const horizontal = props.position === \"bottom\" || props.position === \"top\";\n const outward = props.position === \"bottom\" || props.position === \"right\" ? 1 : -1;\n const baseline = horizontal\n ? props.position === \"bottom\" ? scale.frame.height : 0\n : props.position === \"right\" ? scale.frame.width : 0;\n const selected = ticks(scale, props);\n const context = useCanvasContext();\n const overlap = resolveSignalValue(props.labelOverlap ?? \"allow\");\n const gap = resolveSignalValue(props.labelGap ?? 8);\n if (overlap !== \"allow\" && overlap !== \"skip\") throw new TypeError(\"Axis labelOverlap must be allow or skip.\");\n if (!Number.isFinite(gap) || gap < 0) throw new RangeError(\"Axis labelGap must be finite and nonnegative.\");\n const overflow = resolveSignalValue(props.labelOverflow ?? \"allow\");\n const maxWidth = props.labelMaxWidth === undefined ? undefined : resolveSignalValue(props.labelMaxWidth);\n const maxLines = resolveSignalValue(props.labelMaxLines ?? 2);\n const lineHeightInput = props.labelLineHeight === undefined ? undefined : resolveSignalValue(props.labelLineHeight);\n if (![\"allow\", \"wrap\", \"truncate\"].includes(overflow)) throw new TypeError(\"Axis labelOverflow must be allow, wrap, or truncate.\");\n if ((overflow !== \"allow\" && maxWidth === undefined) || (maxWidth !== undefined && (!Number.isFinite(maxWidth) || maxWidth <= 0))) throw new RangeError(\"Axis labelMaxWidth must be positive and finite for wrap/truncate.\");\n if (!Number.isInteger(maxLines) || maxLines < 1 || maxLines > 20) throw new RangeError(\"Axis labelMaxLines must be an integer from 1 to 20.\");\n if (lineHeightInput !== undefined && (!Number.isFinite(lineHeightInput) || lineHeightInput <= 0)) throw new RangeError(\"Axis labelLineHeight must be positive and finite.\");\n let lineHeight = 0;\n const lines: (readonly string[])[] = [];\n const occupied: { start: number; end: number }[] = [];\n const visible = new Set<number>();\n const texts = selected.map((value, index) => {\n const label = props.tickFormat ? props.tickFormat(value, index)\n : (scale.type === \"utc\" || scale.type === \"trading-time\") ? scale.formatTick(value as number)\n : typeof value === \"number\" ? String(Number(value.toPrecision(6))) : value;\n if (typeof label !== \"string\") throw new TypeError(\"Axis tickFormat must return a string.\");\n return label;\n });\n // Endpoints have priority; sort by physical position for reversed ranges too.\n const order = selected.map((value, index) => ({ index, p: position(scale, value) })).sort((a, b) => a.p - b.p);\n const priority = order.length > 1 ? [order[0], order[order.length - 1], ...order.slice(1, -1)] : order;\n context.save();\n try {\n context.font = font;\n const fontMetrics = context.measureText(\"Mg\");\n lineHeight = lineHeightInput ?? Math.ceil(fontMetrics.actualBoundingBoxAscent + fontMetrics.actualBoundingBoxDescent + 4);\n for (const text of texts) lines.push(fitAxisLabel(context, text, maxWidth ?? Infinity, overflow, maxLines));\n for (const { index, p } of priority) {\n const metrics = lines[index].map(text => context.measureText(text));\n const size = horizontal ? Math.max(...metrics.map(m => m.width)) : (lines[index].length - 1) * lineHeight + Math.max(...metrics.map(m => m.actualBoundingBoxAscent + m.actualBoundingBoxDescent));\n const interval = { start: p - size / 2, end: p + size / 2 };\n if (overlap === \"allow\" || occupied.every(other => interval.end + gap <= other.start || interval.start >= other.end + gap)) {\n visible.add(index); occupied.push(interval);\n }\n }\n } finally { context.restore(); }\n const path = new Path2D();\n if (horizontal) {\n path.moveTo(scale.range[0], baseline);\n path.lineTo(scale.range[1], baseline);\n } else {\n path.moveTo(baseline, scale.range[0]);\n path.lineTo(baseline, scale.range[1]);\n }\n const labels = selected.map((value, index) => {\n const p = position(scale, value);\n if (horizontal) {\n path.moveTo(p, baseline);\n path.lineTo(p, baseline + outward * 6);\n } else {\n path.moveTo(baseline, p);\n path.lineTo(baseline + outward * 6, p);\n }\n if (!visible.has(index)) return null;\n return lines[index].map((label, lineIndex) => (\n <Text\n key={`${index}:${lineIndex}`}\n pointerEvents=\"none\"\n style={{\n left: horizontal ? p : baseline + outward * 10,\n top: horizontal ? baseline + outward * 10 + (outward > 0 ? lineIndex : lineIndex - lines[index].length + 1) * lineHeight : p + (lineIndex - (lines[index].length - 1) / 2) * lineHeight,\n fill,\n font,\n opacity: alpha,\n textAlign: horizontal ? \"center\" : outward < 0 ? \"right\" : \"left\",\n textBaseline: horizontal ? outward > 0 ? \"top\" : \"bottom\" : \"middle\",\n }}\n >\n {label}\n </Text>\n ));\n });\n return [\n <Path\n key=\"axis\"\n pointerEvents=\"none\"\n style={{ d: path, stroke, strokeWidth, opacity: alpha }}\n />,\n labels,\n ];\n}\n"],
5
+ "mappings": "AAqGM;AArGN,SAAS,MAAM,MAAM,oBAAoB,wBAAwB;AAEjE,SAAS,mBAAmB;AAC5B,SAAS,OAAO,eAAe;AAE/B,SAAS,oBAAoB;AAE7B,SAAS,OAAO,gBAAgB;AAUzB,SAAS,KAAK,OAAkB;AACrC,MACE,MAAM,aAAa,YACnB,MAAM,aAAa,UACnB,MAAM,aAAa,SACnB,MAAM,aAAa;AAEnB,UAAM,IAAI,UAAU,oDAAoD;AAC1E,QAAM,SAAS,YAAY,MAAM,OAAO,MAAM;AAC9C,MAAI,CAAC,OAAQ,OAAM,IAAI,UAAU,2BAA2B;AAC5D,QAAM,QAAQ,OAAO,IAAI;AACzB,QAAM,QAAQ,mBAAmB,MAAM,KAAK,KAAK,CAAC;AAClD,QAAM,SAAS,mBAAmB,MAAM,MAAM,KAAK;AACnD,QAAM,cAAc,MAAM,mBAAmB,MAAM,WAAW,KAAK,GAAG,MAAM;AAC5E,QAAM,OAAO,mBAAmB,MAAM,IAAI,KAAK;AAC/C,QAAM,OAAO,mBAAmB,MAAM,IAAI,KAAK;AAC/C,QAAM,QAAQ,QAAQ,mBAAmB,MAAM,OAAO,KAAK,GAAG,MAAM;AACpE,QAAM,aAAa,MAAM,aAAa,YAAY,MAAM,aAAa;AACrE,QAAM,UAAU,MAAM,aAAa,YAAY,MAAM,aAAa,UAAU,IAAI;AAChF,QAAM,WAAW,aACb,MAAM,aAAa,WAAW,MAAM,MAAM,SAAS,IACnD,MAAM,aAAa,UAAU,MAAM,MAAM,QAAQ;AACrD,Q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c;AAAA,QACd,OAAO,EAAE,GAAG,MAAM,QAAQ,aAAa,SAAS,MAAM;AAAA;AAAA,MAFlD;AAAA,IAGN;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -63,6 +63,8 @@ interface BarSeriesBaseProps<D> extends PibblEventHandlers, PibblEventParticipat
63
63
  * Application data supplied to the component or reported by the event. See {@link SignalValue}.
64
64
  */
65
65
  readonly data: SignalValue<readonly D[]>;
66
+ /** Optional committed bar capture; rendering alone performs no inspection searches. */
67
+ readonly inspection?: import("../inspection/bar.js").BarInspectionRef<D>;
66
68
  /** Selects `"vertical"`, `"horizontal"` for orientation. See {@link BarSeriesBaseProps}. */
67
69
  readonly orientation?: "vertical" | "horizontal";
68
70
  /** Property or callback extracting a bar's discrete category. See {@link BarCategoryAccessor}. */
@@ -147,4 +149,4 @@ export type BarSeriesProps<D> = BarSeriesBaseProps<D> & ({
147
149
  *
148
150
  * @see {@link BarSeriesProps}
149
151
  */
150
- export declare function BarSeries<D>({ data: input, orientation, category: categoryInput, value: valueInput, valueStart, valueEnd, categoryScale, valueScale, baseline, group, groupScale, defined, style: styleInput, pointerEvents, ...events }: BarSeriesProps<D>): import("../../../jsx-runtime.js").JSX.Element;
152
+ export declare function BarSeries<D>({ data: input, orientation, category: categoryInput, value: valueInput, valueStart, valueEnd, categoryScale, valueScale, baseline, group, groupScale, defined, style: styleInput, pointerEvents, inspection, ...events }: BarSeriesProps<D>): import("../../../jsx-runtime.js").JSX.Element;
@@ -28,6 +28,7 @@ function BarSeries({
28
28
  defined,
29
29
  style: styleInput,
30
30
  pointerEvents,
31
+ inspection,
31
32
  ...events
32
33
  }) {
33
34
  const categories = useBarScale(categoryScale).get();
@@ -98,6 +99,7 @@ function BarSeries({
98
99
  }
99
100
  const shared = typeof specified === "function" ? void 0 : normalize(specified ?? {}, false);
100
101
  const nodes = [];
102
+ const captured = inspection ? [] : void 0;
101
103
  for (let i = 0; i < data.length; i++) {
102
104
  const datum = data[i];
103
105
  if (defined && !defined(datum, i, data)) continue;
@@ -124,6 +126,18 @@ function BarSeries({
124
126
  throw new RangeError("BarSeries value extent must be finite.");
125
127
  if (extent === 0) continue;
126
128
  const vertical = orientation === "vertical";
129
+ const markFill = fill(from, v);
130
+ captured?.push(Object.freeze({
131
+ datum,
132
+ sourceIndex: i,
133
+ category: c,
134
+ group: g ?? void 0,
135
+ valueStart: from,
136
+ valueEnd: v,
137
+ boundsLocal: Object.freeze({ x: vertical ? start + (slotWidth - bandwidth) / 2 : Math.min(base, end), y: vertical ? Math.min(base, end) : start + (slotWidth - bandwidth) / 2, width: vertical ? bandwidth : extent, height: vertical ? extent : bandwidth }),
138
+ fill: !!markFill,
139
+ strokeWidthLocal: stroke ? strokeWidth : 0
140
+ }));
127
141
  nodes.push(
128
142
  /* @__PURE__ */ jsx(
129
143
  Rectangle,
@@ -134,7 +148,7 @@ function BarSeries({
134
148
  top: vertical ? Math.min(base, end) : start + (slotWidth - bandwidth) / 2,
135
149
  width: vertical ? bandwidth : extent,
136
150
  height: vertical ? extent : bandwidth,
137
- fill: fill(from, v),
151
+ fill: markFill,
138
152
  stroke,
139
153
  strokeWidth,
140
154
  opacity: alpha,
@@ -145,6 +159,7 @@ function BarSeries({
145
159
  )
146
160
  );
147
161
  }
162
+ if (inspection) inspection.capture(captured);
148
163
  return /* @__PURE__ */ jsx(Group, { ...events, children: nodes });
149
164
  }
150
165
  export {