@pibbl/core 0.0.1 → 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.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.txt +81 -0
- package/dist/features/machines/animation.d.ts +64 -0
- package/dist/features/machines/animation.js +55 -0
- package/dist/features/machines/animation.js.map +7 -0
- package/dist/features/machines/animation.mjs +1 -0
- package/dist/features/machines/assign.d.ts +16 -0
- package/dist/features/machines/assign.js +15 -0
- package/dist/features/machines/assign.js.map +7 -0
- package/dist/features/machines/callback.d.ts +9 -0
- package/dist/features/machines/callback.js +7 -0
- package/dist/features/machines/callback.js.map +7 -0
- package/dist/features/machines/hook.d.ts +30 -0
- package/dist/features/machines/hook.js +37 -0
- package/dist/features/machines/hook.js.map +7 -0
- package/dist/features/machines/index.d.ts +6 -0
- package/dist/features/machines/index.js +12 -0
- package/dist/features/machines/index.js.map +7 -0
- package/dist/features/machines/index.mjs +1 -0
- package/dist/features/machines/runtime.d.ts +18 -0
- package/dist/features/machines/runtime.js +363 -0
- package/dist/features/machines/runtime.js.map +7 -0
- package/dist/features/machines/types.d.ts +164 -0
- package/dist/features/physics/2d-geometry.d.ts +3 -3
- package/dist/features/physics/2d-geometry.js.map +1 -1
- package/dist/features/physics/2d-testing.d.ts +1 -1
- package/dist/features/physics/2d-testing.js +2 -2
- package/dist/features/physics/2d-testing.js.map +2 -2
- package/dist/features/physics/2d.d.ts +115 -62
- package/dist/features/physics/2d.js +59 -28
- package/dist/features/physics/2d.js.map +2 -2
- package/dist/features/physics/lib/2d/canvas/components.js +25 -21
- package/dist/features/physics/lib/2d/canvas/components.js.map +2 -2
- package/dist/features/physics/lib/2d/canvas/presentation.js +1 -2
- package/dist/features/physics/lib/2d/canvas/presentation.js.map +2 -2
- package/dist/features/physics/lib/2d/collision/casts.js +4 -2
- package/dist/features/physics/lib/2d/collision/casts.js.map +2 -2
- package/dist/features/physics/lib/2d/query-types.d.ts +6 -0
- package/dist/features/physics/lib/2d/runtime/controller.d.ts +7 -6
- package/dist/features/physics/lib/2d/runtime/controller.js +1 -1
- package/dist/features/physics/lib/2d/runtime/controller.js.map +2 -2
- package/dist/features/physics/lib/2d/runtime/obstacles.js +9 -11
- package/dist/features/physics/lib/2d/runtime/obstacles.js.map +2 -2
- package/dist/features/physics/lib/2d/shapes.js +8 -9
- package/dist/features/physics/lib/2d/shapes.js.map +2 -2
- package/dist/features/physics/lib/2d/types.d.ts +8 -30
- package/dist/features/physics/lib/2d/world/queries.d.ts +7 -6
- package/dist/features/physics/lib/2d/world/queries.js.map +2 -2
- package/dist/features/physics/lib/2d/world/rapier.js +22 -26
- package/dist/features/physics/lib/2d/world/rapier.js.map +2 -2
- package/dist/features/sprites/formats/aseprite.d.ts +5 -0
- package/dist/features/sprites/formats/texture-packer.d.ts +5 -0
- package/dist/features/sprites/index.d.ts +6 -0
- package/dist/features/sprites/loader.d.ts +25 -0
- package/dist/features/sprites/loader.js +6 -3
- package/dist/features/sprites/loader.js.map +2 -2
- package/dist/features/sprites/model.d.ts +75 -0
- package/dist/features/sprites/sprite.d.ts +22 -0
- package/dist/features/textures/index.d.ts +12 -2
- package/dist/features/textures/index.js +33 -1
- package/dist/features/textures/index.js.map +2 -2
- package/dist/features/textures/lib/chemical-field.d.ts +56 -0
- package/dist/features/textures/lib/chemical-field.js +154 -0
- package/dist/features/textures/lib/chemical-field.js.map +7 -0
- package/dist/features/textures/lib/chemical-recipes.d.ts +119 -0
- package/dist/features/textures/lib/chemical-recipes.js +275 -0
- package/dist/features/textures/lib/chemical-recipes.js.map +7 -0
- package/dist/features/textures/lib/definitions.d.ts +3 -18
- package/dist/features/textures/lib/definitions.js +17 -24
- package/dist/features/textures/lib/definitions.js.map +2 -2
- package/dist/features/textures/lib/geometric-patterns.d.ts +149 -0
- package/dist/features/textures/lib/geometric-patterns.js +305 -0
- package/dist/features/textures/lib/geometric-patterns.js.map +7 -0
- package/dist/features/textures/lib/gray-scott.d.ts +55 -0
- package/dist/features/textures/lib/gray-scott.js +37 -0
- package/dist/features/textures/lib/gray-scott.js.map +7 -0
- package/dist/features/textures/lib/palette.js +1 -3
- package/dist/features/textures/lib/palette.js.map +2 -2
- package/dist/features/textures/lib/patterns.d.ts +123 -0
- package/dist/features/textures/lib/patterns.js +344 -0
- package/dist/features/textures/lib/patterns.js.map +7 -0
- package/dist/features/textures/lib/rain-drops.js +2 -1
- package/dist/features/textures/lib/rain-drops.js.map +2 -2
- package/dist/features/textures/lib/reaction-diffusion.d.ts +3 -2
- package/dist/features/textures/lib/reaction-diffusion.js +9 -20
- package/dist/features/textures/lib/reaction-diffusion.js.map +2 -2
- package/dist/features/textures/lib/simulation.d.ts +10 -4
- package/dist/features/textures/lib/simulation.js +23 -13
- package/dist/features/textures/lib/simulation.js.map +2 -2
- package/dist/features/textures/lib/wasm/electric.js +8 -1
- package/dist/features/textures/lib/wasm/electric.js.map +2 -2
- package/dist/features/textures/lib/water-surface.js +1 -3
- package/dist/features/textures/lib/water-surface.js.map +2 -2
- package/dist/features/viz/index.d.ts +92 -5
- package/dist/features/viz/index.js +202 -4
- package/dist/features/viz/index.js.map +2 -2
- package/dist/features/viz/inspection/bar.d.ts +79 -0
- package/dist/features/viz/inspection/bar.js +49 -0
- package/dist/features/viz/inspection/bar.js.map +7 -0
- package/dist/features/viz/inspection/candle.d.ts +156 -0
- package/dist/features/viz/inspection/candle.js +120 -0
- package/dist/features/viz/inspection/candle.js.map +7 -0
- package/dist/features/viz/inspection/capture-types.d.ts +65 -0
- package/dist/features/viz/inspection/capture.d.ts +16 -0
- package/dist/features/viz/inspection/capture.js +49 -0
- package/dist/features/viz/inspection/capture.js.map +7 -0
- package/dist/features/viz/inspection/handler.d.ts +36 -0
- package/dist/features/viz/inspection/handler.js +91 -0
- package/dist/features/viz/inspection/handler.js.map +7 -0
- package/dist/features/viz/inspection/ohlc-bar.d.ts +132 -0
- package/dist/features/viz/inspection/ohlc-bar.js +118 -0
- package/dist/features/viz/inspection/ohlc-bar.js.map +7 -0
- package/dist/features/viz/inspection/owned-ref.d.ts +16 -0
- package/dist/features/viz/inspection/owned-ref.js +99 -0
- package/dist/features/viz/inspection/owned-ref.js.map +7 -0
- package/dist/features/viz/inspection/painted-point.d.ts +22 -0
- package/dist/features/viz/inspection/painted-point.js +29 -0
- package/dist/features/viz/inspection/painted-point.js.map +7 -0
- package/dist/features/viz/inspection/queries.d.ts +100 -0
- package/dist/features/viz/inspection/queries.js +192 -0
- package/dist/features/viz/inspection/queries.js.map +7 -0
- package/dist/features/viz/inspection/query-types.d.ts +177 -0
- package/dist/features/viz/inspection/volume.d.ts +104 -0
- package/dist/features/viz/inspection/volume.js +95 -0
- package/dist/features/viz/inspection/volume.js.map +7 -0
- package/dist/features/viz/inspection.d.ts +19 -0
- package/dist/features/viz/inspection.js +54 -0
- package/dist/features/viz/inspection.js.map +7 -0
- package/dist/features/viz/inspection.mjs +1 -0
- package/dist/features/viz/lib/area-series.d.ts +62 -0
- package/dist/features/viz/lib/area-series.js +120 -0
- package/dist/features/viz/lib/area-series.js.map +7 -0
- package/dist/features/viz/lib/axis-labels.d.ts +2 -0
- package/dist/features/viz/lib/axis-labels.js +41 -0
- package/dist/features/viz/lib/axis-labels.js.map +7 -0
- package/dist/features/viz/lib/axis-title.d.ts +23 -0
- package/dist/features/viz/lib/axis-title.js +24 -0
- package/dist/features/viz/lib/axis-title.js.map +7 -0
- package/dist/features/viz/lib/axis.d.ts +1 -1
- package/dist/features/viz/lib/axis.js +50 -50
- package/dist/features/viz/lib/axis.js.map +2 -2
- package/dist/features/viz/lib/bar-scale.d.ts +7 -0
- package/dist/features/viz/lib/bar-scale.js +34 -0
- package/dist/features/viz/lib/bar-scale.js.map +7 -0
- package/dist/features/viz/lib/bar-series.d.ts +3 -1
- package/dist/features/viz/lib/bar-series.js +21 -5
- package/dist/features/viz/lib/bar-series.js.map +2 -2
- package/dist/features/viz/lib/baseline-series.d.ts +55 -0
- package/dist/features/viz/lib/baseline-series.js +136 -0
- package/dist/features/viz/lib/baseline-series.js.map +7 -0
- package/dist/features/viz/lib/candlestick-series.d.ts +62 -0
- package/dist/features/viz/lib/candlestick-series.js +150 -0
- package/dist/features/viz/lib/candlestick-series.js.map +7 -0
- package/dist/features/viz/lib/censored-point-series.d.ts +71 -0
- package/dist/features/viz/lib/censored-point-series.js +129 -0
- package/dist/features/viz/lib/censored-point-series.js.map +7 -0
- package/dist/features/viz/lib/chart-lines.d.ts +41 -0
- package/dist/features/viz/lib/chart-lines.js +32 -0
- package/dist/features/viz/lib/chart-lines.js.map +7 -0
- package/dist/features/viz/lib/color-context.d.ts +4 -0
- package/dist/features/viz/lib/color-context.js +41 -0
- package/dist/features/viz/lib/color-context.js.map +7 -0
- package/dist/features/viz/lib/color-math.d.ts +4 -0
- package/dist/features/viz/lib/color-math.js +31 -0
- package/dist/features/viz/lib/color-math.js.map +7 -0
- package/dist/features/viz/lib/color-types.d.ts +53 -0
- package/dist/features/viz/lib/curve-definition.d.ts +49 -0
- package/dist/features/viz/lib/curve-definition.js +142 -0
- package/dist/features/viz/lib/curve-definition.js.map +7 -0
- package/dist/features/viz/lib/diverging-color-scale.d.ts +11 -0
- package/dist/features/viz/lib/diverging-color-scale.js +51 -0
- package/dist/features/viz/lib/diverging-color-scale.js.map +7 -0
- package/dist/features/viz/lib/domain-navigation.d.ts +40 -0
- package/dist/features/viz/lib/domain-navigation.js +77 -0
- package/dist/features/viz/lib/domain-navigation.js.map +7 -0
- package/dist/features/viz/lib/editable-chart-elements.d.ts +178 -0
- package/dist/features/viz/lib/editable-chart-elements.js +733 -0
- package/dist/features/viz/lib/editable-chart-elements.js.map +7 -0
- package/dist/features/viz/lib/financial-aggregation.d.ts +127 -0
- package/dist/features/viz/lib/financial-aggregation.js +116 -0
- package/dist/features/viz/lib/financial-aggregation.js.map +7 -0
- package/dist/features/viz/lib/financial-autoscale.d.ts +64 -0
- package/dist/features/viz/lib/financial-autoscale.js +61 -0
- package/dist/features/viz/lib/financial-autoscale.js.map +7 -0
- package/dist/features/viz/lib/financial-comparison.d.ts +62 -0
- package/dist/features/viz/lib/financial-comparison.js +98 -0
- package/dist/features/viz/lib/financial-comparison.js.map +7 -0
- package/dist/features/viz/lib/financial-geometry.d.ts +77 -0
- package/dist/features/viz/lib/financial-geometry.js +67 -0
- package/dist/features/viz/lib/financial-geometry.js.map +7 -0
- package/dist/features/viz/lib/financial-indicators.d.ts +114 -0
- package/dist/features/viz/lib/financial-indicators.js +135 -0
- package/dist/features/viz/lib/financial-indicators.js.map +7 -0
- package/dist/features/viz/lib/financial-oscillators.d.ts +171 -0
- package/dist/features/viz/lib/financial-oscillators.js +265 -0
- package/dist/features/viz/lib/financial-oscillators.js.map +7 -0
- package/dist/features/viz/lib/graph/bipartite.d.ts +14 -0
- package/dist/features/viz/lib/graph/bipartite.js +250 -0
- package/dist/features/viz/lib/graph/bipartite.js.map +7 -0
- package/dist/features/viz/lib/graph/chord.d.ts +44 -0
- package/dist/features/viz/lib/graph/chord.js +348 -0
- package/dist/features/viz/lib/graph/chord.js.map +7 -0
- package/dist/features/viz/lib/graph/dependency.d.ts +26 -0
- package/dist/features/viz/lib/graph/dependency.js +140 -0
- package/dist/features/viz/lib/graph/dependency.js.map +7 -0
- package/dist/features/viz/lib/graph/force.d.ts +28 -0
- package/dist/features/viz/lib/graph/force.js +580 -0
- package/dist/features/viz/lib/graph/force.js.map +7 -0
- package/dist/features/viz/lib/graph/hierarchy.d.ts +21 -0
- package/dist/features/viz/lib/graph/hierarchy.js +112 -0
- package/dist/features/viz/lib/graph/hierarchy.js.map +7 -0
- package/dist/features/viz/lib/graph/icicle.d.ts +16 -0
- package/dist/features/viz/lib/graph/icicle.js +153 -0
- package/dist/features/viz/lib/graph/icicle.js.map +7 -0
- package/dist/features/viz/lib/graph/matrix.d.ts +30 -0
- package/dist/features/viz/lib/graph/matrix.js +243 -0
- package/dist/features/viz/lib/graph/matrix.js.map +7 -0
- package/dist/features/viz/lib/graph/neighborhood.d.ts +11 -0
- package/dist/features/viz/lib/graph/neighborhood.js +281 -0
- package/dist/features/viz/lib/graph/neighborhood.js.map +7 -0
- package/dist/features/viz/lib/graph/routes.d.ts +35 -0
- package/dist/features/viz/lib/graph/routes.js +101 -0
- package/dist/features/viz/lib/graph/routes.js.map +7 -0
- package/dist/features/viz/lib/graph/sankey.d.ts +44 -0
- package/dist/features/viz/lib/graph/sankey.js +341 -0
- package/dist/features/viz/lib/graph/sankey.js.map +7 -0
- package/dist/features/viz/lib/graph/shared.d.ts +59 -0
- package/dist/features/viz/lib/graph/shared.js +301 -0
- package/dist/features/viz/lib/graph/shared.js.map +7 -0
- package/dist/features/viz/lib/graph/tree.d.ts +11 -0
- package/dist/features/viz/lib/graph/tree.js +232 -0
- package/dist/features/viz/lib/graph/tree.js.map +7 -0
- package/dist/features/viz/lib/graph/treemap.d.ts +20 -0
- package/dist/features/viz/lib/graph/treemap.js +227 -0
- package/dist/features/viz/lib/graph/treemap.js.map +7 -0
- package/dist/features/viz/lib/graph/types.d.ts +1097 -0
- package/dist/features/viz/lib/hover-card.js +8 -9
- package/dist/features/viz/lib/hover-card.js.map +2 -2
- package/dist/features/viz/lib/hover-data.d.ts +1 -1
- package/dist/features/viz/lib/hover-data.js +6 -3
- package/dist/features/viz/lib/hover-data.js.map +2 -2
- package/dist/features/viz/lib/hover-types.d.ts +5 -5
- package/dist/features/viz/lib/interval-band-series.d.ts +49 -0
- package/dist/features/viz/lib/interval-band-series.js +136 -0
- package/dist/features/viz/lib/interval-band-series.js.map +7 -0
- package/dist/features/viz/lib/interval-diamond-series.d.ts +43 -0
- package/dist/features/viz/lib/interval-diamond-series.js +122 -0
- package/dist/features/viz/lib/interval-diamond-series.js.map +7 -0
- package/dist/features/viz/lib/interval-series.d.ts +79 -0
- package/dist/features/viz/lib/interval-series.js +158 -0
- package/dist/features/viz/lib/interval-series.js.map +7 -0
- package/dist/features/viz/lib/layout-pie.js +9 -13
- package/dist/features/viz/lib/layout-pie.js.map +2 -2
- package/dist/features/viz/lib/line-series.d.ts +1 -1
- package/dist/features/viz/lib/line-series.js +47 -28
- package/dist/features/viz/lib/line-series.js.map +2 -2
- package/dist/features/viz/lib/linear-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/linear-scale-component.js +18 -0
- package/dist/features/viz/lib/linear-scale-component.js.map +7 -0
- package/dist/features/viz/lib/linear-scale.js +1 -1
- package/dist/features/viz/lib/linear-scale.js.map +2 -2
- package/dist/features/viz/lib/log-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/log-scale-component.js +19 -0
- package/dist/features/viz/lib/log-scale-component.js.map +7 -0
- package/dist/features/viz/lib/log-scale.d.ts +2 -0
- package/dist/features/viz/lib/log-scale.js +53 -0
- package/dist/features/viz/lib/log-scale.js.map +7 -0
- package/dist/features/viz/lib/monotone-curve.d.ts +11 -0
- package/dist/features/viz/lib/monotone-curve.js +63 -0
- package/dist/features/viz/lib/monotone-curve.js.map +7 -0
- package/dist/features/viz/lib/nearest.d.ts +9 -9
- package/dist/features/viz/lib/nearest.js.map +1 -1
- package/dist/features/viz/lib/numeric-range-interpolation.d.ts +15 -0
- package/dist/features/viz/lib/numeric-range-interpolation.js +36 -0
- package/dist/features/viz/lib/numeric-range-interpolation.js.map +7 -0
- package/dist/features/viz/lib/numeric-ticks.d.ts +38 -0
- package/dist/features/viz/lib/numeric-ticks.js +54 -0
- package/dist/features/viz/lib/numeric-ticks.js.map +7 -0
- package/dist/features/viz/lib/ohlc-bar-series.d.ts +55 -0
- package/dist/features/viz/lib/ohlc-bar-series.js +168 -0
- package/dist/features/viz/lib/ohlc-bar-series.js.map +7 -0
- package/dist/features/viz/lib/paired-series.d.ts +44 -0
- package/dist/features/viz/lib/paired-series.js +93 -0
- package/dist/features/viz/lib/paired-series.js.map +7 -0
- package/dist/features/viz/lib/pie-layout.js +2 -1
- package/dist/features/viz/lib/pie-layout.js.map +2 -2
- package/dist/features/viz/lib/plot-series.js +11 -6
- package/dist/features/viz/lib/plot-series.js.map +2 -2
- package/dist/features/viz/lib/plot-types.d.ts +4 -3
- package/dist/features/viz/lib/point-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/point-scale-component.js +19 -0
- package/dist/features/viz/lib/point-scale-component.js.map +7 -0
- package/dist/features/viz/lib/point-scale.d.ts +2 -0
- package/dist/features/viz/lib/point-scale.js +45 -0
- package/dist/features/viz/lib/point-scale.js.map +7 -0
- package/dist/features/viz/lib/point-series.d.ts +1 -1
- package/dist/features/viz/lib/point-series.js +36 -9
- package/dist/features/viz/lib/point-series.js.map +2 -2
- package/dist/features/viz/lib/point-types.d.ts +5 -2
- package/dist/features/viz/lib/reference-band.d.ts +16 -0
- package/dist/features/viz/lib/reference-band.js +30 -0
- package/dist/features/viz/lib/reference-band.js.map +7 -0
- package/dist/features/viz/lib/scale-adjust.js +9 -4
- package/dist/features/viz/lib/scale-adjust.js.map +2 -2
- package/dist/features/viz/lib/scale-context.d.ts +5 -4
- package/dist/features/viz/lib/scale-context.js +15 -11
- package/dist/features/viz/lib/scale-context.js.map +2 -2
- package/dist/features/viz/lib/scale-provider.d.ts +2 -0
- package/dist/features/viz/lib/scale-provider.js +13 -0
- package/dist/features/viz/lib/scale-provider.js.map +7 -0
- package/dist/features/viz/lib/scale-ticks.d.ts +5 -0
- package/dist/features/viz/lib/scale-ticks.js +64 -0
- package/dist/features/viz/lib/scale-ticks.js.map +7 -0
- package/dist/features/viz/lib/scale-view.d.ts +4 -0
- package/dist/features/viz/lib/scale-view.js +21 -0
- package/dist/features/viz/lib/scale-view.js.map +7 -0
- package/dist/features/viz/lib/sequential-color-scale.d.ts +11 -0
- package/dist/features/viz/lib/sequential-color-scale.js +49 -0
- package/dist/features/viz/lib/sequential-color-scale.js.map +7 -0
- package/dist/features/viz/lib/series-position.d.ts +12 -0
- package/dist/features/viz/lib/series-position.js +44 -0
- package/dist/features/viz/lib/series-position.js.map +7 -0
- package/dist/features/viz/lib/step-curves.d.ts +19 -0
- package/dist/features/viz/lib/step-curves.js +53 -0
- package/dist/features/viz/lib/step-curves.js.map +7 -0
- package/dist/features/viz/lib/symlog-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/symlog-scale-component.js +19 -0
- package/dist/features/viz/lib/symlog-scale-component.js.map +7 -0
- package/dist/features/viz/lib/symlog-scale.d.ts +2 -0
- package/dist/features/viz/lib/symlog-scale.js +38 -0
- package/dist/features/viz/lib/symlog-scale.js.map +7 -0
- package/dist/features/viz/lib/threshold-color-scale.d.ts +43 -0
- package/dist/features/viz/lib/threshold-color-scale.js +59 -0
- package/dist/features/viz/lib/threshold-color-scale.js.map +7 -0
- package/dist/features/viz/lib/trading-time-mapping.d.ts +32 -0
- package/dist/features/viz/lib/trading-time-mapping.js +89 -0
- package/dist/features/viz/lib/trading-time-mapping.js.map +7 -0
- package/dist/features/viz/lib/trading-time-scale.d.ts +83 -0
- package/dist/features/viz/lib/trading-time-scale.js +96 -0
- package/dist/features/viz/lib/trading-time-scale.js.map +7 -0
- package/dist/features/viz/lib/trajectory-series.d.ts +71 -0
- package/dist/features/viz/lib/trajectory-series.js +111 -0
- package/dist/features/viz/lib/trajectory-series.js.map +7 -0
- package/dist/features/viz/lib/types.d.ts +114 -21
- package/dist/features/viz/lib/use-bar-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-bar-scale.js +9 -0
- package/dist/features/viz/lib/use-bar-scale.js.map +7 -0
- package/dist/features/viz/lib/use-continuous-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-continuous-scale.js +14 -0
- package/dist/features/viz/lib/use-continuous-scale.js.map +7 -0
- package/dist/features/viz/lib/use-linear-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-linear-scale.js +9 -0
- package/dist/features/viz/lib/use-linear-scale.js.map +7 -0
- package/dist/features/viz/lib/use-log-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-log-scale.js +9 -0
- package/dist/features/viz/lib/use-log-scale.js.map +7 -0
- package/dist/features/viz/lib/use-point-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-point-scale.js +9 -0
- package/dist/features/viz/lib/use-point-scale.js.map +7 -0
- package/dist/features/viz/lib/use-symlog-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-symlog-scale.js +9 -0
- package/dist/features/viz/lib/use-symlog-scale.js.map +7 -0
- package/dist/features/viz/lib/use-utc-scale.d.ts +8 -0
- package/dist/features/viz/lib/use-utc-scale.js +9 -0
- package/dist/features/viz/lib/use-utc-scale.js.map +7 -0
- package/dist/features/viz/lib/utc-labels.d.ts +12 -0
- package/dist/features/viz/lib/utc-labels.js +27 -0
- package/dist/features/viz/lib/utc-labels.js.map +7 -0
- package/dist/features/viz/lib/utc-scale-component.d.ts +7 -0
- package/dist/features/viz/lib/utc-scale-component.js +18 -0
- package/dist/features/viz/lib/utc-scale-component.js.map +7 -0
- package/dist/features/viz/lib/utc-scale.d.ts +21 -0
- package/dist/features/viz/lib/utc-scale.js +124 -0
- package/dist/features/viz/lib/utc-scale.js.map +7 -0
- package/dist/features/viz/lib/volume-series.d.ts +59 -0
- package/dist/features/viz/lib/volume-series.js +117 -0
- package/dist/features/viz/lib/volume-series.js.map +7 -0
- package/dist/features/viz/lib/weighted-point-series.d.ts +71 -0
- package/dist/features/viz/lib/weighted-point-series.js +169 -0
- package/dist/features/viz/lib/weighted-point-series.js.map +7 -0
- package/dist/filters/backdrop-contrast-gpu.d.ts +5 -0
- package/dist/filters/backdrop-contrast-gpu.js +33 -0
- package/dist/filters/backdrop-contrast-gpu.js.map +7 -0
- package/dist/filters/backdrop-contrast.d.ts +21 -0
- package/dist/filters/backdrop-contrast.js +61 -0
- package/dist/filters/backdrop-contrast.js.map +7 -0
- package/dist/filters/displacement.js +1 -1
- package/dist/filters/displacement.js.map +2 -2
- package/dist/filters/emboss-gpu.d.ts +4 -0
- package/dist/filters/emboss-gpu.js +39 -0
- package/dist/filters/emboss-gpu.js.map +7 -0
- package/dist/filters/emboss.d.ts +32 -0
- package/dist/filters/emboss.js +104 -0
- package/dist/filters/emboss.js.map +7 -0
- package/dist/filters/filter-executor.d.ts +11 -4
- package/dist/filters/filter-executor.js +104 -49
- package/dist/filters/filter-executor.js.map +2 -2
- package/dist/filters/reflected-light.js +1 -1
- package/dist/filters/reflected-light.js.map +2 -2
- package/dist/filters/reflection-gpu.d.ts +3 -1
- package/dist/filters/reflection-gpu.js +5 -2
- package/dist/filters/reflection-gpu.js.map +2 -2
- package/dist/filters/render-backdrop-contrast-boundary.d.ts +31 -0
- package/dist/filters/render-backdrop-contrast-boundary.js +116 -0
- package/dist/filters/render-backdrop-contrast-boundary.js.map +7 -0
- package/dist/filters/render-emboss-boundary.d.ts +13 -0
- package/dist/filters/render-emboss-boundary.js +131 -0
- package/dist/filters/render-emboss-boundary.js.map +7 -0
- package/dist/filters.d.ts +9 -5
- package/dist/filters.js +4 -0
- package/dist/filters.js.map +2 -2
- package/dist/index.d.ts +10 -6
- package/dist/index.js +18 -2
- package/dist/index.js.map +2 -2
- package/dist/internal.d.ts +4 -0
- package/dist/internal.js +6 -0
- package/dist/internal.js.map +2 -2
- package/dist/layout-kernel.d.ts +12 -0
- package/dist/layout-kernel.js +11 -0
- package/dist/layout-kernel.js.map +7 -0
- package/dist/layout-kernel.mjs +1 -0
- package/dist/lib/animation/definition.d.ts +5 -3
- package/dist/lib/animation/definition.js +29 -4
- package/dist/lib/animation/definition.js.map +2 -2
- package/dist/lib/animation/playback.d.ts +8 -0
- package/dist/lib/animation/playback.js +33 -11
- package/dist/lib/animation/playback.js.map +2 -2
- package/dist/lib/animation/spring.d.ts +3 -1
- package/dist/lib/animation/spring.js.map +2 -2
- package/dist/lib/animation/types.d.ts +29 -73
- package/dist/lib/backend/types.d.ts +13 -1
- package/dist/lib/backend/types.js.map +2 -2
- package/dist/lib/components/arc-geometry.js +2 -1
- package/dist/lib/components/arc-geometry.js.map +2 -2
- package/dist/lib/components/g.js +2 -0
- package/dist/lib/components/g.js.map +2 -2
- package/dist/lib/components/html-box.js +2 -1
- package/dist/lib/components/html-box.js.map +2 -2
- package/dist/lib/components/img.js +3 -3
- package/dist/lib/components/img.js.map +2 -2
- package/dist/lib/components/layer.js +98 -16
- package/dist/lib/components/layer.js.map +3 -3
- package/dist/lib/components/text.d.ts +16 -0
- package/dist/lib/components/text.js +131 -24
- package/dist/lib/components/text.js.map +2 -2
- package/dist/lib/define-primitive.d.ts +4 -2
- package/dist/lib/define-primitive.js +3 -1
- package/dist/lib/define-primitive.js.map +2 -2
- package/dist/lib/element/metadata.d.ts +9 -0
- package/dist/lib/element/metadata.js +19 -0
- package/dist/lib/element/metadata.js.map +2 -2
- package/dist/lib/element/resolve-primitive-inputs.d.ts +2 -0
- package/dist/lib/element/resolve-primitive-inputs.js +17 -4
- package/dist/lib/element/resolve-primitive-inputs.js.map +2 -2
- package/dist/lib/events/event-facade.d.ts +18 -0
- package/dist/lib/events/event-facade.js +28 -2
- package/dist/lib/events/event-facade.js.map +2 -2
- package/dist/lib/events/hit-test.js +2 -1
- package/dist/lib/events/hit-test.js.map +2 -2
- package/dist/lib/events/propagation.d.ts +2 -1
- package/dist/lib/events/propagation.js +22 -16
- package/dist/lib/events/propagation.js.map +2 -2
- package/dist/lib/events/registrations.d.ts +10 -0
- package/dist/lib/events/registrations.js +160 -5
- package/dist/lib/events/registrations.js.map +2 -2
- package/dist/lib/execute-render.js +25 -1
- package/dist/lib/execute-render.js.map +2 -2
- package/dist/lib/filter/filter-region.js +3 -10
- package/dist/lib/filter/filter-region.js.map +2 -2
- package/dist/lib/focus/focus-manager.d.ts +8 -1
- package/dist/lib/focus/focus-manager.js +87 -43
- package/dist/lib/focus/focus-manager.js.map +2 -2
- package/dist/lib/focus/geometry.d.ts +2 -0
- package/dist/lib/focus/geometry.js +6 -0
- package/dist/lib/focus/geometry.js.map +2 -2
- package/dist/lib/geometry/path-bend-guide.js +1 -1
- package/dist/lib/geometry/path-bend-guide.js.map +2 -2
- package/dist/lib/geometry/path-geometry.js +12 -11
- package/dist/lib/geometry/path-geometry.js.map +2 -2
- package/dist/lib/geometry/path-transforms.js +17 -21
- package/dist/lib/geometry/path-transforms.js.map +2 -2
- package/dist/lib/geometry/path-warp-bezier.js +3 -1
- package/dist/lib/geometry/path-warp-bezier.js.map +2 -2
- package/dist/lib/geometry/path-warp.js +1 -1
- package/dist/lib/geometry/path-warp.js.map +2 -2
- package/dist/lib/global-state.js +2 -0
- package/dist/lib/global-state.js.map +2 -2
- package/dist/lib/hooks/use-animated-value.d.ts +11 -21
- package/dist/lib/hooks/use-animated-value.js +23 -70
- package/dist/lib/hooks/use-animated-value.js.map +3 -3
- package/dist/lib/hooks/use-playback.js +1 -0
- package/dist/lib/hooks/use-playback.js.map +2 -2
- package/dist/lib/html/html-events.d.ts +32 -0
- package/dist/lib/html/html-events.js +179 -0
- package/dist/lib/html/html-events.js.map +7 -0
- package/dist/lib/html/html-service.d.ts +8 -2
- package/dist/lib/html/html-service.js +198 -65
- package/dist/lib/html/html-service.js.map +2 -2
- package/dist/lib/html/overlay-config.js +7 -6
- package/dist/lib/html/overlay-config.js.map +2 -2
- package/dist/lib/html/types.d.ts +29 -2
- package/dist/lib/layout/absolute.d.ts +11 -5
- package/dist/lib/layout/absolute.js +329 -55
- package/dist/lib/layout/absolute.js.map +3 -3
- package/dist/lib/layout/allocation-checkpoint-owner.d.ts +11 -0
- package/dist/lib/layout/allocation-checkpoint-owner.js +86 -0
- package/dist/lib/layout/allocation-checkpoint-owner.js.map +7 -0
- package/dist/lib/layout/allocation-checkpoint.d.ts +53 -0
- package/dist/lib/layout/allocation-checkpoint.js +463 -0
- package/dist/lib/layout/allocation-checkpoint.js.map +7 -0
- package/dist/lib/layout/allocation-dependencies.d.ts +30 -0
- package/dist/lib/layout/allocation-dependencies.js +90 -0
- package/dist/lib/layout/allocation-dependencies.js.map +7 -0
- package/dist/lib/layout/allocation-revision.d.ts +13 -0
- package/dist/lib/layout/allocation-revision.js +67 -0
- package/dist/lib/layout/allocation-revision.js.map +7 -0
- package/dist/lib/layout/box-insets.d.ts +17 -0
- package/dist/lib/layout/box-insets.js +138 -0
- package/dist/lib/layout/box-insets.js.map +7 -0
- package/dist/lib/layout/box-sizing.d.ts +16 -0
- package/dist/lib/layout/box-sizing.js +77 -0
- package/dist/lib/layout/box-sizing.js.map +7 -0
- package/dist/lib/layout/box.js +42 -12
- package/dist/lib/layout/box.js.map +2 -2
- package/dist/lib/layout/canvas-measurement.d.ts +13 -0
- package/dist/lib/layout/canvas-measurement.js +57 -0
- package/dist/lib/layout/canvas-measurement.js.map +7 -0
- package/dist/lib/layout/context.d.ts +35 -6
- package/dist/lib/layout/context.js +72 -3
- package/dist/lib/layout/context.js.map +2 -2
- package/dist/lib/layout/define-layout-component.d.ts +23 -0
- package/dist/lib/layout/define-layout-component.js +84 -0
- package/dist/lib/layout/define-layout-component.js.map +7 -0
- package/dist/lib/layout/flex-allocation-cache.d.ts +42 -0
- package/dist/lib/layout/flex-baseline-mode.d.ts +2 -0
- package/dist/lib/layout/flex-baseline-mode.js +7 -0
- package/dist/lib/layout/flex-baseline-mode.js.map +7 -0
- package/dist/lib/layout/flex.d.ts +50 -15
- package/dist/lib/layout/flex.js +2124 -195
- package/dist/lib/layout/flex.js.map +3 -3
- package/dist/lib/layout/flow.js +225 -49
- package/dist/lib/layout/flow.js.map +2 -2
- package/dist/lib/layout/geometry-publication.d.ts +53 -0
- package/dist/lib/layout/geometry-publication.js +244 -0
- package/dist/lib/layout/geometry-publication.js.map +7 -0
- package/dist/lib/layout/grid-kernel.d.ts +63 -0
- package/dist/lib/layout/grid-kernel.js +168 -0
- package/dist/lib/layout/grid-kernel.js.map +7 -0
- package/dist/lib/layout/grid.d.ts +63 -4
- package/dist/lib/layout/grid.js +767 -171
- package/dist/lib/layout/grid.js.map +3 -3
- package/dist/lib/layout/measure.d.ts +55 -3
- package/dist/lib/layout/measure.js +448 -15
- package/dist/lib/layout/measure.js.map +2 -2
- package/dist/lib/layout/overlay.js +81 -23
- package/dist/lib/layout/overlay.js.map +2 -2
- package/dist/lib/layout/participation.d.ts +27 -0
- package/dist/lib/layout/participation.js +188 -0
- package/dist/lib/layout/participation.js.map +7 -0
- package/dist/lib/layout/place-child.js +1 -1
- package/dist/lib/layout/place-child.js.map +2 -2
- package/dist/lib/layout/positioning-diagnostics.d.ts +1 -1
- package/dist/lib/layout/positioning-diagnostics.js +13 -2
- package/dist/lib/layout/positioning-diagnostics.js.map +2 -2
- package/dist/lib/layout/prepared-root.d.ts +121 -0
- package/dist/lib/layout/prepared-root.js +360 -0
- package/dist/lib/layout/prepared-root.js.map +7 -0
- package/dist/lib/layout/standalone-kernel.d.ts +60 -0
- package/dist/lib/layout/standalone-kernel.js +722 -0
- package/dist/lib/layout/standalone-kernel.js.map +7 -0
- package/dist/lib/layout/topology.d.ts +21 -0
- package/dist/lib/layout/topology.js +113 -0
- package/dist/lib/layout/topology.js.map +7 -0
- package/dist/lib/layout/types.d.ts +5 -0
- package/dist/lib/layout/wasm/artifact.d.ts +1 -0
- package/dist/lib/layout/wasm/artifact.js +5 -0
- package/dist/lib/layout/wasm/artifact.js.map +7 -0
- package/dist/lib/layout/wasm/bytes.d.ts +1 -0
- package/dist/lib/layout/wasm/bytes.js +5 -0
- package/dist/lib/layout/wasm/bytes.js.map +7 -0
- package/dist/lib/layout/wasm/embedded.d.ts +2 -0
- package/dist/lib/layout/wasm/embedded.js +12 -0
- package/dist/lib/layout/wasm/embedded.js.map +7 -0
- package/dist/lib/layout/wasm/layout.wasm +0 -0
- package/dist/lib/layout/wasm/module.d.ts +8 -0
- package/dist/lib/layout/wasm/module.js +70 -0
- package/dist/lib/layout/wasm/module.js.map +7 -0
- package/dist/lib/layout/wasm/region.d.ts +267 -0
- package/dist/lib/layout/wasm/region.js +1018 -0
- package/dist/lib/layout/wasm/region.js.map +7 -0
- package/dist/lib/manipulation/controller.js +4 -7
- package/dist/lib/manipulation/controller.js.map +2 -2
- package/dist/lib/manipulation/frame.js +1 -1
- package/dist/lib/manipulation/frame.js.map +2 -2
- package/dist/lib/manipulation/handles.js +32 -33
- package/dist/lib/manipulation/handles.js.map +2 -2
- package/dist/lib/manipulation/solve.js +12 -10
- package/dist/lib/manipulation/solve.js.map +2 -2
- package/dist/lib/mount-pibbl.js +1 -0
- package/dist/lib/mount-pibbl.js.map +2 -2
- package/dist/lib/mount-prepared-pibbl.d.ts +5 -0
- package/dist/lib/mount-prepared-pibbl.js +29 -0
- package/dist/lib/mount-prepared-pibbl.js.map +7 -0
- package/dist/lib/mount-request.d.ts +8 -0
- package/dist/lib/mount-request.js +41 -0
- package/dist/lib/mount-request.js.map +7 -0
- package/dist/lib/pibbl.d.ts +21 -13
- package/dist/lib/pibbl.js +18 -16
- package/dist/lib/pibbl.js.map +2 -2
- package/dist/lib/recording/recording.d.ts +43 -0
- package/dist/lib/recording/recording.js +555 -0
- package/dist/lib/recording/recording.js.map +7 -0
- package/dist/lib/recording/types.d.ts +118 -0
- package/dist/lib/recording/wasm-bytes.d.ts +1 -0
- package/dist/lib/recording/wasm-bytes.js +5 -0
- package/dist/lib/recording/wasm-bytes.js.map +7 -0
- package/dist/lib/recording/worker-source.d.ts +1 -0
- package/dist/lib/recording/worker-source.js +5 -0
- package/dist/lib/recording/worker-source.js.map +7 -0
- package/dist/lib/render-layer/controller.d.ts +9 -3
- package/dist/lib/render-layer/controller.js +259 -110
- package/dist/lib/render-layer/controller.js.map +2 -2
- package/dist/lib/render-transaction.d.ts +12 -2
- package/dist/lib/render-transaction.js +69 -1
- package/dist/lib/render-transaction.js.map +2 -2
- package/dist/lib/render.js +32 -8
- package/dist/lib/render.js.map +2 -2
- package/dist/lib/scheduler/realm-scheduler.d.ts +2 -0
- package/dist/lib/scheduler/realm-scheduler.js +55 -26
- package/dist/lib/scheduler/realm-scheduler.js.map +2 -2
- package/dist/lib/scheduler/renderer-participant.js +1 -0
- package/dist/lib/scheduler/renderer-participant.js.map +2 -2
- package/dist/lib/series-inspection-frame.d.ts +18 -0
- package/dist/lib/series-inspection-frame.js +70 -0
- package/dist/lib/series-inspection-frame.js.map +7 -0
- package/dist/lib/signals/edge.d.ts +7 -4
- package/dist/lib/signals/edge.js +25 -3
- package/dist/lib/signals/edge.js.map +2 -2
- package/dist/lib/signals/graph.d.ts +16 -2
- package/dist/lib/signals/graph.js +54 -12
- package/dist/lib/signals/graph.js.map +2 -2
- package/dist/lib/signals/input-provision.d.ts +15 -0
- package/dist/lib/signals/input-provision.js +53 -3
- package/dist/lib/signals/input-provision.js.map +2 -2
- package/dist/lib/signals/render-consumer.d.ts +3 -0
- package/dist/lib/signals/render-consumer.js +22 -14
- package/dist/lib/signals/render-consumer.js.map +2 -2
- package/dist/lib/style/positioning.d.ts +50 -2
- package/dist/lib/style/positioning.js +28 -4
- package/dist/lib/style/positioning.js.map +2 -2
- package/dist/lib/style/resolve-built-in.d.ts +4 -3
- package/dist/lib/style/resolve-built-in.js +17 -3
- package/dist/lib/style/resolve-built-in.js.map +2 -2
- package/dist/lib/style/resolve-dispatch.d.ts +3 -0
- package/dist/lib/style/resolve-dispatch.js +77 -4
- package/dist/lib/style/resolve-dispatch.js.map +2 -2
- package/dist/lib/style/resolve-length.d.ts +2 -0
- package/dist/lib/style/resolve-length.js +13 -9
- package/dist/lib/style/resolve-length.js.map +2 -2
- package/dist/lib/style/sizing-length.d.ts +51 -0
- package/dist/lib/style/sizing-length.js +77 -0
- package/dist/lib/style/sizing-length.js.map +7 -0
- package/dist/lib/style/types.d.ts +63 -25
- package/dist/lib/surface/root-surface.js +10 -6
- package/dist/lib/surface/root-surface.js.map +2 -2
- package/dist/lib/textures/texture.js +10 -8
- package/dist/lib/textures/texture.js.map +2 -2
- package/dist/lib/transitions/capture.js +4 -1
- package/dist/lib/transitions/capture.js.map +2 -2
- package/dist/lib/transitions/embers-physics.js +17 -10
- package/dist/lib/transitions/embers-physics.js.map +2 -2
- package/dist/lib/types.d.ts +110 -1
- package/dist/sync.d.ts +16 -0
- package/dist/sync.js +13 -0
- package/dist/sync.js.map +7 -0
- package/dist/sync.mjs +1 -0
- package/package.json +43 -6
- package/dist/features/viz/lib/scale.d.ts +0 -11
- package/dist/features/viz/lib/scale.js +0 -80
- package/dist/features/viz/lib/scale.js.map +0 -7
- package/dist/features/viz/lib/use-scale.d.ts +0 -20
- package/dist/features/viz/lib/use-scale.js +0 -10
- package/dist/features/viz/lib/use-scale.js.map +0 -7
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { OhlcBarSeriesProps } from "../lib/ohlc-bar-series.js";
|
|
2
|
+
import { type NumericPositionScale } from "../lib/series-position.js";
|
|
3
|
+
import type { ResolvedContinuousScale } from "../lib/types.js";
|
|
4
|
+
import type { NumericRenderedSeries, RenderedSeriesPoint } from "./query-types.js";
|
|
5
|
+
/** One original OHLC record and its values and geometry as evaluated during paint.
|
|
6
|
+
* @see {@link OhlcBarRenderedSeries}
|
|
7
|
+
*/
|
|
8
|
+
export interface OhlcBarObservation<D> {
|
|
9
|
+
/** Caller-owned original record. */
|
|
10
|
+
readonly datum: D;
|
|
11
|
+
/** Original source index, including skipped rows. */
|
|
12
|
+
readonly sourceIndex: number;
|
|
13
|
+
/** Evaluated UTC-millisecond timestamp. */
|
|
14
|
+
readonly time: number;
|
|
15
|
+
/** Evaluated opening value. */
|
|
16
|
+
readonly open: number;
|
|
17
|
+
/** Evaluated high value. */
|
|
18
|
+
readonly high: number;
|
|
19
|
+
/** Evaluated low value. */
|
|
20
|
+
readonly low: number;
|
|
21
|
+
/** Evaluated closing value. */
|
|
22
|
+
readonly close: number;
|
|
23
|
+
/** Closing endpoint in series-local coordinates. */ readonly anchorLocal: Readonly<RenderedSeriesPoint>;
|
|
24
|
+
/** Closing endpoint in root-logical coordinates. */ readonly anchorRoot: Readonly<RenderedSeriesPoint>;
|
|
25
|
+
/** High/low segment before world transforms. */ readonly stemLocal: Readonly<{
|
|
26
|
+
/** Horizontal center. */ x: number;
|
|
27
|
+
/** Mapped high endpoint. */ highY: number;
|
|
28
|
+
/** Mapped low endpoint. */ lowY: number;
|
|
29
|
+
}>;
|
|
30
|
+
/** Left-facing opening segment before world transforms. */ readonly openTickLocal: Readonly<{
|
|
31
|
+
/** Left endpoint. */ x1: number;
|
|
32
|
+
/** Center endpoint. */ x2: number;
|
|
33
|
+
/** Mapped opening ordinate. */ y: number;
|
|
34
|
+
}>;
|
|
35
|
+
/** Right-facing closing segment before world transforms. */ readonly closeTickLocal: Readonly<{
|
|
36
|
+
/** Center endpoint. */ x1: number;
|
|
37
|
+
/** Right endpoint. */ x2: number;
|
|
38
|
+
/** Mapped closing ordinate. */ y: number;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
/** A nearest-time OHLC candidate with committed clip eligibility.
|
|
42
|
+
* @see {@link nearestRecordedOhlcBarX}
|
|
43
|
+
*/
|
|
44
|
+
export interface OhlcBarInspectionCandidate<D> extends OhlcBarObservation<D> {
|
|
45
|
+
/** @returns Whether the close anchor lies inside every committed clip. */
|
|
46
|
+
anchorInsideClips(): boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Original OHLC selected by nearest timestamp.
|
|
49
|
+
* @see {@link nearestRecordedOhlcBarX}
|
|
50
|
+
*/
|
|
51
|
+
export interface NearestOhlcBarHit<D> extends OhlcBarObservation<D> {
|
|
52
|
+
/** Absolute UTC-millisecond distance from the requested timestamp. */
|
|
53
|
+
readonly timeDelta: number;
|
|
54
|
+
}
|
|
55
|
+
/** An actual painted OHLC stroke segment covering a root-logical point.
|
|
56
|
+
* @see {@link paintedOhlcBarAt}
|
|
57
|
+
*/
|
|
58
|
+
export interface PaintedOhlcBarHit<D> extends OhlcBarObservation<D> {
|
|
59
|
+
/** Last painted matching segment. */
|
|
60
|
+
readonly part: "stem" | "openTick" | "closeTick";
|
|
61
|
+
}
|
|
62
|
+
/** @internal Local OHLC paint capture. */
|
|
63
|
+
export interface CapturedOhlcBarMark<D> extends Omit<OhlcBarObservation<D>, "anchorRoot"> {
|
|
64
|
+
readonly strokeWidthLocal: number;
|
|
65
|
+
}
|
|
66
|
+
/** Borrowed committed OHLC generation.
|
|
67
|
+
* @see {@link OhlcBarInspectionRef}
|
|
68
|
+
*/
|
|
69
|
+
export interface OhlcBarRenderedSeries<D> {
|
|
70
|
+
/** Captured original observations in source order. */
|
|
71
|
+
readonly observations: readonly OhlcBarObservation<D>[];
|
|
72
|
+
/** Throws after replacement or disposal. */
|
|
73
|
+
assertLive(): void;
|
|
74
|
+
/** Inverts a root-logical point to a timestamp.
|
|
75
|
+
* @param pointRoot - Root-logical point.
|
|
76
|
+
* @returns Timestamp, or undefined for a singular transform.
|
|
77
|
+
*/
|
|
78
|
+
timeAtRoot(pointRoot: Readonly<RenderedSeriesPoint>): number | undefined;
|
|
79
|
+
/** Tests a local point against every committed clip.
|
|
80
|
+
* @param pointLocal - Series-local point.
|
|
81
|
+
* @returns Whether every committed clip contains it.
|
|
82
|
+
*/
|
|
83
|
+
anchorInsideClips(pointLocal: Readonly<RenderedSeriesPoint>): boolean;
|
|
84
|
+
/** @internal */ readonly marks: readonly CapturedOhlcBarMark<D>[];
|
|
85
|
+
/** @internal */ readonly numeric: NumericRenderedSeries<D>;
|
|
86
|
+
/** @internal Converts a root-logical point to local geometry.
|
|
87
|
+
* @param point - Root-logical coordinate.
|
|
88
|
+
* @returns Local coordinate, or undefined for a singular transform.
|
|
89
|
+
*/ localAtRoot(point: Readonly<RenderedSeriesPoint>): Readonly<RenderedSeriesPoint> | undefined;
|
|
90
|
+
}
|
|
91
|
+
/** Mount-owned optional OHLC bar receiver.
|
|
92
|
+
* @see {@link useOhlcBarInspection}
|
|
93
|
+
*/
|
|
94
|
+
export interface OhlcBarInspectionRef<D> {
|
|
95
|
+
/** @returns Current borrowed generation, or undefined before paint and after disposal. */
|
|
96
|
+
rendered(): OhlcBarRenderedSeries<D> | undefined;
|
|
97
|
+
/** @internal Records completed local paint without querying.
|
|
98
|
+
* @param input - Captured marks and committed mappings.
|
|
99
|
+
*/ capture(input: {
|
|
100
|
+
/** Local marks in source order. */
|
|
101
|
+
marks: readonly CapturedOhlcBarMark<D>[];
|
|
102
|
+
/** Committed horizontal mapping. */
|
|
103
|
+
xScale: NumericPositionScale;
|
|
104
|
+
/** Committed price mapping. */
|
|
105
|
+
yScale: ResolvedContinuousScale;
|
|
106
|
+
}): void;
|
|
107
|
+
}
|
|
108
|
+
/** Creates a stable OHLC-bar inspection ref without reading data or subscribing.
|
|
109
|
+
* @param _inputs - Inputs retained only to infer the original datum type.
|
|
110
|
+
* @returns A ref for exactly one OhlcBarSeries inspection prop.
|
|
111
|
+
* @see {@link OhlcBarInspectionRef}
|
|
112
|
+
*/
|
|
113
|
+
export declare function useOhlcBarInspection<D>(_inputs: Pick<OhlcBarSeriesProps<D>, "data" | "time" | "open" | "high" | "low" | "close">): OhlcBarInspectionRef<D>;
|
|
114
|
+
/** Selects captured original OHLC by nearest timestamp, retaining source-order ties.
|
|
115
|
+
* @param rendered - Borrowed committed OHLC generation.
|
|
116
|
+
* @param options - Timestamp and optional pure candidate filter.
|
|
117
|
+
* @returns First source-order match on a tie, or undefined when none qualifies.
|
|
118
|
+
* @see {@link NearestOhlcBarHit}
|
|
119
|
+
*/
|
|
120
|
+
export declare function nearestRecordedOhlcBarX<D>(rendered: OhlcBarRenderedSeries<D>, options: {
|
|
121
|
+
time: number;
|
|
122
|
+
filter?: (observation: OhlcBarInspectionCandidate<D>) => boolean;
|
|
123
|
+
}): NearestOhlcBarHit<D> | undefined;
|
|
124
|
+
/** Finds the last-painted OHLC segment covering a root-logical point.
|
|
125
|
+
* @param rendered - Borrowed committed OHLC generation.
|
|
126
|
+
* @param options - Root-logical point; clips and singular transforms produce no result.
|
|
127
|
+
* @returns Captured OHLC record and painted segment, or undefined for gaps.
|
|
128
|
+
* @see {@link PaintedOhlcBarHit}
|
|
129
|
+
*/
|
|
130
|
+
export declare function paintedOhlcBarAt<D>(rendered: OhlcBarRenderedSeries<D>, options: {
|
|
131
|
+
rootPoint: Readonly<RenderedSeriesPoint>;
|
|
132
|
+
}): PaintedOhlcBarHit<D> | undefined;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
invertNumericPosition
|
|
3
|
+
} from "../lib/series-position.js";
|
|
4
|
+
import { useRenderedRef } from "./owned-ref.js";
|
|
5
|
+
import { nearestRecordedX } from "./queries.js";
|
|
6
|
+
function useOhlcBarInspection(_inputs) {
|
|
7
|
+
return useRenderedRef("ohlcBarInspection", (candidate, geometry) => {
|
|
8
|
+
const observations = Object.freeze(
|
|
9
|
+
candidate.marks.map(
|
|
10
|
+
(mark) => Object.freeze({
|
|
11
|
+
datum: mark.datum,
|
|
12
|
+
sourceIndex: mark.sourceIndex,
|
|
13
|
+
time: mark.time,
|
|
14
|
+
open: mark.open,
|
|
15
|
+
high: mark.high,
|
|
16
|
+
low: mark.low,
|
|
17
|
+
close: mark.close,
|
|
18
|
+
anchorLocal: mark.anchorLocal,
|
|
19
|
+
anchorRoot: geometry.rootAtLocal(mark.anchorLocal),
|
|
20
|
+
stemLocal: mark.stemLocal,
|
|
21
|
+
openTickLocal: mark.openTickLocal,
|
|
22
|
+
closeTickLocal: mark.closeTickLocal
|
|
23
|
+
})
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
const numeric = Object.freeze({
|
|
27
|
+
observations: Object.freeze(
|
|
28
|
+
observations.map(
|
|
29
|
+
(row) => Object.freeze({
|
|
30
|
+
...row,
|
|
31
|
+
domainX: row.time,
|
|
32
|
+
domainY: row.close,
|
|
33
|
+
run: 0
|
|
34
|
+
})
|
|
35
|
+
)
|
|
36
|
+
),
|
|
37
|
+
assertLive: geometry.assertLive,
|
|
38
|
+
domainXAtRoot(point) {
|
|
39
|
+
const local = geometry.localAtRoot(point);
|
|
40
|
+
return local ? invertNumericPosition(candidate.xScale, local.x) : void 0;
|
|
41
|
+
},
|
|
42
|
+
anchorInsideClips: geometry.anchorInsideClips,
|
|
43
|
+
anchorAtDomain(point) {
|
|
44
|
+
geometry.assertLive();
|
|
45
|
+
const anchorLocal = Object.freeze({
|
|
46
|
+
x: candidate.xScale.map(point.domainX),
|
|
47
|
+
y: candidate.yScale.map(point.domainY)
|
|
48
|
+
});
|
|
49
|
+
return Object.freeze({
|
|
50
|
+
anchorLocal,
|
|
51
|
+
anchorRoot: geometry.rootAtLocal(anchorLocal)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return Object.freeze({
|
|
56
|
+
observations,
|
|
57
|
+
marks: Object.freeze(candidate.marks.slice()),
|
|
58
|
+
numeric,
|
|
59
|
+
assertLive: geometry.assertLive,
|
|
60
|
+
localAtRoot: geometry.localAtRoot,
|
|
61
|
+
anchorInsideClips: geometry.anchorInsideClips,
|
|
62
|
+
timeAtRoot: numeric.domainXAtRoot
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function nearestRecordedOhlcBarX(rendered, options) {
|
|
67
|
+
const hit = nearestRecordedX(rendered.numeric, {
|
|
68
|
+
domainX: options.time,
|
|
69
|
+
filter: options.filter ? (candidate) => options.filter(
|
|
70
|
+
candidate
|
|
71
|
+
) : void 0
|
|
72
|
+
});
|
|
73
|
+
if (!hit) return void 0;
|
|
74
|
+
const row = rendered.observations.find(
|
|
75
|
+
(observation) => observation.sourceIndex === hit.sourceIndex
|
|
76
|
+
);
|
|
77
|
+
return Object.freeze({ ...row, timeDelta: hit.domainDelta });
|
|
78
|
+
}
|
|
79
|
+
function segmentCovers(point, segment, strokeWidth) {
|
|
80
|
+
if (strokeWidth <= 0) return false;
|
|
81
|
+
const half = strokeWidth / 2;
|
|
82
|
+
return point.x >= Math.min(segment.x1, segment.x2) && point.x <= Math.max(segment.x1, segment.x2) && point.y >= segment.y - half && point.y <= segment.y + half;
|
|
83
|
+
}
|
|
84
|
+
function stemCovers(point, stem, strokeWidth) {
|
|
85
|
+
return segmentCovers(point, { x1: stem.x, x2: stem.x, y: 0 }, 0) || strokeWidth > 0 && point.x >= stem.x - strokeWidth / 2 && point.x <= stem.x + strokeWidth / 2 && point.y >= Math.min(stem.highY, stem.lowY) && point.y <= Math.max(stem.highY, stem.lowY);
|
|
86
|
+
}
|
|
87
|
+
function paintedOhlcBarAt(rendered, options) {
|
|
88
|
+
rendered.assertLive();
|
|
89
|
+
if (!Number.isFinite(options.rootPoint.x) || !Number.isFinite(options.rootPoint.y))
|
|
90
|
+
throw new RangeError("paintedOhlcBarAt rootPoint must be finite.");
|
|
91
|
+
const point = rendered.localAtRoot(options.rootPoint);
|
|
92
|
+
if (!point || !rendered.anchorInsideClips(point)) return void 0;
|
|
93
|
+
for (let index = rendered.marks.length - 1; index >= 0; index--) {
|
|
94
|
+
const mark = rendered.marks[index];
|
|
95
|
+
if (segmentCovers(point, mark.closeTickLocal, mark.strokeWidthLocal))
|
|
96
|
+
return Object.freeze({
|
|
97
|
+
...rendered.observations[index],
|
|
98
|
+
part: "closeTick"
|
|
99
|
+
});
|
|
100
|
+
if (segmentCovers(point, mark.openTickLocal, mark.strokeWidthLocal))
|
|
101
|
+
return Object.freeze({
|
|
102
|
+
...rendered.observations[index],
|
|
103
|
+
part: "openTick"
|
|
104
|
+
});
|
|
105
|
+
if (stemCovers(point, mark.stemLocal, mark.strokeWidthLocal))
|
|
106
|
+
return Object.freeze({
|
|
107
|
+
...rendered.observations[index],
|
|
108
|
+
part: "stem"
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return void 0;
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
nearestRecordedOhlcBarX,
|
|
115
|
+
paintedOhlcBarAt,
|
|
116
|
+
useOhlcBarInspection
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=ohlc-bar.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/inspection/ohlc-bar.ts"],
|
|
4
|
+
"sourcesContent": ["import type { OhlcBarSeriesProps } from \"../lib/ohlc-bar-series.js\";\nimport {\n invertNumericPosition,\n type NumericPositionScale,\n} from \"../lib/series-position.js\";\nimport type { ResolvedContinuousScale } from \"../lib/types.js\";\nimport { useRenderedRef } from \"./owned-ref.js\";\nimport { nearestRecordedX } from \"./queries.js\";\nimport type {\n NumericRenderedSeries,\n RenderedSeriesPoint,\n} from \"./query-types.js\";\n\n/** One original OHLC record and its values and geometry as evaluated during paint.\n * @see {@link OhlcBarRenderedSeries}\n */\nexport interface OhlcBarObservation<D> {\n /** Caller-owned original record. */\n readonly datum: D;\n /** Original source index, including skipped rows. */\n readonly sourceIndex: number;\n /** Evaluated UTC-millisecond timestamp. */\n readonly time: number;\n /** Evaluated opening value. */\n readonly open: number;\n /** Evaluated high value. */\n readonly high: number;\n /** Evaluated low value. */\n readonly low: number;\n /** Evaluated closing value. */\n readonly close: number;\n /** Closing endpoint in series-local coordinates. */ readonly anchorLocal: Readonly<RenderedSeriesPoint>;\n /** Closing endpoint in root-logical coordinates. */ readonly anchorRoot: Readonly<RenderedSeriesPoint>;\n /** High/low segment before world transforms. */ readonly stemLocal: Readonly<{\n /** Horizontal center. */ x: number;\n /** Mapped high endpoint. */ highY: number;\n /** Mapped low endpoint. */ lowY: number;\n }>;\n /** Left-facing opening segment before world transforms. */ readonly openTickLocal: Readonly<{\n /** Left endpoint. */ x1: number;\n /** Center endpoint. */ x2: number;\n /** Mapped opening ordinate. */ y: number;\n }>;\n /** Right-facing closing segment before world transforms. */ readonly closeTickLocal: Readonly<{\n /** Center endpoint. */ x1: number;\n /** Right endpoint. */ x2: number;\n /** Mapped closing ordinate. */ y: number;\n }>;\n}\n/** A nearest-time OHLC candidate with committed clip eligibility.\n * @see {@link nearestRecordedOhlcBarX}\n */\nexport interface OhlcBarInspectionCandidate<D> extends OhlcBarObservation<D> {\n /** @returns Whether the close anchor lies inside every committed clip. */\n anchorInsideClips(): boolean;\n}\n/** Original OHLC selected by nearest timestamp.\n * @see {@link nearestRecordedOhlcBarX}\n */\nexport interface NearestOhlcBarHit<D> extends OhlcBarObservation<D> {\n /** Absolute UTC-millisecond distance from the requested timestamp. */\n readonly timeDelta: number;\n}\n/** An actual painted OHLC stroke segment covering a root-logical point.\n * @see {@link paintedOhlcBarAt}\n */\nexport interface PaintedOhlcBarHit<D> extends OhlcBarObservation<D> {\n /** Last painted matching segment. */\n readonly part: \"stem\" | \"openTick\" | \"closeTick\";\n}\n/** @internal Local OHLC paint capture. */\nexport interface CapturedOhlcBarMark<D> extends Omit<\n OhlcBarObservation<D>,\n \"anchorRoot\"\n> {\n readonly strokeWidthLocal: number;\n}\n/** Borrowed committed OHLC generation.\n * @see {@link OhlcBarInspectionRef}\n */\nexport interface OhlcBarRenderedSeries<D> {\n /** Captured original observations in source order. */\n readonly observations: readonly OhlcBarObservation<D>[];\n /** Throws after replacement or disposal. */\n assertLive(): void;\n /** Inverts a root-logical point to a timestamp.\n * @param pointRoot - Root-logical point.\n * @returns Timestamp, or undefined for a singular transform.\n */\n timeAtRoot(pointRoot: Readonly<RenderedSeriesPoint>): number | undefined;\n /** Tests a local point against every committed clip.\n * @param pointLocal - Series-local point.\n * @returns Whether every committed clip contains it.\n */\n anchorInsideClips(pointLocal: Readonly<RenderedSeriesPoint>): boolean;\n /** @internal */ readonly marks: readonly CapturedOhlcBarMark<D>[];\n /** @internal */ readonly numeric: NumericRenderedSeries<D>;\n /** @internal Converts a root-logical point to local geometry.\n * @param point - Root-logical coordinate.\n * @returns Local coordinate, or undefined for a singular transform.\n */ localAtRoot(\n point: Readonly<RenderedSeriesPoint>,\n ): Readonly<RenderedSeriesPoint> | undefined;\n}\n/** Mount-owned optional OHLC bar receiver.\n * @see {@link useOhlcBarInspection}\n */\nexport interface OhlcBarInspectionRef<D> {\n /** @returns Current borrowed generation, or undefined before paint and after disposal. */\n rendered(): OhlcBarRenderedSeries<D> | undefined;\n /** @internal Records completed local paint without querying.\n * @param input - Captured marks and committed mappings.\n */ capture(input: {\n /** Local marks in source order. */\n marks: readonly CapturedOhlcBarMark<D>[];\n /** Committed horizontal mapping. */\n xScale: NumericPositionScale;\n /** Committed price mapping. */\n yScale: ResolvedContinuousScale;\n }): void;\n}\n\n/** Creates a stable OHLC-bar inspection ref without reading data or subscribing.\n * @param _inputs - Inputs retained only to infer the original datum type.\n * @returns A ref for exactly one OhlcBarSeries inspection prop.\n * @see {@link OhlcBarInspectionRef}\n */\nexport function useOhlcBarInspection<D>(\n _inputs: Pick<\n OhlcBarSeriesProps<D>,\n \"data\" | \"time\" | \"open\" | \"high\" | \"low\" | \"close\"\n >,\n): OhlcBarInspectionRef<D> {\n return useRenderedRef<\n {\n marks: readonly CapturedOhlcBarMark<D>[];\n xScale: NumericPositionScale;\n yScale: ResolvedContinuousScale;\n },\n OhlcBarRenderedSeries<D>\n >(\"ohlcBarInspection\", (candidate, geometry) => {\n const observations = Object.freeze(\n candidate.marks.map((mark) =>\n Object.freeze({\n datum: mark.datum,\n sourceIndex: mark.sourceIndex,\n time: mark.time,\n open: mark.open,\n high: mark.high,\n low: mark.low,\n close: mark.close,\n anchorLocal: mark.anchorLocal,\n anchorRoot: geometry.rootAtLocal(mark.anchorLocal),\n stemLocal: mark.stemLocal,\n openTickLocal: mark.openTickLocal,\n closeTickLocal: mark.closeTickLocal,\n }),\n ),\n );\n const numeric: NumericRenderedSeries<D> = Object.freeze({\n observations: Object.freeze(\n observations.map((row) =>\n Object.freeze({\n ...row,\n domainX: row.time,\n domainY: row.close,\n run: 0,\n }),\n ),\n ),\n assertLive: geometry.assertLive,\n domainXAtRoot(point: Readonly<RenderedSeriesPoint>) {\n const local = geometry.localAtRoot(point);\n return local\n ? invertNumericPosition(candidate.xScale, local.x)\n : undefined;\n },\n anchorInsideClips: geometry.anchorInsideClips,\n anchorAtDomain(point: Readonly<{ domainX: number; domainY: number }>) {\n geometry.assertLive();\n const anchorLocal = Object.freeze({\n x: candidate.xScale.map(point.domainX),\n y: candidate.yScale.map(point.domainY),\n });\n return Object.freeze({\n anchorLocal,\n anchorRoot: geometry.rootAtLocal(anchorLocal),\n });\n },\n });\n return Object.freeze({\n observations,\n marks: Object.freeze(candidate.marks.slice()),\n numeric,\n assertLive: geometry.assertLive,\n localAtRoot: geometry.localAtRoot,\n anchorInsideClips: geometry.anchorInsideClips,\n timeAtRoot: numeric.domainXAtRoot,\n });\n });\n}\n\n/** Selects captured original OHLC by nearest timestamp, retaining source-order ties.\n * @param rendered - Borrowed committed OHLC generation.\n * @param options - Timestamp and optional pure candidate filter.\n * @returns First source-order match on a tie, or undefined when none qualifies.\n * @see {@link NearestOhlcBarHit}\n */\nexport function nearestRecordedOhlcBarX<D>(\n rendered: OhlcBarRenderedSeries<D>,\n options: {\n time: number;\n filter?: (observation: OhlcBarInspectionCandidate<D>) => boolean;\n },\n): NearestOhlcBarHit<D> | undefined {\n const hit = nearestRecordedX(rendered.numeric, {\n domainX: options.time,\n filter: options.filter\n ? (candidate) =>\n options.filter!(\n candidate as typeof candidate & OhlcBarInspectionCandidate<D>,\n )\n : undefined,\n });\n if (!hit) return undefined;\n const row = rendered.observations.find(\n (observation) => observation.sourceIndex === hit.sourceIndex,\n )!;\n return Object.freeze({ ...row, timeDelta: hit.domainDelta });\n}\n\nfunction segmentCovers(\n point: Readonly<RenderedSeriesPoint>,\n segment: Readonly<{ x1: number; x2: number; y: number }>,\n strokeWidth: number,\n): boolean {\n if (strokeWidth <= 0) return false;\n const half = strokeWidth / 2;\n return (\n point.x >= Math.min(segment.x1, segment.x2) &&\n point.x <= Math.max(segment.x1, segment.x2) &&\n point.y >= segment.y - half &&\n point.y <= segment.y + half\n );\n}\nfunction stemCovers(\n point: Readonly<RenderedSeriesPoint>,\n stem: Readonly<{ x: number; highY: number; lowY: number }>,\n strokeWidth: number,\n): boolean {\n return (\n segmentCovers(point, { x1: stem.x, x2: stem.x, y: 0 }, 0) ||\n (strokeWidth > 0 &&\n point.x >= stem.x - strokeWidth / 2 &&\n point.x <= stem.x + strokeWidth / 2 &&\n point.y >= Math.min(stem.highY, stem.lowY) &&\n point.y <= Math.max(stem.highY, stem.lowY))\n );\n}\n/** Finds the last-painted OHLC segment covering a root-logical point.\n * @param rendered - Borrowed committed OHLC generation.\n * @param options - Root-logical point; clips and singular transforms produce no result.\n * @returns Captured OHLC record and painted segment, or undefined for gaps.\n * @see {@link PaintedOhlcBarHit}\n */\nexport function paintedOhlcBarAt<D>(\n rendered: OhlcBarRenderedSeries<D>,\n options: { rootPoint: Readonly<RenderedSeriesPoint> },\n): PaintedOhlcBarHit<D> | undefined {\n rendered.assertLive();\n if (\n !Number.isFinite(options.rootPoint.x) ||\n !Number.isFinite(options.rootPoint.y)\n )\n throw new RangeError(\"paintedOhlcBarAt rootPoint must be finite.\");\n const point = rendered.localAtRoot(options.rootPoint);\n if (!point || !rendered.anchorInsideClips(point)) return undefined;\n for (let index = rendered.marks.length - 1; index >= 0; index--) {\n const mark = rendered.marks[index]!;\n if (segmentCovers(point, mark.closeTickLocal, mark.strokeWidthLocal))\n return Object.freeze({\n ...rendered.observations[index]!,\n part: \"closeTick\" as const,\n });\n if (segmentCovers(point, mark.openTickLocal, mark.strokeWidthLocal))\n return Object.freeze({\n ...rendered.observations[index]!,\n part: \"openTick\" as const,\n });\n if (stemCovers(point, mark.stemLocal, mark.strokeWidthLocal))\n return Object.freeze({\n ...rendered.observations[index]!,\n part: \"stem\" as const,\n });\n }\n return undefined;\n}\n"],
|
|
5
|
+
"mappings": "AACA;AAAA,EACE;AAAA,OAEK;AAEP,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AAwH1B,SAAS,qBACd,SAIyB;AACzB,SAAO,eAOL,qBAAqB,CAAC,WAAW,aAAa;AAC9C,UAAM,eAAe,OAAO;AAAA,MAC1B,UAAU,MAAM;AAAA,QAAI,CAAC,SACnB,OAAO,OAAO;AAAA,UACZ,OAAO,KAAK;AAAA,UACZ,aAAa,KAAK;AAAA,UAClB,MAAM,KAAK;AAAA,UACX,MAAM,KAAK;AAAA,UACX,MAAM,KAAK;AAAA,UACX,KAAK,KAAK;AAAA,UACV,OAAO,KAAK;AAAA,UACZ,aAAa,KAAK;AAAA,UAClB,YAAY,SAAS,YAAY,KAAK,WAAW;AAAA,UACjD,WAAW,KAAK;AAAA,UAChB,eAAe,KAAK;AAAA,UACpB,gBAAgB,KAAK;AAAA,QACvB,CAAC;AAAA,MACH;AAAA,IACF;AACA,UAAM,UAAoC,OAAO,OAAO;AAAA,MACtD,cAAc,OAAO;AAAA,QACnB,aAAa;AAAA,UAAI,CAAC,QAChB,OAAO,OAAO;AAAA,YACZ,GAAG;AAAA,YACH,SAAS,IAAI;AAAA,YACb,SAAS,IAAI;AAAA,YACb,KAAK;AAAA,UACP,CAAC;AAAA,QACH;AAAA,MACF;AAAA,MACA,YAAY,SAAS;AAAA,MACrB,cAAc,OAAsC;AAClD,cAAM,QAAQ,SAAS,YAAY,KAAK;AACxC,eAAO,QACH,sBAAsB,UAAU,QAAQ,MAAM,CAAC,IAC/C;AAAA,MACN;AAAA,MACA,mBAAmB,SAAS;AAAA,MAC5B,eAAe,OAAuD;AACpE,iBAAS,WAAW;AACpB,cAAM,cAAc,OAAO,OAAO;AAAA,UAChC,GAAG,UAAU,OAAO,IAAI,MAAM,OAAO;AAAA,UACrC,GAAG,UAAU,OAAO,IAAI,MAAM,OAAO;AAAA,QACvC,CAAC;AACD,eAAO,OAAO,OAAO;AAAA,UACnB;AAAA,UACA,YAAY,SAAS,YAAY,WAAW;AAAA,QAC9C,CAAC;AAAA,MACH;AAAA,IACF,CAAC;AACD,WAAO,OAAO,OAAO;AAAA,MACnB;AAAA,MACA,OAAO,OAAO,OAAO,UAAU,MAAM,MAAM,CAAC;AAAA,MAC5C;AAAA,MACA,YAAY,SAAS;AAAA,MACrB,aAAa,SAAS;AAAA,MACtB,mBAAmB,SAAS;AAAA,MAC5B,YAAY,QAAQ;AAAA,IACtB,CAAC;AAAA,EACH,CAAC;AACH;AAQO,SAAS,wBACd,UACA,SAIkC;AAClC,QAAM,MAAM,iBAAiB,SAAS,SAAS;AAAA,IAC7C,SAAS,QAAQ;AAAA,IACjB,QAAQ,QAAQ,SACZ,CAAC,cACC,QAAQ;AAAA,MACN;AAAA,IACF,IACF;AAAA,EACN,CAAC;AACD,MAAI,CAAC,IAAK,QAAO;AACjB,QAAM,MAAM,SAAS,aAAa;AAAA,IAChC,CAAC,gBAAgB,YAAY,gBAAgB,IAAI;AAAA,EACnD;AACA,SAAO,OAAO,OAAO,EAAE,GAAG,KAAK,WAAW,IAAI,YAAY,CAAC;AAC7D;AAEA,SAAS,cACP,OACA,SACA,aACS;AACT,MAAI,eAAe,EAAG,QAAO;AAC7B,QAAM,OAAO,cAAc;AAC3B,SACE,MAAM,KAAK,KAAK,IAAI,QAAQ,IAAI,QAAQ,EAAE,KAC1C,MAAM,KAAK,KAAK,IAAI,QAAQ,IAAI,QAAQ,EAAE,KAC1C,MAAM,KAAK,QAAQ,IAAI,QACvB,MAAM,KAAK,QAAQ,IAAI;AAE3B;AACA,SAAS,WACP,OACA,MACA,aACS;AACT,SACE,cAAc,OAAO,EAAE,IAAI,KAAK,GAAG,IAAI,KAAK,GAAG,GAAG,EAAE,GAAG,CAAC,KACvD,cAAc,KACb,MAAM,KAAK,KAAK,IAAI,cAAc,KAClC,MAAM,KAAK,KAAK,IAAI,cAAc,KAClC,MAAM,KAAK,KAAK,IAAI,KAAK,OAAO,KAAK,IAAI,KACzC,MAAM,KAAK,KAAK,IAAI,KAAK,OAAO,KAAK,IAAI;AAE/C;AAOO,SAAS,iBACd,UACA,SACkC;AAClC,WAAS,WAAW;AACpB,MACE,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC,KACpC,CAAC,OAAO,SAAS,QAAQ,UAAU,CAAC;AAEpC,UAAM,IAAI,WAAW,4CAA4C;AACnE,QAAM,QAAQ,SAAS,YAAY,QAAQ,SAAS;AACpD,MAAI,CAAC,SAAS,CAAC,SAAS,kBAAkB,KAAK,EAAG,QAAO;AACzD,WAAS,QAAQ,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS;AAC/D,UAAM,OAAO,SAAS,MAAM,KAAK;AACjC,QAAI,cAAc,OAAO,KAAK,gBAAgB,KAAK,gBAAgB;AACjE,aAAO,OAAO,OAAO;AAAA,QACnB,GAAG,SAAS,aAAa,KAAK;AAAA,QAC9B,MAAM;AAAA,MACR,CAAC;AACH,QAAI,cAAc,OAAO,KAAK,eAAe,KAAK,gBAAgB;AAChE,aAAO,OAAO,OAAO;AAAA,QACnB,GAAG,SAAS,aAAa,KAAK;AAAA,QAC9B,MAAM;AAAA,MACR,CAAC;AACH,QAAI,WAAW,OAAO,KAAK,WAAW,KAAK,gBAAgB;AACzD,aAAO,OAAO,OAAO;AAAA,QACnB,GAAG,SAAS,aAAa,KAAK;AAAA,QAC9B,MAAM;AAAA,MACR,CAAC;AAAA,EACL;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Point = Readonly<{
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}>;
|
|
5
|
+
interface Geometry {
|
|
6
|
+
assertLive(): void;
|
|
7
|
+
localAtRoot(point: Point): Point | undefined;
|
|
8
|
+
rootAtLocal(point: Point): Point;
|
|
9
|
+
anchorInsideClips(point: Point): boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Shared private mount/generation ownership; no signal reads or query algorithms. */
|
|
12
|
+
export declare function useRenderedRef<C, R>(kind: string, build: (candidate: C, geometry: Geometry) => R): Readonly<{
|
|
13
|
+
capture(input: C): void;
|
|
14
|
+
rendered(): R | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
captureSeriesInspectionFrame,
|
|
3
|
+
useInternalHookSlot
|
|
4
|
+
} from "@pibbl/core/internal";
|
|
5
|
+
function useRenderedRef(kind, build) {
|
|
6
|
+
return useInternalHookSlot(kind, (teardowns) => {
|
|
7
|
+
let closed = false, revision = 0, generation = -1;
|
|
8
|
+
let receiver, candidate, current;
|
|
9
|
+
let frame;
|
|
10
|
+
teardowns.add(() => {
|
|
11
|
+
closed = true;
|
|
12
|
+
candidate = void 0;
|
|
13
|
+
current = void 0;
|
|
14
|
+
frame = void 0;
|
|
15
|
+
receiver = void 0;
|
|
16
|
+
});
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
capture(input) {
|
|
19
|
+
if (closed) throw new Error("Inspection ref has been disposed.");
|
|
20
|
+
const next = captureSeriesInspectionFrame();
|
|
21
|
+
next.onFinish((success) => {
|
|
22
|
+
if (!success || closed || !next.alive()) return;
|
|
23
|
+
if (receiver && receiver !== next.receiver)
|
|
24
|
+
throw new Error(
|
|
25
|
+
"One inspection ref can bind only one mounted series."
|
|
26
|
+
);
|
|
27
|
+
if (!receiver) {
|
|
28
|
+
receiver = next.receiver;
|
|
29
|
+
next.onDispose(() => {
|
|
30
|
+
if (receiver !== next.receiver) return;
|
|
31
|
+
candidate = void 0;
|
|
32
|
+
current = void 0;
|
|
33
|
+
frame = void 0;
|
|
34
|
+
receiver = void 0;
|
|
35
|
+
revision++;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
candidate = input;
|
|
39
|
+
frame = next;
|
|
40
|
+
revision++;
|
|
41
|
+
current = void 0;
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
rendered() {
|
|
45
|
+
if (closed || candidate === void 0 || !frame?.alive())
|
|
46
|
+
return void 0;
|
|
47
|
+
if (current && generation === frame.generation()) return current;
|
|
48
|
+
const captured = frame.resolve();
|
|
49
|
+
if (!captured) return void 0;
|
|
50
|
+
if (current && generation === captured.generation) return current;
|
|
51
|
+
generation = captured.generation;
|
|
52
|
+
const stamp = revision, committedGeneration = generation;
|
|
53
|
+
const transform = captured.transform, inverse = transform.inverse();
|
|
54
|
+
const ctx = captured.canvas.getContext("2d");
|
|
55
|
+
const assertLive = () => {
|
|
56
|
+
if (closed || revision !== stamp || !frame?.alive() || frame.generation() !== committedGeneration)
|
|
57
|
+
throw new Error(
|
|
58
|
+
"Rendered series is stale or disposed; obtain the current generation with rendered()."
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
const rootAtLocal = (point) => {
|
|
62
|
+
const root = transform.transformPoint(new DOMPoint(point.x, point.y));
|
|
63
|
+
return Object.freeze({ x: root.x, y: root.y });
|
|
64
|
+
};
|
|
65
|
+
current = build(candidate, {
|
|
66
|
+
assertLive,
|
|
67
|
+
rootAtLocal,
|
|
68
|
+
localAtRoot(point) {
|
|
69
|
+
assertLive();
|
|
70
|
+
const local = inverse.transformPoint(
|
|
71
|
+
new DOMPoint(point.x, point.y)
|
|
72
|
+
);
|
|
73
|
+
return Number.isFinite(local.x) && Number.isFinite(local.y) ? Object.freeze({ x: local.x, y: local.y }) : void 0;
|
|
74
|
+
},
|
|
75
|
+
anchorInsideClips(point) {
|
|
76
|
+
assertLive();
|
|
77
|
+
const root = rootAtLocal(point);
|
|
78
|
+
ctx.save();
|
|
79
|
+
try {
|
|
80
|
+
for (const clip of captured.clips) {
|
|
81
|
+
ctx.setTransform(clip.transform);
|
|
82
|
+
if (!ctx.isPointInPath(clip.path, root.x, root.y, clip.fillRule))
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
} finally {
|
|
87
|
+
ctx.restore();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return current;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}).value;
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
useRenderedRef
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=owned-ref.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/inspection/owned-ref.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n captureSeriesInspectionFrame,\n useInternalHookSlot,\n} from \"@pibbl/core/internal\";\ntype Point = Readonly<{ x: number; y: number }>;\ninterface Geometry {\n assertLive(): void;\n localAtRoot(point: Point): Point | undefined;\n rootAtLocal(point: Point): Point;\n anchorInsideClips(point: Point): boolean;\n}\n\n/** Shared private mount/generation ownership; no signal reads or query algorithms. */\nexport function useRenderedRef<C, R>(\n kind: string,\n build: (candidate: C, geometry: Geometry) => R,\n) {\n return useInternalHookSlot(kind, (teardowns) => {\n let closed = false,\n revision = 0,\n generation = -1;\n let receiver: object | undefined,\n candidate: C | undefined,\n current: R | undefined;\n let frame: ReturnType<typeof captureSeriesInspectionFrame> | undefined;\n teardowns.add(() => {\n closed = true;\n candidate = undefined;\n current = undefined;\n frame = undefined;\n receiver = undefined;\n });\n return Object.freeze({\n capture(input: C) {\n if (closed) throw new Error(\"Inspection ref has been disposed.\");\n const next = captureSeriesInspectionFrame();\n next.onFinish((success) => {\n if (!success || closed || !next.alive()) return;\n // Receiver removal is settled before successful render completion.\n // Check here so a keyed replacement can adopt the surviving hook.\n if (receiver && receiver !== next.receiver)\n throw new Error(\n \"One inspection ref can bind only one mounted series.\",\n );\n if (!receiver) {\n receiver = next.receiver;\n next.onDispose(() => {\n if (receiver !== next.receiver) return;\n candidate = undefined;\n current = undefined;\n frame = undefined;\n receiver = undefined;\n revision++;\n });\n }\n candidate = input;\n frame = next;\n revision++;\n current = undefined;\n });\n },\n rendered(): R | undefined {\n if (closed || candidate === undefined || !frame?.alive())\n return undefined;\n if (current && generation === frame.generation()) return current;\n const captured = frame.resolve();\n if (!captured) return undefined;\n if (current && generation === captured.generation) return current;\n generation = captured.generation;\n const stamp = revision,\n committedGeneration = generation;\n const transform = captured.transform,\n inverse = transform.inverse();\n const ctx = captured.canvas.getContext(\"2d\")!;\n const assertLive = () => {\n if (\n closed ||\n revision !== stamp ||\n !frame?.alive() ||\n frame.generation() !== committedGeneration\n )\n throw new Error(\n \"Rendered series is stale or disposed; obtain the current generation with rendered().\",\n );\n };\n const rootAtLocal = (point: Point): Point => {\n const root = transform.transformPoint(new DOMPoint(point.x, point.y));\n return Object.freeze({ x: root.x, y: root.y });\n };\n current = build(candidate, {\n assertLive,\n rootAtLocal,\n localAtRoot(point) {\n assertLive();\n const local = inverse.transformPoint(\n new DOMPoint(point.x, point.y),\n );\n return Number.isFinite(local.x) && Number.isFinite(local.y)\n ? Object.freeze({ x: local.x, y: local.y })\n : undefined;\n },\n anchorInsideClips(point) {\n assertLive();\n const root = rootAtLocal(point);\n ctx.save();\n try {\n for (const clip of captured.clips) {\n ctx.setTransform(clip.transform);\n if (\n !ctx.isPointInPath(clip.path, root.x, root.y, clip.fillRule)\n )\n return false;\n }\n return true;\n } finally {\n ctx.restore();\n }\n },\n });\n return current;\n },\n });\n }).value;\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAUA,SAAS,eACd,MACA,OACA;AACA,SAAO,oBAAoB,MAAM,CAAC,cAAc;AAC9C,QAAI,SAAS,OACX,WAAW,GACX,aAAa;AACf,QAAI,UACF,WACA;AACF,QAAI;AACJ,cAAU,IAAI,MAAM;AAClB,eAAS;AACT,kBAAY;AACZ,gBAAU;AACV,cAAQ;AACR,iBAAW;AAAA,IACb,CAAC;AACD,WAAO,OAAO,OAAO;AAAA,MACnB,QAAQ,OAAU;AAChB,YAAI,OAAQ,OAAM,IAAI,MAAM,mCAAmC;AAC/D,cAAM,OAAO,6BAA6B;AAC1C,aAAK,SAAS,CAAC,YAAY;AACzB,cAAI,CAAC,WAAW,UAAU,CAAC,KAAK,MAAM,EAAG;AAGzC,cAAI,YAAY,aAAa,KAAK;AAChC,kBAAM,IAAI;AAAA,cACR;AAAA,YACF;AACF,cAAI,CAAC,UAAU;AACb,uBAAW,KAAK;AAChB,iBAAK,UAAU,MAAM;AACnB,kBAAI,aAAa,KAAK,SAAU;AAChC,0BAAY;AACZ,wBAAU;AACV,sBAAQ;AACR,yBAAW;AACX;AAAA,YACF,CAAC;AAAA,UACH;AACA,sBAAY;AACZ,kBAAQ;AACR;AACA,oBAAU;AAAA,QACZ,CAAC;AAAA,MACH;AAAA,MACA,WAA0B;AACxB,YAAI,UAAU,cAAc,UAAa,CAAC,OAAO,MAAM;AACrD,iBAAO;AACT,YAAI,WAAW,eAAe,MAAM,WAAW,EAAG,QAAO;AACzD,cAAM,WAAW,MAAM,QAAQ;AAC/B,YAAI,CAAC,SAAU,QAAO;AACtB,YAAI,WAAW,eAAe,SAAS,WAAY,QAAO;AAC1D,qBAAa,SAAS;AACtB,cAAM,QAAQ,UACZ,sBAAsB;AACxB,cAAM,YAAY,SAAS,WACzB,UAAU,UAAU,QAAQ;AAC9B,cAAM,MAAM,SAAS,OAAO,WAAW,IAAI;AAC3C,cAAM,aAAa,MAAM;AACvB,cACE,UACA,aAAa,SACb,CAAC,OAAO,MAAM,KACd,MAAM,WAAW,MAAM;AAEvB,kBAAM,IAAI;AAAA,cACR;AAAA,YACF;AAAA,QACJ;AACA,cAAM,cAAc,CAAC,UAAwB;AAC3C,gBAAM,OAAO,UAAU,eAAe,IAAI,SAAS,MAAM,GAAG,MAAM,CAAC,CAAC;AACpE,iBAAO,OAAO,OAAO,EAAE,GAAG,KAAK,GAAG,GAAG,KAAK,EAAE,CAAC;AAAA,QAC/C;AACA,kBAAU,MAAM,WAAW;AAAA,UACzB;AAAA,UACA;AAAA,UACA,YAAY,OAAO;AACjB,uBAAW;AACX,kBAAM,QAAQ,QAAQ;AAAA,cACpB,IAAI,SAAS,MAAM,GAAG,MAAM,CAAC;AAAA,YAC/B;AACA,mBAAO,OAAO,SAAS,MAAM,CAAC,KAAK,OAAO,SAAS,MAAM,CAAC,IACtD,OAAO,OAAO,EAAE,GAAG,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,IACxC;AAAA,UACN;AAAA,UACA,kBAAkB,OAAO;AACvB,uBAAW;AACX,kBAAM,OAAO,YAAY,KAAK;AAC9B,gBAAI,KAAK;AACT,gBAAI;AACF,yBAAW,QAAQ,SAAS,OAAO;AACjC,oBAAI,aAAa,KAAK,SAAS;AAC/B,oBACE,CAAC,IAAI,cAAc,KAAK,MAAM,KAAK,GAAG,KAAK,GAAG,KAAK,QAAQ;AAE3D,yBAAO;AAAA,cACX;AACA,qBAAO;AAAA,YACT,UAAE;AACA,kBAAI,QAAQ;AAAA,YACd;AAAA,UACF;AAAA,QACF,CAAC;AACD,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH,CAAC,EAAE;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PointRenderedSeries } from "./capture-types.js";
|
|
2
|
+
import type { RecordedNumericHit, RenderedSeriesPoint } from "./query-types.js";
|
|
3
|
+
/** The original record and local geometry of a discrete circle/ring covering a query point.
|
|
4
|
+
* @see {@link RecordedNumericHit}
|
|
5
|
+
*/
|
|
6
|
+
export interface PaintedPointHit<D> extends RecordedNumericHit<D> {
|
|
7
|
+
/** Circle radius before world transforms, in local logical units. */
|
|
8
|
+
readonly radiusLocal: number;
|
|
9
|
+
/** Painted stroke width before world transforms, in local logical units. */
|
|
10
|
+
readonly strokeWidthLocal: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Selects the last-painted circle/ring covering a root-logical position in this series.
|
|
14
|
+
* This is geometric fill/stroke coverage, not alpha readback or a Pibbl event target.
|
|
15
|
+
* @param rendered - Borrowed point geometry from the last successful paint.
|
|
16
|
+
* @param options - Explicit root-logical query point; CSS/device pixels are unsupported.
|
|
17
|
+
* @returns Original datum/index and captured geometry, or undefined for clips, holes, omissions or singular transforms.
|
|
18
|
+
* @see {@link PaintedPointHit}
|
|
19
|
+
*/
|
|
20
|
+
export declare function paintedPointAt<D>(rendered: PointRenderedSeries<D>, options: {
|
|
21
|
+
rootPoint: Readonly<RenderedSeriesPoint>;
|
|
22
|
+
}): PaintedPointHit<D> | undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function paintedPointAt(rendered, options) {
|
|
2
|
+
rendered.assertLive();
|
|
3
|
+
const { x, y } = options.rootPoint;
|
|
4
|
+
if (!Number.isFinite(x) || !Number.isFinite(y))
|
|
5
|
+
throw new RangeError("paintedPointAt rootPoint must be finite.");
|
|
6
|
+
const local = rendered.localAtRoot(options.rootPoint);
|
|
7
|
+
if (!local || !rendered.anchorInsideClips(local)) return void 0;
|
|
8
|
+
for (let index = rendered.marks.length - 1; index >= 0; index--) {
|
|
9
|
+
const mark = rendered.marks[index];
|
|
10
|
+
const radius = mark.radiusLocal ?? 0, stroke = mark.strokeWidthLocal ?? 0;
|
|
11
|
+
if (radius === 0 || !mark.fill && stroke === 0) continue;
|
|
12
|
+
const distance = Math.hypot(
|
|
13
|
+
local.x - mark.anchorLocal.x,
|
|
14
|
+
local.y - mark.anchorLocal.y
|
|
15
|
+
);
|
|
16
|
+
if (distance > radius + stroke / 2 || !mark.fill && distance < Math.max(0, radius - stroke / 2))
|
|
17
|
+
continue;
|
|
18
|
+
return Object.freeze({
|
|
19
|
+
...rendered.observations[index],
|
|
20
|
+
radiusLocal: radius,
|
|
21
|
+
strokeWidthLocal: stroke
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
paintedPointAt
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=painted-point.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/inspection/painted-point.ts"],
|
|
4
|
+
"sourcesContent": ["import type { PointRenderedSeries } from \"./capture-types.js\";\nimport type { RecordedNumericHit, RenderedSeriesPoint } from \"./query-types.js\";\n\n/** The original record and local geometry of a discrete circle/ring covering a query point.\n * @see {@link RecordedNumericHit}\n */\nexport interface PaintedPointHit<D> extends RecordedNumericHit<D> {\n /** Circle radius before world transforms, in local logical units. */\n readonly radiusLocal: number;\n /** Painted stroke width before world transforms, in local logical units. */\n readonly strokeWidthLocal: number;\n}\n\n/**\n * Selects the last-painted circle/ring covering a root-logical position in this series.\n * This is geometric fill/stroke coverage, not alpha readback or a Pibbl event target.\n * @param rendered - Borrowed point geometry from the last successful paint.\n * @param options - Explicit root-logical query point; CSS/device pixels are unsupported.\n * @returns Original datum/index and captured geometry, or undefined for clips, holes, omissions or singular transforms.\n * @see {@link PaintedPointHit}\n */\nexport function paintedPointAt<D>(\n rendered: PointRenderedSeries<D>,\n options: { rootPoint: Readonly<RenderedSeriesPoint> },\n): PaintedPointHit<D> | undefined {\n rendered.assertLive();\n const { x, y } = options.rootPoint;\n if (!Number.isFinite(x) || !Number.isFinite(y))\n throw new RangeError(\"paintedPointAt rootPoint must be finite.\");\n const local = rendered.localAtRoot(options.rootPoint);\n if (!local || !rendered.anchorInsideClips(local)) return undefined;\n for (let index = rendered.marks.length - 1; index >= 0; index--) {\n const mark = rendered.marks[index];\n const radius = mark.radiusLocal ?? 0,\n stroke = mark.strokeWidthLocal ?? 0;\n if (radius === 0 || (!mark.fill && stroke === 0)) continue;\n const distance = Math.hypot(\n local.x - mark.anchorLocal.x,\n local.y - mark.anchorLocal.y,\n );\n if (\n distance > radius + stroke / 2 ||\n (!mark.fill && distance < Math.max(0, radius - stroke / 2))\n )\n continue;\n return Object.freeze({\n ...rendered.observations[index],\n radiusLocal: radius,\n strokeWidthLocal: stroke,\n });\n }\n return undefined;\n}\n"],
|
|
5
|
+
"mappings": "AAqBO,SAAS,eACd,UACA,SACgC;AAChC,WAAS,WAAW;AACpB,QAAM,EAAE,GAAG,EAAE,IAAI,QAAQ;AACzB,MAAI,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC;AAC3C,UAAM,IAAI,WAAW,0CAA0C;AACjE,QAAM,QAAQ,SAAS,YAAY,QAAQ,SAAS;AACpD,MAAI,CAAC,SAAS,CAAC,SAAS,kBAAkB,KAAK,EAAG,QAAO;AACzD,WAAS,QAAQ,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS;AAC/D,UAAM,OAAO,SAAS,MAAM,KAAK;AACjC,UAAM,SAAS,KAAK,eAAe,GACjC,SAAS,KAAK,oBAAoB;AACpC,QAAI,WAAW,KAAM,CAAC,KAAK,QAAQ,WAAW,EAAI;AAClD,UAAM,WAAW,KAAK;AAAA,MACpB,MAAM,IAAI,KAAK,YAAY;AAAA,MAC3B,MAAM,IAAI,KAAK,YAAY;AAAA,IAC7B;AACA,QACE,WAAW,SAAS,SAAS,KAC5B,CAAC,KAAK,QAAQ,WAAW,KAAK,IAAI,GAAG,SAAS,SAAS,CAAC;AAEzD;AACF,WAAO,OAAO,OAAO;AAAA,MACnB,GAAG,SAAS,aAAa,KAAK;AAAA,MAC9B,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { NearestRecordedPointHit, NearestRecordedXHit, NumericDomainInterpolation, NumericDuplicateResolver, InspectionCandidate, NumericRenderedFilter, NumericRenderedObservation, NumericRenderedSeries, RecordedXSample, RenderedSeriesPoint } from "./query-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Retains the first source observation at a duplicate domain coordinate.
|
|
4
|
+
*
|
|
5
|
+
* @param first - First selected observation at this domain coordinate.
|
|
6
|
+
* @param _next - Later observation at the same domain coordinate.
|
|
7
|
+
* @returns The earliest source observation.
|
|
8
|
+
* @see {@link NumericDuplicateResolver}
|
|
9
|
+
*/
|
|
10
|
+
export declare function firstSourceObservation<D>(first: NumericRenderedObservation<D>, _next: NumericRenderedObservation<D>): NumericRenderedObservation<D>;
|
|
11
|
+
/**
|
|
12
|
+
* Replaces a source observation with the next one at a duplicate domain coordinate.
|
|
13
|
+
*
|
|
14
|
+
* @param _first - Earlier selected observation at this domain coordinate.
|
|
15
|
+
* @param next - Later observation at the same domain coordinate.
|
|
16
|
+
* @returns The latest source observation.
|
|
17
|
+
* @see {@link NumericDuplicateResolver}
|
|
18
|
+
*/
|
|
19
|
+
export declare function lastSourceObservation<D>(_first: NumericRenderedObservation<D>, next: NumericRenderedObservation<D>): NumericRenderedObservation<D>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns whether a filter candidate's anchor lies inside the committed clip stack.
|
|
22
|
+
*
|
|
23
|
+
* Pass this function as a query filter when visibility at the anchor is required.
|
|
24
|
+
* Queries otherwise examine all eligible rendered observations.
|
|
25
|
+
*
|
|
26
|
+
* @param candidate - Candidate whose committed local anchor should be clip-tested.
|
|
27
|
+
* @returns Whether the candidate anchor lies within every committed clip.
|
|
28
|
+
* @see {@link NumericRenderedFilter}
|
|
29
|
+
*/
|
|
30
|
+
export declare function anchorInsideClips<D>(candidate: InspectionCandidate<D>): boolean;
|
|
31
|
+
/** Options for {@link nearestRecordedX}. */
|
|
32
|
+
export interface NearestRecordedXOptions<D> {
|
|
33
|
+
/** Numeric horizontal domain value to inspect, or undefined for no request. */
|
|
34
|
+
readonly domainX: number | undefined;
|
|
35
|
+
/** Maximum accepted absolute horizontal-domain delta. */
|
|
36
|
+
readonly maxDomainDelta?: number;
|
|
37
|
+
/** Further restricts committed observations for this request. */
|
|
38
|
+
readonly filter?: NumericRenderedFilter<D>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Finds the recorded observation nearest to a numeric horizontal domain value in O(n) time.
|
|
42
|
+
*
|
|
43
|
+
* Ties retain source order. Distance is measured in domain units, while both
|
|
44
|
+
* returned anchors retain their explicitly named local and root-logical units.
|
|
45
|
+
*
|
|
46
|
+
* @param rendered - Committed rendered-series generation to inspect synchronously.
|
|
47
|
+
* @param options - Domain position, optional limit, and observation filter.
|
|
48
|
+
* @returns The selected recorded observation, or undefined when none qualifies.
|
|
49
|
+
* @see {@link NearestRecordedXOptions}
|
|
50
|
+
*/
|
|
51
|
+
export declare function nearestRecordedX<D>(rendered: NumericRenderedSeries<D>, options: NearestRecordedXOptions<D>): NearestRecordedXHit<D> | undefined;
|
|
52
|
+
/** Options for {@link nearestRecordedPoint}. */
|
|
53
|
+
export interface NearestRecordedPointOptions<D> {
|
|
54
|
+
/** Root-logical point to inspect, or undefined for no request. */
|
|
55
|
+
readonly rootPoint: Readonly<RenderedSeriesPoint> | undefined;
|
|
56
|
+
/** Maximum accepted Euclidean root-logical distance. */
|
|
57
|
+
readonly maxRootDistance?: number;
|
|
58
|
+
/** Further restricts committed observations for this request. */
|
|
59
|
+
readonly filter?: NumericRenderedFilter<D>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Finds the recorded observation nearest to a root-logical point in O(n) time.
|
|
63
|
+
*
|
|
64
|
+
* Ties retain source order. This query measures distance in root-logical units
|
|
65
|
+
* so it remains meaningful under nonuniform series transforms.
|
|
66
|
+
*
|
|
67
|
+
* @param rendered - Committed rendered-series generation to inspect synchronously.
|
|
68
|
+
* @param options - Root position, optional limit, and observation filter.
|
|
69
|
+
* @returns The selected recorded observation, or undefined when none qualifies.
|
|
70
|
+
* @see {@link NearestRecordedPointOptions}
|
|
71
|
+
*/
|
|
72
|
+
export declare function nearestRecordedPoint<D>(rendered: NumericRenderedSeries<D>, options: NearestRecordedPointOptions<D>): NearestRecordedPointHit<D> | undefined;
|
|
73
|
+
/** Options for {@link sampleRecordedX}. */
|
|
74
|
+
export interface SampleRecordedXOptions<D> {
|
|
75
|
+
/** Numeric horizontal domain value to sample, or undefined for no request. */
|
|
76
|
+
readonly domainX: number | undefined;
|
|
77
|
+
/** Computes the estimated numeric domain value between two recorded values. */
|
|
78
|
+
readonly interpolation: NumericDomainInterpolation;
|
|
79
|
+
/** Explicitly chooses one observation from each duplicate-domain group. */
|
|
80
|
+
readonly resolveDuplicate?: NumericDuplicateResolver<D>;
|
|
81
|
+
/** Maximum domain interval that may be interpolated across. */
|
|
82
|
+
readonly maxDomainGap?: number;
|
|
83
|
+
/** Further restricts committed observations for this request. */
|
|
84
|
+
readonly filter?: NumericRenderedFilter<D>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Returns an exact recorded observation or a caller-defined interpolation between records.
|
|
88
|
+
*
|
|
89
|
+
* It never bridges separate rendered runs, filtered observations, or an interval larger
|
|
90
|
+
* than `maxDomainGap`. Duplicate x values reject by default and require an explicit
|
|
91
|
+
* `resolveDuplicate` function. Estimated results retain their two source observations and
|
|
92
|
+
* map explicit local/root anchors through the committed generation. This is O(n) in captured
|
|
93
|
+
* observations and the result is borrowed until the rendered generation is replaced or disposed.
|
|
94
|
+
*
|
|
95
|
+
* @param rendered - Committed rendered-series generation to inspect synchronously.
|
|
96
|
+
* @param options - Domain position, interpolation, duplicate policy, and filter.
|
|
97
|
+
* @returns An exact record, an explicitly interpolated estimate, or undefined.
|
|
98
|
+
* @see {@link SampleRecordedXOptions}
|
|
99
|
+
*/
|
|
100
|
+
export declare function sampleRecordedX<D>(rendered: NumericRenderedSeries<D>, options: SampleRecordedXOptions<D>): RecordedXSample<D> | undefined;
|