@pibbl/core 0.0.1 → 0.0.3-alpha.85.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.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/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.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/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/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 +15 -20
- 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 +39 -0
- package/dist/features/textures/lib/gray-scott.js.map +7 -0
- 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/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/viz/index.d.ts +79 -5
- package/dist/features/viz/index.js +145 -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 +23 -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 +148 -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/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 +124 -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/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/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 +27 -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 +123 -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/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 +106 -0
- package/dist/filters/emboss.js.map +7 -0
- 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-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 +2 -0
- package/dist/filters.js +2 -0
- package/dist/filters.js.map +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +2 -2
- package/dist/internal.d.ts +2 -0
- package/dist/internal.js +4 -0
- package/dist/internal.js.map +2 -2
- 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/events/event-facade.d.ts +13 -0
- package/dist/lib/events/event-facade.js +23 -0
- package/dist/lib/events/event-facade.js.map +2 -2
- package/dist/lib/events/propagation.js +19 -14
- package/dist/lib/events/propagation.js.map +2 -2
- package/dist/lib/execute-render.js +13 -0
- package/dist/lib/execute-render.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/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-transaction.d.ts +5 -2
- package/dist/lib/render-transaction.js +23 -1
- package/dist/lib/render-transaction.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/types.d.ts +6 -0
- package/package.json +27 -5
- 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,8 @@
|
|
|
1
|
+
import type { Signal } from "@pibbl/core";
|
|
2
|
+
import type { ResolvedBandScale, ScaleId } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reads an ancestor band scale as a stable, shared readonly signal.
|
|
5
|
+
* @param id - Ancestor scale identity. See {@link ScaleId}.
|
|
6
|
+
* @returns The reactive mapping. See {@link ResolvedBandScale} and {@link Signal}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useBarScale(id: ScaleId): Signal<ResolvedBandScale>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { scaleView } from "./scale-view.js";
|
|
2
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function useBarScale(id) {
|
|
4
|
+
return scaleView(views, id, "useBarScale", (kind) => kind === "band");
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
useBarScale
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-bar-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/use-bar-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Signal } from \"@pibbl/core\";\nimport type { ResolvedBandScale, ResolvedScale, ScaleId } from \"./types.js\";\nimport { scaleView } from \"./scale-view.js\";\nconst views = new WeakMap<Signal<ResolvedScale>, Signal<ResolvedBandScale>>();\n/**\n * Reads an ancestor band scale as a stable, shared readonly signal.\n * @param id - Ancestor scale identity. See {@link ScaleId}.\n * @returns The reactive mapping. See {@link ResolvedBandScale} and {@link Signal}.\n */\nexport function useBarScale(id: ScaleId): Signal<ResolvedBandScale> {\n return scaleView(views, id, \"useBarScale\", (kind) => kind === \"band\");\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,iBAAiB;AAC1B,MAAM,QAAQ,oBAAI,QAA0D;AAMrE,SAAS,YAAY,IAAwC;AAClE,SAAO,UAAU,OAAO,IAAI,eAAe,CAAC,SAAS,SAAS,MAAM;AACtE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Signal } from "@pibbl/core";
|
|
2
|
+
import type { ResolvedContinuousScale, ScaleId } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reads an ancestor continuous scale as a stable, shared readonly signal.
|
|
5
|
+
* @param id - Ancestor scale identity. See {@link ScaleId}.
|
|
6
|
+
* @returns The reactive mapping. See {@link ResolvedContinuousScale} and {@link Signal}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useContinuousScale(id: ScaleId): Signal<ResolvedContinuousScale>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { scaleView } from "./scale-view.js";
|
|
2
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function useContinuousScale(id) {
|
|
4
|
+
return scaleView(
|
|
5
|
+
views,
|
|
6
|
+
id,
|
|
7
|
+
"useContinuousScale",
|
|
8
|
+
(kind) => kind !== "band" && kind !== "point" && kind !== "trading-time"
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
useContinuousScale
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=use-continuous-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/use-continuous-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Signal } from \"@pibbl/core\";\nimport type {\n ResolvedContinuousScale,\n ResolvedScale,\n ScaleId,\n} from \"./types.js\";\nimport { scaleView } from \"./scale-view.js\";\nconst views = new WeakMap<\n Signal<ResolvedScale>,\n Signal<ResolvedContinuousScale>\n>();\n/**\n * Reads an ancestor continuous scale as a stable, shared readonly signal.\n * @param id - Ancestor scale identity. See {@link ScaleId}.\n * @returns The reactive mapping. See {@link ResolvedContinuousScale} and {@link Signal}.\n */\nexport function useContinuousScale(\n id: ScaleId,\n): Signal<ResolvedContinuousScale> {\n return scaleView(\n views,\n id,\n \"useContinuousScale\",\n (kind) => kind !== \"band\" && kind !== \"point\" && kind !== \"trading-time\",\n );\n}\n"],
|
|
5
|
+
"mappings": "AAMA,SAAS,iBAAiB;AAC1B,MAAM,QAAQ,oBAAI,QAGhB;AAMK,SAAS,mBACd,IACiC;AACjC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,CAAC,SAAS,SAAS,UAAU,SAAS,WAAW,SAAS;AAAA,EAC5D;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Signal } from "@pibbl/core";
|
|
2
|
+
import type { ResolvedLinearScale, ScaleId } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reads an ancestor linear scale as a stable, shared readonly signal.
|
|
5
|
+
* @param id - Ancestor scale identity. See {@link ScaleId}.
|
|
6
|
+
* @returns The reactive mapping. See {@link ResolvedLinearScale} and {@link Signal}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useLinearScale(id: ScaleId): Signal<ResolvedLinearScale>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { scaleView } from "./scale-view.js";
|
|
2
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function useLinearScale(id) {
|
|
4
|
+
return scaleView(views, id, "useLinearScale", (kind) => kind === "linear");
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
useLinearScale
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-linear-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/use-linear-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Signal } from \"@pibbl/core\";\nimport type { ResolvedLinearScale, ResolvedScale, ScaleId } from \"./types.js\";\nimport { scaleView } from \"./scale-view.js\";\nconst views = new WeakMap<Signal<ResolvedScale>, Signal<ResolvedLinearScale>>();\n/**\n * Reads an ancestor linear scale as a stable, shared readonly signal.\n * @param id - Ancestor scale identity. See {@link ScaleId}.\n * @returns The reactive mapping. See {@link ResolvedLinearScale} and {@link Signal}.\n */\nexport function useLinearScale(id: ScaleId): Signal<ResolvedLinearScale> {\n return scaleView(views, id, \"useLinearScale\", (kind) => kind === \"linear\");\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,iBAAiB;AAC1B,MAAM,QAAQ,oBAAI,QAA4D;AAMvE,SAAS,eAAe,IAA0C;AACvE,SAAO,UAAU,OAAO,IAAI,kBAAkB,CAAC,SAAS,SAAS,QAAQ;AAC3E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Signal } from "@pibbl/core";
|
|
2
|
+
import type { ResolvedLogScale, ScaleId } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reads an ancestor logarithmic scale as a stable shared readonly signal.
|
|
5
|
+
* @param id - Ancestor scale identity. See {@link ScaleId}.
|
|
6
|
+
* @returns The reactive logarithmic mapping. See {@link ResolvedLogScale}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useLogScale(id: ScaleId): Signal<ResolvedLogScale>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { scaleView } from "./scale-view.js";
|
|
2
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function useLogScale(id) {
|
|
4
|
+
return scaleView(views, id, "useLogScale", (kind) => kind === "log");
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
useLogScale
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-log-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/use-log-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Signal } from \"@pibbl/core\";\nimport type { ResolvedLogScale, ResolvedScale, ScaleId } from \"./types.js\";\nimport { scaleView } from \"./scale-view.js\";\nconst views = new WeakMap<Signal<ResolvedScale>, Signal<ResolvedLogScale>>();\n/**\n * Reads an ancestor logarithmic scale as a stable shared readonly signal.\n * @param id - Ancestor scale identity. See {@link ScaleId}.\n * @returns The reactive logarithmic mapping. See {@link ResolvedLogScale}.\n */\nexport function useLogScale(id: ScaleId): Signal<ResolvedLogScale> {\n return scaleView(views, id, \"useLogScale\", kind => kind === \"log\");\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,iBAAiB;AAC1B,MAAM,QAAQ,oBAAI,QAAyD;AAMpE,SAAS,YAAY,IAAuC;AACjE,SAAO,UAAU,OAAO,IAAI,eAAe,UAAQ,SAAS,KAAK;AACnE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Signal } from "@pibbl/core";
|
|
2
|
+
import type { ResolvedPointScale, ScaleId } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reads an ancestor point scale as a stable shared readonly signal.
|
|
5
|
+
* @param id - Ancestor scale identity. See {@link ScaleId}.
|
|
6
|
+
* @returns The reactive mapping. See {@link ResolvedPointScale}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function usePointScale(id: ScaleId): Signal<ResolvedPointScale>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { scaleView } from "./scale-view.js";
|
|
2
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function usePointScale(id) {
|
|
4
|
+
return scaleView(views, id, "usePointScale", (kind) => kind === "point");
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
usePointScale
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-point-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/use-point-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Signal } from \"@pibbl/core\";\nimport type { ResolvedPointScale, ResolvedScale, ScaleId } from \"./types.js\";\nimport { scaleView } from \"./scale-view.js\";\nconst views = new WeakMap<Signal<ResolvedScale>, Signal<ResolvedPointScale>>();\n/**\n * Reads an ancestor point scale as a stable shared readonly signal.\n * @param id - Ancestor scale identity. See {@link ScaleId}.\n * @returns The reactive mapping. See {@link ResolvedPointScale}.\n */\nexport function usePointScale(id: ScaleId): Signal<ResolvedPointScale> {\n return scaleView(views, id, \"usePointScale\", kind => kind === \"point\");\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,iBAAiB;AAC1B,MAAM,QAAQ,oBAAI,QAA2D;AAMtE,SAAS,cAAc,IAAyC;AACrE,SAAO,UAAU,OAAO,IAAI,iBAAiB,UAAQ,SAAS,OAAO;AACvE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Signal } from "@pibbl/core";
|
|
2
|
+
import type { ResolvedSymlogScale, ScaleId } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reads an ancestor symlog scale as a stable shared readonly signal.
|
|
5
|
+
* @param id - Ancestor scale identity. See {@link ScaleId}.
|
|
6
|
+
* @returns The reactive mapping. See {@link ResolvedSymlogScale}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSymlogScale(id: ScaleId): Signal<ResolvedSymlogScale>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { scaleView } from "./scale-view.js";
|
|
2
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function useSymlogScale(id) {
|
|
4
|
+
return scaleView(views, id, "useSymlogScale", (kind) => kind === "symlog");
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
useSymlogScale
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-symlog-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/use-symlog-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Signal } from \"@pibbl/core\";\nimport type { ResolvedSymlogScale, ResolvedScale, ScaleId } from \"./types.js\";\nimport { scaleView } from \"./scale-view.js\";\nconst views = new WeakMap<Signal<ResolvedScale>, Signal<ResolvedSymlogScale>>();\n/**\n * Reads an ancestor symlog scale as a stable shared readonly signal.\n * @param id - Ancestor scale identity. See {@link ScaleId}.\n * @returns The reactive mapping. See {@link ResolvedSymlogScale}.\n */\nexport function useSymlogScale(id: ScaleId): Signal<ResolvedSymlogScale> {\n return scaleView(views, id, \"useSymlogScale\", kind => kind === \"symlog\");\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,iBAAiB;AAC1B,MAAM,QAAQ,oBAAI,QAA4D;AAMvE,SAAS,eAAe,IAA0C;AACvE,SAAO,UAAU,OAAO,IAAI,kBAAkB,UAAQ,SAAS,QAAQ;AACzE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Signal } from "@pibbl/core";
|
|
2
|
+
import type { ResolvedUtcScale, ScaleId } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Reads an ancestor utc scale as a stable, shared readonly signal.
|
|
5
|
+
* @param id - Ancestor scale identity. See {@link ScaleId}.
|
|
6
|
+
* @returns The reactive mapping. See {@link ResolvedUtcScale} and {@link Signal}.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useUTCScale(id: ScaleId): Signal<ResolvedUtcScale>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { scaleView } from "./scale-view.js";
|
|
2
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function useUTCScale(id) {
|
|
4
|
+
return scaleView(views, id, "useUTCScale", (kind) => kind === "utc");
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
useUTCScale
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-utc-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/use-utc-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Signal } from \"@pibbl/core\";\nimport type { ResolvedUtcScale, ResolvedScale, ScaleId } from \"./types.js\";\nimport { scaleView } from \"./scale-view.js\";\nconst views = new WeakMap<Signal<ResolvedScale>, Signal<ResolvedUtcScale>>();\n/**\n * Reads an ancestor utc scale as a stable, shared readonly signal.\n * @param id - Ancestor scale identity. See {@link ScaleId}.\n * @returns The reactive mapping. See {@link ResolvedUtcScale} and {@link Signal}.\n */\nexport function useUTCScale(id: ScaleId): Signal<ResolvedUtcScale> {\n return scaleView(views, id, \"useUTCScale\", (kind) => kind === \"utc\");\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,iBAAiB;AAC1B,MAAM,QAAQ,oBAAI,QAAyD;AAMpE,SAAS,YAAY,IAAuC;AACjE,SAAO,UAAU,OAAO,IAAI,eAAe,CAAC,SAAS,SAAS,KAAK;AACrE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Locale used for compact UTC tick text. See {@link utcTickLabels}. */
|
|
2
|
+
export interface UTCTickLabelOptions {
|
|
3
|
+
/** BCP 47 locale, default en-US. Calendar is always Gregorian; time zone is UTC. */
|
|
4
|
+
readonly locale?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Creates compact labels with calendar context retained on every tick.
|
|
8
|
+
* @param values - At most 100 safe integer epoch milliseconds within Date range, in any order.
|
|
9
|
+
* @param options - Explicit locale; default en-US.
|
|
10
|
+
* @returns Frozen labels in input order. No geometry or scale state changes. See {@link UTCTickLabelOptions}.
|
|
11
|
+
*/
|
|
12
|
+
export declare function utcTickLabels(values: readonly number[], options?: UTCTickLabelOptions): readonly string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function utcTickLabels(values, options = {}) {
|
|
2
|
+
if (!Array.isArray(values) || values.length > 100 || values.some((v) => !Number.isSafeInteger(v) || Math.abs(v) > 864e13))
|
|
3
|
+
throw new RangeError("utcTickLabels requires at most 100 integer timestamps within Date range.");
|
|
4
|
+
const dates = values.map((value) => new Date(value));
|
|
5
|
+
const midnight = (date) => date.getUTCHours() === 0 && date.getUTCMinutes() === 0 && date.getUTCSeconds() === 0 && date.getUTCMilliseconds() === 0;
|
|
6
|
+
const months = dates.every((date) => midnight(date) && date.getUTCDate() === 1);
|
|
7
|
+
const years = months && dates.every((date) => date.getUTCMonth() === 0);
|
|
8
|
+
const days = dates.every(midnight);
|
|
9
|
+
const milliseconds = dates.some((date) => date.getUTCMilliseconds() !== 0);
|
|
10
|
+
const seconds = milliseconds || dates.some((date) => date.getUTCSeconds() !== 0);
|
|
11
|
+
const formatter = new Intl.DateTimeFormat(options.locale ?? "en-US", {
|
|
12
|
+
timeZone: "UTC",
|
|
13
|
+
calendar: "gregory",
|
|
14
|
+
year: "numeric",
|
|
15
|
+
...years ? {} : { month: "short" },
|
|
16
|
+
...months ? {} : { day: "numeric" },
|
|
17
|
+
...days ? {} : { hour: "2-digit", minute: "2-digit", hourCycle: "h23" },
|
|
18
|
+
...seconds ? { second: "2-digit" } : {},
|
|
19
|
+
...milliseconds ? { fractionalSecondDigits: 3 } : {},
|
|
20
|
+
...dates.some((date) => date.getUTCFullYear() <= 0) ? { era: "short" } : {}
|
|
21
|
+
});
|
|
22
|
+
return Object.freeze(dates.map((date) => formatter.format(date)));
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
utcTickLabels
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=utc-labels.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/utc-labels.ts"],
|
|
4
|
+
"sourcesContent": ["/** Locale used for compact UTC tick text. See {@link utcTickLabels}. */\nexport interface UTCTickLabelOptions {\n /** BCP 47 locale, default en-US. Calendar is always Gregorian; time zone is UTC. */\n readonly locale?: string;\n}\n/**\n * Creates compact labels with calendar context retained on every tick.\n * @param values - At most 100 safe integer epoch milliseconds within Date range, in any order.\n * @param options - Explicit locale; default en-US.\n * @returns Frozen labels in input order. No geometry or scale state changes. See {@link UTCTickLabelOptions}.\n */\nexport function utcTickLabels(values: readonly number[], options: UTCTickLabelOptions = {}): readonly string[] {\n if (!Array.isArray(values) || values.length > 100 || values.some(v => !Number.isSafeInteger(v) || Math.abs(v) > 8_640_000_000_000_000))\n throw new RangeError(\"utcTickLabels requires at most 100 integer timestamps within Date range.\");\n const dates = values.map(value => new Date(value));\n const midnight = (date: Date) => date.getUTCHours() === 0 && date.getUTCMinutes() === 0 && date.getUTCSeconds() === 0 && date.getUTCMilliseconds() === 0;\n const months = dates.every(date => midnight(date) && date.getUTCDate() === 1);\n const years = months && dates.every(date => date.getUTCMonth() === 0);\n const days = dates.every(midnight);\n const milliseconds = dates.some(date => date.getUTCMilliseconds() !== 0);\n const seconds = milliseconds || dates.some(date => date.getUTCSeconds() !== 0);\n const formatter = new Intl.DateTimeFormat(options.locale ?? \"en-US\", {\n timeZone: \"UTC\", calendar: \"gregory\", year: \"numeric\",\n ...(years ? {} : { month: \"short\" as const }),\n ...(months ? {} : { day: \"numeric\" as const }),\n ...(days ? {} : { hour: \"2-digit\" as const, minute: \"2-digit\" as const, hourCycle: \"h23\" as const }),\n ...(seconds ? { second: \"2-digit\" as const } : {}),\n ...(milliseconds ? { fractionalSecondDigits: 3 as const } : {}),\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AAE,wBAAwB,EAAW,IAAI,CAAC;AAAA,IAC7D,GAAI,MAAM,KAAK,UAAQ,KAAK,eAAe,KAAK,CAAC,IAAI,EAAE,KAAK,QAAiB,IAAI,CAAC;AAAA,EACpF,CAAC;AACD,SAAO,OAAO,OAAO,MAAM,IAAI,UAAQ,UAAU,OAAO,IAAI,CAAC,CAAC;AAChE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UTCScaleProps } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Provides a named utc mapping to descendant visualization components.
|
|
4
|
+
* @param props - Identity, domain, range, and children. See {@link UTCScaleProps}.
|
|
5
|
+
* @returns Descendant content within the scale scope.
|
|
6
|
+
*/
|
|
7
|
+
export declare function UTCScale(props: UTCScaleProps): import("@pibbl/core").PibblNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolveSignalValue, useLayoutBox } from "@pibbl/core";
|
|
2
|
+
import { resolveUtcScale } from "./utc-scale.js";
|
|
3
|
+
import { useScaleProvider } from "./scale-provider.js";
|
|
4
|
+
function UTCScale(props) {
|
|
5
|
+
const { width, height } = useLayoutBox();
|
|
6
|
+
useScaleProvider(props.id, "utc", () => resolveUtcScale(
|
|
7
|
+
resolveSignalValue(props.domain),
|
|
8
|
+
resolveSignalValue(props.range),
|
|
9
|
+
resolveSignalValue(props.reverse ?? false),
|
|
10
|
+
width,
|
|
11
|
+
height
|
|
12
|
+
), [props.domain, props.range, props.reverse, width, height]);
|
|
13
|
+
return props.children;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
UTCScale
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=utc-scale-component.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/utc-scale-component.ts"],
|
|
4
|
+
"sourcesContent": ["import { resolveSignalValue, useLayoutBox } from \"@pibbl/core\";\nimport type { UTCScaleProps } from \"./types.js\";\nimport { resolveUtcScale } from \"./utc-scale.js\";\nimport { useScaleProvider } from \"./scale-provider.js\";\n/**\n * Provides a named utc mapping to descendant visualization components.\n * @param props - Identity, domain, range, and children. See {@link UTCScaleProps}.\n * @returns Descendant content within the scale scope.\n */\nexport function UTCScale(props: UTCScaleProps) {\n const { width, height } = useLayoutBox();\n useScaleProvider(props.id, \"utc\", () => resolveUtcScale(\n resolveSignalValue(props.domain), resolveSignalValue(props.range),\n resolveSignalValue(props.reverse ?? false), width, height,\n ), [props.domain, props.range, props.reverse, width, height]);\n return props.children;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB,oBAAoB;AAEjD,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AAM1B,SAAS,SAAS,OAAsB;AAC7C,QAAM,EAAE,OAAO,OAAO,IAAI,aAAa;AACvC,mBAAiB,MAAM,IAAI,OAAO,MAAM;AAAA,IACtC,mBAAmB,MAAM,MAAM;AAAA,IAAG,mBAAmB,MAAM,KAAK;AAAA,IAChE,mBAAmB,MAAM,WAAW,KAAK;AAAA,IAAG;AAAA,IAAO;AAAA,EACrD,GAAG,CAAC,MAAM,QAAQ,MAAM,OAAO,MAAM,SAAS,OAAO,MAAM,CAAC;AAC5D,SAAO,MAAM;AACf;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UTCScale } from "./utc-scale-component.js";
|
|
2
|
+
import type { LinearDomain, ResolvedUtcScale, ScaleRange } from "./types.js";
|
|
3
|
+
export declare function resolveUtcScale(domain: LinearDomain, range: ScaleRange, reverse: boolean, width: number, height: number): ResolvedUtcScale;
|
|
4
|
+
/**
|
|
5
|
+
* Expands a numeric timestamp domain to enclosing UTC calendar boundaries.
|
|
6
|
+
* @param domain - Safe integer epoch-millisecond endpoints, possibly equal or descending.
|
|
7
|
+
* @param options - Optional bounded target tick count (default 5).
|
|
8
|
+
* @returns A frozen outward-rounded domain preserving its direction. See {@link LinearDomain}.
|
|
9
|
+
* @see {@link UTCScale}
|
|
10
|
+
*/
|
|
11
|
+
export declare function niceUTCDomain(domain: LinearDomain, options?: {
|
|
12
|
+
readonly count?: number;
|
|
13
|
+
}): LinearDomain;
|
|
14
|
+
/**
|
|
15
|
+
* Computes a finite numeric extent in source order, skipping only null and undefined.
|
|
16
|
+
* @param data - Source rows, which are never sorted or mutated.
|
|
17
|
+
* @param value - Accessor called once per row with its index and original array.
|
|
18
|
+
* @returns A frozen minimum/maximum pair, or undefined when every row is missing.
|
|
19
|
+
* @see {@link niceUTCDomain}
|
|
20
|
+
*/
|
|
21
|
+
export declare function extent<D>(data: readonly D[], value: (datum: D, index: number, data: readonly D[]) => number | null | undefined): LinearDomain | undefined;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { resolveLinearScale } from "./linear-scale.js";
|
|
2
|
+
const LIMIT = 864e13;
|
|
3
|
+
const DAY = 864e5;
|
|
4
|
+
function timestamp(value, integer = false) {
|
|
5
|
+
if (typeof value !== "number" || !Number.isFinite(value) || Math.abs(value) > LIMIT || integer && !Number.isSafeInteger(value))
|
|
6
|
+
throw new RangeError("UTC timestamps must be finite milliseconds within Date range; domain endpoints must be safe integers.");
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
function validateDomain(domain) {
|
|
10
|
+
if (!Array.isArray(domain) || domain.length !== 2)
|
|
11
|
+
throw new RangeError("UTC domain requires two endpoints.");
|
|
12
|
+
timestamp(domain[0], true);
|
|
13
|
+
timestamp(domain[1], true);
|
|
14
|
+
}
|
|
15
|
+
function monthAt(ordinal) {
|
|
16
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
17
|
+
date.setUTCFullYear(Math.floor(ordinal / 12), (ordinal % 12 + 12) % 12, 1);
|
|
18
|
+
return date.getTime();
|
|
19
|
+
}
|
|
20
|
+
const fixedSteps = [
|
|
21
|
+
1,
|
|
22
|
+
2,
|
|
23
|
+
5,
|
|
24
|
+
10,
|
|
25
|
+
20,
|
|
26
|
+
50,
|
|
27
|
+
100,
|
|
28
|
+
200,
|
|
29
|
+
500,
|
|
30
|
+
...[1, 2, 5, 10, 15, 30].map((n) => n * 1e3),
|
|
31
|
+
...[1, 2, 5, 10, 15, 30].map((n) => n * 6e4),
|
|
32
|
+
...[1, 2, 3, 6, 12].map((n) => n * 36e5),
|
|
33
|
+
DAY,
|
|
34
|
+
2 * DAY
|
|
35
|
+
];
|
|
36
|
+
function selectCadence(lo, hi, count) {
|
|
37
|
+
for (const step of [...fixedSteps, 7 * DAY]) {
|
|
38
|
+
const offset = step === 7 * DAY ? -3 * DAY : 0;
|
|
39
|
+
const first = Math.floor((lo - offset) / step) + 1;
|
|
40
|
+
const last = Math.ceil((hi - offset) / step) - 1;
|
|
41
|
+
if (Math.max(0, last - first + 1) <= count - 2)
|
|
42
|
+
return { first, last, at: (index) => index * step + offset };
|
|
43
|
+
}
|
|
44
|
+
const start = new Date(lo), stop = new Date(hi);
|
|
45
|
+
const lowMonth = start.getUTCFullYear() * 12 + start.getUTCMonth();
|
|
46
|
+
const highMonth = stop.getUTCFullYear() * 12 + stop.getUTCMonth();
|
|
47
|
+
const highBoundary = stop.getUTCDate() === 1 && stop.getUTCHours() === 0 && stop.getUTCMinutes() === 0 && stop.getUTCSeconds() === 0 && stop.getUTCMilliseconds() === 0;
|
|
48
|
+
const steps = [
|
|
49
|
+
1,
|
|
50
|
+
2,
|
|
51
|
+
3,
|
|
52
|
+
6,
|
|
53
|
+
...Array.from({ length: 7 }, (_, exponent) => [1, 2, 5].map((n) => 12 * n * 10 ** exponent)).flat()
|
|
54
|
+
];
|
|
55
|
+
for (const step of steps) {
|
|
56
|
+
const first = Math.floor(lowMonth / step) + 1;
|
|
57
|
+
const last = Math.floor(highMonth / step) - (highBoundary && highMonth % step === 0 ? 1 : 0);
|
|
58
|
+
if (Math.max(0, last - first + 1) <= count - 2)
|
|
59
|
+
return { first, last, at: (index) => monthAt(index * step) };
|
|
60
|
+
}
|
|
61
|
+
if (count === 2) return { first: lo + 1, last: hi - 1, at: (index) => index };
|
|
62
|
+
throw new RangeError("UTC could not select a bounded cadence.");
|
|
63
|
+
}
|
|
64
|
+
function tickCount(count) {
|
|
65
|
+
if (!Number.isInteger(count) || count < 2 || count > 100)
|
|
66
|
+
throw new RangeError("UTC ticks count must be an integer from 2 to 100.");
|
|
67
|
+
}
|
|
68
|
+
function utcTicks(domain, count) {
|
|
69
|
+
tickCount(count);
|
|
70
|
+
if (count === 2) return Object.freeze([...domain]);
|
|
71
|
+
const lo = Math.min(...domain), hi = Math.max(...domain);
|
|
72
|
+
const cadence = selectCadence(lo, hi, count);
|
|
73
|
+
const ticks = [lo];
|
|
74
|
+
for (let i = cadence.first; i <= cadence.last; i++) {
|
|
75
|
+
const value = cadence.at(i);
|
|
76
|
+
if (value > lo && value < hi) ticks.push(timestamp(value, true));
|
|
77
|
+
}
|
|
78
|
+
ticks.push(hi);
|
|
79
|
+
return Object.freeze(domain[0] > domain[1] ? ticks.reverse() : ticks);
|
|
80
|
+
}
|
|
81
|
+
function resolveUtcScale(domain, range, reverse, width, height) {
|
|
82
|
+
validateDomain(domain);
|
|
83
|
+
const linear = resolveLinearScale(domain, range, reverse, width, height);
|
|
84
|
+
return Object.freeze({
|
|
85
|
+
...linear,
|
|
86
|
+
type: "utc",
|
|
87
|
+
map: (value) => linear.map(timestamp(value)),
|
|
88
|
+
ticks: (count = 5) => utcTicks(linear.domain, count),
|
|
89
|
+
formatTick: (value) => new Date(timestamp(value)).toISOString()
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function niceUTCDomain(domain, options = {}) {
|
|
93
|
+
validateDomain(domain);
|
|
94
|
+
const count = options.count ?? 5;
|
|
95
|
+
tickCount(count);
|
|
96
|
+
if (domain[0] === domain[1]) {
|
|
97
|
+
const lo2 = Math.max(-LIMIT, Math.min(LIMIT - 2, domain[0] - 1));
|
|
98
|
+
return Object.freeze([lo2, lo2 + 2]);
|
|
99
|
+
}
|
|
100
|
+
const lo = Math.min(...domain), hi = Math.max(...domain);
|
|
101
|
+
const cadence = selectCadence(lo, hi, count);
|
|
102
|
+
const start = timestamp(cadence.at(cadence.first - 1), true);
|
|
103
|
+
const stop = timestamp(cadence.at(cadence.last + 1), true);
|
|
104
|
+
return Object.freeze(domain[0] > domain[1] ? [stop, start] : [start, stop]);
|
|
105
|
+
}
|
|
106
|
+
function extent(data, value) {
|
|
107
|
+
if (!Array.isArray(data) || typeof value !== "function") throw new TypeError("extent requires an array and accessor.");
|
|
108
|
+
let min = Infinity, max = -Infinity;
|
|
109
|
+
for (let i = 0; i < data.length; i++) {
|
|
110
|
+
const v = value(data[i], i, data);
|
|
111
|
+
if (v === null || v === void 0) continue;
|
|
112
|
+
if (typeof v !== "number" || !Number.isFinite(v)) throw new TypeError("extent values must be finite numbers or missing.");
|
|
113
|
+
min = Math.min(min, v);
|
|
114
|
+
max = Math.max(max, v);
|
|
115
|
+
}
|
|
116
|
+
return min === Infinity ? void 0 : Object.freeze([min, max]);
|
|
117
|
+
}
|
|
118
|
+
export {
|
|
119
|
+
extent,
|
|
120
|
+
niceUTCDomain,
|
|
121
|
+
resolveUtcScale
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=utc-scale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/viz/lib/utc-scale.ts"],
|
|
4
|
+
"sourcesContent": ["import type { UTCScale } from \"./utc-scale-component.js\";\nimport type { LinearDomain, ResolvedUtcScale, ScaleRange } from \"./types.js\";\nimport { resolveLinearScale } from \"./linear-scale.js\";\nconst LIMIT = 8_640_000_000_000_000;\nconst DAY = 86_400_000;\n\nfunction timestamp(value: number, integer = false): number {\n if (typeof value !== \"number\" || !Number.isFinite(value) || Math.abs(value) > LIMIT || (integer && !Number.isSafeInteger(value)))\n throw new RangeError(\"UTC timestamps must be finite milliseconds within Date range; domain endpoints must be safe integers.\");\n return value;\n}\nfunction validateDomain(domain: LinearDomain): void {\n if (!Array.isArray(domain) || domain.length !== 2)\n throw new RangeError(\"UTC domain requires two endpoints.\");\n timestamp(domain[0], true);\n timestamp(domain[1], true);\n}\ninterface Cadence {\n first: number;\n last: number;\n at(index: number): number;\n}\nfunction monthAt(ordinal: number): number {\n const date = new Date(0);\n date.setUTCFullYear(Math.floor(ordinal / 12), ((ordinal % 12) + 12) % 12, 1);\n return date.getTime();\n}\nconst fixedSteps = [1, 2, 5, 10, 20, 50, 100, 200, 500,\n ...[1, 2, 5, 10, 15, 30].map(n => n * 1000),\n ...[1, 2, 5, 10, 15, 30].map(n => n * 60_000),\n ...[1, 2, 3, 6, 12].map(n => n * 3_600_000), DAY, 2 * DAY];\nfunction selectCadence(lo: number, hi: number, count: number): Cadence {\n for (const step of [...fixedSteps, 7 * DAY]) {\n const offset = step === 7 * DAY ? -3 * DAY : 0;\n const first = Math.floor((lo - offset) / step) + 1;\n const last = Math.ceil((hi - offset) / step) - 1;\n if (Math.max(0, last - first + 1) <= count - 2)\n return { first, last, at: index => index * step + offset };\n }\n // Two Date objects for endpoint ordinals; candidate counting is arithmetic.\n const start = new Date(lo), stop = new Date(hi);\n const lowMonth = start.getUTCFullYear() * 12 + start.getUTCMonth();\n const highMonth = stop.getUTCFullYear() * 12 + stop.getUTCMonth();\n const highBoundary = stop.getUTCDate() === 1 && stop.getUTCHours() === 0 &&\n stop.getUTCMinutes() === 0 && stop.getUTCSeconds() === 0 && stop.getUTCMilliseconds() === 0;\n const steps = [1, 2, 3, 6,\n ...Array.from({ length: 7 }, (_, exponent) => [1, 2, 5].map(n => 12 * n * 10 ** exponent)).flat()];\n for (const step of steps) {\n const first = Math.floor(lowMonth / step) + 1;\n const last = Math.floor(highMonth / step) - (highBoundary && highMonth % step === 0 ? 1 : 0);\n if (Math.max(0, last - first + 1) <= count - 2)\n return { first, last, at: index => monthAt(index * step) };\n }\n // Every epoch-aligned cadence crosses year zero for a straddling domain.\n // Two-tick output is endpoints-only; keep already integral millisecond bounds\n // rather than overflow Date trying ever coarser calendar boundaries.\n if (count === 2) return { first: lo + 1, last: hi - 1, at: index => index };\n throw new RangeError(\"UTC could not select a bounded cadence.\");\n}\nfunction tickCount(count: number): void {\n if (!Number.isInteger(count) || count < 2 || count > 100)\n throw new RangeError(\"UTC ticks count must be an integer from 2 to 100.\");\n}\nfunction utcTicks(domain: LinearDomain, count: number): readonly number[] {\n tickCount(count);\n if (count === 2) return Object.freeze([...domain]);\n const lo = Math.min(...domain), hi = Math.max(...domain);\n const cadence = selectCadence(lo, hi, count);\n const ticks = [lo];\n for (let i = cadence.first; i <= cadence.last; i++) {\n const value = cadence.at(i);\n if (value > lo && value < hi) ticks.push(timestamp(value, true));\n }\n ticks.push(hi);\n return Object.freeze(domain[0] > domain[1] ? ticks.reverse() : ticks);\n}\nexport function resolveUtcScale(domain: LinearDomain, range: ScaleRange, reverse: boolean, width: number, height: number): ResolvedUtcScale {\n validateDomain(domain);\n const linear = resolveLinearScale(domain, range, reverse, width, height);\n return Object.freeze({\n ...linear,\n type: \"utc\",\n map: (value: number) => linear.map(timestamp(value)),\n ticks: (count = 5) => utcTicks(linear.domain, count),\n formatTick: (value: number) => new Date(timestamp(value)).toISOString(),\n });\n}\n\n/**\n * Expands a numeric timestamp domain to enclosing UTC calendar boundaries.\n * @param domain - Safe integer epoch-millisecond endpoints, possibly equal or descending.\n * @param options - Optional bounded target tick count (default 5).\n * @returns A frozen outward-rounded domain preserving its direction. See {@link LinearDomain}.\n * @see {@link UTCScale}\n */\nexport function niceUTCDomain(domain: LinearDomain, options: { readonly count?: number } = {}): LinearDomain {\n validateDomain(domain);\n const count = options.count ?? 5;\n tickCount(count);\n if (domain[0] === domain[1]) {\n const lo = Math.max(-LIMIT, Math.min(LIMIT - 2, domain[0] - 1));\n return Object.freeze([lo, lo + 2]);\n }\n const lo = Math.min(...domain), hi = Math.max(...domain);\n const cadence = selectCadence(lo, hi, count);\n const start = timestamp(cadence.at(cadence.first - 1), true);\n const stop = timestamp(cadence.at(cadence.last + 1), true);\n return Object.freeze(domain[0] > domain[1] ? [stop, start] : [start, stop]);\n}\n\n/**\n * Computes a finite numeric extent in source order, skipping only null and undefined.\n * @param data - Source rows, which are never sorted or mutated.\n * @param value - Accessor called once per row with its index and original array.\n * @returns A frozen minimum/maximum pair, or undefined when every row is missing.\n * @see {@link niceUTCDomain}\n */\nexport function extent<D>(data: readonly D[], value: (datum: D, index: number, data: readonly D[]) => number | null | undefined): LinearDomain | undefined {\n if (!Array.isArray(data) || typeof value !== \"function\") throw new TypeError(\"extent requires an array and accessor.\");\n let min = Infinity, max = -Infinity;\n for (let i = 0; i < data.length; i++) {\n const v = value(data[i], i, data);\n if (v === null || v === undefined) continue;\n if (typeof v !== \"number\" || !Number.isFinite(v)) throw new TypeError(\"extent values must be finite numbers or missing.\");\n min = Math.min(min, v); max = Math.max(max, v);\n }\n return min === Infinity ? undefined : Object.freeze([min, max]);\n}\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,0BAA0B;AACnC,MAAM,QAAQ;AACd,MAAM,MAAM;AAEZ,SAAS,UAAU,OAAe,UAAU,OAAe;AACzD,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,KAAK,KAAK,IAAI,KAAK,IAAI,SAAU,WAAW,CAAC,OAAO,cAAc,KAAK;AAC5H,UAAM,IAAI,WAAW,uGAAuG;AAC9H,SAAO;AACT;AACA,SAAS,eAAe,QAA4B;AAClD,MAAI,CAAC,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW;AAC9C,UAAM,IAAI,WAAW,oCAAoC;AAC3D,YAAU,OAAO,CAAC,GAAG,IAAI;AACzB,YAAU,OAAO,CAAC,GAAG,IAAI;AAC3B;AAMA,SAAS,QAAQ,SAAyB;AACxC,QAAM,OAAO,oBAAI,KAAK,CAAC;AACvB,OAAK,eAAe,KAAK,MAAM,UAAU,EAAE,IAAK,UAAU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OAA6G;AACzJ,MAAI,CAAC,MAAM,QAAQ,IAAI,KAAK,OAAO,UAAU,WAAY,OAAM,IAAI,UAAU,wCAAwC;AACrH,MAAI,MAAM,UAAU,MAAM;AAC1B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,IAAI,MAAM,KAAK,CAAC,GAAG,GAAG,IAAI;AAChC,QAAI,MAAM,QAAQ,MAAM,OAAW;AACnC,QAAI,OAAO,MAAM,YAAY,CAAC,OAAO,SAAS,CAAC,EAAG,OAAM,IAAI,UAAU,kDAAkD;AACxH,UAAM,KAAK,IAAI,KAAK,CAAC;AAAG,UAAM,KAAK,IAAI,KAAK,CAAC;AAAA,EAC/C;AACA,SAAO,QAAQ,WAAW,SAAY,OAAO,OAAO,CAAC,KAAK,GAAG,CAAC;AAChE;",
|
|
6
|
+
"names": ["lo"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type FillStyle, type StrokeStyle, type SignalValue, type PibblEventHandlers, type PibblEventParticipationOptions, type PibblNode } from "@pibbl/core";
|
|
2
|
+
import type { LineAccessor, ScaleId } from "./types.js";
|
|
3
|
+
import type { VolumeInspectionRef } from "../inspection/volume.js";
|
|
4
|
+
/** Local column presentation; color meaning is supplied by the application.
|
|
5
|
+
* @see {@link VolumeSeries}
|
|
6
|
+
*/
|
|
7
|
+
export interface VolumeSeriesStyle {
|
|
8
|
+
/** Positive column width in local logical units; default 70% spacing capped at 12. */
|
|
9
|
+
readonly width?: number;
|
|
10
|
+
/** Interior paint; defaults to teal. */
|
|
11
|
+
readonly fill?: FillStyle;
|
|
12
|
+
/** Optional column outline paint. */
|
|
13
|
+
readonly stroke?: StrokeStyle;
|
|
14
|
+
/** Nonnegative outline width in local units; default 1. */
|
|
15
|
+
readonly strokeWidth?: number;
|
|
16
|
+
/** Paint opacity from zero through one; default 1. */
|
|
17
|
+
readonly opacity?: number;
|
|
18
|
+
/** Cursor when the series owns coordinate targeting. */
|
|
19
|
+
readonly cursor?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Time-aligned volume columns with an independent numeric y-scale.
|
|
22
|
+
* @see {@link VolumeSeries}
|
|
23
|
+
*/
|
|
24
|
+
export interface VolumeSeriesProps<D> extends PibblEventHandlers, PibblEventParticipationOptions {
|
|
25
|
+
/** Original records or a signal of records; never sorted or mutated. */
|
|
26
|
+
readonly data: SignalValue<readonly D[]>;
|
|
27
|
+
/** UTC-millisecond property or callback; missing/nonfinite values skip the row. */
|
|
28
|
+
readonly time: LineAccessor<D>;
|
|
29
|
+
/** Nonnegative volume property or callback; missing/nonfinite values skip the row. */
|
|
30
|
+
readonly volume: LineAccessor<D>;
|
|
31
|
+
/** Selects source records before evaluating accessors.
|
|
32
|
+
* @param datum - Original record.
|
|
33
|
+
* @param index - Original source index.
|
|
34
|
+
* @param data - Complete source array.
|
|
35
|
+
* @returns Whether the row participates.
|
|
36
|
+
*/
|
|
37
|
+
readonly defined?: (datum: D, index: number, data: readonly D[]) => boolean;
|
|
38
|
+
/** Numeric time scale identity. */
|
|
39
|
+
readonly xScale: ScaleId;
|
|
40
|
+
/** Independent numeric volume scale identity; the baseline is zero. */
|
|
41
|
+
readonly yScale: ScaleId;
|
|
42
|
+
/** Constant presentation or a hook-free per-record resolver.
|
|
43
|
+
* @param datum - Original record.
|
|
44
|
+
* @param index - Original source index.
|
|
45
|
+
* @param data - Complete source array.
|
|
46
|
+
* @returns Column presentation.
|
|
47
|
+
*/
|
|
48
|
+
readonly style?: SignalValue<VolumeSeriesStyle> | ((datum: D, index: number, data: readonly D[]) => VolumeSeriesStyle);
|
|
49
|
+
/** Optional committed capture; importing the renderer does not import inspection queries. */
|
|
50
|
+
readonly inspection?: VolumeInspectionRef<D>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Paints source-ordered time-aligned volume columns, batching adjacent equal styles.
|
|
54
|
+
* Zero volume is recorded but has no painted coverage. Finite negative volume rejects.
|
|
55
|
+
* @param props - Original records, numeric scales, accessors and optional capture.
|
|
56
|
+
* @returns Ordinary Pibbl paint/event composition.
|
|
57
|
+
* @see {@link VolumeSeriesProps}
|
|
58
|
+
*/
|
|
59
|
+
export declare function VolumeSeries<D>({ data: input, time: timeInput, volume: volumeInput, xScale, yScale, defined, style: styleInput, inspection, pointerEvents, ...events }: VolumeSeriesProps<D>): PibblNode;
|