@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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/features/sprites/loader.ts"],
|
|
4
|
-
"sourcesContent": ["import { defineSpriteAnimation, makeFrame, type SpriteFrame, type SpriteFrameData, type SpriteSheetFormat } from './model.js';\nimport type { PibblAnimationDefinition } from '../../lib/animation/types.js';\n/** Shared decoded atlas and immutable frames/clips. Dispose after all consumers unmount. See {@link SpriteFrame}. */\nexport interface SpriteSheet {\n /** Frames indexed by atlas name or numeric grid index. */ readonly frames: Readonly<Record<string | number, SpriteFrame>>;\n /** Named, seekable animation definitions from the atlas. */ readonly animations: Readonly<Record<string, PibblAnimationDefinition<SpriteFrame>>>;\n /** Release decoded images; unmount every consumer before calling. */ readonly dispose: () => void;\n}\n/** Dimensions of a regular grid, in image pixels. See {@link SpriteFrame}. */\nexport interface SpriteGrid { /** Positive cell width in pixels. */ readonly frameWidth: number; /** Positive cell height in pixels. */ readonly frameHeight: number; /** Outer border width in pixels; defaults to zero. */ readonly margin?: number; /** Gap between cells in pixels; defaults to zero. */ readonly spacing?: number }\n/** Load a grid image or metadata through an explicitly supplied import adapter. See {@link SpriteFrame}. \n * @param url - Grid image URL or atlas metadata URL.\n * @param options - Grid dimensions or an explicit metadata format adapter.\n * @returns A decoded sprite sheet with explicit disposal ownership.\n */\nexport async function loadSpriteSheet(url: string
|
|
5
|
-
"mappings": "AAAA,SAAS,uBAAuB,iBAAiF;AAejH,eAAsB,
|
|
4
|
+
"sourcesContent": ["import { defineSpriteAnimation, makeFrame, type SpriteFrame, type SpriteFrameData, type SpriteSheetFormat } from './model.js';\nimport type { PibblAnimationDefinition } from '../../lib/animation/types.js';\n/** Shared decoded atlas and immutable frames/clips. Dispose after all consumers unmount. See {@link SpriteFrame}. */\nexport interface SpriteSheet {\n /** Frames indexed by atlas name or numeric grid index. */ readonly frames: Readonly<Record<string | number, SpriteFrame>>;\n /** Named, seekable animation definitions from the atlas. */ readonly animations: Readonly<Record<string, PibblAnimationDefinition<SpriteFrame>>>;\n /** Release decoded images; unmount every consumer before calling. */ readonly dispose: () => void;\n}\n/** Dimensions of a regular grid, in image pixels. See {@link SpriteFrame}. */\nexport interface SpriteGrid { /** Positive cell width in pixels. */ readonly frameWidth: number; /** Positive cell height in pixels. */ readonly frameHeight: number; /** Outer border width in pixels; defaults to zero. */ readonly margin?: number; /** Gap between cells in pixels; defaults to zero. */ readonly spacing?: number }\n/** Load a grid image or metadata through an explicitly supplied import adapter. See {@link SpriteFrame}. \n * @param url - Grid image URL or atlas metadata URL.\n * @param options - Grid dimensions or an explicit metadata format adapter.\n * @returns A decoded sprite sheet with explicit disposal ownership.\n */\nexport async function loadSpriteSheet(\n url: string,\n options: { readonly grid: SpriteGrid } | { readonly format: SpriteSheetFormat },\n): Promise<SpriteSheet> {\n const owner = { disposed: false };\n const images: HTMLImageElement[] = [];\n const dispose = () => { if (owner.disposed) return; owner.disposed = true; for (const image of images) image.removeAttribute('src'); };\n const load = async (source: string) => {\n const image = new globalThis.Image(); images.push(image); image.src = source; await image.decode(); return image;\n };\n try {\n let specs: readonly SpriteFrameData[];\n let clips: Readonly<Record<string, readonly { frame: string; duration: number }[]>> = {};\n if ('grid' in options) {\n const { frameWidth: w, frameHeight: h, margin = 0, spacing = 0 } = options.grid;\n if (\n !(\n Number.isInteger(w) &&\n Number.isInteger(h) &&\n Number.isInteger(margin) &&\n Number.isInteger(spacing)\n ) ||\n w <= 0 ||\n h <= 0 ||\n margin < 0 ||\n spacing < 0\n )\n throw new RangeError('Invalid sprite grid dimensions.');\n const image = await load(url);\n const frames: SpriteFrameData[] = [];\n for (let y = margin; y + h <= image.naturalHeight - margin; y += h + spacing)\n for (let x = margin; x + w <= image.naturalWidth - margin; x += w + spacing)\n frames.push({ name: String(frames.length), rect: { x, y, width: w, height: h } });\n if (!frames.length) throw new RangeError('Sprite grid contains no complete frames.');\n specs = frames;\n } else {\n const response = await fetch(url); if (!response.ok) throw new Error(`Sprite metadata failed: ${response.status}`);\n const data = options.format.parse(await response.json());\n for (const path of data.images) await load(new URL(path, new URL(url, document.baseURI)).href);\n specs = data.frames; clips = data.animations ?? {};\n }\n const frames: Record<string, SpriteFrame> = Object.create(null);\n for (const spec of specs) {\n const image = images[spec.page ?? 0], r = spec.rect;\n if (\n !image ||\n !(\n Number.isFinite(r.x) &&\n Number.isFinite(r.y) &&\n Number.isFinite(r.width) &&\n Number.isFinite(r.height)\n ) ||\n r.x < 0 ||\n r.y < 0 ||\n r.width <= 0 ||\n r.height <= 0 ||\n r.x + r.width > image.naturalWidth ||\n r.y + r.height > image.naturalHeight\n )\n throw new RangeError(`Invalid sprite rectangle: ${spec.name}`);\n if (frames[spec.name]) throw new Error(`Duplicate sprite frame: ${spec.name}`);\n const width = spec.sourceSize?.width ?? (spec.rotated ? r.height : r.width);\n const height = spec.sourceSize?.height ?? (spec.rotated ? r.width : r.height);\n const trim = { x: spec.trim?.x ?? 0, y: spec.trim?.y ?? 0 };\n if (\n !(\n Number.isFinite(width) &&\n Number.isFinite(height) &&\n Number.isFinite(trim.x) &&\n Number.isFinite(trim.y)\n ) ||\n width <= 0 ||\n height <= 0 ||\n trim.x < 0 ||\n trim.y < 0 ||\n trim.x + (spec.rotated ? r.height : r.width) > width ||\n trim.y + (spec.rotated ? r.width : r.height) > height\n )\n throw new RangeError(`Invalid sprite logical bounds: ${spec.name}`);\n frames[spec.name] = makeFrame({ ...spec, rect: Object.freeze({ ...r }), sourceSize: Object.freeze({ width, height }), trim: Object.freeze(trim), image, owner });\n }\n const animations: Record<string, PibblAnimationDefinition<SpriteFrame>> = Object.create(null);\n for (const [name, entries] of Object.entries(clips)) animations[name] = defineSpriteAnimation({ frames: entries.map(entry => {\n if (!frames[entry.frame]) throw new Error(`Unknown sprite frame: ${entry.frame}`);\n return { frame: frames[entry.frame], duration: entry.duration };\n }) });\n return Object.freeze({ frames: Object.freeze(frames), animations: Object.freeze(animations), dispose });\n } catch (error) { dispose(); throw error; }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,uBAAuB,iBAAiF;AAejH,eAAsB,gBACpB,KACA,SACsB;AACtB,QAAM,QAAQ,EAAE,UAAU,MAAM;AAChC,QAAM,SAA6B,CAAC;AACpC,QAAM,UAAU,MAAM;AAAE,QAAI,MAAM,SAAU;AAAQ,UAAM,WAAW;AAAM,eAAW,SAAS,OAAQ,OAAM,gBAAgB,KAAK;AAAA,EAAG;AACrI,QAAM,OAAO,OAAO,WAAmB;AACrC,UAAM,QAAQ,IAAI,WAAW,MAAM;AAAG,WAAO,KAAK,KAAK;AAAG,UAAM,MAAM;AAAQ,UAAM,MAAM,OAAO;AAAG,WAAO;AAAA,EAC7G;AACA,MAAI;AACF,QAAI;AACJ,QAAI,QAAkF,CAAC;AACvF,QAAI,UAAU,SAAS;AACrB,YAAM,EAAE,YAAY,GAAG,aAAa,GAAG,SAAS,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AI,CAAC,OAAO,MAAM,KAAK,EAAG,OAAM,IAAI,MAAM,yBAAyB,MAAM,KAAK,EAAE;AAChF,aAAO,EAAE,OAAO,OAAO,MAAM,KAAK,GAAG,UAAU,MAAM,SAAS;AAAA,IAChE,CAAC,EAAE,CAAC;AACJ,WAAO,OAAO,OAAO,EAAE,QAAQ,OAAO,OAAO,MAAM,GAAG,YAAY,OAAO,OAAO,UAAU,GAAG,QAAQ,CAAC;AAAA,EACxG,SAAS,OAAO;AAAE,YAAQ;AAAG,UAAM;AAAA,EAAO;AAC5C;",
|
|
6
6
|
"names": ["frames"]
|
|
7
7
|
}
|
|
@@ -16,7 +16,17 @@ export { tendrils } from "./lib/tendrils.js";
|
|
|
16
16
|
export type { TendrilsOptions, TendrilsMessage } from "./lib/tendrils.js";
|
|
17
17
|
export { lightning } from "./lib/lightning.js";
|
|
18
18
|
export type { LightningOptions, LightningMessage } from "./lib/lightning.js";
|
|
19
|
-
export type { ElectricPoint, ElectricOptions, ElectricControl } from "./lib/electric-shared.js";
|
|
20
|
-
export type { ElectricSource, ElectricSourceMessage } from "./lib/electric-sources.js";
|
|
19
|
+
export type { ElectricPoint, ElectricOptions, ElectricControl, } from "./lib/electric-shared.js";
|
|
20
|
+
export type { ElectricSource, ElectricSourceMessage, } from "./lib/electric-sources.js";
|
|
21
21
|
export { rainDrops } from "./lib/rain-drops.js";
|
|
22
22
|
export type { RainDropsOptions, RainDropsMessage } from "./lib/rain-drops.js";
|
|
23
|
+
export { stripes, checkers, woodGrain, plainWeave, twill, herringbone, } from "./lib/patterns.js";
|
|
24
|
+
export type { FabricOptions, PatternMotionOptions, StripesOptions, CheckersOptions, WoodGrainOptions, } from "./lib/patterns.js";
|
|
25
|
+
export { grayScottPresets } from "./lib/gray-scott.js";
|
|
26
|
+
export type { ReactionDiffusionPreset } from "./lib/gray-scott.js";
|
|
27
|
+
export { softNoise, ridgedNoise } from "./lib/patterns.js";
|
|
28
|
+
export type { NoiseOptions } from "./lib/patterns.js";
|
|
29
|
+
export { schnakenberg, barkley, brusselator, schnakenbergPresets, barkleyPresets, brusselatorPresets } from './lib/chemical-recipes.js';
|
|
30
|
+
export type { SchnakenbergOptions, BarkleyOptions, BrusselatorOptions } from './lib/chemical-recipes.js';
|
|
31
|
+
export { polkaDots, halftone, plaid, truchet, plaidPresets } from './lib/geometric-patterns.js';
|
|
32
|
+
export type { PolkaDotsOptions, HalftoneOptions, PlaidBand, PlaidOptions, TruchetOptions } from './lib/geometric-patterns.js';
|
|
@@ -13,19 +13,51 @@ import { waterSurface } from "./lib/water-surface.js";
|
|
|
13
13
|
import { tendrils } from "./lib/tendrils.js";
|
|
14
14
|
import { lightning } from "./lib/lightning.js";
|
|
15
15
|
import { rainDrops } from "./lib/rain-drops.js";
|
|
16
|
+
import {
|
|
17
|
+
stripes,
|
|
18
|
+
checkers,
|
|
19
|
+
woodGrain,
|
|
20
|
+
plainWeave,
|
|
21
|
+
twill,
|
|
22
|
+
herringbone
|
|
23
|
+
} from "./lib/patterns.js";
|
|
24
|
+
import { grayScottPresets } from "./lib/gray-scott.js";
|
|
25
|
+
import { softNoise, ridgedNoise } from "./lib/patterns.js";
|
|
26
|
+
import { schnakenberg, barkley, brusselator, schnakenbergPresets, barkleyPresets, brusselatorPresets } from "./lib/chemical-recipes.js";
|
|
27
|
+
import { polkaDots, halftone, plaid, truchet, plaidPresets } from "./lib/geometric-patterns.js";
|
|
16
28
|
export {
|
|
17
29
|
ProceduralTexture,
|
|
18
30
|
ReactionDiffusion,
|
|
31
|
+
barkley,
|
|
32
|
+
barkleyPresets,
|
|
33
|
+
brusselator,
|
|
34
|
+
brusselatorPresets,
|
|
19
35
|
cellular,
|
|
36
|
+
checkers,
|
|
37
|
+
grayScottPresets,
|
|
38
|
+
halftone,
|
|
39
|
+
herringbone,
|
|
20
40
|
lightning,
|
|
21
41
|
marble,
|
|
22
42
|
paper,
|
|
43
|
+
plaid,
|
|
44
|
+
plaidPresets,
|
|
45
|
+
plainWeave,
|
|
46
|
+
polkaDots,
|
|
23
47
|
rainDrops,
|
|
24
48
|
reactionDiffusion,
|
|
49
|
+
ridgedNoise,
|
|
50
|
+
schnakenberg,
|
|
51
|
+
schnakenbergPresets,
|
|
52
|
+
softNoise,
|
|
53
|
+
stripes,
|
|
25
54
|
tendrils,
|
|
26
55
|
texturePalettes,
|
|
56
|
+
truchet,
|
|
57
|
+
twill,
|
|
27
58
|
useTexture,
|
|
28
59
|
waterSurface,
|
|
29
|
-
waterWaves
|
|
60
|
+
waterWaves,
|
|
61
|
+
woodGrain
|
|
30
62
|
};
|
|
31
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/features/textures/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { ReactionDiffusion } from \"./lib/reaction-diffusion.js\";\nexport type {\n ReactionDiffusionProps,\n TextureBrush,\n} from \"./lib/reaction-diffusion.js\";\nexport { texturePalettes } from \"./lib/palette.js\";\nexport type { TexturePalette, TextureResolution } from \"./lib/palette.js\";\nexport { ProceduralTexture } from \"./lib/procedural-texture.js\";\nexport type { ProceduralTextureProps } from \"./lib/procedural-texture.js\";\nexport type { TextureKind } from \"./lib/material-field.js\";\nexport type {\n TextureRenderer,\n TextureRenderFrame,\n} from \"./lib/presentation.js\";\nexport {\n useTexture,\n marble,\n paper,\n cellular,\n reactionDiffusion,\n} from \"./lib/definitions.js\";\nexport type {\n MaterialOptions,\n ReactionDiffusionOptions,\n InkMessage,\n} from \"./lib/definitions.js\";\nexport { waterWaves } from \"./lib/water-waves.js\";\nexport type {\n WaterWavesOptions,\n WaterWavesMessage,\n} from \"./lib/water-waves.js\";\nexport { waterSurface } from \"./lib/water-surface.js\";\nexport type {\n WaterSurfaceMessage,\n WaterSurfaceObstacle,\n WaterSurfaceOptions,\n} from \"./lib/water-surface.js\";\nexport { tendrils } from \"./lib/tendrils.js\";\nexport type { TendrilsOptions, TendrilsMessage } from \"./lib/tendrils.js\";\nexport { lightning } from \"./lib/lightning.js\";\nexport type { LightningOptions, LightningMessage } from \"./lib/lightning.js\";\nexport type {
|
|
5
|
-
"mappings": "AAAA,SAAS,yBAAyB;AAKlC,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB;AAOlC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,kBAAkB;AAK3B,SAAS,oBAAoB;AAM7B,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;
|
|
4
|
+
"sourcesContent": ["export { ReactionDiffusion } from \"./lib/reaction-diffusion.js\";\nexport type {\n ReactionDiffusionProps,\n TextureBrush,\n} from \"./lib/reaction-diffusion.js\";\nexport { texturePalettes } from \"./lib/palette.js\";\nexport type { TexturePalette, TextureResolution } from \"./lib/palette.js\";\nexport { ProceduralTexture } from \"./lib/procedural-texture.js\";\nexport type { ProceduralTextureProps } from \"./lib/procedural-texture.js\";\nexport type { TextureKind } from \"./lib/material-field.js\";\nexport type {\n TextureRenderer,\n TextureRenderFrame,\n} from \"./lib/presentation.js\";\nexport {\n useTexture,\n marble,\n paper,\n cellular,\n reactionDiffusion,\n} from \"./lib/definitions.js\";\nexport type {\n MaterialOptions,\n ReactionDiffusionOptions,\n InkMessage,\n} from \"./lib/definitions.js\";\nexport { waterWaves } from \"./lib/water-waves.js\";\nexport type {\n WaterWavesOptions,\n WaterWavesMessage,\n} from \"./lib/water-waves.js\";\nexport { waterSurface } from \"./lib/water-surface.js\";\nexport type {\n WaterSurfaceMessage,\n WaterSurfaceObstacle,\n WaterSurfaceOptions,\n} from \"./lib/water-surface.js\";\nexport { tendrils } from \"./lib/tendrils.js\";\nexport type { TendrilsOptions, TendrilsMessage } from \"./lib/tendrils.js\";\nexport { lightning } from \"./lib/lightning.js\";\nexport type { LightningOptions, LightningMessage } from \"./lib/lightning.js\";\nexport type {\n ElectricPoint,\n ElectricOptions,\n ElectricControl,\n} from \"./lib/electric-shared.js\";\nexport type {\n ElectricSource,\n ElectricSourceMessage,\n} from \"./lib/electric-sources.js\";\n\nexport { rainDrops } from \"./lib/rain-drops.js\";\nexport type { RainDropsOptions, RainDropsMessage } from \"./lib/rain-drops.js\";\n\nexport {\n stripes,\n checkers,\n woodGrain,\n plainWeave,\n twill,\n herringbone,\n} from \"./lib/patterns.js\";\nexport type {\n FabricOptions,\n PatternMotionOptions,\n StripesOptions,\n CheckersOptions,\n WoodGrainOptions,\n} from \"./lib/patterns.js\";\nexport { grayScottPresets } from \"./lib/gray-scott.js\";\nexport type { ReactionDiffusionPreset } from \"./lib/gray-scott.js\";\n\nexport { softNoise, ridgedNoise } from \"./lib/patterns.js\";\nexport type { NoiseOptions } from \"./lib/patterns.js\";\n\nexport { schnakenberg, barkley, brusselator, schnakenbergPresets, barkleyPresets, brusselatorPresets } from './lib/chemical-recipes.js';\nexport type { SchnakenbergOptions, BarkleyOptions, BrusselatorOptions } from './lib/chemical-recipes.js';\n\nexport { polkaDots, halftone, plaid, truchet, plaidPresets } from './lib/geometric-patterns.js';\nexport type { PolkaDotsOptions, HalftoneOptions, PlaidBand, PlaidOptions, TruchetOptions } from './lib/geometric-patterns.js';\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,yBAAyB;AAKlC,SAAS,uBAAuB;AAEhC,SAAS,yBAAyB;AAOlC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,kBAAkB;AAK3B,SAAS,oBAAoB;AAM7B,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;AAY1B,SAAS,iBAAiB;AAG1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAS,wBAAwB;AAGjC,SAAS,WAAW,mBAAmB;AAGvC,SAAS,cAAc,SAAS,aAAa,qBAAqB,gBAAgB,0BAA0B;AAG5G,SAAS,WAAW,UAAU,OAAO,SAAS,oBAAoB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Private periodic finite-difference state; presentation adds a duplicate seam row/column. */
|
|
2
|
+
export interface ChemicalConfig {
|
|
3
|
+
readonly a: number;
|
|
4
|
+
readonly b: number;
|
|
5
|
+
readonly epsilon: number;
|
|
6
|
+
readonly diffusionU: number;
|
|
7
|
+
readonly diffusionV: number;
|
|
8
|
+
readonly seed: number;
|
|
9
|
+
readonly initialNoise: number;
|
|
10
|
+
readonly warmupSteps: number;
|
|
11
|
+
readonly speed: number;
|
|
12
|
+
readonly paused: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface Model {
|
|
15
|
+
readonly equilibrium: (c: ChemicalConfig) => readonly [number, number];
|
|
16
|
+
readonly reaction: (u: number, v: number, c: ChemicalConfig) => readonly [number, number];
|
|
17
|
+
readonly excite: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const schnakenbergModel: Model;
|
|
20
|
+
export declare const brusselatorModel: Model;
|
|
21
|
+
export declare const barkleyModel: Model;
|
|
22
|
+
export declare class ChemicalField {
|
|
23
|
+
private readonly options;
|
|
24
|
+
u: Float32Array;
|
|
25
|
+
v: Float32Array;
|
|
26
|
+
private nextU;
|
|
27
|
+
private nextV;
|
|
28
|
+
private maxU;
|
|
29
|
+
private maxV;
|
|
30
|
+
readonly width: number;
|
|
31
|
+
readonly height: number;
|
|
32
|
+
readonly baseline: number;
|
|
33
|
+
constructor(options: {
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
config: ChemicalConfig;
|
|
37
|
+
model: Model;
|
|
38
|
+
});
|
|
39
|
+
advance(count: number): void;
|
|
40
|
+
paint(options: {
|
|
41
|
+
u: number;
|
|
42
|
+
v: number;
|
|
43
|
+
radius: number;
|
|
44
|
+
strength: number;
|
|
45
|
+
}): void;
|
|
46
|
+
stir(options: {
|
|
47
|
+
u: number;
|
|
48
|
+
v: number;
|
|
49
|
+
du: number;
|
|
50
|
+
dv: number;
|
|
51
|
+
radius: number;
|
|
52
|
+
}): void;
|
|
53
|
+
intensity(index: number): number;
|
|
54
|
+
dispose(): void;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
const schnakenbergModel = {
|
|
2
|
+
equilibrium: (c) => [c.a + c.b, c.b / (c.a + c.b) ** 2],
|
|
3
|
+
reaction: (u, v, c) => {
|
|
4
|
+
const q = u * u * v;
|
|
5
|
+
return [c.a - u + q, c.b - q];
|
|
6
|
+
},
|
|
7
|
+
excite: false
|
|
8
|
+
};
|
|
9
|
+
const brusselatorModel = {
|
|
10
|
+
equilibrium: (c) => [c.a, c.b / c.a],
|
|
11
|
+
reaction: (u, v, c) => {
|
|
12
|
+
const q = u * u * v;
|
|
13
|
+
return [c.a - (c.b + 1) * u + q, c.b * u - q];
|
|
14
|
+
},
|
|
15
|
+
excite: false
|
|
16
|
+
};
|
|
17
|
+
const barkleyModel = {
|
|
18
|
+
equilibrium: () => [0, 0],
|
|
19
|
+
reaction: (u, v, c) => [
|
|
20
|
+
u * (1 - u) * (u - (v + c.b) / c.a) / c.epsilon,
|
|
21
|
+
u - v
|
|
22
|
+
],
|
|
23
|
+
excite: true
|
|
24
|
+
};
|
|
25
|
+
function hash(i, seed) {
|
|
26
|
+
let n = Math.imul(i ^ seed, 73244475);
|
|
27
|
+
n = Math.imul(n ^ n >>> 16, 73244475);
|
|
28
|
+
return ((n ^ n >>> 16) >>> 0) / 4294967295;
|
|
29
|
+
}
|
|
30
|
+
const wrap = (value, size) => (value % size + size) % size;
|
|
31
|
+
class ChemicalField {
|
|
32
|
+
constructor(options) {
|
|
33
|
+
this.options = options;
|
|
34
|
+
this.width = options.width;
|
|
35
|
+
this.height = options.height;
|
|
36
|
+
const n = this.width * this.height;
|
|
37
|
+
this.u = new Float32Array(n);
|
|
38
|
+
this.v = new Float32Array(n);
|
|
39
|
+
this.nextU = new Float32Array(n);
|
|
40
|
+
this.nextV = new Float32Array(n);
|
|
41
|
+
const c = options.config, [u, v] = options.model.equilibrium(c);
|
|
42
|
+
this.baseline = options.model.excite ? 1 : u;
|
|
43
|
+
for (let y = 0; y < this.height; y++)
|
|
44
|
+
for (let x = 0; x < this.width; x++) {
|
|
45
|
+
const i = y * this.width + x, noise = hash(i, c.seed) - 0.5;
|
|
46
|
+
if (options.model.excite) {
|
|
47
|
+
const split = 0.5 + (hash(0, c.seed) - 0.5) * 0.08;
|
|
48
|
+
this.u[i] = (x > this.width * 0.22 && x < this.width * 0.5 && y < this.height * split ? 1 : 0) * (1 - c.initialNoise * 0.5) + c.initialNoise * Math.max(0, noise);
|
|
49
|
+
this.v[i] = y >= this.height * split ? 0.5 : 0;
|
|
50
|
+
} else {
|
|
51
|
+
this.u[i] = u * (1 + c.initialNoise * noise);
|
|
52
|
+
this.v[i] = v * (1 + c.initialNoise * (hash(i, c.seed ^ 1367130551) - 0.5));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
this.maxU = Math.max(1, u * 1.5);
|
|
56
|
+
this.maxV = Math.max(1, v * 1.5);
|
|
57
|
+
this.advance(c.warmupSteps);
|
|
58
|
+
}
|
|
59
|
+
options;
|
|
60
|
+
u;
|
|
61
|
+
v;
|
|
62
|
+
nextU;
|
|
63
|
+
nextV;
|
|
64
|
+
maxU = 1;
|
|
65
|
+
maxV = 1;
|
|
66
|
+
width;
|
|
67
|
+
height;
|
|
68
|
+
baseline;
|
|
69
|
+
advance(count) {
|
|
70
|
+
const { config: c, model } = this.options, w = this.width, h = this.height;
|
|
71
|
+
for (let step = 0; step < count; step++) {
|
|
72
|
+
const stiffness = model.excite ? 1 / c.epsilon : 1 + this.maxU * this.maxU + 2 * this.maxU * this.maxV + c.b;
|
|
73
|
+
const dt = Math.min(
|
|
74
|
+
0.05,
|
|
75
|
+
0.2 / Math.max(1e-3, c.diffusionU, c.diffusionV),
|
|
76
|
+
0.1 / stiffness
|
|
77
|
+
);
|
|
78
|
+
let maxU = 0, maxV = 0;
|
|
79
|
+
for (let y = 0; y < h; y++) {
|
|
80
|
+
const row = y * w, above = (y === 0 ? h - 1 : y - 1) * w, below = (y === h - 1 ? 0 : y + 1) * w;
|
|
81
|
+
for (let x = 0; x < w; x++) {
|
|
82
|
+
const i = row + x, left = row + (x === 0 ? w - 1 : x - 1), right = row + (x === w - 1 ? 0 : x + 1);
|
|
83
|
+
const u = this.u[i], v = this.v[i];
|
|
84
|
+
const lapU = this.u[left] + this.u[right] + this.u[above + x] + this.u[below + x] - 4 * u;
|
|
85
|
+
const lapV = this.v[left] + this.v[right] + this.v[above + x] + this.v[below + x] - 4 * v;
|
|
86
|
+
const [ru, rv] = model.reaction(u, v, c);
|
|
87
|
+
const nu = Math.max(0, u + dt * (c.diffusionU * lapU + ru));
|
|
88
|
+
const nv = Math.max(0, v + dt * (c.diffusionV * lapV + rv));
|
|
89
|
+
if (!Number.isFinite(nu) || !Number.isFinite(nv))
|
|
90
|
+
throw new RangeError(
|
|
91
|
+
"Reaction-diffusion parameters produced a nonfinite field."
|
|
92
|
+
);
|
|
93
|
+
this.nextU[i] = nu;
|
|
94
|
+
this.nextV[i] = nv;
|
|
95
|
+
maxU = Math.max(maxU, nu);
|
|
96
|
+
maxV = Math.max(maxV, nv);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
[this.u, this.nextU] = [this.nextU, this.u];
|
|
100
|
+
[this.v, this.nextV] = [this.nextV, this.v];
|
|
101
|
+
this.maxU = maxU;
|
|
102
|
+
this.maxV = maxV;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
paint(options) {
|
|
106
|
+
const { width: w, height: h } = this;
|
|
107
|
+
for (let y = 0; y < h; y++)
|
|
108
|
+
for (let x = 0; x < w; x++) {
|
|
109
|
+
const dx = wrap(x - options.u * w + w / 2, w) - w / 2, dy = wrap(y - options.v * h + h / 2, h) - h / 2;
|
|
110
|
+
const distance = Math.hypot(dx, dy) / options.radius;
|
|
111
|
+
if (distance >= 1) continue;
|
|
112
|
+
const dose = options.strength * (1 - distance * distance) ** 2;
|
|
113
|
+
const i = y * w + x;
|
|
114
|
+
this.u[i] = Math.max(
|
|
115
|
+
this.u[i],
|
|
116
|
+
this.options.model.excite ? dose : this.baseline * (1 + 2 * dose)
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
this.maxU = Math.max(this.maxU, this.baseline * 3);
|
|
120
|
+
}
|
|
121
|
+
stir(options) {
|
|
122
|
+
const w = this.width, h = this.height;
|
|
123
|
+
const sample = (field, x, y) => {
|
|
124
|
+
x = wrap(x, w);
|
|
125
|
+
y = wrap(y, h);
|
|
126
|
+
const ix = Math.floor(x), iy = Math.floor(y), fx = x - ix, fy = y - iy;
|
|
127
|
+
const x1 = (ix + 1) % w, y1 = (iy + 1) % h;
|
|
128
|
+
return (field[iy * w + ix] * (1 - fx) + field[iy * w + x1] * fx) * (1 - fy) + (field[y1 * w + ix] * (1 - fx) + field[y1 * w + x1] * fx) * fy;
|
|
129
|
+
};
|
|
130
|
+
for (let y = 0; y < h; y++)
|
|
131
|
+
for (let x = 0; x < w; x++) {
|
|
132
|
+
const dx = wrap(x - options.u * w + w / 2, w) - w / 2, dy = wrap(y - options.v * h + h / 2, h) - h / 2;
|
|
133
|
+
const t = Math.max(0, 1 - Math.hypot(dx, dy) / options.radius), weight = t * t * (3 - 2 * t);
|
|
134
|
+
const px = x - options.du * w * weight, py = y - options.dv * h * weight, i = y * w + x;
|
|
135
|
+
this.nextU[i] = sample(this.u, px, py);
|
|
136
|
+
this.nextV[i] = sample(this.v, px, py);
|
|
137
|
+
}
|
|
138
|
+
[this.u, this.nextU] = [this.nextU, this.u];
|
|
139
|
+
[this.v, this.nextV] = [this.nextV, this.v];
|
|
140
|
+
}
|
|
141
|
+
intensity(index) {
|
|
142
|
+
return this.options.model.excite ? this.u[index] : this.u[index] / (2 * this.baseline);
|
|
143
|
+
}
|
|
144
|
+
dispose() {
|
|
145
|
+
this.u = this.v = this.nextU = this.nextV = new Float32Array(0);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
ChemicalField,
|
|
150
|
+
barkleyModel,
|
|
151
|
+
brusselatorModel,
|
|
152
|
+
schnakenbergModel
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=chemical-field.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/features/textures/lib/chemical-field.ts"],
|
|
4
|
+
"sourcesContent": ["/** Private periodic finite-difference state; presentation adds a duplicate seam row/column. */\nexport interface ChemicalConfig {\n readonly a: number;\n readonly b: number;\n readonly epsilon: number;\n readonly diffusionU: number;\n readonly diffusionV: number;\n readonly seed: number;\n readonly initialNoise: number;\n readonly warmupSteps: number;\n readonly speed: number;\n readonly paused: boolean;\n}\ninterface Model {\n readonly equilibrium: (c: ChemicalConfig) => readonly [number, number];\n readonly reaction: (\n u: number,\n v: number,\n c: ChemicalConfig,\n ) => readonly [number, number];\n readonly excite: boolean;\n}\nexport const schnakenbergModel: Model = {\n equilibrium: (c) => [c.a + c.b, c.b / (c.a + c.b) ** 2],\n reaction: (u, v, c) => {\n const q = u * u * v;\n return [c.a - u + q, c.b - q];\n },\n excite: false,\n};\nexport const brusselatorModel: Model = {\n equilibrium: (c) => [c.a, c.b / c.a],\n reaction: (u, v, c) => {\n const q = u * u * v;\n return [c.a - (c.b + 1) * u + q, c.b * u - q];\n },\n excite: false,\n};\nexport const barkleyModel: Model = {\n equilibrium: () => [0, 0],\n reaction: (u, v, c) => [\n (u * (1 - u) * (u - (v + c.b) / c.a)) / c.epsilon,\n u - v,\n ],\n excite: true,\n};\nfunction hash(i: number, seed: number) {\n let n = Math.imul(i ^ seed, 0x45d9f3b);\n n = Math.imul(n ^ (n >>> 16), 0x45d9f3b);\n return ((n ^ (n >>> 16)) >>> 0) / 0xffffffff;\n}\nconst wrap = (value: number, size: number) => ((value % size) + size) % size;\nexport class ChemicalField {\n u: Float32Array;\n v: Float32Array;\n private nextU: Float32Array;\n private nextV: Float32Array;\n private maxU = 1;\n private maxV = 1;\n readonly width: number;\n readonly height: number;\n readonly baseline: number;\n constructor(\n private readonly options: {\n width: number;\n height: number;\n config: ChemicalConfig;\n model: Model;\n },\n ) {\n this.width = options.width;\n this.height = options.height;\n const n = this.width * this.height;\n this.u = new Float32Array(n);\n this.v = new Float32Array(n);\n this.nextU = new Float32Array(n);\n this.nextV = new Float32Array(n);\n const c = options.config,\n [u, v] = options.model.equilibrium(c);\n this.baseline = options.model.excite ? 1 : u;\n for (let y = 0; y < this.height; y++)\n for (let x = 0; x < this.width; x++) {\n const i = y * this.width + x,\n noise = hash(i, c.seed) - 0.5;\n if (options.model.excite) {\n const split = 0.5 + (hash(0, c.seed) - 0.5) * 0.08;\n this.u[i] =\n (x > this.width * 0.22 &&\n x < this.width * 0.5 &&\n y < this.height * split\n ? 1\n : 0) *\n (1 - c.initialNoise * 0.5) +\n c.initialNoise * Math.max(0, noise);\n this.v[i] = y >= this.height * split ? 0.5 : 0;\n } else {\n this.u[i] = u * (1 + c.initialNoise * noise);\n this.v[i] =\n v * (1 + c.initialNoise * (hash(i, c.seed ^ 0x517cc1b7) - 0.5));\n }\n }\n this.maxU = Math.max(1, u * 1.5);\n this.maxV = Math.max(1, v * 1.5);\n this.advance(c.warmupSteps);\n }\n advance(count: number) {\n const { config: c, model } = this.options,\n w = this.width,\n h = this.height;\n for (let step = 0; step < count; step++) {\n // Euler diffusion CFL and reaction stiffness limits. No user-facing time-step knob.\n const stiffness = model.excite\n ? 1 / c.epsilon\n : 1 + this.maxU * this.maxU + 2 * this.maxU * this.maxV + c.b;\n const dt = Math.min(\n 0.05,\n 0.2 / Math.max(0.001, c.diffusionU, c.diffusionV),\n 0.1 / stiffness,\n );\n let maxU = 0,\n maxV = 0;\n for (let y = 0; y < h; y++) {\n const row = y * w,\n above = (y === 0 ? h - 1 : y - 1) * w,\n below = (y === h - 1 ? 0 : y + 1) * w;\n for (let x = 0; x < w; x++) {\n const i = row + x,\n left = row + (x === 0 ? w - 1 : x - 1),\n right = row + (x === w - 1 ? 0 : x + 1);\n const u = this.u[i]!,\n v = this.v[i]!;\n const lapU =\n this.u[left]! +\n this.u[right]! +\n this.u[above + x]! +\n this.u[below + x]! -\n 4 * u;\n const lapV =\n this.v[left]! +\n this.v[right]! +\n this.v[above + x]! +\n this.v[below + x]! -\n 4 * v;\n const [ru, rv] = model.reaction(u, v, c);\n const nu = Math.max(0, u + dt * (c.diffusionU * lapU + ru));\n const nv = Math.max(0, v + dt * (c.diffusionV * lapV + rv));\n if (!Number.isFinite(nu) || !Number.isFinite(nv))\n throw new RangeError(\n \"Reaction-diffusion parameters produced a nonfinite field.\",\n );\n this.nextU[i] = nu;\n this.nextV[i] = nv;\n maxU = Math.max(maxU, nu);\n maxV = Math.max(maxV, nv);\n }\n }\n [this.u, this.nextU] = [this.nextU, this.u];\n [this.v, this.nextV] = [this.nextV, this.v];\n this.maxU = maxU;\n this.maxV = maxV;\n }\n }\n paint(options: { u: number; v: number; radius: number; strength: number }) {\n const { width: w, height: h } = this;\n for (let y = 0; y < h; y++)\n for (let x = 0; x < w; x++) {\n const dx = wrap(x - options.u * w + w / 2, w) - w / 2,\n dy = wrap(y - options.v * h + h / 2, h) - h / 2;\n const distance = Math.hypot(dx, dy) / options.radius;\n if (distance >= 1) continue;\n const dose = options.strength * (1 - distance * distance) ** 2;\n const i = y * w + x;\n this.u[i] = Math.max(\n this.u[i]!,\n this.options.model.excite ? dose : this.baseline * (1 + 2 * dose),\n );\n }\n this.maxU = Math.max(this.maxU, this.baseline * 3);\n }\n stir(options: {\n u: number;\n v: number;\n du: number;\n dv: number;\n radius: number;\n }) {\n const w = this.width,\n h = this.height;\n const sample = (field: Float32Array, x: number, y: number) => {\n x = wrap(x, w);\n y = wrap(y, h);\n const ix = Math.floor(x),\n iy = Math.floor(y),\n fx = x - ix,\n fy = y - iy;\n const x1 = (ix + 1) % w,\n y1 = (iy + 1) % h;\n return (\n (field[iy * w + ix]! * (1 - fx) + field[iy * w + x1]! * fx) * (1 - fy) +\n (field[y1 * w + ix]! * (1 - fx) + field[y1 * w + x1]! * fx) * fy\n );\n };\n for (let y = 0; y < h; y++)\n for (let x = 0; x < w; x++) {\n const dx = wrap(x - options.u * w + w / 2, w) - w / 2,\n dy = wrap(y - options.v * h + h / 2, h) - h / 2;\n const t = Math.max(0, 1 - Math.hypot(dx, dy) / options.radius),\n weight = t * t * (3 - 2 * t);\n const px = x - options.du * w * weight,\n py = y - options.dv * h * weight,\n i = y * w + x;\n this.nextU[i] = sample(this.u, px, py);\n this.nextV[i] = sample(this.v, px, py);\n }\n [this.u, this.nextU] = [this.nextU, this.u];\n [this.v, this.nextV] = [this.nextV, this.v];\n }\n intensity(index: number) {\n return this.options.model.excite\n ? this.u[index]!\n : this.u[index]! / (2 * this.baseline);\n }\n dispose() {\n this.u = this.v = this.nextU = this.nextV = new Float32Array(0);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAsBO,MAAM,oBAA2B;AAAA,EACtC,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC;AAAA,EACtD,UAAU,CAAC,GAAG,GAAG,MAAM;AACrB,UAAM,IAAI,IAAI,IAAI;AAClB,WAAO,CAAC,EAAE,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC;AAAA,EAC9B;AAAA,EACA,QAAQ;AACV;AACO,MAAM,mBAA0B;AAAA,EACrC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAAA,EACnC,UAAU,CAAC,GAAG,GAAG,MAAM;AACrB,UAAM,IAAI,IAAI,IAAI;AAClB,WAAO,CAAC,EAAE,KAAK,EAAE,IAAI,KAAK,IAAI,GAAG,EAAE,IAAI,IAAI,CAAC;AAAA,EAC9C;AAAA,EACA,QAAQ;AACV;AACO,MAAM,eAA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C,IAAI,IAAI,GAClD,KAAK,KAAK,IAAI,QAAQ,IAAI,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI;AAChD,cAAM,IAAI,KAAK,IAAI,GAAG,IAAI,KAAK,MAAM,IAAI,EAAE,IAAI,QAAQ,MAAM,GAC3D,SAAS,IAAI,KAAK,IAAI,IAAI;AAC5B,cAAM,KAAK,IAAI,QAAQ,KAAK,IAAI,QAC9B,KAAK,IAAI,QAAQ,KAAK,IAAI,QAC1B,IAAI,IAAI,IAAI;AACd,aAAK,MAAM,CAAC,IAAI,OAAO,KAAK,GAAG,IAAI,EAAE;AACrC,aAAK,MAAM,CAAC,IAAI,OAAO,KAAK,GAAG,IAAI,EAAE;AAAA,MACvC;AACF,KAAC,KAAK,GAAG,KAAK,KAAK,IAAI,CAAC,KAAK,OAAO,KAAK,CAAC;AAC1C,KAAC,KAAK,GAAG,KAAK,KAAK,IAAI,CAAC,KAAK,OAAO,KAAK,CAAC;AAAA,EAC5C;AAAA,EACA,UAAU,OAAe;AACvB,WAAO,KAAK,QAAQ,MAAM,SACtB,KAAK,EAAE,KAAK,IACZ,KAAK,EAAE,KAAK,KAAM,IAAI,KAAK;AAAA,EACjC;AAAA,EACA,UAAU;AACR,SAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,KAAK,QAAQ,IAAI,aAAa,CAAC;AAAA,EAChE;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { type TextureRecipe } from "@pibbl/core";
|
|
2
|
+
import type { InkMessage } from "./definitions.js";
|
|
3
|
+
/** Shared simulation timing, diffusion and initialization controls. See {@link SchnakenbergOptions}. */
|
|
4
|
+
interface ChemicalOptions {
|
|
5
|
+
/** Unsigned 32-bit initialization seed; default 42. See {@link schnakenberg}. */
|
|
6
|
+
readonly seed?: number;
|
|
7
|
+
/** Activator diffusion per grid cell, finite 0–32. See {@link schnakenberg}. */
|
|
8
|
+
readonly diffusionU?: number;
|
|
9
|
+
/** Inhibitor diffusion per grid cell, finite 0–32. See {@link schnakenberg}. */
|
|
10
|
+
readonly diffusionV?: number;
|
|
11
|
+
/** Initial seeded disturbance amplitude, finite 0–1; default 0.1. See {@link schnakenberg}. */
|
|
12
|
+
readonly initialNoise?: number;
|
|
13
|
+
/** Initialization steps, integer 0–12000; default 4096. See {@link schnakenberg}. */
|
|
14
|
+
readonly warmupSteps?: number;
|
|
15
|
+
/** Multiplier of 480 numerical steps/second, finite 0–4; default 1. Zero idles. See {@link schnakenberg}. */
|
|
16
|
+
readonly speed?: number;
|
|
17
|
+
/** Initially suspend stepping; default false. See {@link InkMessage}. */
|
|
18
|
+
readonly paused?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Schnakenberg production rates, diffusion and initialization. See {@link schnakenberg}. */
|
|
21
|
+
export interface SchnakenbergOptions extends ChemicalOptions {
|
|
22
|
+
/** Activator source, finite 0.01–2; default 0.1. See {@link schnakenberg}. */
|
|
23
|
+
readonly a?: number;
|
|
24
|
+
/** Inhibitor source, finite 0.01–2; default 0.9. See {@link schnakenberg}. */
|
|
25
|
+
readonly b?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Excitability, recovery, diffusion and initialization. See {@link barkley}. */
|
|
28
|
+
export interface BarkleyOptions extends ChemicalOptions {
|
|
29
|
+
/** Excitability scale, finite 0.3–1.2; default 0.75. See {@link barkley}. */
|
|
30
|
+
readonly a?: number;
|
|
31
|
+
/** Excitation threshold offset, finite 0–0.2; default 0.02. See {@link barkley}. */
|
|
32
|
+
readonly b?: number;
|
|
33
|
+
/** Fast/slow time separation, finite 0.005–0.1; default 0.02. See {@link barkley}. */
|
|
34
|
+
readonly epsilon?: number;
|
|
35
|
+
}
|
|
36
|
+
/** Brusselator feed rates, diffusion and initialization. See {@link brusselator}. */
|
|
37
|
+
export interface BrusselatorOptions extends ChemicalOptions {
|
|
38
|
+
/** Activator feed, finite 0.1–3; default 1. See {@link brusselator}. */
|
|
39
|
+
readonly a?: number;
|
|
40
|
+
/** Conversion rate, finite 0.1–5; default 1.8. See {@link brusselator}. */
|
|
41
|
+
readonly b?: number;
|
|
42
|
+
}
|
|
43
|
+
/** Immutable Schnakenberg starting configurations. See {@link SchnakenbergOptions}. */
|
|
44
|
+
export declare const schnakenbergPresets: Readonly<{
|
|
45
|
+
/** Separated activator spots. See {@link schnakenberg}. */
|
|
46
|
+
spots: Readonly<{
|
|
47
|
+
a: 0.1;
|
|
48
|
+
b: 0.9;
|
|
49
|
+
diffusionU: 1;
|
|
50
|
+
diffusionV: 20;
|
|
51
|
+
}>;
|
|
52
|
+
/** Connected activator bands. See {@link schnakenberg}. */
|
|
53
|
+
labyrinths: Readonly<{
|
|
54
|
+
a: 0.01;
|
|
55
|
+
b: 1.7;
|
|
56
|
+
diffusionU: 1;
|
|
57
|
+
diffusionV: 20;
|
|
58
|
+
warmupSteps: 10000;
|
|
59
|
+
}>;
|
|
60
|
+
}>;
|
|
61
|
+
/** Immutable Barkley starting configurations. See {@link BarkleyOptions}. */
|
|
62
|
+
export declare const barkleyPresets: Readonly<{
|
|
63
|
+
/** Broken excitation fronts form rotating spirals. See {@link barkley}. */
|
|
64
|
+
spirals: Readonly<{
|
|
65
|
+
a: 0.75;
|
|
66
|
+
b: 0.02;
|
|
67
|
+
epsilon: 0.02;
|
|
68
|
+
diffusionU: 1;
|
|
69
|
+
diffusionV: 0;
|
|
70
|
+
}>;
|
|
71
|
+
/** Broader propagating excitation fronts. See {@link barkley}. */
|
|
72
|
+
waves: Readonly<{
|
|
73
|
+
a: 0.9;
|
|
74
|
+
b: 0.01;
|
|
75
|
+
epsilon: 0.04;
|
|
76
|
+
diffusionU: 1;
|
|
77
|
+
diffusionV: 0;
|
|
78
|
+
}>;
|
|
79
|
+
}>;
|
|
80
|
+
/** Immutable Brusselator starting configurations. See {@link BrusselatorOptions}. */
|
|
81
|
+
export declare const brusselatorPresets: Readonly<{
|
|
82
|
+
/** Differential diffusion supports stationary spots. See {@link brusselator}. */
|
|
83
|
+
spots: Readonly<{
|
|
84
|
+
a: 1;
|
|
85
|
+
b: 1.9;
|
|
86
|
+
diffusionU: 0.2;
|
|
87
|
+
diffusionV: 2;
|
|
88
|
+
warmupSteps: 10000;
|
|
89
|
+
}>;
|
|
90
|
+
/** Equal diffusion above the oscillation threshold. See {@link brusselator}. */
|
|
91
|
+
oscillations: Readonly<{
|
|
92
|
+
a: 1;
|
|
93
|
+
b: 3;
|
|
94
|
+
diffusionU: 0.3;
|
|
95
|
+
diffusionV: 0.3;
|
|
96
|
+
}>;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Creates a periodic Schnakenberg activator/inhibitor texture with paint, stir, pause and reset.
|
|
100
|
+
* @param options - Reaction rates, diffusion and initialization. See {@link SchnakenbergOptions}.
|
|
101
|
+
* @returns A mountable simulation recipe. See {@link TextureRecipe}, {@link InkMessage}.
|
|
102
|
+
* @see {@link schnakenbergPresets}
|
|
103
|
+
*/
|
|
104
|
+
export declare function schnakenberg(options?: SchnakenbergOptions): TextureRecipe<InkMessage>;
|
|
105
|
+
/**
|
|
106
|
+
* Creates a periodic Barkley excitable texture initialized with a broken excitation front.
|
|
107
|
+
* @param options - Excitability, recovery, diffusion and initialization. See {@link BarkleyOptions}.
|
|
108
|
+
* @returns A mountable simulation recipe. See {@link TextureRecipe}, {@link InkMessage}.
|
|
109
|
+
* @see {@link barkleyPresets}
|
|
110
|
+
*/
|
|
111
|
+
export declare function barkley(options?: BarkleyOptions): TextureRecipe<InkMessage>;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a periodic Brusselator texture with paint, stir, pause and reset.
|
|
114
|
+
* @param options - Feed rates, diffusion and initialization. See {@link BrusselatorOptions}.
|
|
115
|
+
* @returns A mountable simulation recipe. See {@link TextureRecipe}, {@link InkMessage}.
|
|
116
|
+
* @see {@link brusselatorPresets}
|
|
117
|
+
*/
|
|
118
|
+
export declare function brusselator(options?: BrusselatorOptions): TextureRecipe<InkMessage>;
|
|
119
|
+
export {};
|