@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,49 @@
1
+ import { useRenderedRef } from "./owned-ref.js";
2
+ function useBarInspection(_inputs) {
3
+ return useRenderedRef(
4
+ "barSeriesInspection",
5
+ (marks, geometry) => Object.freeze({
6
+ marks: Object.freeze(marks.slice()),
7
+ assertLive: geometry.assertLive,
8
+ localAtRoot: geometry.localAtRoot,
9
+ anchorInsideClips: geometry.anchorInsideClips
10
+ })
11
+ );
12
+ }
13
+ function paintedBarAt(rendered, options) {
14
+ rendered.assertLive();
15
+ if (!Number.isFinite(options.rootPoint.x) || !Number.isFinite(options.rootPoint.y))
16
+ throw new RangeError("paintedBarAt rootPoint must be finite.");
17
+ const point = rendered.localAtRoot(options.rootPoint);
18
+ if (!point || !rendered.anchorInsideClips(point)) return void 0;
19
+ for (let index = rendered.marks.length - 1; index >= 0; index--) {
20
+ const mark = rendered.marks[index], b = mark.boundsLocal, half = mark.strokeWidthLocal / 2;
21
+ const inside = point.x >= b.x && point.x <= b.x + b.width && point.y >= b.y && point.y <= b.y + b.height;
22
+ const outline = half > 0 && point.x >= b.x - half && point.x <= b.x + b.width + half && point.y >= b.y - half && point.y <= b.y + b.height + half && !(point.x > b.x + half && point.x < b.x + b.width - half && point.y > b.y + half && point.y < b.y + b.height - half);
23
+ if (!(mark.fill && inside || outline)) continue;
24
+ const {
25
+ datum,
26
+ sourceIndex,
27
+ category,
28
+ group,
29
+ valueStart,
30
+ valueEnd,
31
+ boundsLocal
32
+ } = mark;
33
+ return Object.freeze({
34
+ datum,
35
+ sourceIndex,
36
+ category,
37
+ group,
38
+ valueStart,
39
+ valueEnd,
40
+ boundsLocal
41
+ });
42
+ }
43
+ return void 0;
44
+ }
45
+ export {
46
+ paintedBarAt,
47
+ useBarInspection
48
+ };
49
+ //# sourceMappingURL=bar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/features/viz/inspection/bar.ts"],
4
+ "sourcesContent": ["import type { LayoutBox } from \"@pibbl/core\";\nimport type { BarSeriesProps } from \"../lib/bar-series.js\";\nimport type { BandCategory } from \"../lib/types.js\";\nimport type { RenderedSeriesPoint } from \"./query-types.js\";\nimport { useRenderedRef } from \"./owned-ref.js\";\n\n/** Original range/value/grouped bar with its captured endpoints and local paint bounds.\n * @see {@link BarRenderedSeries}\n */\nexport interface PaintedBarHit<D> {\n /** Caller-owned original record. */\n readonly datum: D;\n /** Original zero-based source position. */\n readonly sourceIndex: number;\n /** Original discrete category, without numeric coercion. */\n readonly category: BandCategory;\n /** Original subgroup when grouping is enabled. */\n readonly group: BandCategory | undefined;\n /** Data-space starting endpoint, including an ordinary bar's baseline. */\n readonly valueStart: number;\n /** Data-space ending endpoint. */\n readonly valueEnd: number;\n /** Logical rectangle bounds before world transforms. */\n readonly boundsLocal: Readonly<LayoutBox>;\n}\n/** @internal Captured rectangle paint flags used only for geometric lookup. */\nexport interface CapturedBarMark<D> extends PaintedBarHit<D> {\n /** Whether this rectangle paints its interior. */\n readonly fill: boolean;\n /** Painted stroke width in local logical units. */\n readonly strokeWidthLocal: number;\n}\n/** A borrowed committed categorical bar generation; contains no numeric category mapping.\n * @see {@link PaintedBarHit}\n */\nexport interface BarRenderedSeries<D> {\n /** Original records and geometry in source paint order. */\n readonly marks: readonly CapturedBarMark<D>[];\n /** Throws after replacement or disposal. */\n assertLive(): void;\n /** Converts root logical units into this generation's local geometry.\n * @param point - Root-logical Canvas point.\n * @returns Local point or undefined for a singular transform.\n */\n localAtRoot(\n point: Readonly<RenderedSeriesPoint>,\n ): Readonly<RenderedSeriesPoint> | undefined;\n /** Tests a local point against every committed clip/layer bound.\n * @param point - Local-logical Canvas point.\n * @returns Whether the point is inside every clip and layer bound.\n */\n anchorInsideClips(point: Readonly<RenderedSeriesPoint>): boolean;\n}\n/** Mount-owned optional categorical-bar capture.\n * @see {@link BarRenderedSeries}\n */\nexport interface BarInspectionRef<D> {\n /** Returns the last successful generation.\n * @returns Borrowed bar geometry or undefined before paint/after disposal.\n */\n rendered(): BarRenderedSeries<D> | undefined;\n /** @internal Records candidate values and paint geometry without executing a search.\n * @param input - Source-ordered captured rectangle marks.\n */\n capture(input: readonly CapturedBarMark<D>[]): void;\n}\n\n/**\n * Owns opt-in capture for ordinary, range or grouped categorical bars.\n * @param _inputs - Bar inputs used for datum inference; no data is read or subscribed here.\n * @returns A stable ref to pass to one BarSeries inspection prop; captured endpoints share one fixed contract.\n * @see {@link BarInspectionRef}\n */\nexport function useBarInspection<D>(\n _inputs: Pick<BarSeriesProps<D>, \"data\" | \"category\">,\n): BarInspectionRef<D> {\n return useRenderedRef<readonly CapturedBarMark<D>[], BarRenderedSeries<D>>(\n \"barSeriesInspection\",\n (marks, geometry) =>\n Object.freeze({\n marks: Object.freeze(marks.slice()),\n assertLive: geometry.assertLive,\n localAtRoot: geometry.localAtRoot,\n anchorInsideClips: geometry.anchorInsideClips,\n }),\n );\n}\n\n/**\n * Finds the last-painted bar covering a root-logical point in this explicit series.\n * @param rendered - Borrowed committed categorical bar values and rectangle geometry.\n * @param options - Root-logical query point; respects every clip, fill/stroke and source order.\n * @returns Original record, category/group, endpoints and local bounds, or undefined for gaps and singular transforms.\n * @see {@link PaintedBarHit}\n */\nexport function paintedBarAt<D>(\n rendered: BarRenderedSeries<D>,\n options: { rootPoint: Readonly<RenderedSeriesPoint> },\n): PaintedBarHit<D> | undefined {\n rendered.assertLive();\n if (\n !Number.isFinite(options.rootPoint.x) ||\n !Number.isFinite(options.rootPoint.y)\n )\n throw new RangeError(\"paintedBarAt rootPoint must be finite.\");\n const point = rendered.localAtRoot(options.rootPoint);\n if (!point || !rendered.anchorInsideClips(point)) return undefined;\n for (let index = rendered.marks.length - 1; index >= 0; index--) {\n const mark = rendered.marks[index],\n b = mark.boundsLocal,\n half = mark.strokeWidthLocal / 2;\n const inside =\n point.x >= b.x &&\n point.x <= b.x + b.width &&\n point.y >= b.y &&\n point.y <= b.y + b.height;\n const outline =\n half > 0 &&\n point.x >= b.x - half &&\n point.x <= b.x + b.width + half &&\n point.y >= b.y - half &&\n point.y <= b.y + b.height + half &&\n !(\n point.x > b.x + half &&\n point.x < b.x + b.width - half &&\n point.y > b.y + half &&\n point.y < b.y + b.height - half\n );\n if (!((mark.fill && inside) || outline)) continue;\n const {\n datum,\n sourceIndex,\n category,\n group,\n valueStart,\n valueEnd,\n boundsLocal,\n } = mark;\n return Object.freeze({\n datum,\n sourceIndex,\n category,\n group,\n valueStart,\n valueEnd,\n boundsLocal,\n });\n }\n return undefined;\n}\n"],
5
+ "mappings": "AAIA,SAAS,sBAAsB;AAqExB,SAAS,iBACd,SACqB;AACrB,SAAO;AAAA,IACL;AAAA,IACA,CAAC,OAAO,aACN,OAAO,OAAO;AAAA,MACZ,OAAO,OAAO,OAAO,MAAM,MAAM,CAAC;AAAA,MAClC,YAAY,SAAS;AAAA,MACrB,aAAa,SAAS;AAAA,MACtB,mBAAmB,SAAS;AAAA,IAC9B,CAAC;AAAA,EACL;AACF;AASO,SAAS,aACd,UACA,SAC8B;AAC9B,WAAS,WAAW;AACpB,MACE,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC,KACpC,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC;AAEpC,UAAM,IAAI,WAAW,wCAAwC;AAC/D,QAAM,QAAQ,SAAS,YAAY,QAAQ,SAAS;AACpD,MAAI,CAAC,SAAS,CAAC,SAAS,kBAAkB,KAAK,EAAG,QAAO;AACzD,WAAS,QAAQ,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS;AAC/D,UAAM,OAAO,SAAS,MAAM,KAAK,GAC/B,IAAI,KAAK,aACT,OAAO,KAAK,mBAAmB;AACjC,UAAM,SACJ,MAAM,KAAK,EAAE,KACb,MAAM,KAAK,EAAE,IAAI,EAAE,SACnB,MAAM,KAAK,EAAE,KACb,MAAM,KAAK,EAAE,IAAI,EAAE;AACrB,UAAM,UACJ,OAAO,KACP,MAAM,KAAK,EAAE,IAAI,QACjB,MAAM,KAAK,EAAE,IAAI,EAAE,QAAQ,QAC3B,MAAM,KAAK,EAAE,IAAI,QACjB,MAAM,KAAK,EAAE,IAAI,EAAE,SAAS,QAC5B,EACE,MAAM,IAAI,EAAE,IAAI,QAChB,MAAM,IAAI,EAAE,IAAI,EAAE,QAAQ,QAC1B,MAAM,IAAI,EAAE,IAAI,QAChB,MAAM,IAAI,EAAE,IAAI,EAAE,SAAS;AAE/B,QAAI,EAAG,KAAK,QAAQ,UAAW,SAAU;AACzC,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI;AACJ,WAAO,OAAO,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,156 @@
1
+ import type { LayoutBox } from "@pibbl/core";
2
+ import type { CandlestickSeriesProps } from "../lib/candlestick-series.js";
3
+ import { type NumericPositionScale } from "../lib/series-position.js";
4
+ import type { ResolvedContinuousScale } from "../lib/types.js";
5
+ import type { NumericRenderedSeries, RenderedSeriesPoint } from "./query-types.js";
6
+ /** One original candle with its evaluated OHLC values and committed local geometry.
7
+ * @see {@link CandleRenderedSeries}
8
+ */
9
+ export interface CandleObservation<D> {
10
+ /** Caller-owned original record. */
11
+ readonly datum: D;
12
+ /** Original source index, including skipped records. */
13
+ readonly sourceIndex: number;
14
+ /** Evaluated UTC-millisecond timestamp. */
15
+ readonly time: number;
16
+ /** Evaluated opening value. */
17
+ readonly open: number;
18
+ /** Evaluated high value. */
19
+ readonly high: number;
20
+ /** Evaluated low value. */
21
+ readonly low: number;
22
+ /** Evaluated closing value. */
23
+ readonly close: number;
24
+ /** Closing endpoint in series-local logical units. */
25
+ readonly anchorLocal: Readonly<RenderedSeriesPoint>;
26
+ /** Closing endpoint in root-logical units. */
27
+ readonly anchorRoot: Readonly<RenderedSeriesPoint>;
28
+ /** Body rectangle before world transforms. */
29
+ readonly bodyBoundsLocal: Readonly<LayoutBox>;
30
+ /** Wick center and endpoints before world transforms. */
31
+ readonly wickLocal: Readonly<{
32
+ /** Horizontal wick center in series-local logical units. */
33
+ x: number;
34
+ /** Mapped low endpoint in series-local logical units. */
35
+ lowY: number;
36
+ /** Mapped high endpoint in series-local logical units. */
37
+ highY: number;
38
+ }>;
39
+ }
40
+ /** A candle candidate whose closing endpoint can be tested against committed clips.
41
+ * @see {@link CandleObservation}
42
+ */
43
+ export interface CandleInspectionCandidate<D> extends CandleObservation<D> {
44
+ /**
45
+ * @returns Whether the close anchor lies inside every committed clip.
46
+ */
47
+ anchorInsideClips(): boolean;
48
+ }
49
+ /** Candle selected by nearest timestamp.
50
+ * @see {@link nearestRecordedCandleX}
51
+ */
52
+ export interface NearestCandleHit<D> extends CandleObservation<D> {
53
+ /** Absolute UTC-millisecond distance from the requested timestamp. */
54
+ readonly timeDelta: number;
55
+ }
56
+ /** Candle part whose actual painted geometry covers a root-logical query point.
57
+ * @see {@link paintedCandleAt}
58
+ */
59
+ export interface PaintedCandleHit<D> extends CandleObservation<D> {
60
+ /** Part selected in source paint order: body paints after wick. */
61
+ readonly part: "body" | "wick";
62
+ }
63
+ /** @internal Local candle geometry and paint flags committed by CandlestickSeries. */
64
+ export interface CapturedCandleMark<D> extends Omit<CandleObservation<D>, "anchorRoot"> {
65
+ /** Whether the body paints an interior. */
66
+ readonly bodyFill: boolean;
67
+ /** Local body outline width, zero when its outline is not painted. */
68
+ readonly bodyStrokeWidthLocal: number;
69
+ /** Local wick stroke width, zero when its wick is not painted. */
70
+ readonly wickStrokeWidthLocal: number;
71
+ }
72
+ /** Borrowed committed candle generation.
73
+ * @see {@link CandleInspectionRef}
74
+ */
75
+ export interface CandleRenderedSeries<D> {
76
+ /** Captured original records, values, and geometry in source order. */
77
+ readonly observations: readonly CandleObservation<D>[];
78
+ /** Throws after replacement or disposal. */
79
+ assertLive(): void;
80
+ /**
81
+ * Selects the supplied/nearest timestamp at a root-logical coordinate.
82
+ * @param pointRoot - Root-logical point to invert through the committed transform.
83
+ * @returns UTC milliseconds, or undefined for singular transforms or empty mappings.
84
+ */
85
+ timeAtRoot(pointRoot: Readonly<RenderedSeriesPoint>): number | undefined;
86
+ /**
87
+ * Tests local geometry against each committed clip.
88
+ * @param pointLocal - Series-local logical point.
89
+ * @returns Whether every committed clip contains the point.
90
+ */
91
+ anchorInsideClips(pointLocal: Readonly<RenderedSeriesPoint>): boolean;
92
+ /** @internal Captured paint flags in source paint order. */
93
+ readonly marks: readonly CapturedCandleMark<D>[];
94
+ /** @internal Numeric-query view based on close endpoints. */
95
+ readonly numeric: NumericRenderedSeries<D>;
96
+ /**
97
+ * @internal Converts root-logical points to local geometry.
98
+ * @param point - Root-logical point to convert.
99
+ * @returns Series-local point, or undefined when the transform is singular.
100
+ */
101
+ localAtRoot(point: Readonly<RenderedSeriesPoint>): Readonly<RenderedSeriesPoint> | undefined;
102
+ }
103
+ /** Mount-owned optional candle capture.
104
+ * @see {@link useCandleInspection}
105
+ */
106
+ export interface CandleInspectionRef<D> {
107
+ /**
108
+ * @returns The current borrowed generation, or undefined before paint and after disposal.
109
+ */
110
+ rendered(): CandleRenderedSeries<D> | undefined;
111
+ /**
112
+ * @internal Records a completed CandlestickSeries paint without executing queries.
113
+ * @param input - Source-ordered marks and the committed numeric mappings.
114
+ */
115
+ capture(input: {
116
+ /** Source-ordered local marks and paint flags. */
117
+ marks: readonly CapturedCandleMark<D>[];
118
+ /** Committed numeric or trading-time horizontal mapping. */
119
+ xScale: NumericPositionScale;
120
+ /** Committed continuous vertical mapping. */
121
+ yScale: ResolvedContinuousScale;
122
+ }): void;
123
+ }
124
+ /**
125
+ * Creates a stable optional candle receiver without reading data or subscribing.
126
+ *
127
+ * @param _inputs - Inputs retained only to infer the original datum type.
128
+ * @returns A ref for exactly one CandlestickSeries inspection prop.
129
+ * @see {@link CandleInspectionRef}
130
+ */
131
+ export declare function useCandleInspection<D>(_inputs: Pick<CandlestickSeriesProps<D>, "data" | "time" | "open" | "high" | "low" | "close">): CandleInspectionRef<D>;
132
+ /**
133
+ * Selects a captured candle nearest to a requested UTC timestamp.
134
+ *
135
+ * @param rendered - Borrowed committed candle generation.
136
+ * @param options - Timestamp and optional pure candidate filter.
137
+ * @returns The first source-order candle on a tie, or undefined when none qualifies.
138
+ * @see {@link NearestCandleHit}
139
+ */
140
+ export declare function nearestRecordedCandleX<D>(rendered: CandleRenderedSeries<D>, options: {
141
+ time: number;
142
+ filter?: (observation: CandleInspectionCandidate<D>) => boolean;
143
+ }): NearestCandleHit<D> | undefined;
144
+ /**
145
+ * Finds the last-painted candle body or wick covering a root-logical point.
146
+ *
147
+ * Body coverage is tested before wick coverage because a candle paints its body after its wick.
148
+ *
149
+ * @param rendered - Borrowed committed candle generation.
150
+ * @param options - Root-logical point; clips and singular transforms produce no result.
151
+ * @returns Captured candle and painted part, or undefined for gaps and unpainted geometry.
152
+ * @see {@link PaintedCandleHit}
153
+ */
154
+ export declare function paintedCandleAt<D>(rendered: CandleRenderedSeries<D>, options: {
155
+ rootPoint: Readonly<RenderedSeriesPoint>;
156
+ }): PaintedCandleHit<D> | undefined;
@@ -0,0 +1,120 @@
1
+ import {
2
+ invertNumericPosition
3
+ } from "../lib/series-position.js";
4
+ import { nearestRecordedX } from "./queries.js";
5
+ import { useRenderedRef } from "./owned-ref.js";
6
+ function useCandleInspection(_inputs) {
7
+ return useRenderedRef("candleInspection", (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
+ open: mark.open,
15
+ high: mark.high,
16
+ low: mark.low,
17
+ close: mark.close,
18
+ anchorLocal: mark.anchorLocal,
19
+ anchorRoot: geometry.rootAtLocal(mark.anchorLocal),
20
+ bodyBoundsLocal: mark.bodyBoundsLocal,
21
+ wickLocal: mark.wickLocal
22
+ })
23
+ )
24
+ );
25
+ const numeric = Object.freeze({
26
+ observations: Object.freeze(
27
+ observations.map(
28
+ (row) => Object.freeze({
29
+ ...row,
30
+ domainX: row.time,
31
+ domainY: row.close,
32
+ run: 0
33
+ })
34
+ )
35
+ ),
36
+ assertLive: geometry.assertLive,
37
+ domainXAtRoot(point) {
38
+ const local = geometry.localAtRoot(point);
39
+ return local ? invertNumericPosition(candidate.xScale, local.x) : void 0;
40
+ },
41
+ anchorInsideClips: geometry.anchorInsideClips,
42
+ anchorAtDomain(point) {
43
+ geometry.assertLive();
44
+ const anchorLocal = Object.freeze({
45
+ x: candidate.xScale.map(point.domainX),
46
+ y: candidate.yScale.map(point.domainY)
47
+ });
48
+ return Object.freeze({
49
+ anchorLocal,
50
+ anchorRoot: geometry.rootAtLocal(anchorLocal)
51
+ });
52
+ }
53
+ });
54
+ return Object.freeze({
55
+ observations,
56
+ marks: Object.freeze(candidate.marks.slice()),
57
+ numeric,
58
+ assertLive: geometry.assertLive,
59
+ localAtRoot: geometry.localAtRoot,
60
+ anchorInsideClips: geometry.anchorInsideClips,
61
+ timeAtRoot: numeric.domainXAtRoot
62
+ });
63
+ });
64
+ }
65
+ function nearestRecordedCandleX(rendered, options) {
66
+ const hit = nearestRecordedX(rendered.numeric, {
67
+ domainX: options.time,
68
+ filter: options.filter ? (candidate) => options.filter(
69
+ candidate
70
+ ) : void 0
71
+ });
72
+ if (!hit) return void 0;
73
+ const row = rendered.observations.find(
74
+ (observation) => observation.sourceIndex === hit.sourceIndex
75
+ );
76
+ return Object.freeze({ ...row, timeDelta: hit.domainDelta });
77
+ }
78
+ function rectangleCovers(point, bounds, fill, strokeWidth) {
79
+ const half = strokeWidth / 2;
80
+ const inside = point.x >= bounds.x && point.x <= bounds.x + bounds.width && point.y >= bounds.y && point.y <= bounds.y + bounds.height;
81
+ const outline = half > 0 && point.x >= bounds.x - half && point.x <= bounds.x + bounds.width + half && point.y >= bounds.y - half && point.y <= bounds.y + bounds.height + half && !(point.x > bounds.x + half && point.x < bounds.x + bounds.width - half && point.y > bounds.y + half && point.y < bounds.y + bounds.height - half);
82
+ return fill && inside || outline;
83
+ }
84
+ function wickCovers(point, wick, strokeWidth) {
85
+ if (strokeWidth <= 0 || wick.lowY === wick.highY) return false;
86
+ const half = strokeWidth / 2;
87
+ return point.x >= wick.x - half && point.x <= wick.x + half && point.y >= Math.min(wick.lowY, wick.highY) && point.y <= Math.max(wick.lowY, wick.highY);
88
+ }
89
+ function paintedCandleAt(rendered, options) {
90
+ rendered.assertLive();
91
+ if (!Number.isFinite(options.rootPoint.x) || !Number.isFinite(options.rootPoint.y))
92
+ throw new RangeError("paintedCandleAt rootPoint must be finite.");
93
+ const point = rendered.localAtRoot(options.rootPoint);
94
+ if (!point || !rendered.anchorInsideClips(point)) return void 0;
95
+ for (let index = rendered.marks.length - 1; index >= 0; index--) {
96
+ const mark = rendered.marks[index];
97
+ if (rectangleCovers(
98
+ point,
99
+ mark.bodyBoundsLocal,
100
+ mark.bodyFill,
101
+ mark.bodyStrokeWidthLocal
102
+ ))
103
+ return Object.freeze({
104
+ ...rendered.observations[index],
105
+ part: "body"
106
+ });
107
+ if (wickCovers(point, mark.wickLocal, mark.wickStrokeWidthLocal))
108
+ return Object.freeze({
109
+ ...rendered.observations[index],
110
+ part: "wick"
111
+ });
112
+ }
113
+ return void 0;
114
+ }
115
+ export {
116
+ nearestRecordedCandleX,
117
+ paintedCandleAt,
118
+ useCandleInspection
119
+ };
120
+ //# sourceMappingURL=candle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/features/viz/inspection/candle.ts"],
4
+ "sourcesContent": ["import type { LayoutBox } from \"@pibbl/core\";\nimport type { CandlestickSeriesProps } from \"../lib/candlestick-series.js\";\nimport {\n invertNumericPosition,\n type NumericPositionScale,\n} from \"../lib/series-position.js\";\nimport type { ResolvedContinuousScale } from \"../lib/types.js\";\nimport type {\n NumericRenderedSeries,\n RenderedSeriesPoint,\n} from \"./query-types.js\";\nimport { nearestRecordedX } from \"./queries.js\";\nimport { useRenderedRef } from \"./owned-ref.js\";\n\n/** One original candle with its evaluated OHLC values and committed local geometry.\n * @see {@link CandleRenderedSeries}\n */\nexport interface CandleObservation<D> {\n /** Caller-owned original record. */\n readonly datum: D;\n /** Original source index, including skipped records. */\n readonly sourceIndex: number;\n /** Evaluated UTC-millisecond timestamp. */\n readonly time: number;\n /** Evaluated opening value. */\n readonly open: number;\n /** Evaluated high value. */\n readonly high: number;\n /** Evaluated low value. */\n readonly low: number;\n /** Evaluated closing value. */\n readonly close: number;\n /** Closing endpoint in series-local logical units. */\n readonly anchorLocal: Readonly<RenderedSeriesPoint>;\n /** Closing endpoint in root-logical units. */\n readonly anchorRoot: Readonly<RenderedSeriesPoint>;\n /** Body rectangle before world transforms. */\n readonly bodyBoundsLocal: Readonly<LayoutBox>;\n /** Wick center and endpoints before world transforms. */\n readonly wickLocal: Readonly<{\n /** Horizontal wick center in series-local logical units. */\n x: number;\n /** Mapped low endpoint in series-local logical units. */\n lowY: number;\n /** Mapped high endpoint in series-local logical units. */\n highY: number;\n }>;\n}\n\n/** A candle candidate whose closing endpoint can be tested against committed clips.\n * @see {@link CandleObservation}\n */\nexport interface CandleInspectionCandidate<D> extends CandleObservation<D> {\n /**\n * @returns Whether the close anchor lies inside every committed clip.\n */\n anchorInsideClips(): boolean;\n}\n\n/** Candle selected by nearest timestamp.\n * @see {@link nearestRecordedCandleX}\n */\nexport interface NearestCandleHit<D> extends CandleObservation<D> {\n /** Absolute UTC-millisecond distance from the requested timestamp. */\n readonly timeDelta: number;\n}\n\n/** Candle part whose actual painted geometry covers a root-logical query point.\n * @see {@link paintedCandleAt}\n */\nexport interface PaintedCandleHit<D> extends CandleObservation<D> {\n /** Part selected in source paint order: body paints after wick. */\n readonly part: \"body\" | \"wick\";\n}\n\n/** @internal Local candle geometry and paint flags committed by CandlestickSeries. */\nexport interface CapturedCandleMark<D> extends Omit<\n CandleObservation<D>,\n \"anchorRoot\"\n> {\n /** Whether the body paints an interior. */\n readonly bodyFill: boolean;\n /** Local body outline width, zero when its outline is not painted. */\n readonly bodyStrokeWidthLocal: number;\n /** Local wick stroke width, zero when its wick is not painted. */\n readonly wickStrokeWidthLocal: number;\n}\n\n/** Borrowed committed candle generation.\n * @see {@link CandleInspectionRef}\n */\nexport interface CandleRenderedSeries<D> {\n /** Captured original records, values, and geometry in source order. */\n readonly observations: readonly CandleObservation<D>[];\n /** Throws after replacement or disposal. */\n assertLive(): void;\n /**\n * Selects the supplied/nearest timestamp at a root-logical coordinate.\n * @param pointRoot - Root-logical point to invert through the committed transform.\n * @returns UTC milliseconds, or undefined for singular transforms or empty mappings.\n */\n timeAtRoot(pointRoot: Readonly<RenderedSeriesPoint>): number | undefined;\n /**\n * Tests local geometry against each committed clip.\n * @param pointLocal - Series-local logical point.\n * @returns Whether every committed clip contains the point.\n */\n anchorInsideClips(pointLocal: Readonly<RenderedSeriesPoint>): boolean;\n /** @internal Captured paint flags in source paint order. */\n readonly marks: readonly CapturedCandleMark<D>[];\n /** @internal Numeric-query view based on close endpoints. */\n readonly numeric: NumericRenderedSeries<D>;\n /**\n * @internal Converts root-logical points to local geometry.\n * @param point - Root-logical point to convert.\n * @returns Series-local point, or undefined when the transform is singular.\n */\n localAtRoot(\n point: Readonly<RenderedSeriesPoint>,\n ): Readonly<RenderedSeriesPoint> | undefined;\n}\n\n/** Mount-owned optional candle capture.\n * @see {@link useCandleInspection}\n */\nexport interface CandleInspectionRef<D> {\n /**\n * @returns The current borrowed generation, or undefined before paint and after disposal.\n */\n rendered(): CandleRenderedSeries<D> | undefined;\n /**\n * @internal Records a completed CandlestickSeries paint without executing queries.\n * @param input - Source-ordered marks and the committed numeric mappings.\n */\n capture(input: {\n /** Source-ordered local marks and paint flags. */\n marks: readonly CapturedCandleMark<D>[];\n /** Committed numeric or trading-time horizontal mapping. */\n xScale: NumericPositionScale;\n /** Committed continuous vertical mapping. */\n yScale: ResolvedContinuousScale;\n }): void;\n}\n\n/**\n * Creates a stable optional candle receiver without reading data or subscribing.\n *\n * @param _inputs - Inputs retained only to infer the original datum type.\n * @returns A ref for exactly one CandlestickSeries inspection prop.\n * @see {@link CandleInspectionRef}\n */\nexport function useCandleInspection<D>(\n _inputs: Pick<\n CandlestickSeriesProps<D>,\n \"data\" | \"time\" | \"open\" | \"high\" | \"low\" | \"close\"\n >,\n): CandleInspectionRef<D> {\n return useRenderedRef<\n {\n marks: readonly CapturedCandleMark<D>[];\n xScale: NumericPositionScale;\n yScale: ResolvedContinuousScale;\n },\n CandleRenderedSeries<D>\n >(\"candleInspection\", (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 open: mark.open,\n high: mark.high,\n low: mark.low,\n close: mark.close,\n anchorLocal: mark.anchorLocal,\n anchorRoot: geometry.rootAtLocal(mark.anchorLocal),\n bodyBoundsLocal: mark.bodyBoundsLocal,\n wickLocal: mark.wickLocal,\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.close,\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/**\n * Selects a captured candle nearest to a requested UTC timestamp.\n *\n * @param rendered - Borrowed committed candle generation.\n * @param options - Timestamp and optional pure candidate filter.\n * @returns The first source-order candle on a tie, or undefined when none qualifies.\n * @see {@link NearestCandleHit}\n */\nexport function nearestRecordedCandleX<D>(\n rendered: CandleRenderedSeries<D>,\n options: {\n time: number;\n filter?: (observation: CandleInspectionCandidate<D>) => boolean;\n },\n): NearestCandleHit<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 & CandleInspectionCandidate<D>,\n )\n : undefined,\n });\n if (!hit) return undefined;\n const row = rendered.observations.find(\n (observation) => observation.sourceIndex === hit.sourceIndex,\n )!;\n return Object.freeze({ ...row, timeDelta: hit.domainDelta });\n}\n\nfunction rectangleCovers(\n point: Readonly<RenderedSeriesPoint>,\n bounds: Readonly<LayoutBox>,\n fill: boolean,\n strokeWidth: number,\n): boolean {\n const half = strokeWidth / 2;\n const inside =\n point.x >= bounds.x &&\n point.x <= bounds.x + bounds.width &&\n point.y >= bounds.y &&\n point.y <= bounds.y + bounds.height;\n const outline =\n half > 0 &&\n point.x >= bounds.x - half &&\n point.x <= bounds.x + bounds.width + half &&\n point.y >= bounds.y - half &&\n point.y <= bounds.y + bounds.height + half &&\n !(\n point.x > bounds.x + half &&\n point.x < bounds.x + bounds.width - half &&\n point.y > bounds.y + half &&\n point.y < bounds.y + bounds.height - half\n );\n return (fill && inside) || outline;\n}\n\nfunction wickCovers(\n point: Readonly<RenderedSeriesPoint>,\n wick: Readonly<{ x: number; lowY: number; highY: number }>,\n strokeWidth: number,\n): boolean {\n if (strokeWidth <= 0 || wick.lowY === wick.highY) return false;\n const half = strokeWidth / 2;\n return (\n point.x >= wick.x - half &&\n point.x <= wick.x + half &&\n point.y >= Math.min(wick.lowY, wick.highY) &&\n point.y <= Math.max(wick.lowY, wick.highY)\n );\n}\n\n/**\n * Finds the last-painted candle body or wick covering a root-logical point.\n *\n * Body coverage is tested before wick coverage because a candle paints its body after its wick.\n *\n * @param rendered - Borrowed committed candle generation.\n * @param options - Root-logical point; clips and singular transforms produce no result.\n * @returns Captured candle and painted part, or undefined for gaps and unpainted geometry.\n * @see {@link PaintedCandleHit}\n */\nexport function paintedCandleAt<D>(\n rendered: CandleRenderedSeries<D>,\n options: { rootPoint: Readonly<RenderedSeriesPoint> },\n): PaintedCandleHit<D> | undefined {\n rendered.assertLive();\n if (\n !Number.isFinite(options.rootPoint.x) ||\n !Number.isFinite(options.rootPoint.y)\n )\n throw new RangeError(\"paintedCandleAt rootPoint must be finite.\");\n const point = rendered.localAtRoot(options.rootPoint);\n if (!point || !rendered.anchorInsideClips(point)) return undefined;\n for (let index = rendered.marks.length - 1; index >= 0; index--) {\n const mark = rendered.marks[index]!;\n if (\n rectangleCovers(\n point,\n mark.bodyBoundsLocal,\n mark.bodyFill,\n mark.bodyStrokeWidthLocal,\n )\n )\n return Object.freeze({\n ...rendered.observations[index]!,\n part: \"body\" as const,\n });\n if (wickCovers(point, mark.wickLocal, mark.wickStrokeWidthLocal))\n return Object.freeze({\n ...rendered.observations[index]!,\n part: \"wick\" as const,\n });\n }\n return undefined;\n}\n"],
5
+ "mappings": "AAEA;AAAA,EACE;AAAA,OAEK;AAMP,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AA2IxB,SAAS,oBACd,SAIwB;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,MAAM,KAAK;AAAA,UACX,MAAM,KAAK;AAAA,UACX,KAAK,KAAK;AAAA,UACV,OAAO,KAAK;AAAA,UACZ,aAAa,KAAK;AAAA,UAClB,YAAY,SAAS,YAAY,KAAK,WAAW;AAAA,UACjD,iBAAiB,KAAK;AAAA,UACtB,WAAW,KAAK;AAAA,QAClB,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,YAAY,KAAK;AACxC,eAAO,QACH,sBAAsB,UAAU,QAAQ,MAAM,CAAC,IAC/C;AAAA,MACN;AAAA,MACA,mBAAmB,SAAS;AAAA,MAC5B,eAAe,OAAuD;AACpE,iBAAS,WAAW;AACpB,cAAM,cAAc,OAAO,OAAO;AAAA,UAChC,GAAG,UAAU,OAAO,IAAI,MAAM,OAAO;AAAA,UACrC,GAAG,UAAU,OAAO,IAAI,MAAM,OAAO;AAAA,QACvC,CAAC;AACD,eAAO,OAAO,OAAO;AAAA,UACnB;AAAA,UACA,YAAY,SAAS,YAAY,WAAW;AAAA,QAC9C,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AACD,WAAO,OAAO,OAAO;AAAA,MACnB;AAAA,MACA,OAAO,OAAO,OAAO,UAAU,MAAM,MAAM,CAAC;AAAA,MAC5C;AAAA,MACA,YAAY,SAAS;AAAA,MACrB,aAAa,SAAS;AAAA,MACtB,mBAAmB,SAAS;AAAA,MAC5B,YAAY,QAAQ;AAAA,IACtB,CAAC;AAAA,EACH,CAAC;AACH;AAUO,SAAS,uBACd,UACA,SAIiC;AACjC,QAAM,MAAM,iBAAiB,SAAS,SAAS;AAAA,IAC7C,SAAS,QAAQ;AAAA,IACjB,QAAQ,QAAQ,SACZ,CAAC,cACC,QAAQ;AAAA,MACN;AAAA,IACF,IACF;AAAA,EACN,CAAC;AACD,MAAI,CAAC,IAAK,QAAO;AACjB,QAAM,MAAM,SAAS,aAAa;AAAA,IAChC,CAAC,gBAAgB,YAAY,gBAAgB,IAAI;AAAA,EACnD;AACA,SAAO,OAAO,OAAO,EAAE,GAAG,KAAK,WAAW,IAAI,YAAY,CAAC;AAC7D;AAEA,SAAS,gBACP,OACA,QACA,MACA,aACS;AACT,QAAM,OAAO,cAAc;AAC3B,QAAM,SACJ,MAAM,KAAK,OAAO,KAClB,MAAM,KAAK,OAAO,IAAI,OAAO,SAC7B,MAAM,KAAK,OAAO,KAClB,MAAM,KAAK,OAAO,IAAI,OAAO;AAC/B,QAAM,UACJ,OAAO,KACP,MAAM,KAAK,OAAO,IAAI,QACtB,MAAM,KAAK,OAAO,IAAI,OAAO,QAAQ,QACrC,MAAM,KAAK,OAAO,IAAI,QACtB,MAAM,KAAK,OAAO,IAAI,OAAO,SAAS,QACtC,EACE,MAAM,IAAI,OAAO,IAAI,QACrB,MAAM,IAAI,OAAO,IAAI,OAAO,QAAQ,QACpC,MAAM,IAAI,OAAO,IAAI,QACrB,MAAM,IAAI,OAAO,IAAI,OAAO,SAAS;AAEzC,SAAQ,QAAQ,UAAW;AAC7B;AAEA,SAAS,WACP,OACA,MACA,aACS;AACT,MAAI,eAAe,KAAK,KAAK,SAAS,KAAK,MAAO,QAAO;AACzD,QAAM,OAAO,cAAc;AAC3B,SACE,MAAM,KAAK,KAAK,IAAI,QACpB,MAAM,KAAK,KAAK,IAAI,QACpB,MAAM,KAAK,KAAK,IAAI,KAAK,MAAM,KAAK,KAAK,KACzC,MAAM,KAAK,KAAK,IAAI,KAAK,MAAM,KAAK,KAAK;AAE7C;AAYO,SAAS,gBACd,UACA,SACiC;AACjC,WAAS,WAAW;AACpB,MACE,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC,KACpC,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC;AAEpC,UAAM,IAAI,WAAW,2CAA2C;AAClE,QAAM,QAAQ,SAAS,YAAY,QAAQ,SAAS;AACpD,MAAI,CAAC,SAAS,CAAC,SAAS,kBAAkB,KAAK,EAAG,QAAO;AACzD,WAAS,QAAQ,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS;AAC/D,UAAM,OAAO,SAAS,MAAM,KAAK;AACjC,QACE;AAAA,MACE;AAAA,MACA,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,IACP;AAEA,aAAO,OAAO,OAAO;AAAA,QACnB,GAAG,SAAS,aAAa,KAAK;AAAA,QAC9B,MAAM;AAAA,MACR,CAAC;AACH,QAAI,WAAW,OAAO,KAAK,WAAW,KAAK,oBAAoB;AAC7D,aAAO,OAAO,OAAO;AAAA,QACnB,GAAG,SAAS,aAAa,KAAK;AAAA,QAC9B,MAAM;AAAA,MACR,CAAC;AAAA,EACL;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,65 @@
1
+ import type { NumericRenderedSeries, RenderedSeriesPoint } from "./query-types.js";
2
+ /** Values evaluated by a numeric series, before applying its world transform. */
3
+ export interface CapturedNumericObservation<D> {
4
+ /** Original caller-owned record. */
5
+ readonly datum: D;
6
+ /** Original zero-based source position, including skipped rows. */
7
+ readonly sourceIndex: number;
8
+ /** Horizontal data-space value. */
9
+ readonly domainX: number;
10
+ /** Vertical data-space value. */
11
+ readonly domainY: number;
12
+ /** Local logical anchor before world transforms. */
13
+ readonly anchorLocal: Readonly<RenderedSeriesPoint>;
14
+ /** Contiguous valid run identity; interpolation cannot cross runs. */
15
+ readonly run: number;
16
+ /** Optional local circle radius captured for discrete point geometry. */
17
+ readonly radiusLocal?: number;
18
+ /** Whether the mark has geometric fill coverage. */
19
+ readonly fill?: boolean;
20
+ /** Local painted stroke width, zero when absent. */
21
+ readonly strokeWidthLocal?: number;
22
+ }
23
+ /** Structural capture input used by renderers; no query is executed by capture. */
24
+ export interface NumericSeriesCapture<D> {
25
+ /** Evaluated values and geometry owned by this candidate generation. */
26
+ readonly observations: readonly CapturedNumericObservation<D>[];
27
+ /** Captured numeric x mapping and inversion. */
28
+ readonly xScale: import("../lib/series-position.js").NumericPositionScale;
29
+ /** Captured numeric y mapping for explicit interpolation anchors. */
30
+ readonly yScale: import("../lib/series-position.js").NumericPositionScale;
31
+ }
32
+ /** Optional renderer sink and mount-owned access to the last successful paint.
33
+ * @see {@link NumericRenderedSeries}
34
+ */
35
+ export interface NumericInspectionRef<D> {
36
+ /** Returns borrowed rendered values.
37
+ * @returns Current committed generation, or undefined before paint/after disposal.
38
+ */
39
+ rendered(): NumericRenderedSeries<D> | undefined;
40
+ /** @internal Records a candidate; publishes only after successful root rendering.
41
+ * @param input - Values evaluated by the receiver in source order.
42
+ */
43
+ capture(input: NumericSeriesCapture<D>): void;
44
+ }
45
+ /** Rendered numeric points with committed circle/ring geometry.
46
+ * @see {@link NumericRenderedSeries}
47
+ */
48
+ export interface PointRenderedSeries<D> extends NumericRenderedSeries<D> {
49
+ /** @internal Borrowed geometry corresponding to observations in source order. */
50
+ readonly marks: readonly CapturedNumericObservation<D>[];
51
+ /** @internal Maps a root-logical point to this committed local frame.
52
+ * @param point - Root-logical Canvas coordinates.
53
+ * @returns Local coordinates, or undefined for a singular transform.
54
+ */
55
+ localAtRoot(point: Readonly<RenderedSeriesPoint>): Readonly<RenderedSeriesPoint> | undefined;
56
+ }
57
+ /** Mount-owned point capture; queries are imported independently.
58
+ * @see {@link PointRenderedSeries}
59
+ */
60
+ export interface PointInspectionRef<D> extends NumericInspectionRef<D> {
61
+ /** Returns borrowed point geometry.
62
+ * @returns Current point generation, or undefined before paint/after disposal.
63
+ */
64
+ rendered(): PointRenderedSeries<D> | undefined;
65
+ }
@@ -0,0 +1,16 @@
1
+ import type { HoverSeries } from "../lib/hover-types.js";
2
+ import type { NumericInspectionRef, PointInspectionRef } from "./capture-types.js";
3
+ /**
4
+ * Owns optional numeric capture without reading signals or executing queries.
5
+ * @param _series - Typed descriptor used for datum inference; not observed or registered.
6
+ * @returns A stable mount-owned capture ref; pass it to one numeric series' inspection prop.
7
+ * @see {@link NumericInspectionRef}
8
+ */
9
+ export declare function useNumericInspection<D>(_series: HoverSeries<D>): NumericInspectionRef<D>;
10
+ /**
11
+ * Owns optional circle/ring capture for one PointSeries; O(n) retained geometry when enabled.
12
+ * @param _series - Typed descriptor used for datum inference; not observed or registered.
13
+ * @returns A stable point inspection ref. Rendered records are borrowed until replacement/disposal.
14
+ * @see {@link PointInspectionRef}
15
+ */
16
+ export declare function usePointInspection<D>(_series: HoverSeries<D>): PointInspectionRef<D>;
@@ -0,0 +1,49 @@
1
+ import { invertNumericPosition } from "../lib/series-position.js";
2
+ import { useRenderedRef } from "./owned-ref.js";
3
+ function useCapture() {
4
+ return useRenderedRef(
5
+ "numericSeriesInspection",
6
+ (candidate, geometry) => {
7
+ const rows = candidate.observations.map(
8
+ (row) => Object.freeze({
9
+ ...row,
10
+ anchorLocal: Object.freeze({ ...row.anchorLocal }),
11
+ anchorRoot: geometry.rootAtLocal(row.anchorLocal)
12
+ })
13
+ );
14
+ return Object.freeze({
15
+ observations: Object.freeze(rows),
16
+ marks: Object.freeze(candidate.observations.slice()),
17
+ assertLive: geometry.assertLive,
18
+ localAtRoot: geometry.localAtRoot,
19
+ anchorInsideClips: geometry.anchorInsideClips,
20
+ domainXAtRoot(point) {
21
+ const local = geometry.localAtRoot(point);
22
+ return local ? invertNumericPosition(candidate.xScale, local.x) : void 0;
23
+ },
24
+ anchorAtDomain(point) {
25
+ geometry.assertLive();
26
+ const anchorLocal = Object.freeze({
27
+ x: candidate.xScale.map(point.domainX),
28
+ y: candidate.yScale.map(point.domainY)
29
+ });
30
+ return Object.freeze({
31
+ anchorLocal,
32
+ anchorRoot: geometry.rootAtLocal(anchorLocal)
33
+ });
34
+ }
35
+ });
36
+ }
37
+ );
38
+ }
39
+ function useNumericInspection(_series) {
40
+ return useCapture();
41
+ }
42
+ function usePointInspection(_series) {
43
+ return useCapture();
44
+ }
45
+ export {
46
+ useNumericInspection,
47
+ usePointInspection
48
+ };
49
+ //# sourceMappingURL=capture.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/features/viz/inspection/capture.ts"],
4
+ "sourcesContent": ["import { invertNumericPosition } from \"../lib/series-position.js\";\nimport { useRenderedRef } from \"./owned-ref.js\";\nimport type { HoverSeries } from \"../lib/hover-types.js\";\nimport type {\n NumericSeriesCapture,\n NumericInspectionRef,\n PointInspectionRef,\n PointRenderedSeries,\n} from \"./capture-types.js\";\n\nfunction useCapture<D>(): PointInspectionRef<D> {\n return useRenderedRef<NumericSeriesCapture<D>, PointRenderedSeries<D>>(\n \"numericSeriesInspection\",\n (candidate, geometry) => {\n const rows = candidate.observations.map((row) =>\n Object.freeze({\n ...row,\n anchorLocal: Object.freeze({ ...row.anchorLocal }),\n anchorRoot: geometry.rootAtLocal(row.anchorLocal),\n }),\n );\n return Object.freeze({\n observations: Object.freeze(rows),\n marks: Object.freeze(candidate.observations.slice()),\n assertLive: geometry.assertLive,\n localAtRoot: geometry.localAtRoot,\n anchorInsideClips: geometry.anchorInsideClips,\n domainXAtRoot(point: Readonly<{ x: number; y: number }>) {\n const local = geometry.localAtRoot(point);\n return local\n ? invertNumericPosition(candidate.xScale, local.x)\n : undefined;\n },\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 },\n );\n}\n\n/**\n * Owns optional numeric capture without reading signals or executing queries.\n * @param _series - Typed descriptor used for datum inference; not observed or registered.\n * @returns A stable mount-owned capture ref; pass it to one numeric series' inspection prop.\n * @see {@link NumericInspectionRef}\n */\nexport function useNumericInspection<D>(\n _series: HoverSeries<D>,\n): NumericInspectionRef<D> {\n return useCapture<D>();\n}\n\n/**\n * Owns optional circle/ring capture for one PointSeries; O(n) retained geometry when enabled.\n * @param _series - Typed descriptor used for datum inference; not observed or registered.\n * @returns A stable point inspection ref. Rendered records are borrowed until replacement/disposal.\n * @see {@link PointInspectionRef}\n */\nexport function usePointInspection<D>(\n _series: HoverSeries<D>,\n): PointInspectionRef<D> {\n return useCapture<D>();\n}\n"],
5
+ "mappings": "AAAA,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAS/B,SAAS,aAAuC;AAC9C,SAAO;AAAA,IACL;AAAA,IACA,CAAC,WAAW,aAAa;AACvB,YAAM,OAAO,UAAU,aAAa;AAAA,QAAI,CAAC,QACvC,OAAO,OAAO;AAAA,UACZ,GAAG;AAAA,UACH,aAAa,OAAO,OAAO,EAAE,GAAG,IAAI,YAAY,CAAC;AAAA,UACjD,YAAY,SAAS,YAAY,IAAI,WAAW;AAAA,QAClD,CAAC;AAAA,MACH;AACA,aAAO,OAAO,OAAO;AAAA,QACnB,cAAc,OAAO,OAAO,IAAI;AAAA,QAChC,OAAO,OAAO,OAAO,UAAU,aAAa,MAAM,CAAC;AAAA,QACnD,YAAY,SAAS;AAAA,QACrB,aAAa,SAAS;AAAA,QACtB,mBAAmB,SAAS;AAAA,QAC5B,cAAc,OAA2C;AACvD,gBAAM,QAAQ,SAAS,YAAY,KAAK;AACxC,iBAAO,QACH,sBAAsB,UAAU,QAAQ,MAAM,CAAC,IAC/C;AAAA,QACN;AAAA,QACA,eAAe,OAAuD;AACpE,mBAAS,WAAW;AACpB,gBAAM,cAAc,OAAO,OAAO;AAAA,YAChC,GAAG,UAAU,OAAO,IAAI,MAAM,OAAO;AAAA,YACrC,GAAG,UAAU,OAAO,IAAI,MAAM,OAAO;AAAA,UACvC,CAAC;AACD,iBAAO,OAAO,OAAO;AAAA,YACnB;AAAA,YACA,YAAY,SAAS,YAAY,WAAW;AAAA,UAC9C,CAAC;AAAA,QACH;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAQO,SAAS,qBACd,SACyB;AACzB,SAAO,WAAc;AACvB;AAQO,SAAS,mBACd,SACuB;AACvB,SAAO,WAAc;AACvB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,36 @@
1
+ import type { PibblEvent } from "@pibbl/core";
2
+ /** A mount-owned source of borrowed committed render records.
3
+ * @see {@link InspectionContext}
4
+ */
5
+ export interface InspectionRef<S> {
6
+ /** Returns the current committed record.
7
+ * @returns Borrowed record or undefined before paint/after disposal.
8
+ */
9
+ rendered(): S | undefined;
10
+ }
11
+ /** Lazy synchronous inspection; expires when its handler returns.
12
+ * @see {@link InspectionRef}
13
+ */
14
+ export interface InspectionContext {
15
+ /** Pins one receiver's committed generation for this logical dispatch.
16
+ * @param ref - Explicit ref identifying the mounted receiver.
17
+ * @returns Borrowed generation or undefined before paint/after disposal.
18
+ */
19
+ rendered<S>(ref: InspectionRef<S>): S | undefined;
20
+ /**
21
+ * Executes only on demand and memoizes equal requests, including no result.
22
+ * Options contain plain scalar fields, function identities and logical points.
23
+ * @param query - Pure synchronous query with a stable result contract.
24
+ * @param rendered - Committed generation pinned for this request.
25
+ * @param options - Named query parameters; functions compare by identity.
26
+ * @returns Query result, including undefined, reused for equal requests in dispatch.
27
+ */
28
+ request<S, A, R>(query: (rendered: S, options: A) => R, rendered: S, options: A): R;
29
+ }
30
+ /**
31
+ * Adapts an ordinary handler to lazy typed inspection without changing its event.
32
+ * @param handler - Synchronous callback receiving the unchanged event and an expiring context.
33
+ * @returns An ordinary event handler. Searches occur only on request; memo state releases at dispatch end.
34
+ * @see {@link InspectionContext}
35
+ */
36
+ export declare function withInspection<E extends PibblEvent>(handler: (event: E, context: InspectionContext) => void): (event: E) => void;