@pibbl/core 0.0.2 → 0.0.3-alpha.90.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/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 +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.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 +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/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 +141 -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 +102 -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 +296 -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-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 +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.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/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/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/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/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/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/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 +2 -0
- 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/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/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 +10 -2
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -203,3 +203,84 @@ License: Apache-2.0
|
|
|
203
203
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
204
204
|
See the License for the specific language governing permissions and
|
|
205
205
|
limitations under the License.
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
Recording/GIF WASM dependency: gif-0.14.1
|
|
209
|
+
Source: https://github.com/image-rs/image-gif
|
|
210
|
+
License: MIT
|
|
211
|
+
|
|
212
|
+
The MIT License (MIT)
|
|
213
|
+
|
|
214
|
+
Copyright (c) 2015 nwin
|
|
215
|
+
|
|
216
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
217
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
218
|
+
in the Software without restriction, including without limitation the rights
|
|
219
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
220
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
221
|
+
furnished to do so, subject to the following conditions:
|
|
222
|
+
|
|
223
|
+
The above copyright notice and this permission notice shall be included in all
|
|
224
|
+
copies or substantial portions of the Software.
|
|
225
|
+
|
|
226
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
227
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
228
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
229
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
230
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
231
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
232
|
+
SOFTWARE.
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
Recording/GIF WASM dependency: color_quant-1.1.0
|
|
236
|
+
Source: https://github.com/image-rs/color_quant
|
|
237
|
+
License: MIT
|
|
238
|
+
|
|
239
|
+
The MIT License (MIT)
|
|
240
|
+
|
|
241
|
+
Copyright (c) 2016 PistonDevelopers
|
|
242
|
+
|
|
243
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
244
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
245
|
+
in the Software without restriction, including without limitation the rights
|
|
246
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
247
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
248
|
+
furnished to do so, subject to the following conditions:
|
|
249
|
+
|
|
250
|
+
The above copyright notice and this permission notice shall be included in all
|
|
251
|
+
copies or substantial portions of the Software.
|
|
252
|
+
|
|
253
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
254
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
255
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
256
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
257
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
258
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
259
|
+
SOFTWARE.
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
Recording/GIF WASM dependency: weezl-0.1.12
|
|
263
|
+
Source: https://github.com/image-rs/weezl
|
|
264
|
+
License: MIT
|
|
265
|
+
|
|
266
|
+
The MIT License (MIT)
|
|
267
|
+
|
|
268
|
+
Copyright (c) HeroicKatora 2020
|
|
269
|
+
|
|
270
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
271
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
272
|
+
in the Software without restriction, including without limitation the rights
|
|
273
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
274
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
275
|
+
furnished to do so, subject to the following conditions:
|
|
276
|
+
|
|
277
|
+
The above copyright notice and this permission notice shall be included in all
|
|
278
|
+
copies or substantial portions of the Software.
|
|
279
|
+
|
|
280
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
281
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
282
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
283
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
284
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
285
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
286
|
+
SOFTWARE.
|
|
@@ -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,IAA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AACA,aAAS,IAAI,GAAG,IAAI,GAAG;AACrB,eAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,cAAM,KAAK,KAAK,IAAI,QAAQ,IAAI,IAAI,IAAI,GAAG,CAAC,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 {};
|