@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.
- package/THIRD_PARTY_NOTICES.txt +81 -0
- 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/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/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/world/rapier.js +22 -26
- package/dist/features/physics/lib/2d/world/rapier.js.map +2 -2
- package/dist/features/sprites/loader.js +6 -3
- package/dist/features/sprites/loader.js.map +2 -2
- 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 +68 -6
- package/dist/features/viz/index.js +164 -2
- 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-title.js +2 -1
- package/dist/features/viz/lib/axis-title.js.map +2 -2
- package/dist/features/viz/lib/axis.js +1 -1
- package/dist/features/viz/lib/axis.js.map +2 -2
- package/dist/features/viz/lib/bar-series.d.ts +3 -1
- package/dist/features/viz/lib/bar-series.js +16 -1
- 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/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 +5 -2
- package/dist/features/viz/lib/hover-data.js.map +2 -2
- 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.js +1 -1
- package/dist/features/viz/lib/linear-scale.js.map +2 -2
- 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/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/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-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.js +4 -1
- package/dist/features/viz/lib/reference-band.js.map +2 -2
- package/dist/features/viz/lib/scale-context.d.ts +1 -1
- package/dist/features/viz/lib/scale-ticks.js +21 -6
- package/dist/features/viz/lib/scale-ticks.js.map +2 -2
- 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/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 +20 -4
- package/dist/features/viz/lib/use-continuous-scale.js +6 -1
- package/dist/features/viz/lib/use-continuous-scale.js.map +2 -2
- package/dist/features/viz/lib/utc-scale.js +11 -10
- package/dist/features/viz/lib/utc-scale.js.map +2 -2
- 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 +9 -5
- 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/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/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 +26 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "@pibbl/core/jsx-runtime";
|
|
2
|
+
import { resolveScalarSizingLength } from "../../../lib/style/sizing-length.js";
|
|
2
3
|
import {
|
|
3
4
|
Group,
|
|
4
5
|
Rectangle,
|
|
5
6
|
definePrimitive,
|
|
6
7
|
resolveSignalValue,
|
|
7
|
-
resolveBox
|
|
8
|
-
resolveLength
|
|
8
|
+
resolveBox
|
|
9
9
|
} from "@pibbl/core";
|
|
10
10
|
import {
|
|
11
11
|
pushLayoutBox,
|
|
@@ -69,11 +69,11 @@ const Card = definePrimitive(
|
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
resolveStyle(style, context) {
|
|
72
|
-
const width =
|
|
72
|
+
const width = resolveScalarSizingLength(
|
|
73
73
|
style.width,
|
|
74
74
|
context.allocation.width,
|
|
75
75
|
"width"
|
|
76
|
-
), height =
|
|
76
|
+
), height = resolveScalarSizingLength(
|
|
77
77
|
style.height,
|
|
78
78
|
context.allocation.height,
|
|
79
79
|
"height"
|
|
@@ -86,11 +86,10 @@ const Card = definePrimitive(
|
|
|
86
86
|
{ component: "HoverCard" }
|
|
87
87
|
);
|
|
88
88
|
const strokeWidth = style.strokeWidth ?? 1, cornerRadius = style.cornerRadius ?? 7, opacity = style.opacity ?? 1;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
);
|
|
89
|
+
if (!Number.isFinite(strokeWidth) || strokeWidth < 0 || !Number.isFinite(cornerRadius) || cornerRadius < 0 || !Number.isFinite(opacity) || opacity < 0)
|
|
90
|
+
throw new RangeError(
|
|
91
|
+
"HoverCard paint dimensions must be finite and nonnegative."
|
|
92
|
+
);
|
|
94
93
|
if (opacity > 1)
|
|
95
94
|
throw new RangeError("HoverCard opacity must be in [0,1].");
|
|
96
95
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/features/viz/lib/hover-card.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n Group,\n Rectangle,\n definePrimitive,\n resolveSignalValue,\n resolveBox,\n
|
|
5
|
-
"mappings": "AAwKM,SACE,KADF;AAxKN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { resolveScalarSizingLength } from '../../../lib/style/sizing-length.js';\nimport {\n Group,\n Rectangle,\n definePrimitive,\n resolveSignalValue,\n resolveBox,\n type BoxStyle,\n type PibblNode,\n type FillStyle,\n type StrokeStyle,\n type SignalValue,\n} from \"@pibbl/core\";\nimport {\n pushLayoutBox,\n setCurrentComponentAfterRender,\n type SignalStyle,\n} from \"@pibbl/core/internal\";\nimport type { HoverPoint } from \"./hover-types.js\";\nimport {\n placeHoverCard,\n type HoverBounds,\n type HoverPlacement,\n} from \"./hover-placement.js\";\nexport type { HoverBounds, HoverPlacement } from \"./hover-placement.js\";\n/**\n * Supported geometry and presentation properties for HoverCard.\n *\n * @see {@link BoxStyle}\n * @see {@link FillStyle}\n * @see {@link StrokeStyle}\n * @see {@link HoverCardProps}\n */\nexport interface HoverCardStyle {\n /** Horizontal extent in the units of the containing geometry or surface. See {@link BoxStyle}. */\n readonly width: Exclude<BoxStyle[\"width\"], undefined | \"auto\">;\n /** Vertical extent in the units of the containing geometry or surface. See {@link BoxStyle}. */\n readonly height: Exclude<BoxStyle[\"height\"], undefined | \"auto\">;\n /** Insets between the border box and content box. See {@link BoxStyle}. */\n readonly padding?: BoxStyle[\"padding\"];\n /** Paint used for the interior. See {@link FillStyle}. */\n readonly fill?: FillStyle;\n /** Paint used for the outline. See {@link StrokeStyle}. */\n readonly stroke?: StrokeStyle;\n /** Width of the painted outline. See {@link HoverCardStyle}. */\n readonly strokeWidth?: number;\n /**\n * Uniform corner radius used where no per-corner override is supplied. See\n * {@link HoverCardStyle}.\n */\n readonly cornerRadius?: number;\n /** Opacity of the painted result. See {@link HoverCardStyle}. */\n readonly opacity?: number;\n /**\n * Not accepted in this variant; use the alternative fields instead. See {@link HoverCardStyle}.\n */\n readonly filter?: never;\n /**\n * Not accepted in this variant; use the alternative fields instead. See {@link HoverCardStyle}.\n */\n readonly custom?: never;\n}\n/**\n * Authored inputs for HoverCard, including the declared data and presentation options.\n *\n * @see {@link SignalValue}\n * @see {@link HoverPoint}\n * @see {@link HoverBounds}\n * @see {@link HoverPlacement}\n * @see {@link SignalStyle}\n * @see {@link HoverCardStyle}\n * @see {@link PibblNode}\n * @see {@link HoverCard}\n */\nexport interface HoverCardProps {\n /**\n * Logical point to which the content or result is anchored. See {@link SignalValue},\n * {@link HoverPoint}.\n */\n readonly anchor: SignalValue<HoverPoint>;\n /** Clearance around the anchor before placing the item. See {@link SignalValue}. */\n readonly anchorRadius?: SignalValue<number>;\n /** Spacing between adjacent items. See {@link SignalValue}. */\n readonly gap?: SignalValue<number>;\n /**\n * Logical region constraining the content or query. See {@link SignalValue},\n * {@link HoverBounds}.\n */\n readonly bounds?: SignalValue<HoverBounds>;\n /**\n * Preferred placement relative to the anchor or containing geometry. See {@link HoverPlacement}\n * .\n */\n readonly placement?: HoverPlacement;\n /**\n * Declared presentation and layout properties. See {@link SignalValue}, {@link SignalStyle},\n * {@link HoverCardStyle}.\n */\n readonly style: SignalValue<SignalStyle<HoverCardStyle>>;\n /** Descendant content or the callback that supplies it. See {@link PibblNode}. */\n readonly children?: PibblNode;\n}\ntype CardInputs = Omit<\n HoverCardProps,\n \"style\" | \"anchor\" | \"anchorRadius\" | \"gap\" | \"bounds\"\n> & {\n anchor: HoverPoint;\n anchorRadius: number;\n gap: number;\n bounds?: HoverBounds;\n};\ninterface CardResolved {\n readonly custom?: never;\n readonly box: ReturnType<typeof resolveBox>;\n readonly bounds: HoverBounds;\n readonly fill: FillStyle;\n readonly stroke: StrokeStyle;\n readonly strokeWidth: number;\n readonly cornerRadius: number;\n readonly opacity: number;\n}\nfunction Content({\n width,\n height,\n children,\n}: {\n width: number;\n height: number;\n children?: PibblNode;\n}) {\n // Establish both allocation and percentage basis for arbitrary composed nodes;\n // this is a content box, not a layout parent that requires child dimensions.\n const box = { x: 0, y: 0, width, height };\n const outer = pushLayoutBox(box);\n let inner: (() => void) | undefined;\n try {\n inner = pushLayoutBox(box);\n setCurrentComponentAfterRender(() => {\n inner!();\n outer();\n });\n } catch (error) {\n inner?.();\n outer();\n throw error;\n }\n return children;\n}\nconst Card = definePrimitive<\n CardInputs,\n HoverCardStyle,\n HoverCardStyle,\n CardResolved\n>(\n function renderHoverCard(props, style, context) {\n context.globalAlpha *= style.opacity;\n const { borderBox: box, contentBox: content } = style.box;\n const at = placeHoverCard({\n anchor: props.anchor,\n anchorRadius: props.anchorRadius,\n gap: props.gap,\n bounds: props.bounds ?? style.bounds,\n width: box.width,\n height: box.height,\n strokeWidth: style.stroke ? style.strokeWidth : 0,\n placement: props.placement ?? \"auto\",\n });\n return (\n <Group style={{ translateX: at.x, translateY: at.y }}>\n <Rectangle\n pointerEvents=\"none\"\n style={{\n width: box.width,\n height: box.height,\n fill: style.fill,\n stroke: style.stroke,\n strokeWidth: style.strokeWidth,\n cornerRadius: style.cornerRadius,\n }}\n />\n <Group style={{ translateX: content.x, translateY: content.y }}>\n <Content width={content.width} height={content.height}>\n {props.children}\n </Content>\n </Group>\n </Group>\n );\n },\n {\n resolveStyle(style, context) {\n const width = resolveScalarSizingLength(\n style.width,\n context.allocation.width,\n \"width\",\n ),\n height = resolveScalarSizingLength(\n style.height,\n context.allocation.height,\n \"height\",\n );\n if (width === undefined || height === undefined)\n throw new TypeError(\"HoverCard requires declared width and height.\");\n const box = resolveBox(\n { width, height, padding: style.padding ?? 10 },\n { minWidth: 0, maxWidth: Infinity, minHeight: 0, maxHeight: Infinity },\n { component: \"HoverCard\" },\n );\n const strokeWidth = style.strokeWidth ?? 1,\n cornerRadius = style.cornerRadius ?? 7,\n opacity = style.opacity ?? 1;\n if (\n !Number.isFinite(strokeWidth) ||\n strokeWidth < 0 ||\n !Number.isFinite(cornerRadius) ||\n cornerRadius < 0 ||\n !Number.isFinite(opacity) ||\n opacity < 0\n )\n throw new RangeError(\n \"HoverCard paint dimensions must be finite and nonnegative.\",\n );\n if (opacity > 1)\n throw new RangeError(\"HoverCard opacity must be in [0,1].\");\n return {\n box,\n bounds: {\n x: 0,\n y: 0,\n width: context.allocation.width,\n height: context.allocation.height,\n },\n fill: style.fill ?? \"rgba(255,255,255,0.92)\",\n stroke: style.stroke ?? \"rgba(98,117,139,0.35)\",\n strokeWidth,\n cornerRadius,\n opacity,\n };\n },\n },\n);\nconst fields = new Set([\n \"width\",\n \"height\",\n \"padding\",\n \"fill\",\n \"stroke\",\n \"strokeWidth\",\n \"cornerRadius\",\n \"opacity\",\n]);\n/**\n * Positions a declared card outside a protected anchor, allowing overflow if needed.\n *\n * @param props - Anchor, placement, style, and hover-card content. See {@link HoverCardProps}.\n * @returns Pibbl content placed as a hover card. See {@link PibblNode}.\n *\n * @see {@link HoverCardProps}\n * @see {@link PibblNode}\n */\nexport function HoverCard(props: HoverCardProps): PibblNode {\n const style = resolveSignalValue(props.style);\n if (!style || typeof style !== \"object\")\n throw new TypeError(\"HoverCard requires a style with width and height.\");\n for (const field of Object.keys(style))\n if (!fields.has(field))\n throw new TypeError(`HoverCard does not support style.${field}.`);\n return (\n <Card\n anchor={resolveSignalValue(props.anchor)}\n anchorRadius={resolveSignalValue(props.anchorRadius ?? 0)}\n gap={resolveSignalValue(props.gap ?? 8)}\n bounds={\n props.bounds === undefined\n ? undefined\n : resolveSignalValue(props.bounds)\n }\n placement={props.placement}\n style={style}\n >\n {props.children}\n </Card>\n );\n}\n"],
|
|
5
|
+
"mappings": "AAwKM,SACE,KADF;AAxKN,SAAS,iCAAiC;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAEP;AAAA,EACE;AAAA,OAGK;AAkGP,SAAS,QAAQ;AAAA,EACf;AAAA,EACA;AAAA,EACA;AACF,GAIG;AAGD,QAAM,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,OAAO,OAAO;AACxC,QAAM,QAAQ,cAAc,GAAG;AAC/B,MAAI;AACJ,MAAI;AACF,YAAQ,cAAc,GAAG;AACzB,mCAA+B,MAAM;AACnC,YAAO;AACP,YAAM;AAAA,IACR,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ;AACR,UAAM;AACN,UAAM;AAAA,EACR;AACA,SAAO;AACT;AACA,MAAM,OAAO;AAAA,EAMX,SAAS,gBAAgB,OAAO,OAAO,SAAS;AAC9C,YAAQ,eAAe,MAAM;AAC7B,UAAM,EAAE,WAAW,KAAK,YAAY,QAAQ,IAAI,MAAM;AACtD,UAAM,KAAK,eAAe;AAAA,MACxB,QAAQ,MAAM;AAAA,MAC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@@ import type { HoverDataProps } from "./hover-types.js";
|
|
|
9
9
|
* @see {@link HoverDataProps}
|
|
10
10
|
* @see {@link PibblNode}
|
|
11
11
|
*/
|
|
12
|
-
export declare function HoverData<T>({ query, children }: HoverDataProps<T>): PibblNode;
|
|
12
|
+
export declare function HoverData<T>({ query, children, }: HoverDataProps<T>): PibblNode;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { withHooksForbidden } from "@pibbl/core/internal";
|
|
2
2
|
import { readScale } from "./scale-context.js";
|
|
3
|
-
function HoverData({
|
|
3
|
+
function HoverData({
|
|
4
|
+
query,
|
|
5
|
+
children
|
|
6
|
+
}) {
|
|
4
7
|
if (typeof query !== "function" || typeof children !== "function")
|
|
5
8
|
throw new TypeError("HoverData requires query and children functions.");
|
|
6
9
|
const snapshots = /* @__PURE__ */ new Map();
|
|
@@ -16,7 +19,7 @@ function HoverData({ query, children }) {
|
|
|
16
19
|
const value = readScale(id, "HoverData");
|
|
17
20
|
if (!value) throw new TypeError("HoverData requires a scale ID.");
|
|
18
21
|
const resolved = value.get();
|
|
19
|
-
if (resolved.type === "band" || resolved.type === "point")
|
|
22
|
+
if (resolved.type === "band" || resolved.type === "point" || resolved.type === "trading-time")
|
|
20
23
|
throw new TypeError(
|
|
21
24
|
"HoverData numeric queries require continuous scales."
|
|
22
25
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/features/viz/lib/hover-data.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { PibblNode } from \"@pibbl/core\";\nimport { withHooksForbidden } from \"@pibbl/core/internal\";\nimport type { HoverDataProps, HoverQueryContext } from \"./hover-types.js\";\nimport type { ResolvedContinuousScale, ScaleId } from \"./types.js\";\nimport { readScale } from \"./scale-context.js\";\n/**\n * Evaluates an ordinary synchronous query under the current scale scope.\n *\n * @param props - Hover query and child renderer receiving its result. See {@link HoverDataProps}.\n * @returns Content rendered from the current hover query result. See {@link PibblNode}.\n *\n * @see {@link HoverDataProps}\n * @see {@link PibblNode}\n */\nexport function HoverData<T>({
|
|
5
|
-
"mappings": "AACA,SAAS,0BAA0B;AAGnC,SAAS,iBAAiB;AAUnB,SAAS,UAAa,
|
|
4
|
+
"sourcesContent": ["import type { PibblNode } from \"@pibbl/core\";\nimport { withHooksForbidden } from \"@pibbl/core/internal\";\nimport type { HoverDataProps, HoverQueryContext } from \"./hover-types.js\";\nimport type { ResolvedContinuousScale, ScaleId } from \"./types.js\";\nimport { readScale } from \"./scale-context.js\";\n/**\n * Evaluates an ordinary synchronous query under the current scale scope.\n *\n * @param props - Hover query and child renderer receiving its result. See {@link HoverDataProps}.\n * @returns Content rendered from the current hover query result. See {@link PibblNode}.\n *\n * @see {@link HoverDataProps}\n * @see {@link PibblNode}\n */\nexport function HoverData<T>({\n query,\n children,\n}: HoverDataProps<T>): PibblNode {\n if (typeof query !== \"function\" || typeof children !== \"function\")\n throw new TypeError(\"HoverData requires query and children functions.\");\n const snapshots = new Map<ScaleId, ResolvedContinuousScale>();\n let active = true;\n const context: HoverQueryContext = {\n scale(id) {\n if (!active)\n throw new Error(\n \"HoverData query context cannot be retained outside its invocation.\",\n );\n let snapshot = snapshots.get(id);\n if (!snapshot) {\n const value = readScale(id, \"HoverData\");\n if (!value) throw new TypeError(\"HoverData requires a scale ID.\");\n const resolved = value.get();\n if (\n resolved.type === \"band\" ||\n resolved.type === \"point\" ||\n resolved.type === \"trading-time\"\n )\n throw new TypeError(\n \"HoverData numeric queries require continuous scales.\",\n );\n snapshot = resolved;\n snapshots.set(id, snapshot);\n }\n return snapshot;\n },\n };\n let result: T | undefined;\n try {\n result = withHooksForbidden(\n \"Pibbl hooks cannot be called inside a HoverData query.\",\n () => query(context),\n );\n if (\n result != null &&\n (typeof result === \"object\" || typeof result === \"function\") &&\n typeof (result as { then?: unknown }).then === \"function\"\n )\n throw new TypeError(\n \"HoverData query must be synchronous; promises are unsupported.\",\n );\n } finally {\n active = false;\n }\n return withHooksForbidden(\n \"Pibbl hooks cannot be called inside a HoverData render callback; return a component instead.\",\n () => children(result),\n );\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,0BAA0B;AAGnC,SAAS,iBAAiB;AAUnB,SAAS,UAAa;AAAA,EAC3B;AAAA,EACA;AACF,GAAiC;AAC/B,MAAI,OAAO,UAAU,cAAc,OAAO,aAAa;AACrD,UAAM,IAAI,UAAU,kDAAkD;AACxE,QAAM,YAAY,oBAAI,IAAsC;AAC5D,MAAI,SAAS;AACb,QAAM,UAA6B;AAAA,IACjC,MAAM,IAAI;AACR,UAAI,CAAC;AACH,cAAM,IAAI;AAAA,UACR;AAAA,QACF;AACF,UAAI,WAAW,UAAU,IAAI,EAAE;AAC/B,UAAI,CAAC,UAAU;AACb,cAAM,QAAQ,UAAU,IAAI,WAAW;AACvC,YAAI,CAAC,MAAO,OAAM,IAAI,UAAU,gCAAgC;AAChE,cAAM,WAAW,MAAM,IAAI;AAC3B,YACE,SAAS,SAAS,UAClB,SAAS,SAAS,WAClB,SAAS,SAAS;AAElB,gBAAM,IAAI;AAAA,YACR;AAAA,UACF;AACF,mBAAW;AACX,kBAAU,IAAI,IAAI,QAAQ;AAAA,MAC5B;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACA,MAAI;AACJ,MAAI;AACF,aAAS;AAAA,MACP;AAAA,MACA,MAAM,MAAM,OAAO;AAAA,IACrB;AACA,QACE,UAAU,SACT,OAAO,WAAW,YAAY,OAAO,WAAW,eACjD,OAAQ,OAA8B,SAAS;AAE/C,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,EACJ,UAAE;AACA,aAAS;AAAA,EACX;AACA,SAAO;AAAA,IACL;AAAA,IACA,MAAM,SAAS,MAAM;AAAA,EACvB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Path } from "@pibbl/core";
|
|
2
|
+
import type { PibblEventHandlers, PibblEventParticipationOptions, SignalValue } from "@pibbl/core";
|
|
3
|
+
import type { SignalStyle } from "@pibbl/core/internal";
|
|
4
|
+
import type { AreaSeriesStyle } from "./area-series.js";
|
|
5
|
+
import type { LineAccessor, LineSeriesProps } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Authored inputs for {@link IntervalBandSeries}.
|
|
8
|
+
*
|
|
9
|
+
* The data, horizontal coordinate, scales, and defined predicate use the same contract as
|
|
10
|
+
* {@link LineSeriesProps}. Each contiguous run of at least two observations draws its upper
|
|
11
|
+
* boundary forward and lower boundary backward.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link AreaSeriesStyle}
|
|
14
|
+
* @see {@link LineSeriesProps}
|
|
15
|
+
*/
|
|
16
|
+
export interface IntervalBandSeriesProps<D> extends PibblEventHandlers, PibblEventParticipationOptions {
|
|
17
|
+
/** Application data supplied directly or through a signal. */
|
|
18
|
+
readonly data: LineSeriesProps<D>["data"];
|
|
19
|
+
/** Property key or callback extracting the horizontal coordinate. */
|
|
20
|
+
readonly x: LineAccessor<D>;
|
|
21
|
+
/** Property key or callback extracting the lower bound. */
|
|
22
|
+
readonly lower: LineAccessor<D>;
|
|
23
|
+
/** Property key or callback extracting the upper bound. */
|
|
24
|
+
readonly upper: LineAccessor<D>;
|
|
25
|
+
/** Continuous scale used to map horizontal data coordinates. */
|
|
26
|
+
readonly xScale: LineSeriesProps<D>["xScale"];
|
|
27
|
+
/** Continuous scale used to map both data bounds. */
|
|
28
|
+
readonly yScale: LineSeriesProps<D>["yScale"];
|
|
29
|
+
/** Selects records that participate in a matching-bounds run. */
|
|
30
|
+
readonly defined?: LineSeriesProps<D>["defined"];
|
|
31
|
+
/** Curve used to connect successive matching bounds. */
|
|
32
|
+
readonly curve?: LineSeriesProps<D>["curve"];
|
|
33
|
+
/** Shared band presentation. Individual datum styling is not supported. */
|
|
34
|
+
readonly style?: SignalValue<SignalStyle<AreaSeriesStyle>>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Draws a filled band between matching lower and upper observations.
|
|
38
|
+
*
|
|
39
|
+
* Missing, non-finite, and excluded coordinates split runs. A lower value above its upper
|
|
40
|
+
* value rejects the datum; equal bounds produce zero-area geometry. The component owns one
|
|
41
|
+
* ordinary {@link Path} target, so event participation follows standard Path defaults.
|
|
42
|
+
*
|
|
43
|
+
* @param props - Data, coordinate accessors, continuous scales, and presentation.
|
|
44
|
+
* @returns A Pibbl path node containing all drawable interval-band runs.
|
|
45
|
+
* @throws When data, presentation, or bounds are invalid.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link IntervalBandSeriesProps}
|
|
48
|
+
*/
|
|
49
|
+
export declare function IntervalBandSeries<D>({ data: dataInput, x: xInput, lower: lowerInput, upper: upperInput, xScale: xId, yScale: yId, defined, curve, style: styleInput, ...eventProps }: IntervalBandSeriesProps<D>): import("../../../jsx-runtime.js").JSX.Element;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx } from "@pibbl/core/jsx-runtime";
|
|
2
|
+
import { useNumericPosition } from "./series-position.js";
|
|
3
|
+
import { Path, resolveSignalValue } from "@pibbl/core";
|
|
4
|
+
import {
|
|
5
|
+
useInternalValueMemoSlot,
|
|
6
|
+
validateTexturePaint
|
|
7
|
+
} from "@pibbl/core/internal";
|
|
8
|
+
import { opacity } from "./paint.js";
|
|
9
|
+
import {
|
|
10
|
+
appendCurveForward,
|
|
11
|
+
appendCurveReverse,
|
|
12
|
+
curveGeometry,
|
|
13
|
+
resolveSeriesCurve,
|
|
14
|
+
validatePairedCurveGeometry
|
|
15
|
+
} from "./curve-definition.js";
|
|
16
|
+
import { useContinuousScale } from "./use-continuous-scale.js";
|
|
17
|
+
function accessor(input) {
|
|
18
|
+
return typeof input === "function" ? input : (datum) => datum[input];
|
|
19
|
+
}
|
|
20
|
+
function fill(value) {
|
|
21
|
+
if (typeof value === "string" || value instanceof CanvasGradient || value instanceof CanvasPattern)
|
|
22
|
+
return value;
|
|
23
|
+
try {
|
|
24
|
+
validateTexturePaint(value);
|
|
25
|
+
return value;
|
|
26
|
+
} catch {
|
|
27
|
+
throw new TypeError("IntervalBandSeries: invalid fill.");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function IntervalBandSeries({
|
|
31
|
+
data: dataInput,
|
|
32
|
+
x: xInput,
|
|
33
|
+
lower: lowerInput,
|
|
34
|
+
upper: upperInput,
|
|
35
|
+
xScale: xId,
|
|
36
|
+
yScale: yId,
|
|
37
|
+
defined,
|
|
38
|
+
curve,
|
|
39
|
+
style: styleInput,
|
|
40
|
+
...eventProps
|
|
41
|
+
}) {
|
|
42
|
+
const xScale = useNumericPosition(xId);
|
|
43
|
+
const yScale = useContinuousScale(yId).get();
|
|
44
|
+
const curveDefinition = resolveSeriesCurve(curve);
|
|
45
|
+
const x = useInternalValueMemoSlot(
|
|
46
|
+
"vizIntervalBandXAccessor",
|
|
47
|
+
() => accessor(xInput),
|
|
48
|
+
[xInput]
|
|
49
|
+
);
|
|
50
|
+
const lower = useInternalValueMemoSlot(
|
|
51
|
+
"vizIntervalBandLowerAccessor",
|
|
52
|
+
() => accessor(lowerInput),
|
|
53
|
+
[lowerInput]
|
|
54
|
+
);
|
|
55
|
+
const upper = useInternalValueMemoSlot(
|
|
56
|
+
"vizIntervalBandUpperAccessor",
|
|
57
|
+
() => accessor(upperInput),
|
|
58
|
+
[upperInput]
|
|
59
|
+
);
|
|
60
|
+
const data = resolveSignalValue(dataInput);
|
|
61
|
+
if (!Array.isArray(data))
|
|
62
|
+
throw new TypeError(
|
|
63
|
+
"IntervalBandSeries data must be an array or a signal containing an array."
|
|
64
|
+
);
|
|
65
|
+
const style = resolveSignalValue(styleInput) ?? {};
|
|
66
|
+
if (style === null || typeof style !== "object" || Array.isArray(style))
|
|
67
|
+
throw new TypeError("IntervalBandSeries: style must be an object.");
|
|
68
|
+
const bandFill = fill(resolveSignalValue(style.fill) ?? "#2563eb");
|
|
69
|
+
const alpha = opacity(
|
|
70
|
+
resolveSignalValue(style.opacity) ?? 0.2,
|
|
71
|
+
"IntervalBandSeries"
|
|
72
|
+
);
|
|
73
|
+
const cursor = resolveSignalValue(style.cursor);
|
|
74
|
+
if (cursor !== void 0 && typeof cursor !== "string")
|
|
75
|
+
throw new TypeError("IntervalBandSeries: cursor must be a string.");
|
|
76
|
+
const path = new Path2D();
|
|
77
|
+
let run = [];
|
|
78
|
+
const closeRun = () => {
|
|
79
|
+
if (run.length >= 2) {
|
|
80
|
+
const upper2 = curveGeometry(
|
|
81
|
+
curveDefinition,
|
|
82
|
+
run.map(([x2, _lower, value]) => [x2, value])
|
|
83
|
+
);
|
|
84
|
+
const lower2 = curveGeometry(
|
|
85
|
+
curveDefinition,
|
|
86
|
+
run.map(([x2, value]) => [x2, value])
|
|
87
|
+
);
|
|
88
|
+
validatePairedCurveGeometry(upper2, lower2);
|
|
89
|
+
path.moveTo(upper2.start[0], upper2.start[1]);
|
|
90
|
+
appendCurveForward(path, upper2);
|
|
91
|
+
appendCurveReverse(path, lower2);
|
|
92
|
+
path.closePath();
|
|
93
|
+
}
|
|
94
|
+
run = [];
|
|
95
|
+
};
|
|
96
|
+
for (let i = 0; i < data.length; i++) {
|
|
97
|
+
const datum = data[i];
|
|
98
|
+
if (defined && !defined(datum, i, data)) {
|
|
99
|
+
closeRun();
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const xv = x(datum, i, data);
|
|
103
|
+
const lowerValue = lower(datum, i, data);
|
|
104
|
+
const upperValue = upper(datum, i, data);
|
|
105
|
+
if (typeof xv !== "number" || typeof lowerValue !== "number" || typeof upperValue !== "number" || !Number.isFinite(xv) || !Number.isFinite(lowerValue) || !Number.isFinite(upperValue)) {
|
|
106
|
+
closeRun();
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (lowerValue > upperValue)
|
|
110
|
+
throw new RangeError(
|
|
111
|
+
`IntervalBandSeries datum at index ${i} has lower bound above upper bound.`
|
|
112
|
+
);
|
|
113
|
+
const point = [
|
|
114
|
+
xScale.map(xv),
|
|
115
|
+
yScale.map(lowerValue),
|
|
116
|
+
yScale.map(upperValue)
|
|
117
|
+
];
|
|
118
|
+
if (!point.every(Number.isFinite)) {
|
|
119
|
+
closeRun();
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
run.push(point);
|
|
123
|
+
}
|
|
124
|
+
closeRun();
|
|
125
|
+
return /* @__PURE__ */ jsx(
|
|
126
|
+
Path,
|
|
127
|
+
{
|
|
128
|
+
...eventProps,
|
|
129
|
+
style: { d: path, fill: bandFill, opacity: alpha, cursor }
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
IntervalBandSeries
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=interval-band-series.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/interval-band-series.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useNumericPosition } from \"./series-position.js\";\nimport { Path, resolveSignalValue } from \"@pibbl/core\";\nimport type {\n FillStyle,\n PibblEventHandlers,\n PibblEventParticipationOptions,\n SignalValue,\n} from \"@pibbl/core\";\nimport {\n useInternalValueMemoSlot,\n validateTexturePaint,\n} from \"@pibbl/core/internal\";\nimport type { SignalStyle } from \"@pibbl/core/internal\";\nimport type { AreaSeriesStyle } from \"./area-series.js\";\nimport { opacity } from \"./paint.js\";\nimport type { LineAccessor, LineCoordinate, LineSeriesProps } from \"./types.js\";\nimport {\n appendCurveForward,\n appendCurveReverse,\n curveGeometry,\n resolveSeriesCurve,\n validatePairedCurveGeometry,\n} from \"./curve-definition.js\";\nimport { useContinuousScale } from \"./use-continuous-scale.js\";\n\n/**\n * Authored inputs for {@link IntervalBandSeries}.\n *\n * The data, horizontal coordinate, scales, and defined predicate use the same contract as\n * {@link LineSeriesProps}. Each contiguous run of at least two observations draws its upper\n * boundary forward and lower boundary backward.\n *\n * @see {@link AreaSeriesStyle}\n * @see {@link LineSeriesProps}\n */\nexport interface IntervalBandSeriesProps<D>\n extends PibblEventHandlers, PibblEventParticipationOptions {\n /** Application data supplied directly or through a signal. */\n readonly data: LineSeriesProps<D>[\"data\"];\n /** Property key or callback extracting the horizontal coordinate. */\n readonly x: LineAccessor<D>;\n /** Property key or callback extracting the lower bound. */\n readonly lower: LineAccessor<D>;\n /** Property key or callback extracting the upper bound. */\n readonly upper: LineAccessor<D>;\n /** Continuous scale used to map horizontal data coordinates. */\n readonly xScale: LineSeriesProps<D>[\"xScale\"];\n /** Continuous scale used to map both data bounds. */\n readonly yScale: LineSeriesProps<D>[\"yScale\"];\n /** Selects records that participate in a matching-bounds run. */\n readonly defined?: LineSeriesProps<D>[\"defined\"];\n /** Curve used to connect successive matching bounds. */\n readonly curve?: LineSeriesProps<D>[\"curve\"];\n /** Shared band presentation. Individual datum styling is not supported. */\n readonly style?: SignalValue<SignalStyle<AreaSeriesStyle>>;\n}\n\nfunction accessor<D>(\n input: LineAccessor<D>,\n): (datum: D, index: number, data: readonly D[]) => LineCoordinate {\n return typeof input === \"function\"\n ? input\n : (datum) => datum[input] as LineCoordinate;\n}\n\nfunction fill(value: unknown): FillStyle {\n if (\n typeof value === \"string\" ||\n value instanceof CanvasGradient ||\n value instanceof CanvasPattern\n )\n return value;\n try {\n validateTexturePaint(value as never);\n return value as FillStyle;\n } catch {\n throw new TypeError(\"IntervalBandSeries: invalid fill.\");\n }\n}\n\n/**\n * Draws a filled band between matching lower and upper observations.\n *\n * Missing, non-finite, and excluded coordinates split runs. A lower value above its upper\n * value rejects the datum; equal bounds produce zero-area geometry. The component owns one\n * ordinary {@link Path} target, so event participation follows standard Path defaults.\n *\n * @param props - Data, coordinate accessors, continuous scales, and presentation.\n * @returns A Pibbl path node containing all drawable interval-band runs.\n * @throws When data, presentation, or bounds are invalid.\n *\n * @see {@link IntervalBandSeriesProps}\n */\nexport function IntervalBandSeries<D>({\n data: dataInput,\n x: xInput,\n lower: lowerInput,\n upper: upperInput,\n xScale: xId,\n yScale: yId,\n defined,\n curve,\n style: styleInput,\n ...eventProps\n}: IntervalBandSeriesProps<D>) {\n const xScale = useNumericPosition(xId);\n const yScale = useContinuousScale(yId).get();\n const curveDefinition = resolveSeriesCurve(curve);\n const x = useInternalValueMemoSlot(\n \"vizIntervalBandXAccessor\",\n () => accessor(xInput),\n [xInput],\n );\n const lower = useInternalValueMemoSlot(\n \"vizIntervalBandLowerAccessor\",\n () => accessor(lowerInput),\n [lowerInput],\n );\n const upper = useInternalValueMemoSlot(\n \"vizIntervalBandUpperAccessor\",\n () => accessor(upperInput),\n [upperInput],\n );\n const data = resolveSignalValue(dataInput);\n if (!Array.isArray(data))\n throw new TypeError(\n \"IntervalBandSeries data must be an array or a signal containing an array.\",\n );\n const style = resolveSignalValue(styleInput) ?? {};\n if (style === null || typeof style !== \"object\" || Array.isArray(style))\n throw new TypeError(\"IntervalBandSeries: style must be an object.\");\n const bandFill = fill(resolveSignalValue(style.fill) ?? \"#2563eb\");\n const alpha = opacity(\n resolveSignalValue(style.opacity) ?? 0.2,\n \"IntervalBandSeries\",\n );\n const cursor = resolveSignalValue(style.cursor);\n if (cursor !== undefined && typeof cursor !== \"string\")\n throw new TypeError(\"IntervalBandSeries: cursor must be a string.\");\n\n const path = new Path2D();\n let run: (readonly [number, number, number])[] = [];\n const closeRun = () => {\n if (run.length >= 2) {\n const upper = curveGeometry(\n curveDefinition,\n run.map(([x, _lower, value]) => [x, value] as const),\n );\n const lower = curveGeometry(\n curveDefinition,\n run.map(([x, value]) => [x, value] as const),\n );\n validatePairedCurveGeometry(upper, lower);\n path.moveTo(upper.start[0], upper.start[1]);\n appendCurveForward(path, upper);\n appendCurveReverse(path, lower);\n path.closePath();\n }\n run = [];\n };\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n if (defined && !defined(datum, i, data)) {\n closeRun();\n continue;\n }\n const xv = x(datum, i, data);\n const lowerValue = lower(datum, i, data);\n const upperValue = upper(datum, i, data);\n if (\n typeof xv !== \"number\" ||\n typeof lowerValue !== \"number\" ||\n typeof upperValue !== \"number\" ||\n !Number.isFinite(xv) ||\n !Number.isFinite(lowerValue) ||\n !Number.isFinite(upperValue)\n ) {\n closeRun();\n continue;\n }\n if (lowerValue > upperValue)\n throw new RangeError(\n `IntervalBandSeries datum at index ${i} has lower bound above upper bound.`,\n );\n const point = [\n xScale.map(xv),\n yScale.map(lowerValue),\n yScale.map(upperValue),\n ] as const;\n if (!point.every(Number.isFinite)) {\n closeRun();\n continue;\n }\n run.push(point);\n }\n closeRun();\n return (\n <Path\n {...eventProps}\n style={{ d: path, fill: bandFill, opacity: alpha, cursor }}\n />\n );\n}\n"],
|
|
5
|
+
"mappings": "AAqMI;AArMJ,SAAS,0BAA0B;AACnC,SAAS,MAAM,0BAA0B;AAOzC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAkCnC,SAAS,SACP,OACiE;AACjE,SAAO,OAAO,UAAU,aACpB,QACA,CAAC,UAAU,MAAM,KAAK;AAC5B;AAEA,SAAS,KAAK,OAA2B;AACvC,MACE,OAAO,UAAU,YACjB,iBAAiB,kBACjB,iBAAiB;AAEjB,WAAO;AACT,MAAI;AACF,yBAAqB,KAAc;AACnC,WAAO;AAAA,EACT,QAAQ;AACN,UAAM,IAAI,UAAU,mCAAmC;AAAA,EACzD;AACF;AAeO,SAAS,mBAAsB;AAAA,EACpC,MAAM;AAAA,EACN,GAAG;AAAA,EACH,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,GAA+B;AAC7B,QAAM,SAAS,mBAAmB,GAAG;AACrC,QAAM,SAAS,mBAAmB,GAAG,EAAE,IAA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CAAC,GAAGA,OAAM,MAAM,CAAC,CAAC;AAC1C,yBAAmB,MAAMA,MAAK;AAC9B,yBAAmB,MAAME,MAAK;AAC9B,WAAK,UAAU;AAAA,IACjB;AACA,UAAM,CAAC;AAAA,EACT;AACA,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,QAAQ,KAAK,CAAC;AACpB,QAAI,WAAW,CAAC,QAAQ,OAAO,GAAG,IAAI,GAAG;AACvC,eAAS;AACT;AAAA,IACF;AACA,UAAM,KAAK,EAAE,OAAO,GAAG,IAAI;AAC3B,UAAM,aAAa,MAAM,OAAO,GAAG,IAAI;AACvC,UAAM,aAAa,MAAM,OAAO,GAAG,IAAI;AACvC,QACE,OAAO,OAAO,YACd,OAAO,eAAe,YACtB,OAAO,eAAe,YACtB,CAAC,OAAO,SAAS,EAAE,KACnB,CAAC,OAAO,SAAS,UAAU,KAC3B,CAAC,OAAO,SAAS,UAAU,GAC3B;AACA,eAAS;AACT;AAAA,IACF;AACA,QAAI,aAAa;AACf,YAAM,IAAI;AAAA,QACR,qCAAqC,CAAC;AAAA,MACxC;AACF,UAAM,QAAQ;AAAA,MACZ,OAAO,IAAI,EAAE;AAAA,MACb,OAAO,IAAI,UAAU;AAAA,MACrB,OAAO,IAAI,UAAU;AAAA,IACvB;AACA,QAAI,CAAC,MAAM,MAAM,OAAO,QAAQ,GAAG;AACjC,eAAS;AACT;AAAA,IACF;AACA,QAAI,KAAK,KAAK;AAAA,EAChB;AACA,WAAS;AACT,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO,EAAE,GAAG,MAAM,MAAM,UAAU,SAAS,OAAO,OAAO;AAAA;AAAA,EAC3D;AAEJ;",
|
|
6
|
+
"names": ["upper", "x", "lower"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type FillStyle, type PibblNode, type SignalValue, type StrokeStyle } from "@pibbl/core";
|
|
2
|
+
import { type SignalStyle } from "@pibbl/core/internal";
|
|
3
|
+
import type { IntervalSeriesProps } from "./interval-series.js";
|
|
4
|
+
/** Local-pixel height and shared paint for supplied summary diamonds.
|
|
5
|
+
* @see {@link IntervalDiamondSeries}
|
|
6
|
+
*/
|
|
7
|
+
export interface IntervalDiamondSeriesStyle {
|
|
8
|
+
/** Full perpendicular height in local pixels; defaults to 12. Zero hides marks. */
|
|
9
|
+
readonly height?: number;
|
|
10
|
+
/** Diamond interior paint; defaults to #087f8c. */
|
|
11
|
+
readonly fill?: FillStyle;
|
|
12
|
+
/** Diamond outline paint; defaults to #087f8c. */
|
|
13
|
+
readonly stroke?: StrokeStyle;
|
|
14
|
+
/** Visible outline width in local pixels; defaults to 1.5. */
|
|
15
|
+
readonly strokeWidth?: number;
|
|
16
|
+
/** Outline targeting width in local pixels; defaults to strokeWidth. */
|
|
17
|
+
readonly lineInteractionWidth?: number;
|
|
18
|
+
/** Shared opacity from zero to one; defaults to 1. */
|
|
19
|
+
readonly opacity?: number;
|
|
20
|
+
/** Cursor shown over painted diamonds. */
|
|
21
|
+
readonly cursor?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Supplied summary estimates and bounds placed horizontally at categorical centers.
|
|
24
|
+
* @see {@link IntervalSeriesProps}
|
|
25
|
+
* @see {@link IntervalDiamondSeriesStyle}
|
|
26
|
+
*/
|
|
27
|
+
export interface IntervalDiamondSeriesProps<D> extends Omit<IntervalSeriesProps<D>, "style"> {
|
|
28
|
+
/** Whole-object and shallow field signals are observed; per-datum styling is not supported. */
|
|
29
|
+
readonly style?: SignalValue<SignalStyle<IntervalDiamondSeriesStyle>>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Draw supplied summary estimates as horizontal diamonds; no pooling or inference.
|
|
33
|
+
* Left/right tips map lower/upper, top/bottom map the estimate. Estimates must
|
|
34
|
+
* lie inside the supplied bounds. Missing/nonfinite rows and unknown categories
|
|
35
|
+
* are omitted; reversed bounds and invalid log values reject included rows.
|
|
36
|
+
* Diamonds share one ordinary Path target; handlers receive ordinary events.
|
|
37
|
+
* Mapping does not clamp or clip. Compose a Clip when required.
|
|
38
|
+
*
|
|
39
|
+
* @param props - Supplied rows, accessors, categorical/value scales, and shared paint.
|
|
40
|
+
* @returns One batched Pibbl Path containing the supplied diamonds in source order.
|
|
41
|
+
* @see {@link IntervalDiamondSeriesProps}
|
|
42
|
+
*/
|
|
43
|
+
export declare function IntervalDiamondSeries<D>(props: IntervalDiamondSeriesProps<D>): PibblNode;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx } from "@pibbl/core/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
Path,
|
|
4
|
+
resolveSignalValue
|
|
5
|
+
} from "@pibbl/core";
|
|
6
|
+
import { withHooksForbidden } from "@pibbl/core/internal";
|
|
7
|
+
import { lookupScale } from "./scale-context.js";
|
|
8
|
+
import { useContinuousScale } from "./use-continuous-scale.js";
|
|
9
|
+
import { finiteCoordinate, pointAccessor, pointData } from "./point-data.js";
|
|
10
|
+
import { opacity, width } from "./paint.js";
|
|
11
|
+
function IntervalDiamondSeries(props) {
|
|
12
|
+
const receiver = "IntervalDiamondSeries";
|
|
13
|
+
const {
|
|
14
|
+
data: input,
|
|
15
|
+
category: categoryInput,
|
|
16
|
+
estimate: estimateInput,
|
|
17
|
+
lower: lowerInput,
|
|
18
|
+
upper: upperInput,
|
|
19
|
+
categoryScale,
|
|
20
|
+
valueScale,
|
|
21
|
+
defined,
|
|
22
|
+
style: styleInput,
|
|
23
|
+
...events
|
|
24
|
+
} = props;
|
|
25
|
+
const categories = lookupScale(categoryScale, receiver)?.get();
|
|
26
|
+
const values = useContinuousScale(valueScale).get();
|
|
27
|
+
if (!categories || categories.type !== "point" && categories.type !== "band")
|
|
28
|
+
throw new TypeError(
|
|
29
|
+
`${receiver}: categoryScale requires PointScale or BarScale.`
|
|
30
|
+
);
|
|
31
|
+
const data = pointData(resolveSignalValue(input), receiver);
|
|
32
|
+
const category = typeof categoryInput === "function" ? categoryInput : (datum) => datum[categoryInput];
|
|
33
|
+
const estimate = pointAccessor(estimateInput), lower = pointAccessor(lowerInput), upper = pointAccessor(upperInput);
|
|
34
|
+
const specified = resolveSignalValue(styleInput) ?? {};
|
|
35
|
+
if (typeof specified !== "object" || Array.isArray(specified))
|
|
36
|
+
throw new TypeError(`${receiver}: style must be an object.`);
|
|
37
|
+
const resolved = {};
|
|
38
|
+
for (const key of Object.keys(specified)) {
|
|
39
|
+
if (![
|
|
40
|
+
"height",
|
|
41
|
+
"fill",
|
|
42
|
+
"stroke",
|
|
43
|
+
"strokeWidth",
|
|
44
|
+
"lineInteractionWidth",
|
|
45
|
+
"opacity",
|
|
46
|
+
"cursor"
|
|
47
|
+
].includes(key))
|
|
48
|
+
throw new TypeError(`${receiver}: unsupported style field ${key}.`);
|
|
49
|
+
resolved[key] = resolveSignalValue(
|
|
50
|
+
specified[key]
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
const style = resolved;
|
|
54
|
+
const halfHeight = width(style.height ?? 12, `${receiver} height`) / 2;
|
|
55
|
+
const strokeWidth = width(style.strokeWidth ?? 1.5, receiver);
|
|
56
|
+
const lineInteractionWidth = width(
|
|
57
|
+
style.lineInteractionWidth ?? strokeWidth,
|
|
58
|
+
receiver
|
|
59
|
+
);
|
|
60
|
+
const alpha = opacity(style.opacity ?? 1, receiver);
|
|
61
|
+
if (style.cursor !== void 0 && typeof style.cursor !== "string")
|
|
62
|
+
throw new TypeError(`${receiver}: cursor must be a string.`);
|
|
63
|
+
const path = new Path2D();
|
|
64
|
+
for (let i = 0; i < data.length; i++) {
|
|
65
|
+
const datum = data[i];
|
|
66
|
+
const row = withHooksForbidden(
|
|
67
|
+
`${receiver}: accessors cannot call hooks.`,
|
|
68
|
+
() => {
|
|
69
|
+
if (defined && !defined(datum, i, data)) return void 0;
|
|
70
|
+
return {
|
|
71
|
+
category: category(datum, i, data),
|
|
72
|
+
estimate: estimate(datum, i, data),
|
|
73
|
+
lower: lower(datum, i, data),
|
|
74
|
+
upper: upper(datum, i, data)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
if (!row || row.category == null || !finiteCoordinate(row.estimate) || !finiteCoordinate(row.lower) || !finiteCoordinate(row.upper))
|
|
79
|
+
continue;
|
|
80
|
+
const start = categories.map(row.category);
|
|
81
|
+
if (start === void 0) continue;
|
|
82
|
+
if (row.lower > row.upper)
|
|
83
|
+
throw new RangeError(
|
|
84
|
+
`${receiver}: lower must not exceed upper (row ${i}).`
|
|
85
|
+
);
|
|
86
|
+
if (row.estimate < row.lower || row.estimate > row.upper)
|
|
87
|
+
throw new RangeError(
|
|
88
|
+
`${receiver}: estimate must lie inside supplied bounds (row ${i}).`
|
|
89
|
+
);
|
|
90
|
+
const center = start + (categories.type === "band" ? categories.bandwidth / 2 : 0);
|
|
91
|
+
const lo = values.map(row.lower), hi = values.map(row.upper), point = values.map(row.estimate);
|
|
92
|
+
if (!(Number.isFinite(center - halfHeight) && Number.isFinite(center + halfHeight) && Number.isFinite(lo) && Number.isFinite(hi) && Number.isFinite(point)))
|
|
93
|
+
throw new RangeError(
|
|
94
|
+
`${receiver}: mapped coordinates must be finite (row ${i}).`
|
|
95
|
+
);
|
|
96
|
+
if (halfHeight === 0) continue;
|
|
97
|
+
path.moveTo(lo, center);
|
|
98
|
+
path.lineTo(point, center - halfHeight);
|
|
99
|
+
path.lineTo(hi, center);
|
|
100
|
+
path.lineTo(point, center + halfHeight);
|
|
101
|
+
path.closePath();
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ jsx(
|
|
104
|
+
Path,
|
|
105
|
+
{
|
|
106
|
+
...events,
|
|
107
|
+
style: {
|
|
108
|
+
d: path,
|
|
109
|
+
fill: style.fill ?? "#087f8c",
|
|
110
|
+
stroke: style.stroke ?? "#087f8c",
|
|
111
|
+
strokeWidth,
|
|
112
|
+
lineInteractionWidth,
|
|
113
|
+
opacity: alpha,
|
|
114
|
+
cursor: style.cursor
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
IntervalDiamondSeries
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=interval-diamond-series.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/interval-diamond-series.tsx"],
|
|
4
|
+
"sourcesContent": ["import {\n Path,\n resolveSignalValue,\n type FillStyle,\n type PibblNode,\n type SignalValue,\n type StrokeStyle,\n} from \"@pibbl/core\";\nimport { withHooksForbidden, type SignalStyle } from \"@pibbl/core/internal\";\nimport type { IntervalSeriesProps } from \"./interval-series.js\";\nimport type { BandCategory } from \"./types.js\";\nimport { lookupScale } from \"./scale-context.js\";\nimport { useContinuousScale } from \"./use-continuous-scale.js\";\nimport { finiteCoordinate, pointAccessor, pointData } from \"./point-data.js\";\nimport { opacity, width } from \"./paint.js\";\n\n/** Local-pixel height and shared paint for supplied summary diamonds.\n * @see {@link IntervalDiamondSeries}\n */\nexport interface IntervalDiamondSeriesStyle {\n /** Full perpendicular height in local pixels; defaults to 12. Zero hides marks. */\n readonly height?: number;\n /** Diamond interior paint; defaults to #087f8c. */\n readonly fill?: FillStyle;\n /** Diamond outline paint; defaults to #087f8c. */\n readonly stroke?: StrokeStyle;\n /** Visible outline width in local pixels; defaults to 1.5. */\n readonly strokeWidth?: number;\n /** Outline targeting width in local pixels; defaults to strokeWidth. */\n readonly lineInteractionWidth?: number;\n /** Shared opacity from zero to one; defaults to 1. */\n readonly opacity?: number;\n /** Cursor shown over painted diamonds. */\n readonly cursor?: string;\n}\n\n/** Supplied summary estimates and bounds placed horizontally at categorical centers.\n * @see {@link IntervalSeriesProps}\n * @see {@link IntervalDiamondSeriesStyle}\n */\nexport interface IntervalDiamondSeriesProps<D> extends Omit<\n IntervalSeriesProps<D>,\n \"style\"\n> {\n /** Whole-object and shallow field signals are observed; per-datum styling is not supported. */\n readonly style?: SignalValue<SignalStyle<IntervalDiamondSeriesStyle>>;\n}\n\n/**\n * Draw supplied summary estimates as horizontal diamonds; no pooling or inference.\n * Left/right tips map lower/upper, top/bottom map the estimate. Estimates must\n * lie inside the supplied bounds. Missing/nonfinite rows and unknown categories\n * are omitted; reversed bounds and invalid log values reject included rows.\n * Diamonds share one ordinary Path target; handlers receive ordinary events.\n * Mapping does not clamp or clip. Compose a Clip when required.\n *\n * @param props - Supplied rows, accessors, categorical/value scales, and shared paint.\n * @returns One batched Pibbl Path containing the supplied diamonds in source order.\n * @see {@link IntervalDiamondSeriesProps}\n */\nexport function IntervalDiamondSeries<D>(\n props: IntervalDiamondSeriesProps<D>,\n): PibblNode {\n const receiver = \"IntervalDiamondSeries\";\n const {\n data: input,\n category: categoryInput,\n estimate: estimateInput,\n lower: lowerInput,\n upper: upperInput,\n categoryScale,\n valueScale,\n defined,\n style: styleInput,\n ...events\n } = props;\n const categories = lookupScale(categoryScale, receiver)?.get();\n const values = useContinuousScale(valueScale).get();\n if (\n !categories ||\n (categories.type !== \"point\" && categories.type !== \"band\")\n )\n throw new TypeError(\n `${receiver}: categoryScale requires PointScale or BarScale.`,\n );\n const data = pointData(resolveSignalValue(input), receiver);\n const category =\n typeof categoryInput === \"function\"\n ? categoryInput\n : (datum: D) => datum[categoryInput] as BandCategory | null | undefined;\n const estimate = pointAccessor(estimateInput),\n lower = pointAccessor(lowerInput),\n upper = pointAccessor(upperInput);\n const specified = resolveSignalValue(styleInput) ?? {};\n if (typeof specified !== \"object\" || Array.isArray(specified))\n throw new TypeError(`${receiver}: style must be an object.`);\n const resolved: Record<string, unknown> = {};\n for (const key of Object.keys(specified)) {\n if (\n ![\n \"height\",\n \"fill\",\n \"stroke\",\n \"strokeWidth\",\n \"lineInteractionWidth\",\n \"opacity\",\n \"cursor\",\n ].includes(key)\n )\n throw new TypeError(`${receiver}: unsupported style field ${key}.`);\n resolved[key] = resolveSignalValue(\n specified[key as keyof typeof specified],\n );\n }\n const style = resolved as IntervalDiamondSeriesStyle;\n const halfHeight = width(style.height ?? 12, `${receiver} height`) / 2;\n const strokeWidth = width(style.strokeWidth ?? 1.5, receiver);\n const lineInteractionWidth = width(\n style.lineInteractionWidth ?? strokeWidth,\n receiver,\n );\n const alpha = opacity(style.opacity ?? 1, receiver);\n if (style.cursor !== undefined && typeof style.cursor !== \"string\")\n throw new TypeError(`${receiver}: cursor must be a string.`);\n const path = new Path2D();\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n const row = withHooksForbidden(\n `${receiver}: accessors cannot call hooks.`,\n () => {\n if (defined && !defined(datum, i, data)) return undefined;\n return {\n category: category(datum, i, data),\n estimate: estimate(datum, i, data),\n lower: lower(datum, i, data),\n upper: upper(datum, i, data),\n };\n },\n );\n if (\n !row ||\n row.category == null ||\n !finiteCoordinate(row.estimate) ||\n !finiteCoordinate(row.lower) ||\n !finiteCoordinate(row.upper)\n )\n continue;\n const start = categories.map(row.category);\n if (start === undefined) continue;\n if (row.lower > row.upper)\n throw new RangeError(\n `${receiver}: lower must not exceed upper (row ${i}).`,\n );\n if (row.estimate < row.lower || row.estimate > row.upper)\n throw new RangeError(\n `${receiver}: estimate must lie inside supplied bounds (row ${i}).`,\n );\n const center =\n start + (categories.type === \"band\" ? categories.bandwidth / 2 : 0);\n const lo = values.map(row.lower),\n hi = values.map(row.upper),\n point = values.map(row.estimate);\n if (!(\n Number.isFinite(center - halfHeight) &&\n Number.isFinite(center + halfHeight) &&\n Number.isFinite(lo) &&\n Number.isFinite(hi) &&\n Number.isFinite(point)\n ))\n throw new RangeError(\n `${receiver}: mapped coordinates must be finite (row ${i}).`,\n );\n if (halfHeight === 0) continue;\n path.moveTo(lo, center);\n path.lineTo(point, center - halfHeight);\n path.lineTo(hi, center);\n path.lineTo(point, center + halfHeight);\n path.closePath();\n }\n return (\n <Path\n {...events}\n style={{\n d: path,\n fill: style.fill ?? \"#087f8c\",\n stroke: style.stroke ?? \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