@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/features/textures/lib/water-surface.ts"],
4
- "sourcesContent": ["import {\n defineTexture,\n type TextureContext,\n type TextureRecipe,\n} from \"@pibbl/core\";\nimport { validateSeed } from \"./palette.js\";\nimport { bytes } from \"./wasm/water-surface-bytes.js\";\n\n/**\n * An axis-aligned obstacle rectangle in a water-surface simulation.\n *\n * @see {@link WaterSurfaceOptions}\n */\nexport interface WaterSurfaceObstacle {\n /**\n * Horizontal coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly x: number;\n /**\n * Vertical coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly y: number;\n /**\n * Horizontal extent in the units of the containing geometry or surface. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly width: number;\n /**\n * Vertical extent in the units of the containing geometry or surface. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly height: number;\n}\n\n/**\n * Water simulation controls including wave motion, viscosity, pause state, and obstacles.\n *\n * @see {@link WaterSurfaceObstacle}\n * @see {@link waterSurface}\n */\nexport interface WaterSurfaceOptions {\n /**\n * Seed used for deterministic sampling or simulation initialization. See\n * {@link WaterSurfaceOptions}.\n */\n readonly seed?: number;\n /** Multiplier controlling the simulation's animation rate. See {@link WaterSurfaceOptions}. */\n readonly speed?: number;\n /** Spatial scale of the generated water pattern. See {@link WaterSurfaceOptions}. */\n readonly scale?: number;\n /** Strength of injected wave disturbances. See {@link WaterSurfaceOptions}. */\n readonly rippleStrength?: number;\n /** Artistic thickness from 0 (water) to 1 (slow, strongly damped). */\n readonly viscosity?: number;\n /** Whether simulation or playback advancement is suspended. See {@link WaterSurfaceOptions}. */\n readonly paused?: boolean;\n /** Obstacle geometry used by the flow or water simulation. See {@link WaterSurfaceObstacle}. */\n readonly obstacles?: readonly WaterSurfaceObstacle[];\n}\n\n/**\n * Ripple, pause, and reset commands for a water-surface simulation.\n *\n * @see {@link waterSurface}\n */\nexport type WaterSurfaceMessage =\n | {\n /** The literal \"pause\" identifying this variant. See {@link WaterSurfaceMessage}. */\n readonly type: \"pause\";\n /** Whether simulation or playback advancement is suspended. See {@link WaterSurfaceMessage}. */\n readonly paused: boolean;\n }\n | {\n /** The literal \"reset\" identifying this variant. See {@link WaterSurfaceMessage}. */\n readonly type: \"reset\";\n }\n | {\n /** The literal \"ripple\" identifying this variant. See {@link WaterSurfaceMessage}. */\n readonly type: \"ripple\";\n /**\n * Horizontal coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceMessage}.\n */\n readonly x: number;\n /**\n * Vertical coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceMessage}.\n */\n readonly y: number;\n };\n\ninterface Config {\n readonly seed: number;\n readonly speed: number;\n readonly scale: number;\n readonly rippleStrength: number;\n readonly viscosity: number;\n readonly paused: boolean;\n readonly obstacles: readonly WaterSurfaceObstacle[];\n}\ninterface State {\n config: Config;\n simulation: WaterSimulation;\n phase: number;\n paused: boolean;\n fresh: boolean;\n elapsed: number;\n energy: number;\n}\ninterface WaterKernel {\n clear(\n height: number,\n velocity: number,\n nextHeight: number,\n nextVelocity: number,\n count: number,\n ): void;\n impulse(\n velocity: number,\n solid: number,\n width: number,\n rows: number,\n u: number,\n v: number,\n radius: number,\n strength: number,\n ): void;\n steps(\n height: number,\n velocity: number,\n nextHeight: number,\n nextVelocity: number,\n solid: number,\n width: number,\n rows: number,\n count: number,\n viscosity: number,\n ): number;\n clearMask(solid: number, count: number): void;\n maskRectangle(\n solid: number,\n width: number,\n rows: number,\n x: number,\n y: number,\n w: number,\n h: number,\n ): void;\n maskFields(\n height: number,\n velocity: number,\n nextHeight: number,\n nextVelocity: number,\n solid: number,\n count: number,\n ): void;\n wake(\n velocity: number,\n solid: number,\n width: number,\n rows: number,\n bx: number,\n by: number,\n bw: number,\n bh: number,\n ax: number,\n ay: number,\n aw: number,\n ah: number,\n ): number;\n initializeModes(ptr: number, seed: number, scale: number): void;\n raster(\n height: number,\n solid: number,\n width: number,\n rows: number,\n pixels: number,\n outWidth: number,\n outHeight: number,\n modes: number,\n time: number,\n strength: number,\n ): void;\n}\n\nconst FIXED_STEP = 1 / 120;\nconst MAX_STEPS = 6;\nconst IDLE_ENERGY = 0.0006;\nlet compiled: WebAssembly.Module | undefined;\n\nfunction kernel(): WebAssembly.Module {\n return (compiled ??= new WebAssembly.Module(\n Uint8Array.from(atob(bytes), (character) => character.charCodeAt(0)),\n ));\n}\n\nfunction gridSize(width: number, height: number): readonly [number, number] {\n const scale = Math.min(\n 1,\n 128 / Math.min(width, height),\n 256 / Math.max(width, height),\n );\n return [\n Math.max(2, Math.round(width * scale)),\n Math.max(2, Math.round(height * scale)),\n ];\n}\n\nclass WaterSimulation {\n readonly memory: WebAssembly.Memory;\n readonly image: ImageData;\n private readonly modeOffset: number;\n readonly height: Float32Array;\n readonly velocity: Float32Array;\n private readonly nextHeight: Float32Array;\n private readonly nextVelocity: Float32Array;\n readonly solid: Uint8Array;\n private readonly kernel: WaterKernel;\n private previousObstacles: readonly WaterSurfaceObstacle[] = [];\n constructor(\n readonly width: number,\n readonly rows: number,\n obstacles: readonly WaterSurfaceObstacle[],\n readonly outputWidth: number,\n readonly outputHeight: number,\n config: Config,\n ) {\n const count = width * rows;\n const scalarBytes = count * Float32Array.BYTES_PER_ELEMENT;\n const solidOffset = 65536 + scalarBytes * 4;\n this.modeOffset = Math.ceil((solidOffset + count) / 8) * 8;\n const pixelOffset = this.modeOffset + 96;\n const pages = Math.ceil(\n (pixelOffset + outputWidth * outputHeight * 4) / 65536,\n );\n this.memory = new WebAssembly.Memory({ initial: pages, maximum: pages });\n this.kernel = new WebAssembly.Instance(kernel(), {\n env: {\n memory: this.memory,\n abort() {\n throw new Error(\"Water surface WASM aborted.\");\n },\n },\n }).exports as unknown as WaterKernel;\n this.height = new Float32Array(this.memory.buffer, 65536, count);\n this.velocity = new Float32Array(\n this.memory.buffer,\n 65536 + scalarBytes,\n count,\n );\n this.nextHeight = new Float32Array(\n this.memory.buffer,\n 65536 + scalarBytes * 2,\n count,\n );\n this.nextVelocity = new Float32Array(\n this.memory.buffer,\n 65536 + scalarBytes * 3,\n count,\n );\n this.solid = new Uint8Array(this.memory.buffer, solidOffset, count);\n this.image = new ImageData(\n new Uint8ClampedArray(\n this.memory.buffer,\n pixelOffset,\n outputWidth * outputHeight * 4,\n ),\n outputWidth,\n outputHeight,\n );\n this.configure(config);\n this.setObstacles(obstacles);\n }\n reset() {\n this.kernel.clear(\n this.height.byteOffset,\n this.velocity.byteOffset,\n this.nextHeight.byteOffset,\n this.nextVelocity.byteOffset,\n this.height.length,\n );\n }\n setObstacles(obstacles: readonly WaterSurfaceObstacle[]): number {\n if (sameObstacles(this.previousObstacles, obstacles)) return 0;\n const previous = this.previousObstacles;\n this.kernel.clearMask(this.solid.byteOffset, this.solid.length);\n for (const o of obstacles)\n this.kernel.maskRectangle(\n this.solid.byteOffset,\n this.width,\n this.rows,\n o.x,\n o.y,\n o.width,\n o.height,\n );\n this.kernel.maskFields(\n this.height.byteOffset,\n this.velocity.byteOffset,\n this.nextHeight.byteOffset,\n this.nextVelocity.byteOffset,\n this.solid.byteOffset,\n this.solid.length,\n );\n this.previousObstacles = obstacles;\n // A moving solid leaves one bounded impulse at its trailing edge. The\n // height-field remains an appearance-only texture; this is not a force or\n // collider update in Pibbl physics.\n let wakeEnergy = 0;\n for (\n let index = 0;\n index < Math.min(previous.length, obstacles.length);\n index++\n ) {\n const before = previous[index],\n after = obstacles[index];\n wakeEnergy += this.kernel.wake(\n this.velocity.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n before.x,\n before.y,\n before.width,\n before.height,\n after.x,\n after.y,\n after.width,\n after.height,\n );\n }\n return wakeEnergy;\n }\n ripple(u: number, v: number, strength: number) {\n this.kernel.impulse(\n this.velocity.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n u,\n v,\n Math.max(2, Math.min(this.width, this.rows) * 0.075),\n strength * 1.8,\n );\n }\n step(count: number, viscosity: number): number {\n return this.kernel.steps(\n this.height.byteOffset,\n this.velocity.byteOffset,\n this.nextHeight.byteOffset,\n this.nextVelocity.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n count,\n viscosity,\n );\n }\n configure(config: Config) {\n this.kernel.initializeModes(this.modeOffset, config.seed, config.scale);\n }\n raster(time: number, strength: number) {\n this.kernel.raster(\n this.height.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n this.image.data.byteOffset,\n this.outputWidth,\n this.outputHeight,\n this.modeOffset,\n time,\n strength,\n );\n }\n dispose() {\n this.height.fill(0);\n this.velocity.fill(0);\n this.solid.fill(0);\n }\n}\n\nfunction sameObstacles(\n left: readonly WaterSurfaceObstacle[],\n right: readonly WaterSurfaceObstacle[],\n) {\n return (\n left.length === right.length &&\n left.every((value, index) => {\n const other = right[index];\n return (\n value.x === other.x &&\n value.y === other.y &&\n value.width === other.width &&\n value.height === other.height\n );\n })\n );\n}\nfunction options(input: WaterSurfaceOptions): Config {\n const seed = validateSeed(input.seed ?? 0),\n speed = input.speed ?? 1,\n scale = input.scale ?? 4,\n rippleStrength = input.rippleStrength ?? 1,\n viscosity = input.viscosity ?? 0;\n if (!Number.isFinite(viscosity) || viscosity < 0 || viscosity > 1)\n throw new RangeError(\n \"Water surface viscosity must be finite and within [0, 1].\",\n );\n if (!Number.isFinite(speed) || speed < 0)\n throw new RangeError(\"Water surface speed must be finite and nonnegative.\");\n if (!Number.isInteger(scale) || scale < 1 || scale > 32)\n throw new RangeError(\n \"Water surface scale must be an integer from 1 to 32.\",\n );\n if (!Number.isFinite(rippleStrength) || rippleStrength < 0)\n throw new RangeError(\n \"Water surface ripple strength must be finite and nonnegative.\",\n );\n const obstacles = Object.freeze(\n (input.obstacles ?? []).map((obstacle) => {\n if (\n ![obstacle.x, obstacle.y, obstacle.width, obstacle.height].every(\n Number.isFinite,\n ) ||\n obstacle.x < 0 ||\n obstacle.y < 0 ||\n obstacle.width < 0 ||\n obstacle.height < 0 ||\n obstacle.x + obstacle.width > 1 ||\n obstacle.y + obstacle.height > 1\n )\n throw new RangeError(\n \"Water surface obstacles must be finite normalized rectangles within [0, 1].\",\n );\n return Object.freeze({ ...obstacle });\n }),\n );\n return {\n seed,\n speed,\n scale,\n rippleStrength,\n viscosity,\n paused: input.paused ?? false,\n obstacles,\n };\n}\nfunction assertDataTexture(context: TextureContext) {\n if (context.palette !== undefined)\n throw new TypeError(\n \"waterSurface is a numeric displacement map and does not accept a palette.\",\n );\n}\nfunction assertCoordinate(value: number, name: \"x\" | \"y\") {\n if (!Number.isFinite(value) || value < 0 || value > 1)\n throw new RangeError(\n `Water ripple ${name} must be finite and within [0, 1].`,\n );\n}\nfunction active(state: State) {\n return state.config.speed > 0 || state.energy > IDLE_ENERGY;\n}\nfunction replaceSimulation(\n state: State,\n context: TextureContext,\n config: Config,\n): number {\n const [width, rows] = gridSize(context.canvas.width, context.canvas.height);\n if (\n state.simulation.width !== width ||\n state.simulation.rows !== rows ||\n state.simulation.outputWidth !== context.canvas.width ||\n state.simulation.outputHeight !== context.canvas.height\n ) {\n state.simulation.dispose();\n state.simulation = new WaterSimulation(\n width,\n rows,\n config.obstacles,\n context.canvas.width,\n context.canvas.height,\n config,\n );\n return 0;\n }\n return state.simulation.setObstacles(config.obstacles);\n}\nconst recipe = /* @__PURE__ */ defineTexture<\n WaterSurfaceOptions,\n State,\n WaterSurfaceMessage\n>({\n defaultPlacement: { mode: \"stretch\" },\n create(context, input) {\n assertDataTexture(context);\n const config = options(input),\n [width, rows] = gridSize(context.canvas.width, context.canvas.height);\n if (!config.paused && config.speed > 0) context.requestFrame();\n return {\n config,\n simulation: new WaterSimulation(\n width,\n rows,\n config.obstacles,\n context.canvas.width,\n context.canvas.height,\n config,\n ),\n phase: 0,\n paused: config.paused,\n fresh: true,\n elapsed: 0,\n energy: 0,\n };\n },\n update(state, input, context) {\n assertDataTexture(context);\n const next = options(input),\n previous = state.config;\n const wasActive = active(state);\n const wakeEnergy = replaceSimulation(state, context, next);\n if (next.seed !== previous.seed || next.scale !== previous.scale) {\n state.phase = 0;\n state.simulation.configure(next);\n state.simulation.reset();\n state.energy = 0;\n }\n if (next.paused !== previous.paused) state.paused = next.paused;\n if (next.paused !== previous.paused || next.speed !== previous.speed) {\n state.fresh = true;\n state.elapsed = 0;\n }\n state.config = next;\n if (wakeEnergy > 0) {\n state.energy = Math.max(state.energy, wakeEnergy);\n if (!wasActive) {\n state.fresh = true;\n state.elapsed = 0;\n }\n }\n context.invalidate();\n if (!state.paused && active(state)) context.requestFrame();\n },\n receive(state, message, context) {\n if (message.type === \"pause\") {\n state.paused = message.paused;\n state.fresh = true;\n state.elapsed = 0;\n if (!state.paused && active(state)) context.requestFrame();\n return;\n }\n if (message.type === \"reset\") {\n state.simulation.reset();\n state.phase = 0;\n state.energy = 0;\n state.elapsed = 0;\n state.fresh = true;\n context.invalidate();\n return;\n }\n if (message.type === \"ripple\") {\n assertCoordinate(message.x, \"x\");\n assertCoordinate(message.y, \"y\");\n const wasActive = active(state);\n state.simulation.ripple(message.x, message.y, 1);\n state.energy = Math.max(state.energy, 1);\n if (!wasActive) {\n state.fresh = true;\n state.elapsed = 0;\n }\n context.invalidate();\n if (!state.paused) context.requestFrame();\n return;\n }\n throw new TypeError(\"Unknown water surface message.\");\n },\n advance(state, frame, context) {\n if (state.paused || !active(state)) return;\n if (!state.fresh) {\n state.elapsed += Math.min(0.05, frame.delta / 1000);\n const steps = Math.min(MAX_STEPS, Math.floor(state.elapsed / FIXED_STEP));\n if (steps) {\n state.elapsed -= steps * FIXED_STEP;\n state.energy = state.simulation.step(steps, state.config.viscosity);\n state.phase +=\n ((frame.delta / 1000) * state.config.speed) /\n (1 + 4 * state.config.viscosity);\n context.invalidate();\n }\n }\n state.fresh = false;\n if (active(state)) context.requestFrame();\n },\n rasterize(state, context) {\n state.simulation.raster(state.phase, state.config.rippleStrength);\n context.canvas.getContext(\"2d\")!.putImageData(state.simulation.image, 0, 0);\n },\n dispose(state) {\n state.simulation.dispose();\n },\n});\n\n/**\n * A WASM-only, bounded reflective height-field displacement map.\n *\n * @param options - Water appearance and simulation settings. See {@link WaterSurfaceOptions}.\n * @returns A water-surface texture recipe accepting surface messages. See {@link TextureRecipe} ,\n * {@link WaterSurfaceMessage} .\n *\n * @see {@link WaterSurfaceOptions}\n * @see {@link TextureRecipe}\n * @see {@link WaterSurfaceMessage}\n */\nexport function waterSurface(\n options: WaterSurfaceOptions = {},\n): TextureRecipe<WaterSurfaceMessage> {\n return recipe(options);\n}\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,OAGK;AACP,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AAqLtB,M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,cAAM,SAAS,MAAM,WAAW,KAAK,OAAO,MAAM,OAAO,SAAS;AAClE,cAAM,SACF,MAAM,QAAQ,MAAQ,MAAM,OAAO,SACpC,IAAI,IAAI,MAAM,OAAO;AACxB,gBAAQ,WAAW;AAAA,MACrB;AAAA,IACF;AACA,UAAM,QAAQ;AACd,QAAI,OAAO,KAAK,EAAG,SAAQ,aAAa;AAAA,EAC1C;AAAA,EACA,UAAU,OAAO,SAAS;AACxB,UAAM,WAAW,OAAO,MAAM,OAAO,MAAM,OAAO,cAAc;AAChE,YAAQ,OAAO,WAAW,IAAI,EAAG,aAAa,MAAM,WAAW,OAAO,GAAG,CAAC;AAAA,EAC5E;AAAA,EACA,QAAQ,OAAO;AACb,UAAM,WAAW,QAAQ;AAAA,EAC3B;AACF,CAAC;AAaM,SAAS,aACdA,WAA+B,CAAC,GACI;AACpC,SAAO,OAAOA,QAAO;AACvB;",
4
+ "sourcesContent": ["import {\n defineTexture,\n type TextureContext,\n type TextureRecipe,\n} from \"@pibbl/core\";\nimport { validateSeed } from \"./palette.js\";\nimport { bytes } from \"./wasm/water-surface-bytes.js\";\n\n/**\n * An axis-aligned obstacle rectangle in a water-surface simulation.\n *\n * @see {@link WaterSurfaceOptions}\n */\nexport interface WaterSurfaceObstacle {\n /**\n * Horizontal coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly x: number;\n /**\n * Vertical coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly y: number;\n /**\n * Horizontal extent in the units of the containing geometry or surface. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly width: number;\n /**\n * Vertical extent in the units of the containing geometry or surface. See\n * {@link WaterSurfaceObstacle}.\n */\n readonly height: number;\n}\n\n/**\n * Water simulation controls including wave motion, viscosity, pause state, and obstacles.\n *\n * @see {@link WaterSurfaceObstacle}\n * @see {@link waterSurface}\n */\nexport interface WaterSurfaceOptions {\n /**\n * Seed used for deterministic sampling or simulation initialization. See\n * {@link WaterSurfaceOptions}.\n */\n readonly seed?: number;\n /** Multiplier controlling the simulation's animation rate. See {@link WaterSurfaceOptions}. */\n readonly speed?: number;\n /** Spatial scale of the generated water pattern. See {@link WaterSurfaceOptions}. */\n readonly scale?: number;\n /** Strength of injected wave disturbances. See {@link WaterSurfaceOptions}. */\n readonly rippleStrength?: number;\n /** Artistic thickness from 0 (water) to 1 (slow, strongly damped). */\n readonly viscosity?: number;\n /** Whether simulation or playback advancement is suspended. See {@link WaterSurfaceOptions}. */\n readonly paused?: boolean;\n /** Obstacle geometry used by the flow or water simulation. See {@link WaterSurfaceObstacle}. */\n readonly obstacles?: readonly WaterSurfaceObstacle[];\n}\n\n/**\n * Ripple, pause, and reset commands for a water-surface simulation.\n *\n * @see {@link waterSurface}\n */\nexport type WaterSurfaceMessage =\n | {\n /** The literal \"pause\" identifying this variant. See {@link WaterSurfaceMessage}. */\n readonly type: \"pause\";\n /** Whether simulation or playback advancement is suspended. See {@link WaterSurfaceMessage}. */\n readonly paused: boolean;\n }\n | {\n /** The literal \"reset\" identifying this variant. See {@link WaterSurfaceMessage}. */\n readonly type: \"reset\";\n }\n | {\n /** The literal \"ripple\" identifying this variant. See {@link WaterSurfaceMessage}. */\n readonly type: \"ripple\";\n /**\n * Horizontal coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceMessage}.\n */\n readonly x: number;\n /**\n * Vertical coordinate or displacement in the containing coordinate system. See\n * {@link WaterSurfaceMessage}.\n */\n readonly y: number;\n };\n\ninterface Config {\n readonly seed: number;\n readonly speed: number;\n readonly scale: number;\n readonly rippleStrength: number;\n readonly viscosity: number;\n readonly paused: boolean;\n readonly obstacles: readonly WaterSurfaceObstacle[];\n}\ninterface State {\n config: Config;\n simulation: WaterSimulation;\n phase: number;\n paused: boolean;\n fresh: boolean;\n elapsed: number;\n energy: number;\n}\ninterface WaterKernel {\n clear(\n height: number,\n velocity: number,\n nextHeight: number,\n nextVelocity: number,\n count: number,\n ): void;\n impulse(\n velocity: number,\n solid: number,\n width: number,\n rows: number,\n u: number,\n v: number,\n radius: number,\n strength: number,\n ): void;\n steps(\n height: number,\n velocity: number,\n nextHeight: number,\n nextVelocity: number,\n solid: number,\n width: number,\n rows: number,\n count: number,\n viscosity: number,\n ): number;\n clearMask(solid: number, count: number): void;\n maskRectangle(\n solid: number,\n width: number,\n rows: number,\n x: number,\n y: number,\n w: number,\n h: number,\n ): void;\n maskFields(\n height: number,\n velocity: number,\n nextHeight: number,\n nextVelocity: number,\n solid: number,\n count: number,\n ): void;\n wake(\n velocity: number,\n solid: number,\n width: number,\n rows: number,\n bx: number,\n by: number,\n bw: number,\n bh: number,\n ax: number,\n ay: number,\n aw: number,\n ah: number,\n ): number;\n initializeModes(ptr: number, seed: number, scale: number): void;\n raster(\n height: number,\n solid: number,\n width: number,\n rows: number,\n pixels: number,\n outWidth: number,\n outHeight: number,\n modes: number,\n time: number,\n strength: number,\n ): void;\n}\n\nconst FIXED_STEP = 1 / 120;\nconst MAX_STEPS = 6;\nconst IDLE_ENERGY = 0.0006;\nlet compiled: WebAssembly.Module | undefined;\n\nfunction kernel(): WebAssembly.Module {\n return (compiled ??= new WebAssembly.Module(\n Uint8Array.from(atob(bytes), (character) => character.charCodeAt(0)),\n ));\n}\n\nfunction gridSize(width: number, height: number): readonly [number, number] {\n const scale = Math.min(\n 1,\n 128 / Math.min(width, height),\n 256 / Math.max(width, height),\n );\n return [\n Math.max(2, Math.round(width * scale)),\n Math.max(2, Math.round(height * scale)),\n ];\n}\n\nclass WaterSimulation {\n readonly memory: WebAssembly.Memory;\n readonly image: ImageData;\n private readonly modeOffset: number;\n readonly height: Float32Array;\n readonly velocity: Float32Array;\n private readonly nextHeight: Float32Array;\n private readonly nextVelocity: Float32Array;\n readonly solid: Uint8Array;\n private readonly kernel: WaterKernel;\n private previousObstacles: readonly WaterSurfaceObstacle[] = [];\n constructor(\n readonly width: number,\n readonly rows: number,\n obstacles: readonly WaterSurfaceObstacle[],\n readonly outputWidth: number,\n readonly outputHeight: number,\n config: Config,\n ) {\n const count = width * rows;\n const scalarBytes = count * Float32Array.BYTES_PER_ELEMENT;\n const solidOffset = 65536 + scalarBytes * 4;\n this.modeOffset = Math.ceil((solidOffset + count) / 8) * 8;\n const pixelOffset = this.modeOffset + 96;\n const pages = Math.ceil(\n (pixelOffset + outputWidth * outputHeight * 4) / 65536,\n );\n this.memory = new WebAssembly.Memory({ initial: pages, maximum: pages });\n this.kernel = new WebAssembly.Instance(kernel(), {\n env: {\n memory: this.memory,\n abort() {\n throw new Error(\"Water surface WASM aborted.\");\n },\n },\n }).exports as unknown as WaterKernel;\n this.height = new Float32Array(this.memory.buffer, 65536, count);\n this.velocity = new Float32Array(\n this.memory.buffer,\n 65536 + scalarBytes,\n count,\n );\n this.nextHeight = new Float32Array(\n this.memory.buffer,\n 65536 + scalarBytes * 2,\n count,\n );\n this.nextVelocity = new Float32Array(\n this.memory.buffer,\n 65536 + scalarBytes * 3,\n count,\n );\n this.solid = new Uint8Array(this.memory.buffer, solidOffset, count);\n this.image = new ImageData(\n new Uint8ClampedArray(\n this.memory.buffer,\n pixelOffset,\n outputWidth * outputHeight * 4,\n ),\n outputWidth,\n outputHeight,\n );\n this.configure(config);\n this.setObstacles(obstacles);\n }\n reset() {\n this.kernel.clear(\n this.height.byteOffset,\n this.velocity.byteOffset,\n this.nextHeight.byteOffset,\n this.nextVelocity.byteOffset,\n this.height.length,\n );\n }\n setObstacles(obstacles: readonly WaterSurfaceObstacle[]): number {\n if (sameObstacles(this.previousObstacles, obstacles)) return 0;\n const previous = this.previousObstacles;\n this.kernel.clearMask(this.solid.byteOffset, this.solid.length);\n for (const o of obstacles)\n this.kernel.maskRectangle(\n this.solid.byteOffset,\n this.width,\n this.rows,\n o.x,\n o.y,\n o.width,\n o.height,\n );\n this.kernel.maskFields(\n this.height.byteOffset,\n this.velocity.byteOffset,\n this.nextHeight.byteOffset,\n this.nextVelocity.byteOffset,\n this.solid.byteOffset,\n this.solid.length,\n );\n this.previousObstacles = obstacles;\n // A moving solid leaves one bounded impulse at its trailing edge. The\n // height-field remains an appearance-only texture; this is not a force or\n // collider update in Pibbl physics.\n let wakeEnergy = 0;\n for (\n let index = 0;\n index < Math.min(previous.length, obstacles.length);\n index++\n ) {\n const before = previous[index],\n after = obstacles[index];\n wakeEnergy += this.kernel.wake(\n this.velocity.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n before.x,\n before.y,\n before.width,\n before.height,\n after.x,\n after.y,\n after.width,\n after.height,\n );\n }\n return wakeEnergy;\n }\n ripple(u: number, v: number, strength: number) {\n this.kernel.impulse(\n this.velocity.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n u,\n v,\n Math.max(2, Math.min(this.width, this.rows) * 0.075),\n strength * 1.8,\n );\n }\n step(count: number, viscosity: number): number {\n return this.kernel.steps(\n this.height.byteOffset,\n this.velocity.byteOffset,\n this.nextHeight.byteOffset,\n this.nextVelocity.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n count,\n viscosity,\n );\n }\n configure(config: Config) {\n this.kernel.initializeModes(this.modeOffset, config.seed, config.scale);\n }\n raster(time: number, strength: number) {\n this.kernel.raster(\n this.height.byteOffset,\n this.solid.byteOffset,\n this.width,\n this.rows,\n this.image.data.byteOffset,\n this.outputWidth,\n this.outputHeight,\n this.modeOffset,\n time,\n strength,\n );\n }\n dispose() {\n this.height.fill(0);\n this.velocity.fill(0);\n this.solid.fill(0);\n }\n}\n\nfunction sameObstacles(\n left: readonly WaterSurfaceObstacle[],\n right: readonly WaterSurfaceObstacle[],\n) {\n return (\n left.length === right.length &&\n left.every((value, index) => {\n const other = right[index];\n return (\n value.x === other.x &&\n value.y === other.y &&\n value.width === other.width &&\n value.height === other.height\n );\n })\n );\n}\nfunction options(input: WaterSurfaceOptions): Config {\n const seed = validateSeed(input.seed ?? 0),\n speed = input.speed ?? 1,\n scale = input.scale ?? 4,\n rippleStrength = input.rippleStrength ?? 1,\n viscosity = input.viscosity ?? 0;\n if (!Number.isFinite(viscosity) || viscosity < 0 || viscosity > 1)\n throw new RangeError(\n \"Water surface viscosity must be finite and within [0, 1].\",\n );\n if (!Number.isFinite(speed) || speed < 0)\n throw new RangeError(\"Water surface speed must be finite and nonnegative.\");\n if (!Number.isInteger(scale) || scale < 1 || scale > 32)\n throw new RangeError(\n \"Water surface scale must be an integer from 1 to 32.\",\n );\n if (!Number.isFinite(rippleStrength) || rippleStrength < 0)\n throw new RangeError(\n \"Water surface ripple strength must be finite and nonnegative.\",\n );\n const obstacles = Object.freeze(\n (input.obstacles ?? []).map((obstacle) => {\n if (\n !(\n Number.isFinite(obstacle.x) &&\n Number.isFinite(obstacle.y) &&\n Number.isFinite(obstacle.width) &&\n Number.isFinite(obstacle.height)\n ) ||\n obstacle.x < 0 ||\n obstacle.y < 0 ||\n obstacle.width < 0 ||\n obstacle.height < 0 ||\n obstacle.x + obstacle.width > 1 ||\n obstacle.y + obstacle.height > 1\n )\n throw new RangeError(\n \"Water surface obstacles must be finite normalized rectangles within [0, 1].\",\n );\n return Object.freeze({ ...obstacle });\n }),\n );\n return {\n seed,\n speed,\n scale,\n rippleStrength,\n viscosity,\n paused: input.paused ?? false,\n obstacles,\n };\n}\nfunction assertDataTexture(context: TextureContext) {\n if (context.palette !== undefined)\n throw new TypeError(\n \"waterSurface is a numeric displacement map and does not accept a palette.\",\n );\n}\nfunction assertCoordinate(value: number, name: \"x\" | \"y\") {\n if (!Number.isFinite(value) || value < 0 || value > 1)\n throw new RangeError(\n `Water ripple ${name} must be finite and within [0, 1].`,\n );\n}\nfunction active(state: State) {\n return state.config.speed > 0 || state.energy > IDLE_ENERGY;\n}\nfunction replaceSimulation(\n state: State,\n context: TextureContext,\n config: Config,\n): number {\n const [width, rows] = gridSize(context.canvas.width, context.canvas.height);\n if (\n state.simulation.width !== width ||\n state.simulation.rows !== rows ||\n state.simulation.outputWidth !== context.canvas.width ||\n state.simulation.outputHeight !== context.canvas.height\n ) {\n state.simulation.dispose();\n state.simulation = new WaterSimulation(\n width,\n rows,\n config.obstacles,\n context.canvas.width,\n context.canvas.height,\n config,\n );\n return 0;\n }\n return state.simulation.setObstacles(config.obstacles);\n}\nconst recipe = /* @__PURE__ */ defineTexture<\n WaterSurfaceOptions,\n State,\n WaterSurfaceMessage\n>({\n defaultPlacement: { mode: \"stretch\" },\n create(context, input) {\n assertDataTexture(context);\n const config = options(input),\n [width, rows] = gridSize(context.canvas.width, context.canvas.height);\n if (!config.paused && config.speed > 0) context.requestFrame();\n return {\n config,\n simulation: new WaterSimulation(\n width,\n rows,\n config.obstacles,\n context.canvas.width,\n context.canvas.height,\n config,\n ),\n phase: 0,\n paused: config.paused,\n fresh: true,\n elapsed: 0,\n energy: 0,\n };\n },\n update(state, input, context) {\n assertDataTexture(context);\n const next = options(input),\n previous = state.config;\n const wasActive = active(state);\n const wakeEnergy = replaceSimulation(state, context, next);\n if (next.seed !== previous.seed || next.scale !== previous.scale) {\n state.phase = 0;\n state.simulation.configure(next);\n state.simulation.reset();\n state.energy = 0;\n }\n if (next.paused !== previous.paused) state.paused = next.paused;\n if (next.paused !== previous.paused || next.speed !== previous.speed) {\n state.fresh = true;\n state.elapsed = 0;\n }\n state.config = next;\n if (wakeEnergy > 0) {\n state.energy = Math.max(state.energy, wakeEnergy);\n if (!wasActive) {\n state.fresh = true;\n state.elapsed = 0;\n }\n }\n context.invalidate();\n if (!state.paused && active(state)) context.requestFrame();\n },\n receive(state, message, context) {\n if (message.type === \"pause\") {\n state.paused = message.paused;\n state.fresh = true;\n state.elapsed = 0;\n if (!state.paused && active(state)) context.requestFrame();\n return;\n }\n if (message.type === \"reset\") {\n state.simulation.reset();\n state.phase = 0;\n state.energy = 0;\n state.elapsed = 0;\n state.fresh = true;\n context.invalidate();\n return;\n }\n if (message.type === \"ripple\") {\n assertCoordinate(message.x, \"x\");\n assertCoordinate(message.y, \"y\");\n const wasActive = active(state);\n state.simulation.ripple(message.x, message.y, 1);\n state.energy = Math.max(state.energy, 1);\n if (!wasActive) {\n state.fresh = true;\n state.elapsed = 0;\n }\n context.invalidate();\n if (!state.paused) context.requestFrame();\n return;\n }\n throw new TypeError(\"Unknown water surface message.\");\n },\n advance(state, frame, context) {\n if (state.paused || !active(state)) return;\n if (!state.fresh) {\n state.elapsed += Math.min(0.05, frame.delta / 1000);\n const steps = Math.min(MAX_STEPS, Math.floor(state.elapsed / FIXED_STEP));\n if (steps) {\n state.elapsed -= steps * FIXED_STEP;\n state.energy = state.simulation.step(steps, state.config.viscosity);\n state.phase +=\n ((frame.delta / 1000) * state.config.speed) /\n (1 + 4 * state.config.viscosity);\n context.invalidate();\n }\n }\n state.fresh = false;\n if (active(state)) context.requestFrame();\n },\n rasterize(state, context) {\n state.simulation.raster(state.phase, state.config.rippleStrength);\n context.canvas.getContext(\"2d\")!.putImageData(state.simulation.image, 0, 0);\n },\n dispose(state) {\n state.simulation.dispose();\n },\n});\n\n/**\n * A WASM-only, bounded reflective height-field displacement map.\n *\n * @param options - Water appearance and simulation settings. See {@link WaterSurfaceOptions}.\n * @returns A water-surface texture recipe accepting surface messages. See {@link TextureRecipe} ,\n * {@link WaterSurfaceMessage} .\n *\n * @see {@link WaterSurfaceOptions}\n * @see {@link TextureRecipe}\n * @see {@link WaterSurfaceMessage}\n */\nexport function waterSurface(\n options: WaterSurfaceOptions = {},\n): TextureRecipe<WaterSurfaceMessage> {\n return recipe(options);\n}\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,OAGK;AACP,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AAqLtB,MAAM,aAAa,IAAI;AACvB,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,IAAI;AAEJ,SAAS,SAA6B;AACpC,SAAQ,aAAa,IAAI,YAAY;AAAA,IACnC,WAAW,KAAK,KAAK,KAAK,GAAG,CAAC,cAAc,UAAU,WAAW,CAAC,CAAC;AAAA,EACrE;AACF;AAEA,SAAS,SAAS,OAAe,QAA2C;AAC1E,QAAM,QAAQ,K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Aa;AAAA,EAC1C;AAAA,EACA,UAAU,OAAO,SAAS;AACxB,UAAM,WAAW,OAAO,MAAM,OAAO,MAAM,OAAO,cAAc;AAChE,YAAQ,OAAO,WAAW,IAAI,EAAG,aAAa,MAAM,WAAW,OAAO,GAAG,CAAC;AAAA,EAC5E;AAAA,EACA,QAAQ,OAAO;AACb,UAAM,WAAW,QAAQ;AAAA,EAC3B;AACF,CAAC;AAaM,SAAS,aACdA,WAA+B,CAAC,GACI;AACpC,SAAO,OAAOA,QAAO;AACvB;",
6
6
  "names": ["options"]
7
7
  }
@@ -7,8 +7,17 @@ export { useUTCScale } from "./lib/use-utc-scale.js";
7
7
  export type { ScaleId, LinearDomain, BandCategory, BandDomain, BarScaleProps, BandScaleRange, ResolvedBandScale, ScaleRange, ScaleLayoutStyle, LinearScaleProps, ResolvedLinearScale, ResolvedScale, } from "./lib/types.js";
8
8
  export { Axis } from "./lib/axis.js";
9
9
  export { LineSeries } from "./lib/line-series.js";
10
+ export { AreaSeries } from "./lib/area-series.js";
11
+ export type { AreaSeriesProps, AreaSeriesStyle } from "./lib/area-series.js";
12
+ export { IntervalBandSeries } from "./lib/interval-band-series.js";
13
+ export type { IntervalBandSeriesProps } from "./lib/interval-band-series.js";
14
+ export { HorizontalIntervalSeries, VerticalIntervalSeries, } from "./lib/interval-series.js";
15
+ export type { IntervalSeriesStyle, IntervalSeriesProps, HorizontalIntervalSeriesProps, VerticalIntervalSeriesProps, } from "./lib/interval-series.js";
16
+ export type { SeriesCurve } from "./lib/curve-definition.js";
17
+ export { stepBefore, stepAfter, stepMidpoint } from "./lib/step-curves.js";
18
+ export { monotoneX } from "./lib/monotone-curve.js";
10
19
  export { ScaleAdjust } from "./lib/scale-adjust.js";
11
- export type { AxisStyle, AxisProps, LineCoordinate, LineAccessor, LineCurve, LineSeriesStyle, LineSeriesProps, ScaleAdjustProps, } from "./lib/types.js";
20
+ export type { AxisStyle, AxisProps, LineCoordinate, LineAccessor, SeriesAccessor, SeriesCoordinate, LineCurve, LineSeriesStyle, LineSeriesProps, ScaleAdjustProps, } from "./lib/types.js";
12
21
  export { PointSeries } from "./lib/point-series.js";
13
22
  export type { PointAccessor, PointMarkStyle, PointSeriesStyle, PointStyleResolver, PointSeriesProps, } from "./lib/point-types.js";
14
23
  export { PlotSeries } from "./lib/plot-series.js";
@@ -29,11 +38,24 @@ export type { BarThresholdFill, BarCategoryAccessor, BarSeriesStyle, BarStyleRes
29
38
  export { pieSlices } from "./lib/pie-slices.js";
30
39
  export type { PieOptions, PieSliceGeometry } from "./lib/pie-slices.js";
31
40
  export { PieLayout, PieSlice, PieLabel } from "./lib/pie-layout.js";
32
- export type { PieLayoutProps, PieLayoutStyle, PieLayoutSlice, PieLabelPlacement, PieLabelLayout, PieSliceProps, PieSliceStyle, PieLabelProps, PieLabelStyle } from "./lib/pie-types.js";
41
+ export type { PieLayoutProps, PieLayoutStyle, PieLayoutSlice, PieLabelPlacement, PieLabelLayout, PieSliceProps, PieSliceStyle, PieLabelProps, PieLabelStyle, } from "./lib/pie-types.js";
33
42
  export { extent, niceUTCDomain } from "./lib/utc-scale.js";
34
- export type { NumericDomain, UtcDomain, UTCScaleProps, ResolvedUtcScale, ResolvedContinuousScale } from "./lib/types.js";
35
- export { linearTicks, niceLinearDomain, formatNumber } from "./lib/numeric-ticks.js";
36
- export type { LinearTickOptions, NumberFormatOptions } from "./lib/numeric-ticks.js";
43
+ export type { NumericDomain, UtcDomain, UTCScaleProps, ResolvedUtcScale, ResolvedContinuousScale, } from "./lib/types.js";
44
+ export { linearTicks, niceLinearDomain, formatNumber, } from "./lib/numeric-ticks.js";
45
+ export type { LinearTickOptions, NumberFormatOptions, } from "./lib/numeric-ticks.js";
46
+ export { interpolateNumericRange } from "./lib/numeric-range-interpolation.js";
47
+ export { visibleOhlcPriceExtent, padLinearDomain, } from "./lib/financial-autoscale.js";
48
+ export type { VisibleOhlcPriceExtentOptions, PadLinearDomainOptions, } from "./lib/financial-autoscale.js";
49
+ export { percentageReturns, indexTo100 } from "./lib/financial-comparison.js";
50
+ export type { ComparisonBaseOptions, PercentageReturnPoint, IndexedValuePoint, } from "./lib/financial-comparison.js";
51
+ export { aggregateOhlcv, sessionVwap } from "./lib/financial-aggregation.js";
52
+ export type { OhlcvBucket, OhlcvSource, AggregatedOhlcvPoint, AggregateOhlcvOptions, SessionIdentifier, SessionAccessor, SessionVwapOptions, SessionVwapPoint, } from "./lib/financial-aggregation.js";
53
+ export { RangeNavigator, EditableReferenceLine, EditableReferenceBand, EditableTrendLine, } from "./lib/editable-chart-elements.js";
54
+ export type { ChartAnchor, RangeNavigatorProps, RangeNavigatorStyle, EditableReferenceLineProps, EditableReferenceLineStyle, EditableReferenceBandProps, EditableReferenceBandStyle, EditableTrendLineProps, EditableTrendLineStyle, } from "./lib/editable-chart-elements.js";
55
+ export { simpleMovingAverage, exponentialMovingAverage, bollingerBands, } from "./lib/financial-indicators.js";
56
+ export type { MovingAverageOptions, BollingerBandsOptions, MovingAveragePoint, BollingerBandPoint, } from "./lib/financial-indicators.js";
57
+ export { relativeStrengthIndex, movingAverageConvergenceDivergence, stochasticOscillator, } from "./lib/financial-oscillators.js";
58
+ export type { OscillatorOptions, RelativeStrengthIndexOptions, MovingAverageConvergenceDivergenceOptions, StochasticOscillatorOptions, RelativeStrengthIndexPoint, MovingAverageConvergenceDivergencePoint, StochasticOscillatorPoint, } from "./lib/financial-oscillators.js";
37
59
  export { utcTickLabels } from "./lib/utc-labels.js";
38
60
  export type { UTCTickLabelOptions } from "./lib/utc-labels.js";
39
61
  export { LogScale } from "./lib/log-scale-component.js";
@@ -46,8 +68,48 @@ export { PointScale } from "./lib/point-scale-component.js";
46
68
  export { usePointScale } from "./lib/use-point-scale.js";
47
69
  export type { PointScaleProps, ResolvedPointScale } from "./lib/types.js";
48
70
  export { GridLines, ReferenceLine } from "./lib/chart-lines.js";
49
- export type { ChartLineProps, GridLinesProps, ReferenceLineProps } from "./lib/chart-lines.js";
71
+ export type { ChartLineProps, GridLinesProps, ReferenceLineProps, } from "./lib/chart-lines.js";
50
72
  export { ReferenceBand } from "./lib/reference-band.js";
51
73
  export type { ReferenceBandProps } from "./lib/reference-band.js";
52
74
  export { AxisTitle } from "./lib/axis-title.js";
53
75
  export type { AxisTitleProps } from "./lib/axis-title.js";
76
+ export { panDomain, zoomDomain } from "./lib/domain-navigation.js";
77
+ export type { DomainNavigationConstraints, PanDomainOptions, ZoomDomainOptions, } from "./lib/domain-navigation.js";
78
+ export { SequentialColorScale, useSequentialColorScale, } from "./lib/sequential-color-scale.js";
79
+ export { DivergingColorScale, useDivergingColorScale, } from "./lib/diverging-color-scale.js";
80
+ export type { ColorScaleStop, SequentialColorScaleProps, DivergingColorScaleProps, ResolvedSequentialColorScale, ResolvedDivergingColorScale, } from "./lib/color-types.js";
81
+ export { ThresholdColorScale, useThresholdColorScale, } from "./lib/threshold-color-scale.js";
82
+ export type { ThresholdColorBand, ThresholdColorScaleProps, ResolvedThresholdColorScale, } from "./lib/threshold-color-scale.js";
83
+ export { VolumeSeries } from "./lib/volume-series.js";
84
+ export type { VolumeSeriesProps, VolumeSeriesStyle, } from "./lib/volume-series.js";
85
+ export { TradingTimeScale, useTradingTimeScale, } from "./lib/trading-time-scale.js";
86
+ export type { TradingTimeScaleProps, ResolvedTradingTimeScale, } from "./lib/trading-time-scale.js";
87
+ export { CandlestickSeries } from "./lib/candlestick-series.js";
88
+ export type { CandlestickSeriesProps, CandlestickSeriesStyle, CandleBodyStyle, CandleWickStyle, } from "./lib/candlestick-series.js";
89
+ export { OhlcBarSeries } from "./lib/ohlc-bar-series.js";
90
+ export type { OhlcBarSeriesProps, OhlcBarSeriesStyle, } from "./lib/ohlc-bar-series.js";
91
+ export { BaselineSeries } from "./lib/baseline-series.js";
92
+ export type { BaselineSeriesProps, BaselineSeriesStyle, BaselineSideStyle, } from "./lib/baseline-series.js";
93
+ export { IntervalDiamondSeries } from "./lib/interval-diamond-series.js";
94
+ export type { IntervalDiamondSeriesProps, IntervalDiamondSeriesStyle, } from "./lib/interval-diamond-series.js";
95
+ export { CensoredPointSeries } from "./lib/censored-point-series.js";
96
+ export type { CensoringStatus, CensoringAccessor, CensoredPointSeriesProps, CensoredPointSeriesStyle, } from "./lib/censored-point-series.js";
97
+ export { WeightedPointSeries } from "./lib/weighted-point-series.js";
98
+ export type { WeightedPointSeriesProps, WeightedPointSeriesStyle, WeightAccessor, } from "./lib/weighted-point-series.js";
99
+ export { TrajectorySeries } from "./lib/trajectory-series.js";
100
+ export type { TrajectorySeriesProps, TrajectorySeriesStyle, TrajectoryGroupAccessor, } from "./lib/trajectory-series.js";
101
+ export { PairedSeries } from "./lib/paired-series.js";
102
+ export type { PairedSeriesProps, PairedSeriesStyle, } from "./lib/paired-series.js";
103
+ export type { VizKey, Accessor, Bounds, Point, Style, MarkStyle, NodeStyle, EdgeStyle, LabelStyle, FrameStyle, LabelGeometry, GraphData, GraphAccessors, GraphNodeGeometry, GraphRoute, GraphEdgeGeometry, GraphLayout, GraphPresentation, MarkInteraction, GraphNodeProps, GraphEdgeProps, GraphLabelProps, GraphViewProps, DependencyStyle, DependencyOptions, DependencyGraphProps, ForceSettings, ForceOptions, ForceLayout, ForceNetworkController, ForceStyle, ForceNetworkProps, ForceHookOptions, HierarchyAccessors, TreeEdge, TreeNodeGeometry, TreeLayout, TreeStyle, TreeOptions, TidyTreeProps, MatrixData, MatrixAccessors, MatrixCellGeometry, MatrixLayout, MatrixStyle, MatrixOptions, AdjacencyMatrixProps, MatrixCellProps, SankeyNodeGeometry, SankeyFlowGeometry, SankeyLayout, SankeyAccessors, SankeyStyle, SankeyOptions, SankeyProps, BipartiteData, BipartiteAccessors, BipartiteEdgeGeometry, BipartiteLayout, BipartiteStyle, BipartiteOptions, BipartiteGraphProps, PartitionAccessors, PartitionCellGeometry, PartitionLayout, PartitionPresentation, TreemapStyle, TreemapOptions, TreemapProps, PartitionCellProps, NeighborhoodStyle, NeighborhoodOptions, NeighborhoodNodeGeometry, NeighborhoodLayout, RadialNeighborhoodProps, IcicleStyle, IcicleOptions, IcicleProps, ChordData, ChordAccessors, ChordArc, ChordBandGeometry, ChordRibbonGeometry, ChordLayout, ChordStyle, ChordOptions, ChordDiagramProps, ForceSimulation, ForceSimulationFactory, Size, } from './lib/graph/types.js';
104
+ export { GraphNode, GraphEdge, GraphLabel, GraphView, defaultGraphNodeStyle, defaultGraphEdgeStyle, defaultGraphLabelStyle } from './lib/graph/shared.js';
105
+ export { straightGraphRoute, orthogonalGraphRoute, curvedGraphRoute } from './lib/graph/routes.js';
106
+ export { layoutDependencies, DependencyGraph } from './lib/graph/dependency.js';
107
+ export { layoutMatrix, AdjacencyMatrix, MatrixCell, defaultMatrixCellStyle } from './lib/graph/matrix.js';
108
+ export { layoutSankey, Sankey, SankeyNode, SankeyFlow, defaultSankeyNodeStyle, defaultSankeyFlowStyle } from './lib/graph/sankey.js';
109
+ export { layoutBipartite, BipartiteGraph } from './lib/graph/bipartite.js';
110
+ export { layoutChords, ChordDiagram, ChordBand, ChordRibbon, defaultChordBandStyle, defaultChordRibbonStyle } from './lib/graph/chord.js';
111
+ export { layoutTree, TidyTree } from './lib/graph/tree.js';
112
+ export { layoutTreemap, Treemap, TreemapCell, defaultPartitionCellStyle } from './lib/graph/treemap.js';
113
+ export { layoutIcicle, Icicle, IcicleCell } from './lib/graph/icicle.js';
114
+ export { layoutNeighborhood, RadialNeighborhood } from './lib/graph/neighborhood.js';
115
+ export { createForceSimulation, layoutForceNetwork, useForceNetwork, ForceNetwork } from './lib/graph/force.js';
@@ -6,6 +6,14 @@ import { useBarScale } from "./lib/use-bar-scale.js";
6
6
  import { useUTCScale } from "./lib/use-utc-scale.js";
7
7
  import { Axis } from "./lib/axis.js";
8
8
  import { LineSeries } from "./lib/line-series.js";
9
+ import { AreaSeries } from "./lib/area-series.js";
10
+ import { IntervalBandSeries } from "./lib/interval-band-series.js";
11
+ import {
12
+ HorizontalIntervalSeries,
13
+ VerticalIntervalSeries
14
+ } from "./lib/interval-series.js";
15
+ import { stepBefore, stepAfter, stepMidpoint } from "./lib/step-curves.js";
16
+ import { monotoneX } from "./lib/monotone-curve.js";
9
17
  import { ScaleAdjust } from "./lib/scale-adjust.js";
10
18
  import { PointSeries } from "./lib/point-series.js";
11
19
  import { PlotSeries } from "./lib/plot-series.js";
@@ -23,7 +31,34 @@ import { BarSeries } from "./lib/bar-series.js";
23
31
  import { pieSlices } from "./lib/pie-slices.js";
24
32
  import { PieLayout, PieSlice, PieLabel } from "./lib/pie-layout.js";
25
33
  import { extent, niceUTCDomain } from "./lib/utc-scale.js";
26
- import { linearTicks, niceLinearDomain, formatNumber } from "./lib/numeric-ticks.js";
34
+ import {
35
+ linearTicks,
36
+ niceLinearDomain,
37
+ formatNumber
38
+ } from "./lib/numeric-ticks.js";
39
+ import { interpolateNumericRange } from "./lib/numeric-range-interpolation.js";
40
+ import {
41
+ visibleOhlcPriceExtent,
42
+ padLinearDomain
43
+ } from "./lib/financial-autoscale.js";
44
+ import { percentageReturns, indexTo100 } from "./lib/financial-comparison.js";
45
+ import { aggregateOhlcv, sessionVwap } from "./lib/financial-aggregation.js";
46
+ import {
47
+ RangeNavigator,
48
+ EditableReferenceLine,
49
+ EditableReferenceBand,
50
+ EditableTrendLine
51
+ } from "./lib/editable-chart-elements.js";
52
+ import {
53
+ simpleMovingAverage,
54
+ exponentialMovingAverage,
55
+ bollingerBands
56
+ } from "./lib/financial-indicators.js";
57
+ import {
58
+ relativeStrengthIndex,
59
+ movingAverageConvergenceDivergence,
60
+ stochasticOscillator
61
+ } from "./lib/financial-oscillators.js";
27
62
  import { utcTickLabels } from "./lib/utc-labels.js";
28
63
  import { LogScale } from "./lib/log-scale-component.js";
29
64
  import { useLogScale } from "./lib/use-log-scale.js";
@@ -34,48 +69,175 @@ import { usePointScale } from "./lib/use-point-scale.js";
34
69
  import { GridLines, ReferenceLine } from "./lib/chart-lines.js";
35
70
  import { ReferenceBand } from "./lib/reference-band.js";
36
71
  import { AxisTitle } from "./lib/axis-title.js";
72
+ import { panDomain, zoomDomain } from "./lib/domain-navigation.js";
73
+ import {
74
+ SequentialColorScale,
75
+ useSequentialColorScale
76
+ } from "./lib/sequential-color-scale.js";
77
+ import {
78
+ DivergingColorScale,
79
+ useDivergingColorScale
80
+ } from "./lib/diverging-color-scale.js";
81
+ import {
82
+ ThresholdColorScale,
83
+ useThresholdColorScale
84
+ } from "./lib/threshold-color-scale.js";
85
+ import { VolumeSeries } from "./lib/volume-series.js";
86
+ import {
87
+ TradingTimeScale,
88
+ useTradingTimeScale
89
+ } from "./lib/trading-time-scale.js";
90
+ import { CandlestickSeries } from "./lib/candlestick-series.js";
91
+ import { OhlcBarSeries } from "./lib/ohlc-bar-series.js";
92
+ import { BaselineSeries } from "./lib/baseline-series.js";
93
+ import { IntervalDiamondSeries } from "./lib/interval-diamond-series.js";
94
+ import { CensoredPointSeries } from "./lib/censored-point-series.js";
95
+ import { WeightedPointSeries } from "./lib/weighted-point-series.js";
96
+ import { TrajectorySeries } from "./lib/trajectory-series.js";
97
+ import { PairedSeries } from "./lib/paired-series.js";
98
+ import { GraphNode, GraphEdge, GraphLabel, GraphView, defaultGraphNodeStyle, defaultGraphEdgeStyle, defaultGraphLabelStyle } from "./lib/graph/shared.js";
99
+ import { straightGraphRoute, orthogonalGraphRoute, curvedGraphRoute } from "./lib/graph/routes.js";
100
+ import { layoutDependencies, DependencyGraph } from "./lib/graph/dependency.js";
101
+ import { layoutMatrix, AdjacencyMatrix, MatrixCell, defaultMatrixCellStyle } from "./lib/graph/matrix.js";
102
+ import { layoutSankey, Sankey, SankeyNode, SankeyFlow, defaultSankeyNodeStyle, defaultSankeyFlowStyle } from "./lib/graph/sankey.js";
103
+ import { layoutBipartite, BipartiteGraph } from "./lib/graph/bipartite.js";
104
+ import { layoutChords, ChordDiagram, ChordBand, ChordRibbon, defaultChordBandStyle, defaultChordRibbonStyle } from "./lib/graph/chord.js";
105
+ import { layoutTree, TidyTree } from "./lib/graph/tree.js";
106
+ import { layoutTreemap, Treemap, TreemapCell, defaultPartitionCellStyle } from "./lib/graph/treemap.js";
107
+ import { layoutIcicle, Icicle, IcicleCell } from "./lib/graph/icicle.js";
108
+ import { layoutNeighborhood, RadialNeighborhood } from "./lib/graph/neighborhood.js";
109
+ import { createForceSimulation, layoutForceNetwork, useForceNetwork, ForceNetwork } from "./lib/graph/force.js";
37
110
  export {
111
+ AdjacencyMatrix,
38
112
  AnchoredLayout,
113
+ AreaSeries,
39
114
  Axis,
40
115
  AxisTitle,
41
116
  BarScale,
42
117
  BarSeries,
118
+ BaselineSeries,
119
+ BipartiteGraph,
120
+ CandlestickSeries,
121
+ CensoredPointSeries,
122
+ ChordBand,
123
+ ChordDiagram,
124
+ ChordRibbon,
125
+ DependencyGraph,
126
+ DivergingColorScale,
127
+ EditableReferenceBand,
128
+ EditableReferenceLine,
129
+ EditableTrendLine,
130
+ ForceNetwork,
131
+ GraphEdge,
132
+ GraphLabel,
133
+ GraphNode,
134
+ GraphView,
43
135
  GridLines,
136
+ HorizontalIntervalSeries,
44
137
  HoverCard,
45
138
  HoverData,
139
+ Icicle,
140
+ IcicleCell,
141
+ IntervalBandSeries,
142
+ IntervalDiamondSeries,
46
143
  LineSeries,
47
144
  LinearScale,
48
145
  LogScale,
146
+ MatrixCell,
147
+ OhlcBarSeries,
148
+ PairedSeries,
49
149
  PieLabel,
50
150
  PieLayout,
51
151
  PieSlice,
52
152
  PlotSeries,
53
153
  PointScale,
54
154
  PointSeries,
155
+ RadialNeighborhood,
156
+ RangeNavigator,
55
157
  ReferenceBand,
56
158
  ReferenceLine,
159
+ Sankey,
160
+ SankeyFlow,
161
+ SankeyNode,
57
162
  ScaleAdjust,
163
+ SequentialColorScale,
58
164
  SymlogScale,
165
+ ThresholdColorScale,
166
+ TidyTree,
167
+ TradingTimeScale,
168
+ TrajectorySeries,
169
+ Treemap,
170
+ TreemapCell,
59
171
  UTCScale,
172
+ VerticalIntervalSeries,
173
+ VolumeSeries,
174
+ WeightedPointSeries,
175
+ aggregateOhlcv,
176
+ bollingerBands,
60
177
  closestPoint,
61
178
  closestX,
179
+ createForceSimulation,
180
+ curvedGraphRoute,
181
+ defaultChordBandStyle,
182
+ defaultChordRibbonStyle,
183
+ defaultGraphEdgeStyle,
184
+ defaultGraphLabelStyle,
185
+ defaultGraphNodeStyle,
186
+ defaultMatrixCellStyle,
187
+ defaultPartitionCellStyle,
188
+ defaultSankeyFlowStyle,
189
+ defaultSankeyNodeStyle,
62
190
  defineSeries,
191
+ exponentialMovingAverage,
63
192
  extent,
64
193
  formatNumber,
194
+ indexTo100,
195
+ interpolateNumericRange,
65
196
  interpolateX,
197
+ layoutBipartite,
198
+ layoutChords,
199
+ layoutDependencies,
200
+ layoutForceNetwork,
201
+ layoutIcicle,
202
+ layoutMatrix,
203
+ layoutNeighborhood,
204
+ layoutSankey,
205
+ layoutTree,
206
+ layoutTreemap,
66
207
  linearInterpolation,
67
208
  linearTicks,
209
+ monotoneX,
210
+ movingAverageConvergenceDivergence,
68
211
  nearestDomainValue,
69
212
  nearestPoint,
70
213
  niceLinearDomain,
71
214
  niceUTCDomain,
215
+ orthogonalGraphRoute,
216
+ padLinearDomain,
217
+ panDomain,
218
+ percentageReturns,
72
219
  pieSlices,
220
+ relativeStrengthIndex,
221
+ sessionVwap,
222
+ simpleMovingAverage,
223
+ stepAfter,
224
+ stepBefore,
225
+ stepMidpoint,
226
+ stochasticOscillator,
227
+ straightGraphRoute,
73
228
  useBarScale,
229
+ useDivergingColorScale,
230
+ useForceNetwork,
74
231
  useLinearScale,
75
232
  useLogScale,
76
233
  usePointScale,
234
+ useSequentialColorScale,
77
235
  useSymlogScale,
236
+ useThresholdColorScale,
237
+ useTradingTimeScale,
78
238
  useUTCScale,
79
- utcTickLabels
239
+ utcTickLabels,
240
+ visibleOhlcPriceExtent,
241
+ zoomDomain
80
242
  };
81
243
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/features/viz/index.ts"],
4
- "sourcesContent": ["export { LinearScale } from \"./lib/linear-scale-component.js\";\nexport { BarScale } from \"./lib/bar-scale.js\";\nexport { UTCScale } from \"./lib/utc-scale-component.js\";\nexport { useLinearScale } from \"./lib/use-linear-scale.js\";\nexport { useBarScale } from \"./lib/use-bar-scale.js\";\nexport { useUTCScale } from \"./lib/use-utc-scale.js\";\nexport type {\n ScaleId,\n LinearDomain,\n BandCategory,\n BandDomain,\n BarScaleProps,\n BandScaleRange,\n ResolvedBandScale,\n ScaleRange,\n ScaleLayoutStyle,\n LinearScaleProps,\n ResolvedLinearScale,\n ResolvedScale,\n} from \"./lib/types.js\";\nexport { Axis } from \"./lib/axis.js\";\nexport { LineSeries } from \"./lib/line-series.js\";\nexport { ScaleAdjust } from \"./lib/scale-adjust.js\";\nexport type {\n AxisStyle,\n AxisProps,\n LineCoordinate,\n LineAccessor,\n LineCurve,\n LineSeriesStyle,\n LineSeriesProps,\n ScaleAdjustProps,\n} from \"./lib/types.js\";\nexport { PointSeries } from \"./lib/point-series.js\";\nexport type {\n PointAccessor,\n PointMarkStyle,\n PointSeriesStyle,\n PointStyleResolver,\n PointSeriesProps,\n} from \"./lib/point-types.js\";\nexport { PlotSeries } from \"./lib/plot-series.js\";\nexport type { PlotSeriesProps, PlotKeyAccessor } from \"./lib/plot-types.js\";\nexport { nearestDomainValue, nearestPoint } from \"./lib/nearest.js\";\nexport type { NearestPointOptions, NearestPoint } from \"./lib/nearest.js\";\n\nexport { HoverData } from \"./lib/hover-data.js\";\nexport { defineSeries, closestPoint } from \"./lib/hover-queries.js\";\nexport type {\n HoverQueryContext,\n HoverQuery,\n HoverDataProps,\n HoverSeries,\n HoverPoint,\n HoverHit,\n HoverSeriesMap,\n ClosestPointHit,\n ClosestPointOptions,\n} from \"./lib/hover-types.js\";\n\nexport { HoverCard } from \"./lib/hover-card.js\";\nexport type {\n HoverCardProps,\n HoverCardStyle,\n HoverBounds,\n HoverPlacement,\n} from \"./lib/hover-card.js\";\n\nexport {\n closestX,\n interpolateX,\n linearInterpolation,\n} from \"./lib/hover-queries.js\";\nexport type {\n ClosestXOptions,\n ClosestXHit,\n HoverInterpolation,\n InterpolateXOptions,\n HoverSample,\n} from \"./lib/hover-types.js\";\n\nexport { AnchoredLayout } from \"./lib/anchored-layout.js\";\nexport type {\n AnchoredItem,\n AnchoredPlacement,\n AnchoredLayoutProps,\n} from \"./lib/anchored-layout.js\";\n\nexport { BarSeries } from \"./lib/bar-series.js\";\nexport type {\n BarThresholdFill,\n BarCategoryAccessor,\n BarSeriesStyle,\n BarStyleResolver,\n BarSeriesProps,\n} from \"./lib/bar-series.js\";\n\nexport { pieSlices } from \"./lib/pie-slices.js\";\nexport type { PieOptions, PieSliceGeometry } from \"./lib/pie-slices.js\";\n\nexport { PieLayout, PieSlice, PieLabel } from \"./lib/pie-layout.js\";\nexport type { PieLayoutProps, PieLayoutStyle, PieLayoutSlice, PieLabelPlacement, PieLabelLayout, PieSliceProps, PieSliceStyle, PieLabelProps, PieLabelStyle } from \"./lib/pie-types.js\";\n\nexport { extent, niceUTCDomain } from \"./lib/utc-scale.js\";\nexport type { NumericDomain, UtcDomain, UTCScaleProps, ResolvedUtcScale, ResolvedContinuousScale } from \"./lib/types.js\";\n\nexport { linearTicks, niceLinearDomain, formatNumber } from \"./lib/numeric-ticks.js\";\nexport type { LinearTickOptions, NumberFormatOptions } from \"./lib/numeric-ticks.js\";\n\nexport { utcTickLabels } from \"./lib/utc-labels.js\";\nexport type { UTCTickLabelOptions } from \"./lib/utc-labels.js\";\n\nexport { LogScale } from \"./lib/log-scale-component.js\";\nexport { useLogScale } from \"./lib/use-log-scale.js\";\nexport type { LogScaleProps, ResolvedLogScale } from \"./lib/types.js\";\n\nexport { SymlogScale } from \"./lib/symlog-scale-component.js\";\nexport { useSymlogScale } from \"./lib/use-symlog-scale.js\";\nexport type { SymlogScaleProps, ResolvedSymlogScale } from \"./lib/types.js\";\n\nexport { PointScale } from \"./lib/point-scale-component.js\";\nexport { usePointScale } from \"./lib/use-point-scale.js\";\nexport type { PointScaleProps, ResolvedPointScale } from \"./lib/types.js\";\nexport { GridLines, ReferenceLine } from \"./lib/chart-lines.js\";\nexport type { ChartLineProps, GridLinesProps, ReferenceLineProps } from \"./lib/chart-lines.js\";\nexport { ReferenceBand } from \"./lib/reference-band.js\";\nexport type { ReferenceBandProps } from \"./lib/reference-band.js\";\nexport { AxisTitle } from \"./lib/axis-title.js\";\nexport type { AxisTitleProps } from \"./lib/axis-title.js\";\n"],
5
- "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAe5B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAW5B,SAAS,mBAAmB;AAQ5B,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB,oBAAoB;AAGjD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,oBAAoB;AAa3C,SAAS,iBAAiB;AAQ1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,sBAAsB;AAO/B,SAAS,iBAAiB;AAS1B,SAAS,iBAAiB;AAG1B,SAAS,WAAW,UAAU,gBAAgB;AAG9C,SAAS,QAAQ,qBAAqB;AAGtC,SAAS,aAAa,kBAAkB,oBAAoB;AAG5D,SAAS,qBAAqB;AAG9B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAG5B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAG/B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAE9B,SAAS,WAAW,qBAAqB;AAEzC,SAAS,qBAAqB;AAE9B,SAAS,iBAAiB;",
4
+ "sourcesContent": ["export { LinearScale } from \"./lib/linear-scale-component.js\";\nexport { BarScale } from \"./lib/bar-scale.js\";\nexport { UTCScale } from \"./lib/utc-scale-component.js\";\nexport { useLinearScale } from \"./lib/use-linear-scale.js\";\nexport { useBarScale } from \"./lib/use-bar-scale.js\";\nexport { useUTCScale } from \"./lib/use-utc-scale.js\";\nexport type {\n ScaleId,\n LinearDomain,\n BandCategory,\n BandDomain,\n BarScaleProps,\n BandScaleRange,\n ResolvedBandScale,\n ScaleRange,\n ScaleLayoutStyle,\n LinearScaleProps,\n ResolvedLinearScale,\n ResolvedScale,\n} from \"./lib/types.js\";\nexport { Axis } from \"./lib/axis.js\";\nexport { LineSeries } from \"./lib/line-series.js\";\nexport { AreaSeries } from \"./lib/area-series.js\";\nexport type { AreaSeriesProps, AreaSeriesStyle } from \"./lib/area-series.js\";\nexport { IntervalBandSeries } from \"./lib/interval-band-series.js\";\nexport type { IntervalBandSeriesProps } from \"./lib/interval-band-series.js\";\nexport {\n HorizontalIntervalSeries,\n VerticalIntervalSeries,\n} from \"./lib/interval-series.js\";\nexport type {\n IntervalSeriesStyle,\n IntervalSeriesProps,\n HorizontalIntervalSeriesProps,\n VerticalIntervalSeriesProps,\n} from \"./lib/interval-series.js\";\nexport type { SeriesCurve } from \"./lib/curve-definition.js\";\nexport { stepBefore, stepAfter, stepMidpoint } from \"./lib/step-curves.js\";\nexport { monotoneX } from \"./lib/monotone-curve.js\";\nexport { ScaleAdjust } from \"./lib/scale-adjust.js\";\nexport type {\n AxisStyle,\n AxisProps,\n LineCoordinate,\n LineAccessor,\n SeriesAccessor,\n SeriesCoordinate,\n LineCurve,\n LineSeriesStyle,\n LineSeriesProps,\n ScaleAdjustProps,\n} from \"./lib/types.js\";\nexport { PointSeries } from \"./lib/point-series.js\";\nexport type {\n PointAccessor,\n PointMarkStyle,\n PointSeriesStyle,\n PointStyleResolver,\n PointSeriesProps,\n} from \"./lib/point-types.js\";\nexport { PlotSeries } from \"./lib/plot-series.js\";\nexport type { PlotSeriesProps, PlotKeyAccessor } from \"./lib/plot-types.js\";\nexport { nearestDomainValue, nearestPoint } from \"./lib/nearest.js\";\nexport type { NearestPointOptions, NearestPoint } from \"./lib/nearest.js\";\n\nexport { HoverData } from \"./lib/hover-data.js\";\nexport { defineSeries, closestPoint } from \"./lib/hover-queries.js\";\nexport type {\n HoverQueryContext,\n HoverQuery,\n HoverDataProps,\n HoverSeries,\n HoverPoint,\n HoverHit,\n HoverSeriesMap,\n ClosestPointHit,\n ClosestPointOptions,\n} from \"./lib/hover-types.js\";\n\nexport { HoverCard } from \"./lib/hover-card.js\";\nexport type {\n HoverCardProps,\n HoverCardStyle,\n HoverBounds,\n HoverPlacement,\n} from \"./lib/hover-card.js\";\n\nexport {\n closestX,\n interpolateX,\n linearInterpolation,\n} from \"./lib/hover-queries.js\";\nexport type {\n ClosestXOptions,\n ClosestXHit,\n HoverInterpolation,\n InterpolateXOptions,\n HoverSample,\n} from \"./lib/hover-types.js\";\n\nexport { AnchoredLayout } from \"./lib/anchored-layout.js\";\nexport type {\n AnchoredItem,\n AnchoredPlacement,\n AnchoredLayoutProps,\n} from \"./lib/anchored-layout.js\";\n\nexport { BarSeries } from \"./lib/bar-series.js\";\nexport type {\n BarThresholdFill,\n BarCategoryAccessor,\n BarSeriesStyle,\n BarStyleResolver,\n BarSeriesProps,\n} from \"./lib/bar-series.js\";\n\nexport { pieSlices } from \"./lib/pie-slices.js\";\nexport type { PieOptions, PieSliceGeometry } from \"./lib/pie-slices.js\";\n\nexport { PieLayout, PieSlice, PieLabel } from \"./lib/pie-layout.js\";\nexport type {\n PieLayoutProps,\n PieLayoutStyle,\n PieLayoutSlice,\n PieLabelPlacement,\n PieLabelLayout,\n PieSliceProps,\n PieSliceStyle,\n PieLabelProps,\n PieLabelStyle,\n} from \"./lib/pie-types.js\";\n\nexport { extent, niceUTCDomain } from \"./lib/utc-scale.js\";\nexport type {\n NumericDomain,\n UtcDomain,\n UTCScaleProps,\n ResolvedUtcScale,\n ResolvedContinuousScale,\n} from \"./lib/types.js\";\n\nexport {\n linearTicks,\n niceLinearDomain,\n formatNumber,\n} from \"./lib/numeric-ticks.js\";\nexport type {\n LinearTickOptions,\n NumberFormatOptions,\n} from \"./lib/numeric-ticks.js\";\nexport { interpolateNumericRange } from \"./lib/numeric-range-interpolation.js\";\nexport {\n visibleOhlcPriceExtent,\n padLinearDomain,\n} from \"./lib/financial-autoscale.js\";\nexport type {\n VisibleOhlcPriceExtentOptions,\n PadLinearDomainOptions,\n} from \"./lib/financial-autoscale.js\";\nexport { percentageReturns, indexTo100 } from \"./lib/financial-comparison.js\";\nexport type {\n ComparisonBaseOptions,\n PercentageReturnPoint,\n IndexedValuePoint,\n} from \"./lib/financial-comparison.js\";\nexport { aggregateOhlcv, sessionVwap } from \"./lib/financial-aggregation.js\";\nexport type {\n OhlcvBucket,\n OhlcvSource,\n AggregatedOhlcvPoint,\n AggregateOhlcvOptions,\n SessionIdentifier,\n SessionAccessor,\n SessionVwapOptions,\n SessionVwapPoint,\n} from \"./lib/financial-aggregation.js\";\nexport {\n RangeNavigator,\n EditableReferenceLine,\n EditableReferenceBand,\n EditableTrendLine,\n} from \"./lib/editable-chart-elements.js\";\nexport type {\n ChartAnchor,\n RangeNavigatorProps,\n RangeNavigatorStyle,\n EditableReferenceLineProps,\n EditableReferenceLineStyle,\n EditableReferenceBandProps,\n EditableReferenceBandStyle,\n EditableTrendLineProps,\n EditableTrendLineStyle,\n} from \"./lib/editable-chart-elements.js\";\nexport {\n simpleMovingAverage,\n exponentialMovingAverage,\n bollingerBands,\n} from \"./lib/financial-indicators.js\";\nexport type {\n MovingAverageOptions,\n BollingerBandsOptions,\n MovingAveragePoint,\n BollingerBandPoint,\n} from \"./lib/financial-indicators.js\";\nexport {\n relativeStrengthIndex,\n movingAverageConvergenceDivergence,\n stochasticOscillator,\n} from \"./lib/financial-oscillators.js\";\nexport type {\n OscillatorOptions,\n RelativeStrengthIndexOptions,\n MovingAverageConvergenceDivergenceOptions,\n StochasticOscillatorOptions,\n RelativeStrengthIndexPoint,\n MovingAverageConvergenceDivergencePoint,\n StochasticOscillatorPoint,\n} from \"./lib/financial-oscillators.js\";\n\nexport { utcTickLabels } from \"./lib/utc-labels.js\";\nexport type { UTCTickLabelOptions } from \"./lib/utc-labels.js\";\n\nexport { LogScale } from \"./lib/log-scale-component.js\";\nexport { useLogScale } from \"./lib/use-log-scale.js\";\nexport type { LogScaleProps, ResolvedLogScale } from \"./lib/types.js\";\n\nexport { SymlogScale } from \"./lib/symlog-scale-component.js\";\nexport { useSymlogScale } from \"./lib/use-symlog-scale.js\";\nexport type { SymlogScaleProps, ResolvedSymlogScale } from \"./lib/types.js\";\n\nexport { PointScale } from \"./lib/point-scale-component.js\";\nexport { usePointScale } from \"./lib/use-point-scale.js\";\nexport type { PointScaleProps, ResolvedPointScale } from \"./lib/types.js\";\nexport { GridLines, ReferenceLine } from \"./lib/chart-lines.js\";\nexport type {\n ChartLineProps,\n GridLinesProps,\n ReferenceLineProps,\n} from \"./lib/chart-lines.js\";\nexport { ReferenceBand } from \"./lib/reference-band.js\";\nexport type { ReferenceBandProps } from \"./lib/reference-band.js\";\nexport { AxisTitle } from \"./lib/axis-title.js\";\nexport type { AxisTitleProps } from \"./lib/axis-title.js\";\n\nexport { panDomain, zoomDomain } from \"./lib/domain-navigation.js\";\nexport type {\n DomainNavigationConstraints,\n PanDomainOptions,\n ZoomDomainOptions,\n} from \"./lib/domain-navigation.js\";\n\nexport {\n SequentialColorScale,\n useSequentialColorScale,\n} from \"./lib/sequential-color-scale.js\";\nexport {\n DivergingColorScale,\n useDivergingColorScale,\n} from \"./lib/diverging-color-scale.js\";\nexport type {\n ColorScaleStop,\n SequentialColorScaleProps,\n DivergingColorScaleProps,\n ResolvedSequentialColorScale,\n ResolvedDivergingColorScale,\n} from \"./lib/color-types.js\";\n\nexport {\n ThresholdColorScale,\n useThresholdColorScale,\n} from \"./lib/threshold-color-scale.js\";\nexport type {\n ThresholdColorBand,\n ThresholdColorScaleProps,\n ResolvedThresholdColorScale,\n} from \"./lib/threshold-color-scale.js\";\n\nexport { VolumeSeries } from \"./lib/volume-series.js\";\nexport type {\n VolumeSeriesProps,\n VolumeSeriesStyle,\n} from \"./lib/volume-series.js\";\n\nexport {\n TradingTimeScale,\n useTradingTimeScale,\n} from \"./lib/trading-time-scale.js\";\nexport type {\n TradingTimeScaleProps,\n ResolvedTradingTimeScale,\n} from \"./lib/trading-time-scale.js\";\nexport { CandlestickSeries } from \"./lib/candlestick-series.js\";\nexport type {\n CandlestickSeriesProps,\n CandlestickSeriesStyle,\n CandleBodyStyle,\n CandleWickStyle,\n} from \"./lib/candlestick-series.js\";\nexport { OhlcBarSeries } from \"./lib/ohlc-bar-series.js\";\nexport type {\n OhlcBarSeriesProps,\n OhlcBarSeriesStyle,\n} from \"./lib/ohlc-bar-series.js\";\n\nexport { BaselineSeries } from \"./lib/baseline-series.js\";\nexport type {\n BaselineSeriesProps,\n BaselineSeriesStyle,\n BaselineSideStyle,\n} from \"./lib/baseline-series.js\";\nexport { IntervalDiamondSeries } from \"./lib/interval-diamond-series.js\";\nexport type {\n IntervalDiamondSeriesProps,\n IntervalDiamondSeriesStyle,\n} from \"./lib/interval-diamond-series.js\";\nexport { CensoredPointSeries } from \"./lib/censored-point-series.js\";\nexport type {\n CensoringStatus,\n CensoringAccessor,\n CensoredPointSeriesProps,\n CensoredPointSeriesStyle,\n} from \"./lib/censored-point-series.js\";\nexport { WeightedPointSeries } from \"./lib/weighted-point-series.js\";\nexport type {\n WeightedPointSeriesProps,\n WeightedPointSeriesStyle,\n WeightAccessor,\n} from \"./lib/weighted-point-series.js\";\nexport { TrajectorySeries } from \"./lib/trajectory-series.js\";\nexport type {\n TrajectorySeriesProps,\n TrajectorySeriesStyle,\n TrajectoryGroupAccessor,\n} from \"./lib/trajectory-series.js\";\nexport { PairedSeries } from \"./lib/paired-series.js\";\nexport type {\n PairedSeriesProps,\n PairedSeriesStyle,\n} from \"./lib/paired-series.js\";\n\n// Graph visualization: public geometry, marks, layouts, and reference compositions.\nexport type {\n VizKey,\n Accessor,\n Bounds,\n Point,\n Style,\n MarkStyle,\n NodeStyle,\n EdgeStyle,\n LabelStyle,\n FrameStyle,\n LabelGeometry,\n GraphData,\n GraphAccessors,\n GraphNodeGeometry,\n GraphRoute,\n GraphEdgeGeometry,\n GraphLayout,\n GraphPresentation,\n MarkInteraction,\n GraphNodeProps,\n GraphEdgeProps,\n GraphLabelProps,\n GraphViewProps,\n DependencyStyle,\n DependencyOptions,\n DependencyGraphProps,\n ForceSettings,\n ForceOptions,\n ForceLayout,\n ForceNetworkController,\n ForceStyle,\n ForceNetworkProps,\n ForceHookOptions,\n HierarchyAccessors,\n TreeEdge,\n TreeNodeGeometry,\n TreeLayout,\n TreeStyle,\n TreeOptions,\n TidyTreeProps,\n MatrixData,\n MatrixAccessors,\n MatrixCellGeometry,\n MatrixLayout,\n MatrixStyle,\n MatrixOptions,\n AdjacencyMatrixProps,\n MatrixCellProps,\n SankeyNodeGeometry,\n SankeyFlowGeometry,\n SankeyLayout,\n SankeyAccessors,\n SankeyStyle,\n SankeyOptions,\n SankeyProps,\n BipartiteData,\n BipartiteAccessors,\n BipartiteEdgeGeometry,\n BipartiteLayout,\n BipartiteStyle,\n BipartiteOptions,\n BipartiteGraphProps,\n PartitionAccessors,\n PartitionCellGeometry,\n PartitionLayout,\n PartitionPresentation,\n TreemapStyle,\n TreemapOptions,\n TreemapProps,\n PartitionCellProps,\n NeighborhoodStyle,\n NeighborhoodOptions,\n NeighborhoodNodeGeometry,\n NeighborhoodLayout,\n RadialNeighborhoodProps,\n IcicleStyle,\n IcicleOptions,\n IcicleProps,\n ChordData,\n ChordAccessors,\n ChordArc,\n ChordBandGeometry,\n ChordRibbonGeometry,\n ChordLayout,\n ChordStyle,\n ChordOptions,\n ChordDiagramProps,\n ForceSimulation,\n ForceSimulationFactory,\n Size,\n} from './lib/graph/types.js';\nexport { GraphNode, GraphEdge, GraphLabel, GraphView, defaultGraphNodeStyle, defaultGraphEdgeStyle, defaultGraphLabelStyle } from './lib/graph/shared.js';\nexport { straightGraphRoute, orthogonalGraphRoute, curvedGraphRoute } from './lib/graph/routes.js';\nexport { layoutDependencies, DependencyGraph } from './lib/graph/dependency.js';\nexport { layoutMatrix, AdjacencyMatrix, MatrixCell, defaultMatrixCellStyle } from './lib/graph/matrix.js';\nexport { layoutSankey, Sankey, SankeyNode, SankeyFlow, defaultSankeyNodeStyle, defaultSankeyFlowStyle } from './lib/graph/sankey.js';\nexport { layoutBipartite, BipartiteGraph } from './lib/graph/bipartite.js';\nexport { layoutChords, ChordDiagram, ChordBand, ChordRibbon, defaultChordBandStyle, defaultChordRibbonStyle } from './lib/graph/chord.js';\nexport { layoutTree, TidyTree } from './lib/graph/tree.js';\nexport { layoutTreemap, Treemap, TreemapCell, defaultPartitionCellStyle } from './lib/graph/treemap.js';\nexport { layoutIcicle, Icicle, IcicleCell } from './lib/graph/icicle.js';\nexport { layoutNeighborhood, RadialNeighborhood } from './lib/graph/neighborhood.js';\nexport { createForceSimulation, layoutForceNetwork, useForceNetwork, ForceNetwork } from './lib/graph/force.js';\n"],
5
+ "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAe5B,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAE3B,SAAS,0BAA0B;AAEnC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAQP,SAAS,YAAY,WAAW,oBAAoB;AACpD,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAa5B,SAAS,mBAAmB;AAQ5B,SAAS,kBAAkB;AAE3B,SAAS,oBAAoB,oBAAoB;AAGjD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,oBAAoB;AAa3C,SAAS,iBAAiB;AAQ1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AASP,SAAS,sBAAsB;AAO/B,SAAS,iBAAiB;AAS1B,SAAS,iBAAiB;AAG1B,SAAS,WAAW,UAAU,gBAAgB;AAa9C,SAAS,QAAQ,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BAA+B;AACnH,SAAS,YAAY,gBAAgB;AACrC,SAAS,eAAe,SAAS,aAAa,iCAAiC;AAC/E,SAAS,cAAc,QAAQ,kBAAkB;AACjD,SAAS,oBAAoB,0BAA0B;AACvD,SAAS,uBAAuB,oBAAoB,iBAAiB,oBAAoB;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,79 @@
1
+ import type { LayoutBox } from "@pibbl/core";
2
+ import type { BarSeriesProps } from "../lib/bar-series.js";
3
+ import type { BandCategory } from "../lib/types.js";
4
+ import type { RenderedSeriesPoint } from "./query-types.js";
5
+ /** Original range/value/grouped bar with its captured endpoints and local paint bounds.
6
+ * @see {@link BarRenderedSeries}
7
+ */
8
+ export interface PaintedBarHit<D> {
9
+ /** Caller-owned original record. */
10
+ readonly datum: D;
11
+ /** Original zero-based source position. */
12
+ readonly sourceIndex: number;
13
+ /** Original discrete category, without numeric coercion. */
14
+ readonly category: BandCategory;
15
+ /** Original subgroup when grouping is enabled. */
16
+ readonly group: BandCategory | undefined;
17
+ /** Data-space starting endpoint, including an ordinary bar's baseline. */
18
+ readonly valueStart: number;
19
+ /** Data-space ending endpoint. */
20
+ readonly valueEnd: number;
21
+ /** Logical rectangle bounds before world transforms. */
22
+ readonly boundsLocal: Readonly<LayoutBox>;
23
+ }
24
+ /** @internal Captured rectangle paint flags used only for geometric lookup. */
25
+ export interface CapturedBarMark<D> extends PaintedBarHit<D> {
26
+ /** Whether this rectangle paints its interior. */
27
+ readonly fill: boolean;
28
+ /** Painted stroke width in local logical units. */
29
+ readonly strokeWidthLocal: number;
30
+ }
31
+ /** A borrowed committed categorical bar generation; contains no numeric category mapping.
32
+ * @see {@link PaintedBarHit}
33
+ */
34
+ export interface BarRenderedSeries<D> {
35
+ /** Original records and geometry in source paint order. */
36
+ readonly marks: readonly CapturedBarMark<D>[];
37
+ /** Throws after replacement or disposal. */
38
+ assertLive(): void;
39
+ /** Converts root logical units into this generation's local geometry.
40
+ * @param point - Root-logical Canvas point.
41
+ * @returns Local point or undefined for a singular transform.
42
+ */
43
+ localAtRoot(point: Readonly<RenderedSeriesPoint>): Readonly<RenderedSeriesPoint> | undefined;
44
+ /** Tests a local point against every committed clip/layer bound.
45
+ * @param point - Local-logical Canvas point.
46
+ * @returns Whether the point is inside every clip and layer bound.
47
+ */
48
+ anchorInsideClips(point: Readonly<RenderedSeriesPoint>): boolean;
49
+ }
50
+ /** Mount-owned optional categorical-bar capture.
51
+ * @see {@link BarRenderedSeries}
52
+ */
53
+ export interface BarInspectionRef<D> {
54
+ /** Returns the last successful generation.
55
+ * @returns Borrowed bar geometry or undefined before paint/after disposal.
56
+ */
57
+ rendered(): BarRenderedSeries<D> | undefined;
58
+ /** @internal Records candidate values and paint geometry without executing a search.
59
+ * @param input - Source-ordered captured rectangle marks.
60
+ */
61
+ capture(input: readonly CapturedBarMark<D>[]): void;
62
+ }
63
+ /**
64
+ * Owns opt-in capture for ordinary, range or grouped categorical bars.
65
+ * @param _inputs - Bar inputs used for datum inference; no data is read or subscribed here.
66
+ * @returns A stable ref to pass to one BarSeries inspection prop; captured endpoints share one fixed contract.
67
+ * @see {@link BarInspectionRef}
68
+ */
69
+ export declare function useBarInspection<D>(_inputs: Pick<BarSeriesProps<D>, "data" | "category">): BarInspectionRef<D>;
70
+ /**
71
+ * Finds the last-painted bar covering a root-logical point in this explicit series.
72
+ * @param rendered - Borrowed committed categorical bar values and rectangle geometry.
73
+ * @param options - Root-logical query point; respects every clip, fill/stroke and source order.
74
+ * @returns Original record, category/group, endpoints and local bounds, or undefined for gaps and singular transforms.
75
+ * @see {@link PaintedBarHit}
76
+ */
77
+ export declare function paintedBarAt<D>(rendered: BarRenderedSeries<D>, options: {
78
+ rootPoint: Readonly<RenderedSeriesPoint>;
79
+ }): PaintedBarHit<D> | undefined;