@motionscript/core 0.1.0-alpha.3 → 0.1.0-alpha.5
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/CHANGELOG.md +220 -0
- package/LICENSE +201 -201
- package/NOTICE +48 -0
- package/README.md +93 -72
- package/dist/assets/asset-index.js.map +1 -1
- package/dist/assets/catalog.d.ts +9 -0
- package/dist/assets/catalog.d.ts.map +1 -1
- package/dist/assets/catalog.js +11 -0
- package/dist/assets/catalog.js.map +1 -1
- package/dist/assets/errors.d.ts.map +1 -1
- package/dist/assets/errors.js +8 -3
- package/dist/assets/errors.js.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/manager.d.ts +26 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/assets/manager.js +79 -4
- package/dist/assets/manager.js.map +1 -1
- package/dist/assets/manifest.js.map +1 -1
- package/dist/assets/record.js.map +1 -1
- package/dist/assets/scope.d.ts +3 -3
- package/dist/assets/scope.d.ts.map +1 -1
- package/dist/assets/scope.js.map +1 -1
- package/dist/attributes/audio/filters/chain.d.ts +1 -1
- package/dist/attributes/audio/filters/chain.js.map +1 -1
- package/dist/attributes/audio/filters/curve.d.ts +8 -8
- package/dist/attributes/audio/filters/curve.d.ts.map +1 -1
- package/dist/attributes/audio/filters/curve.js +20 -19
- package/dist/attributes/audio/filters/curve.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/gain.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/highpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/lowpass.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/speed.d.ts +2 -2
- package/dist/attributes/audio/filters/implementations/speed.js.map +1 -1
- package/dist/attributes/audio/filters/implementations/tremolo.js.map +1 -1
- package/dist/attributes/audio/filters/index.d.ts +1 -1
- package/dist/attributes/audio/filters/index.d.ts.map +1 -1
- package/dist/attributes/audio/filters/index.js +1 -1
- package/dist/attributes/audio/filters/index.js.map +1 -1
- package/dist/attributes/audio/filters/registry.js.map +1 -1
- package/dist/attributes/audio/filters/union.js.map +1 -1
- package/dist/attributes/audio/request.d.ts +17 -2
- package/dist/attributes/audio/request.d.ts.map +1 -1
- package/dist/attributes/audio/request.js.map +1 -1
- package/dist/attributes/audio/schedule.d.ts +4 -2
- package/dist/attributes/audio/schedule.d.ts.map +1 -1
- package/dist/attributes/audio/schedule.js +15 -8
- package/dist/attributes/audio/schedule.js.map +1 -1
- package/dist/attributes/audio/sound.d.ts +4 -2
- package/dist/attributes/audio/sound.d.ts.map +1 -1
- package/dist/attributes/audio/sound.js +8 -4
- package/dist/attributes/audio/sound.js.map +1 -1
- package/dist/attributes/index.js.map +1 -1
- package/dist/attributes/layout/alignment.js +1 -1
- package/dist/attributes/layout/alignment.js.map +1 -1
- package/dist/attributes/layout/index.js.map +1 -1
- package/dist/attributes/layout/insets.js.map +1 -1
- package/dist/attributes/layout/matrix2d.js.map +1 -1
- package/dist/attributes/layout/size.js.map +1 -1
- package/dist/attributes/layout/transform3d.js.map +1 -1
- package/dist/attributes/layout/vector2.js.map +1 -1
- package/dist/attributes/layout/world-transform.js.map +1 -1
- package/dist/attributes/mask/boolean.js.map +1 -1
- package/dist/attributes/mask/mask.js.map +1 -1
- package/dist/attributes/properties/decorator.d.ts +3 -1
- package/dist/attributes/properties/decorator.d.ts.map +1 -1
- package/dist/attributes/properties/decorator.js.map +1 -1
- package/dist/attributes/properties/inputs.js.map +1 -1
- package/dist/attributes/properties/typed.d.ts +9 -2
- package/dist/attributes/properties/typed.d.ts.map +1 -1
- package/dist/attributes/properties/typed.js +15 -1
- package/dist/attributes/properties/typed.js.map +1 -1
- package/dist/attributes/render3d/orbit.d.ts +8 -8
- package/dist/attributes/render3d/orbit.js +7 -7
- package/dist/attributes/render3d/orbit.js.map +1 -1
- package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
- package/dist/attributes/shape/corners/corner-style.js.map +1 -1
- package/dist/attributes/shape/corners/corners.js.map +1 -1
- package/dist/attributes/shape/corners/index.js.map +1 -1
- package/dist/attributes/shape/effects/backdrop.d.ts +4 -4
- package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
- package/dist/attributes/shape/effects/backdrop.js.map +1 -1
- package/dist/attributes/shape/effects/chain.d.ts +28 -120
- package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
- package/dist/attributes/shape/effects/chain.js +16 -88
- package/dist/attributes/shape/effects/chain.js.map +1 -1
- package/dist/attributes/shape/effects/effect-data.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +2 -2
- package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.d.ts +15 -24
- package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/lut.d.ts +1 -1
- package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
- package/dist/attributes/shape/effects/implementations/shader.js +15 -8
- package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
- package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
- package/dist/attributes/shape/effects/index.d.ts +2 -6
- package/dist/attributes/shape/effects/index.d.ts.map +1 -1
- package/dist/attributes/shape/effects/index.js.map +1 -1
- package/dist/attributes/shape/effects/registry.d.ts +23 -6
- package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
- package/dist/attributes/shape/effects/registry.js +44 -10
- package/dist/attributes/shape/effects/registry.js.map +1 -1
- package/dist/attributes/shape/effects/union.d.ts +2 -6
- package/dist/attributes/shape/effects/union.d.ts.map +1 -1
- package/dist/attributes/shape/effects/union.js.map +1 -1
- package/dist/attributes/shape/fill/blend.js.map +1 -1
- package/dist/attributes/shape/fill/chain.js.map +1 -1
- package/dist/attributes/shape/fill/coerce.js.map +1 -1
- package/dist/attributes/shape/fill/color/constants.js.map +1 -1
- package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
- package/dist/attributes/shape/fill/color/parser.js +81 -44
- package/dist/attributes/shape/fill/color/parser.js.map +1 -1
- package/dist/attributes/shape/fill/gradient-stops.d.ts +16 -0
- package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -0
- package/dist/attributes/shape/fill/gradient-stops.js +65 -0
- package/dist/attributes/shape/fill/gradient-stops.js.map +1 -0
- package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/color.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/conic-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/conic-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/fractal-noise.js +2 -10
- package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/image.js +5 -4
- package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/linear-gradient.js +2 -6
- package/dist/attributes/shape/fill/implementations/linear-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.d.ts.map +1 -1
- package/dist/attributes/shape/fill/implementations/radial-gradient.js +2 -5
- package/dist/attributes/shape/fill/implementations/radial-gradient.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/stripe.js.map +1 -1
- package/dist/attributes/shape/fill/implementations/video.js +1 -1
- package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
- package/dist/attributes/shape/fill/index.js.map +1 -1
- package/dist/attributes/shape/fill/lerp.js.map +1 -1
- package/dist/attributes/shape/fill/media-preset.js.map +1 -1
- package/dist/attributes/shape/fill/registry.js.map +1 -1
- package/dist/attributes/shape/fill/union.js.map +1 -1
- package/dist/attributes/shape/filters/chain.d.ts +4 -10
- package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
- package/dist/attributes/shape/filters/chain.js +1 -13
- package/dist/attributes/shape/filters/chain.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/alpha.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/blur.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-adjustment.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/exposure.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/grayscale.js.map +1 -1
- package/dist/attributes/shape/filters/implementations/posterize-time.js.map +1 -1
- package/dist/attributes/shape/filters/index.d.ts +1 -1
- package/dist/attributes/shape/filters/index.js.map +1 -1
- package/dist/attributes/shape/filters/registry.d.ts +2 -2
- package/dist/attributes/shape/filters/registry.js +3 -3
- package/dist/attributes/shape/filters/registry.js.map +1 -1
- package/dist/attributes/shape/filters/union.d.ts +6 -7
- package/dist/attributes/shape/filters/union.d.ts.map +1 -1
- package/dist/attributes/shape/filters/union.js.map +1 -1
- package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
- package/dist/attributes/shape/path/anchors.js +12 -5
- package/dist/attributes/shape/path/anchors.js.map +1 -1
- package/dist/attributes/shape/path/bezier.js.map +1 -1
- package/dist/attributes/shape/path/index.js.map +1 -1
- package/dist/attributes/shape/path/measure.js.map +1 -1
- package/dist/attributes/shape/path/morph.d.ts.map +1 -1
- package/dist/attributes/shape/path/morph.js +16 -4
- package/dist/attributes/shape/path/morph.js.map +1 -1
- package/dist/attributes/shape/path/ops.js.map +1 -1
- package/dist/attributes/shape/path/types.js.map +1 -1
- package/dist/attributes/shape/path/walk.js.map +1 -1
- package/dist/attributes/shape/shaders/index.js.map +1 -1
- package/dist/attributes/shape/shaders/pack.js.map +1 -1
- package/dist/attributes/shape/shaders/resolve.js.map +1 -1
- package/dist/attributes/shape/shadow/index.js.map +1 -1
- package/dist/attributes/shape/shadow/shadow.js.map +1 -1
- package/dist/attributes/shape/stroke/index.d.ts +2 -2
- package/dist/attributes/shape/stroke/index.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/index.js +1 -1
- package/dist/attributes/shape/stroke/index.js.map +1 -1
- package/dist/attributes/shape/stroke/stroke.d.ts +27 -6
- package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
- package/dist/attributes/shape/stroke/stroke.js +22 -2
- package/dist/attributes/shape/stroke/stroke.js.map +1 -1
- package/dist/attributes/shared/operators.js.map +1 -1
- package/dist/attributes/text/index.js.map +1 -1
- package/dist/attributes/text/ops.d.ts +6 -0
- package/dist/attributes/text/ops.d.ts.map +1 -1
- package/dist/attributes/text/ops.js +1 -0
- package/dist/attributes/text/ops.js.map +1 -1
- package/dist/attributes/text/types.js.map +1 -1
- package/dist/browser/chunks/chunk-FUZVFT3W.js +18 -0
- package/dist/browser/chunks/chunk-FUZVFT3W.js.map +7 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.js +3 -0
- package/dist/browser/chunks/chunk-QG6C23IJ.js.map +7 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js +2 -0
- package/dist/browser/chunks/chunk-SFNJRPBV.js.map +7 -0
- package/dist/browser/component.js +1 -1
- package/dist/browser/component.js.map +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +4 -4
- package/dist/browser/jsx-jsx-dev-runtime.js +1 -1
- package/dist/browser/jsx-jsx-runtime.js +1 -1
- package/dist/browser/manifest.json +3 -2
- package/dist/browser/sdk.js +1 -1
- package/dist/component.js.map +1 -1
- package/dist/document/audio.d.ts +1 -1
- package/dist/document/audio.js +4 -4
- package/dist/document/audio.js.map +1 -1
- package/dist/document/builtins.d.ts.map +1 -1
- package/dist/document/builtins.js +8 -14
- package/dist/document/builtins.js.map +1 -1
- package/dist/document/command-traits.d.ts +1 -1
- package/dist/document/command-traits.js +13 -1
- package/dist/document/command-traits.js.map +1 -1
- package/dist/document/deny-globals.js.map +1 -1
- package/dist/document/diff.js.map +1 -1
- package/dist/document/doc-index.d.ts +2 -2
- package/dist/document/doc-index.d.ts.map +1 -1
- package/dist/document/doc-index.js.map +1 -1
- package/dist/document/expression/compile.d.ts.map +1 -1
- package/dist/document/expression/compile.js +8 -5
- package/dist/document/expression/compile.js.map +1 -1
- package/dist/document/expression/index.js.map +1 -1
- package/dist/document/expression/ops.js +1 -1
- package/dist/document/expression/ops.js.map +1 -1
- package/dist/document/expression/parse.d.ts.map +1 -1
- package/dist/document/expression/parse.js +15 -6
- package/dist/document/expression/parse.js.map +1 -1
- package/dist/document/expression/refs.d.ts +1 -1
- package/dist/document/expression/refs.js +1 -1
- package/dist/document/expression/refs.js.map +1 -1
- package/dist/document/expression/types.js.map +1 -1
- package/dist/document/expression/walk.d.ts.map +1 -1
- package/dist/document/expression/walk.js +2 -1
- package/dist/document/expression/walk.js.map +1 -1
- package/dist/document/index.d.ts +2 -0
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/index.js +2 -0
- package/dist/document/index.js.map +1 -1
- package/dist/document/node-decorator.js.map +1 -1
- package/dist/document/node-descriptor.d.ts +19 -0
- package/dist/document/node-descriptor.d.ts.map +1 -1
- package/dist/document/node-descriptor.js.map +1 -1
- package/dist/document/placement.d.ts +70 -0
- package/dist/document/placement.d.ts.map +1 -0
- package/dist/document/placement.js +83 -0
- package/dist/document/placement.js.map +1 -0
- package/dist/document/project.d.ts +2 -2
- package/dist/document/project.d.ts.map +1 -1
- package/dist/document/project.js.map +1 -1
- package/dist/document/registry.d.ts +17 -0
- package/dist/document/registry.d.ts.map +1 -1
- package/dist/document/registry.js +29 -2
- package/dist/document/registry.js.map +1 -1
- package/dist/document/timeline-patch.js.map +1 -1
- package/dist/document/timeline.d.ts +73 -18
- package/dist/document/timeline.d.ts.map +1 -1
- package/dist/document/timeline.js +192 -40
- package/dist/document/timeline.js.map +1 -1
- package/dist/document/types.d.ts +12 -12
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.js +2 -2
- package/dist/document/types.js.map +1 -1
- package/dist/document/validate.d.ts +2 -2
- package/dist/document/validate.d.ts.map +1 -1
- package/dist/document/validate.js +37 -31
- package/dist/document/validate.js.map +1 -1
- package/dist/document/withdraw.d.ts +28 -0
- package/dist/document/withdraw.d.ts.map +1 -0
- package/dist/document/withdraw.js +61 -0
- package/dist/document/withdraw.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-runtime.d.ts +9 -1
- package/dist/jsx/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx/jsx-runtime.js +13 -3
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/layout/bounds.d.ts +0 -1
- package/dist/layout/bounds.d.ts.map +1 -1
- package/dist/layout/bounds.js.map +1 -1
- package/dist/layout/constraints.js.map +1 -1
- package/dist/layout/flex.d.ts +4 -2
- package/dist/layout/flex.d.ts.map +1 -1
- package/dist/layout/flex.js +27 -11
- package/dist/layout/flex.js.map +1 -1
- package/dist/layout/freeform.js.map +1 -1
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/item.js.map +1 -1
- package/dist/layout/ops.d.ts +6 -0
- package/dist/layout/ops.d.ts.map +1 -1
- package/dist/layout/ops.js +6 -0
- package/dist/layout/ops.js.map +1 -1
- package/dist/layout/types.js.map +1 -1
- package/dist/nodes/2d/node-lifecycle.js.map +1 -1
- package/dist/nodes/2d/node-motion.js.map +1 -1
- package/dist/nodes/2d/node-render.d.ts +3 -3
- package/dist/nodes/2d/node-render.d.ts.map +1 -1
- package/dist/nodes/2d/node-render.js.map +1 -1
- package/dist/nodes/2d/node-transform.js.map +1 -1
- package/dist/nodes/2d/node2d.d.ts +115 -3
- package/dist/nodes/2d/node2d.d.ts.map +1 -1
- package/dist/nodes/2d/node2d.js +180 -28
- package/dist/nodes/2d/node2d.js.map +1 -1
- package/dist/nodes/2d/paint-node.d.ts +27 -0
- package/dist/nodes/2d/paint-node.d.ts.map +1 -1
- package/dist/nodes/2d/paint-node.js +42 -0
- package/dist/nodes/2d/paint-node.js.map +1 -1
- package/dist/nodes/audio/audio-bus.js.map +1 -1
- package/dist/nodes/audio/index.js.map +1 -1
- package/dist/nodes/audio/node-audio.js.map +1 -1
- package/dist/nodes/audio/sound-node.d.ts +2 -2
- package/dist/nodes/audio/sound-node.d.ts.map +1 -1
- package/dist/nodes/audio/sound-node.js +1 -1
- package/dist/nodes/audio/sound-node.js.map +1 -1
- package/dist/nodes/geometry/bounds-shape-node.d.ts +4 -4
- package/dist/nodes/geometry/bounds-shape-node.js +2 -2
- package/dist/nodes/geometry/bounds-shape-node.js.map +1 -1
- package/dist/nodes/geometry/box-path-node.d.ts +3 -3
- package/dist/nodes/geometry/box-path-node.js +2 -2
- package/dist/nodes/geometry/box-path-node.js.map +1 -1
- package/dist/nodes/geometry/ellipse-node.js.map +1 -1
- package/dist/nodes/geometry/group-bounds.d.ts +2 -2
- package/dist/nodes/geometry/group-bounds.d.ts.map +1 -1
- package/dist/nodes/geometry/group-bounds.js +1 -2
- package/dist/nodes/geometry/group-bounds.js.map +1 -1
- package/dist/nodes/geometry/path-node.d.ts.map +1 -1
- package/dist/nodes/geometry/path-node.js +6 -0
- package/dist/nodes/geometry/path-node.js.map +1 -1
- package/dist/nodes/geometry/polygon-node.js.map +1 -1
- package/dist/nodes/geometry/polygram-node.js.map +1 -1
- package/dist/nodes/geometry/rect-node.js.map +1 -1
- package/dist/nodes/geometry/shape-node.js.map +1 -1
- package/dist/nodes/geometry/shape-outline.d.ts +2 -2
- package/dist/nodes/geometry/shape-outline.d.ts.map +1 -1
- package/dist/nodes/geometry/shape-outline.js +2 -13
- package/dist/nodes/geometry/shape-outline.js.map +1 -1
- package/dist/nodes/index.d.ts +3 -8
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +3 -8
- package/dist/nodes/index.js.map +1 -1
- package/dist/nodes/layout/camera-node.d.ts +9 -0
- package/dist/nodes/layout/camera-node.d.ts.map +1 -1
- package/dist/nodes/layout/camera-node.js +38 -3
- package/dist/nodes/layout/camera-node.js.map +1 -1
- package/dist/nodes/layout/orbit-camera-node.d.ts +1 -1
- package/dist/nodes/layout/orbit-camera-node.js +1 -1
- package/dist/nodes/layout/orbit-camera-node.js.map +1 -1
- package/dist/nodes/layout/rotated-box.js.map +1 -1
- package/dist/nodes/media/video-node.d.ts.map +1 -1
- package/dist/nodes/media/video-node.js +2 -0
- package/dist/nodes/media/video-node.js.map +1 -1
- package/dist/nodes/node/declare-paints.js.map +1 -1
- package/dist/nodes/node/node-editor-state.js.map +1 -1
- package/dist/nodes/node/node-reactive.js.map +1 -1
- package/dist/nodes/node/node-time.d.ts +3 -3
- package/dist/nodes/node/node-time.d.ts.map +1 -1
- package/dist/nodes/node/node-time.js +1 -1
- package/dist/nodes/node/node-time.js.map +1 -1
- package/dist/nodes/node/node-walk.js.map +1 -1
- package/dist/nodes/node/node.d.ts +5 -3
- package/dist/nodes/node/node.d.ts.map +1 -1
- package/dist/nodes/node/node.js +44 -19
- package/dist/nodes/node/node.js.map +1 -1
- package/dist/nodes/node/text-defaults.d.ts +10 -12
- package/dist/nodes/node/text-defaults.d.ts.map +1 -1
- package/dist/nodes/node/text-defaults.js +10 -12
- package/dist/nodes/node/text-defaults.js.map +1 -1
- package/dist/nodes/{scene → root}/canvas2d-node.d.ts +2 -2
- package/dist/nodes/root/canvas2d-node.d.ts.map +1 -0
- package/dist/nodes/{scene → root}/canvas2d-node.js +2 -2
- package/dist/nodes/root/canvas2d-node.js.map +1 -0
- package/dist/nodes/root/provider-node.d.ts.map +1 -0
- package/dist/nodes/root/provider-node.js.map +1 -0
- package/dist/nodes/root/theme-provider-node.d.ts.map +1 -0
- package/dist/nodes/root/theme-provider-node.js.map +1 -0
- package/dist/nodes/text/default-text-style-node.d.ts +5 -2
- package/dist/nodes/text/default-text-style-node.d.ts.map +1 -1
- package/dist/nodes/text/default-text-style-node.js +10 -4
- package/dist/nodes/text/default-text-style-node.js.map +1 -1
- package/dist/nodes/text/number-format.d.ts +1 -1
- package/dist/nodes/text/number-format.js +1 -1
- package/dist/nodes/text/number-format.js.map +1 -1
- package/dist/nodes/text/number-node.js.map +1 -1
- package/dist/nodes/text/number-pattern.js.map +1 -1
- package/dist/nodes/text/richtext-node.js +1 -1
- package/dist/nodes/text/richtext-node.js.map +1 -1
- package/dist/nodes/text/text-base.d.ts.map +1 -1
- package/dist/nodes/text/text-base.js +1 -1
- package/dist/nodes/text/text-base.js.map +1 -1
- package/dist/nodes/text/text-node.js.map +1 -1
- package/dist/nodes/text/text-selection.js.map +1 -1
- package/dist/nodes/three/camera-nodes.d.ts +21 -3
- package/dist/nodes/three/camera-nodes.d.ts.map +1 -1
- package/dist/nodes/three/camera-nodes.js +42 -1
- package/dist/nodes/three/camera-nodes.js.map +1 -1
- package/dist/nodes/three/canvas3d-node.d.ts +29 -6
- package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
- package/dist/nodes/three/canvas3d-node.js +44 -2
- package/dist/nodes/three/canvas3d-node.js.map +1 -1
- package/dist/nodes/three/drawable-nodes.d.ts +25 -11
- package/dist/nodes/three/drawable-nodes.d.ts.map +1 -1
- package/dist/nodes/three/drawable-nodes.js +43 -13
- package/dist/nodes/three/drawable-nodes.js.map +1 -1
- package/dist/nodes/three/environment-nodes.d.ts +9 -3
- package/dist/nodes/three/environment-nodes.d.ts.map +1 -1
- package/dist/nodes/three/environment-nodes.js.map +1 -1
- package/dist/nodes/three/geometry-nodes.d.ts +2 -2
- package/dist/nodes/three/geometry-nodes.js +2 -2
- package/dist/nodes/three/geometry-nodes.js.map +1 -1
- package/dist/nodes/three/grid-geometry3d.js.map +1 -1
- package/dist/nodes/three/group3d.js.map +1 -1
- package/dist/nodes/three/light-nodes.d.ts.map +1 -1
- package/dist/nodes/three/light-nodes.js +3 -3
- package/dist/nodes/three/light-nodes.js.map +1 -1
- package/dist/nodes/three/mesh3d.js.map +1 -1
- package/dist/nodes/three/node3d.d.ts +48 -0
- package/dist/nodes/three/node3d.d.ts.map +1 -1
- package/dist/nodes/three/node3d.js +53 -3
- package/dist/nodes/three/node3d.js.map +1 -1
- package/dist/platform/audio-sink.d.ts +2 -2
- package/dist/platform/audio-sink.d.ts.map +1 -1
- package/dist/platform/audio-sink.js.map +1 -1
- package/dist/platform/exporter.d.ts +13 -8
- package/dist/platform/exporter.d.ts.map +1 -1
- package/dist/platform/exporter.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/stepped-clock.js.map +1 -1
- package/dist/platform/storage-adapter.d.ts +12 -6
- package/dist/platform/storage-adapter.d.ts.map +1 -1
- package/dist/platform/storage-adapter.js +4 -0
- package/dist/platform/storage-adapter.js.map +1 -1
- package/dist/platform/ticker.d.ts +6 -0
- package/dist/platform/ticker.d.ts.map +1 -1
- package/dist/platform/ticker.js +6 -0
- package/dist/platform/ticker.js.map +1 -1
- package/dist/project/config.js.map +1 -1
- package/dist/project/index.js.map +1 -1
- package/dist/project/tree.d.ts +3 -3
- package/dist/project/tree.d.ts.map +1 -1
- package/dist/project/tree.js.map +1 -1
- package/dist/props/host.js.map +1 -1
- package/dist/props/index.js.map +1 -1
- package/dist/props/observer.js.map +1 -1
- package/dist/props/slot.js.map +1 -1
- package/dist/renamed-scene-names.d.ts +17 -0
- package/dist/renamed-scene-names.d.ts.map +1 -0
- package/dist/renamed-scene-names.js +9 -0
- package/dist/renamed-scene-names.js.map +1 -0
- package/dist/render/canvas-render-context2d.d.ts +2 -2
- package/dist/render/canvas-render-context2d.d.ts.map +1 -1
- package/dist/render/canvas-render-context2d.js.map +1 -1
- package/dist/render/clip-contains.js.map +1 -1
- package/dist/render/clip.js.map +1 -1
- package/dist/render/descriptors/ellipse.js.map +1 -1
- package/dist/render/descriptors/latex.js.map +1 -1
- package/dist/render/descriptors/line.js.map +1 -1
- package/dist/render/descriptors/path-builder.js.map +1 -1
- package/dist/render/descriptors/path.js.map +1 -1
- package/dist/render/descriptors/polygon.js.map +1 -1
- package/dist/render/descriptors/polygram.js.map +1 -1
- package/dist/render/descriptors/rect.js.map +1 -1
- package/dist/render/descriptors/richtext.js.map +1 -1
- package/dist/render/descriptors/shape.d.ts +12 -0
- package/dist/render/descriptors/shape.d.ts.map +1 -1
- package/dist/render/descriptors/shape.js.map +1 -1
- package/dist/render/descriptors/text.d.ts +2 -2
- package/dist/render/descriptors/text.js +2 -2
- package/dist/render/descriptors/text.js.map +1 -1
- package/dist/render/descriptors/transform.d.ts +2 -2
- package/dist/render/descriptors/transform.d.ts.map +1 -1
- package/dist/render/descriptors/transform.js.map +1 -1
- package/dist/render/graphics2d.d.ts +3 -3
- package/dist/render/graphics2d.d.ts.map +1 -1
- package/dist/render/graphics2d.js +1 -1
- package/dist/render/graphics2d.js.map +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/measure-context.js.map +1 -1
- package/dist/render/null-render-context.js.map +1 -1
- package/dist/render/render-context2d.d.ts +2 -2
- package/dist/render/render-context2d.d.ts.map +1 -1
- package/dist/render/render-context2d.js.map +1 -1
- package/dist/render/surface.js.map +1 -1
- package/dist/render/text-defaults.js.map +1 -1
- package/dist/render/text-layout.js.map +1 -1
- package/dist/render3d/bounds3d.d.ts.map +1 -1
- package/dist/render3d/bounds3d.js +4 -2
- package/dist/render3d/bounds3d.js.map +1 -1
- package/dist/render3d/builders.js.map +1 -1
- package/dist/render3d/camera.d.ts +6 -0
- package/dist/render3d/camera.d.ts.map +1 -1
- package/dist/render3d/camera.js +5 -3
- package/dist/render3d/camera.js.map +1 -1
- package/dist/render3d/fill3d.d.ts +2 -9
- package/dist/render3d/fill3d.d.ts.map +1 -1
- package/dist/render3d/fill3d.js +2 -13
- package/dist/render3d/fill3d.js.map +1 -1
- package/dist/render3d/geometry.d.ts +8 -1
- package/dist/render3d/geometry.d.ts.map +1 -1
- package/dist/render3d/geometry.js.map +1 -1
- package/dist/render3d/graphics3d.d.ts +8 -4
- package/dist/render3d/graphics3d.d.ts.map +1 -1
- package/dist/render3d/graphics3d.js +18 -10
- package/dist/render3d/graphics3d.js.map +1 -1
- package/dist/render3d/index.d.ts +1 -1
- package/dist/render3d/index.js +1 -1
- package/dist/render3d/index.js.map +1 -1
- package/dist/render3d/inert.d.ts +14 -0
- package/dist/render3d/inert.d.ts.map +1 -0
- package/dist/render3d/inert.js +62 -0
- package/dist/render3d/inert.js.map +1 -0
- package/dist/render3d/light.js.map +1 -1
- package/dist/render3d/material.d.ts +10 -5
- package/dist/render3d/material.d.ts.map +1 -1
- package/dist/render3d/material.js.map +1 -1
- package/dist/render3d/matrix4.js.map +1 -1
- package/dist/render3d/render-context3d.js.map +1 -1
- package/dist/render3d/resources.js.map +1 -1
- package/dist/render3d/rounded-box.js.map +1 -1
- package/dist/render3d/scene-settings.d.ts +23 -4
- package/dist/render3d/scene-settings.d.ts.map +1 -1
- package/dist/render3d/scene-settings.js.map +1 -1
- package/dist/render3d/scene3d.d.ts +11 -0
- package/dist/render3d/scene3d.d.ts.map +1 -1
- package/dist/render3d/scene3d.js +39 -6
- package/dist/render3d/scene3d.js.map +1 -1
- package/dist/render3d/segments.js.map +1 -1
- package/dist/render3d/texture.d.ts +9 -0
- package/dist/render3d/texture.d.ts.map +1 -1
- package/dist/render3d/texture.js +13 -0
- package/dist/render3d/texture.js.map +1 -1
- package/dist/render3d/tracking.js.map +1 -1
- package/dist/render3d/transform.d.ts +1 -1
- package/dist/render3d/transform.js.map +1 -1
- package/dist/render3d/vector3.d.ts +18 -1
- package/dist/render3d/vector3.d.ts.map +1 -1
- package/dist/render3d/vector3.js +27 -0
- package/dist/render3d/vector3.js.map +1 -1
- package/dist/render3d/walk.d.ts +1 -1
- package/dist/render3d/walk.d.ts.map +1 -1
- package/dist/render3d/walk.js +5 -1
- package/dist/render3d/walk.js.map +1 -1
- package/dist/runtime/asset-refine.js.map +1 -1
- package/dist/runtime/asset-timeline.js.map +1 -1
- package/dist/runtime/asset-update.js.map +1 -1
- package/dist/runtime/audio-index.js.map +1 -1
- package/dist/runtime/builtin-context.js.map +1 -1
- package/dist/runtime/clip-instance.d.ts +5 -3
- package/dist/runtime/clip-instance.d.ts.map +1 -1
- package/dist/runtime/clip-instance.js +10 -6
- package/dist/runtime/clip-instance.js.map +1 -1
- package/dist/runtime/clip-store.d.ts +9 -0
- package/dist/runtime/clip-store.d.ts.map +1 -1
- package/dist/runtime/clip-store.js +19 -0
- package/dist/runtime/clip-store.js.map +1 -1
- package/dist/runtime/engine.d.ts +5 -0
- package/dist/runtime/engine.d.ts.map +1 -1
- package/dist/runtime/engine.js +2 -0
- package/dist/runtime/engine.js.map +1 -1
- package/dist/runtime/frame-time.d.ts +31 -0
- package/dist/runtime/frame-time.d.ts.map +1 -0
- package/dist/runtime/frame-time.js +29 -0
- package/dist/runtime/frame-time.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/node-picking.d.ts +44 -3
- package/dist/runtime/node-picking.d.ts.map +1 -1
- package/dist/runtime/node-picking.js +118 -3
- package/dist/runtime/node-picking.js.map +1 -1
- package/dist/runtime/node-picking3d.d.ts +2 -1
- package/dist/runtime/node-picking3d.d.ts.map +1 -1
- package/dist/runtime/node-picking3d.js +5 -2
- package/dist/runtime/node-picking3d.js.map +1 -1
- package/dist/runtime/placement.d.ts.map +1 -1
- package/dist/runtime/placement.js +4 -5
- package/dist/runtime/placement.js.map +1 -1
- package/dist/runtime/playback-controller.d.ts +31 -2
- package/dist/runtime/playback-controller.d.ts.map +1 -1
- package/dist/runtime/playback-controller.js +63 -6
- package/dist/runtime/playback-controller.js.map +1 -1
- package/dist/runtime/playback.js.map +1 -1
- package/dist/runtime/precompisition.js.map +1 -1
- package/dist/runtime/project-assets.js.map +1 -1
- package/dist/runtime/session.d.ts +9 -7
- package/dist/runtime/session.d.ts.map +1 -1
- package/dist/runtime/session.js +12 -4
- package/dist/runtime/session.js.map +1 -1
- package/dist/runtime/settle.js.map +1 -1
- package/dist/runtime/state-evaluator.d.ts +1 -1
- package/dist/runtime/state-evaluator.d.ts.map +1 -1
- package/dist/runtime/state-evaluator.js +4 -3
- package/dist/runtime/state-evaluator.js.map +1 -1
- package/dist/runtime/text-geometry.js.map +1 -1
- package/dist/sdk/index.d.ts +19 -15
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +11 -6
- package/dist/sdk/index.js.map +1 -1
- package/dist/tween/command-decorator.d.ts +2 -0
- package/dist/tween/command-decorator.d.ts.map +1 -1
- package/dist/tween/command-decorator.js.map +1 -1
- package/dist/tween/command.js.map +1 -1
- package/dist/tween/ease/constants.d.ts.map +1 -1
- package/dist/tween/ease/constants.js +8 -5
- package/dist/tween/ease/constants.js.map +1 -1
- package/dist/tween/ease/curve.d.ts.map +1 -1
- package/dist/tween/ease/curve.js +4 -3
- package/dist/tween/ease/curve.js.map +1 -1
- package/dist/tween/ease/describe.d.ts +15 -0
- package/dist/tween/ease/describe.d.ts.map +1 -0
- package/dist/tween/ease/describe.js +37 -0
- package/dist/tween/ease/describe.js.map +1 -0
- package/dist/tween/ease/type.js.map +1 -1
- package/dist/tween/index.js.map +1 -1
- package/dist/tween/inert.js.map +1 -1
- package/dist/tween/lerp.js.map +1 -1
- package/dist/tween/loop.js.map +1 -1
- package/dist/tween/prepare.d.ts +3 -3
- package/dist/tween/prepare.js +3 -3
- package/dist/tween/prepare.js.map +1 -1
- package/dist/tween/seekable.d.ts +1 -1
- package/dist/tween/seekable.js.map +1 -1
- package/dist/tween/stepper.js.map +1 -1
- package/dist/tween/to-command.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/context.js.map +1 -1
- package/dist/util/csv.js.map +1 -1
- package/dist/util/generateList.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/metrics.d.ts +1 -1
- package/dist/util/metrics.js +1 -1
- package/dist/util/metrics.js.map +1 -1
- package/dist/util/random.js.map +1 -1
- package/dist/util/reference.js.map +1 -1
- package/dist/util/scheduler.js.map +1 -1
- package/package.json +2 -1
- package/dist/attributes/shape/effects/implementations/displace.d.ts +0 -48
- package/dist/attributes/shape/effects/implementations/displace.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/displace.js +0 -30
- package/dist/attributes/shape/effects/implementations/displace.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/god-rays.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/god-rays.js +0 -26
- package/dist/attributes/shape/effects/implementations/god-rays.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.d.ts +0 -28
- package/dist/attributes/shape/effects/implementations/texture.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/texture.js +0 -25
- package/dist/attributes/shape/effects/implementations/texture.js.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.d.ts +0 -41
- package/dist/attributes/shape/effects/implementations/trails.d.ts.map +0 -1
- package/dist/attributes/shape/effects/implementations/trails.js +0 -22
- package/dist/attributes/shape/effects/implementations/trails.js.map +0 -1
- package/dist/browser/chunks/chunk-2T3HXSC2.js +0 -2
- package/dist/browser/chunks/chunk-2T3HXSC2.js.map +0 -7
- package/dist/browser/chunks/chunk-KJXGRHOL.js +0 -3
- package/dist/browser/chunks/chunk-KJXGRHOL.js.map +0 -7
- package/dist/browser/chunks/chunk-TGDX2SS2.js +0 -18
- package/dist/browser/chunks/chunk-TGDX2SS2.js.map +0 -7
- package/dist/nodes/geometry/dot-grid-node.d.ts +0 -105
- package/dist/nodes/geometry/dot-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/dot-grid-node.js +0 -142
- package/dist/nodes/geometry/dot-grid-node.js.map +0 -1
- package/dist/nodes/geometry/grid-lines.d.ts +0 -101
- package/dist/nodes/geometry/grid-lines.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-lines.js +0 -128
- package/dist/nodes/geometry/grid-lines.js.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.d.ts +0 -58
- package/dist/nodes/geometry/grid-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/grid-pattern-node.js +0 -172
- package/dist/nodes/geometry/grid-pattern-node.js.map +0 -1
- package/dist/nodes/geometry/line-grid-node.d.ts +0 -62
- package/dist/nodes/geometry/line-grid-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-grid-node.js +0 -127
- package/dist/nodes/geometry/line-grid-node.js.map +0 -1
- package/dist/nodes/geometry/line-node.d.ts +0 -58
- package/dist/nodes/geometry/line-node.d.ts.map +0 -1
- package/dist/nodes/geometry/line-node.js +0 -123
- package/dist/nodes/geometry/line-node.js.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.d.ts +0 -39
- package/dist/nodes/geometry/viewport-pattern-node.d.ts.map +0 -1
- package/dist/nodes/geometry/viewport-pattern-node.js +0 -79
- package/dist/nodes/geometry/viewport-pattern-node.js.map +0 -1
- package/dist/nodes/scene/canvas2d-node.d.ts.map +0 -1
- package/dist/nodes/scene/canvas2d-node.js.map +0 -1
- package/dist/nodes/scene/provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/provider-node.js.map +0 -1
- package/dist/nodes/scene/theme-provider-node.d.ts.map +0 -1
- package/dist/nodes/scene/theme-provider-node.js.map +0 -1
- /package/dist/nodes/{scene → root}/provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/provider-node.js +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.d.ts +0 -0
- /package/dist/nodes/{scene → root}/theme-provider-node.js +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { ShapeNode, type ShapeProps } from "./shape-node.js";
|
|
2
|
-
import { Graphics2D } from "../../render/graphics2d.js";
|
|
3
|
-
import { Clip } from "../../render/clip.js";
|
|
4
|
-
import { type Vector2 } from "../../attributes/layout/vector2.js";
|
|
5
|
-
/** A dot grid's own props, over the four paint stacks every `ShapeNode` has. */
|
|
6
|
-
export interface DotGridProps extends ShapeProps {
|
|
7
|
-
/**
|
|
8
|
-
* Number of cells along each axis — the count of equal gaps between the major
|
|
9
|
-
* dots. `divisions` of 4 puts 5 major dots along each axis (the two edges plus
|
|
10
|
-
* three inside). Deliberately the same word, and the same meaning, as
|
|
11
|
-
* `LineGrid.divisions`.
|
|
12
|
-
*/
|
|
13
|
-
divisions: number;
|
|
14
|
-
/**
|
|
15
|
-
* How finely each division is split again. `1` (the default) draws only the
|
|
16
|
-
* major dots; `2` puts one minor dot between each pair, `4` puts three.
|
|
17
|
-
*/
|
|
18
|
-
subdivisions: number;
|
|
19
|
-
/** Radius of a major dot, in the node's own units. */
|
|
20
|
-
radius: number;
|
|
21
|
-
/**
|
|
22
|
-
* A minor dot's radius as a fraction of a major one's.
|
|
23
|
-
*
|
|
24
|
-
* The dot grid's answer to `LineGrid.subStroke`, and a different kind of
|
|
25
|
-
* answer on purpose. A minor *rule* reads as a lighter version of a major one,
|
|
26
|
-
* so the engine dims its paint; a minor *dot* reads as a smaller version of a
|
|
27
|
-
* major one, because a disc has an area to shrink where a hairline does not.
|
|
28
|
-
* Making it a fraction rather than a second paint stack is also what keeps the
|
|
29
|
-
* whole field paintable as **one** fill — see {@link DotGrid.shapeGraphics} —
|
|
30
|
-
* so a gradient laid across the grid crosses every dot in it rather than
|
|
31
|
-
* banding the majors against the minors.
|
|
32
|
-
*/
|
|
33
|
-
subScale: number;
|
|
34
|
-
/**
|
|
35
|
-
* Pixel offset that pans the whole field. Dots tile and wrap, so the node
|
|
36
|
-
* always stays full and animating this scrolls the grid behind a fixed box —
|
|
37
|
-
* `LineGrid.offset` exactly, so a dot grid stacked on a line grid with the
|
|
38
|
-
* same numbers keeps its dots on the intersections while both scroll.
|
|
39
|
-
*/
|
|
40
|
-
offset: Vector2;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* A **dotted grid** — the field of dots a layout is sketched on.
|
|
44
|
-
*
|
|
45
|
-
* The counterpart to motion-script's `LineGrid`, written here because the engine
|
|
46
|
-
* has no dotted one. It is deliberately the *same node* with a different mark:
|
|
47
|
-
* the same `divisions` / `subdivisions` / `offset` props, resolved through the
|
|
48
|
-
* same tiling (see `./tiling`), so the two line up dot-on-intersection when one
|
|
49
|
-
* is laid over the other and stay lined up while both are panned.
|
|
50
|
-
*
|
|
51
|
-
* ## Its silhouette is the dots
|
|
52
|
-
*
|
|
53
|
-
* Which is the whole implementation, and the reason there is no `renderSelf`
|
|
54
|
-
* here at all. {@link ShapeNode} already paints `shadow` + `fill` of
|
|
55
|
-
* {@link shapeGraphics}, lays `overlay` over it and runs `stroke` round it — so
|
|
56
|
-
* returning the union of every dot from that one method gets all four stacks
|
|
57
|
-
* right, in the right order, with no render code of this class's own.
|
|
58
|
-
*
|
|
59
|
-
* That is also where the pair's asymmetry comes from and why it is not a defect:
|
|
60
|
-
* a line grid's rules are painted by its `stroke`, because a line encloses no
|
|
61
|
-
* area, and a dot grid's dots are painted by its `fill`, because a disc is
|
|
62
|
-
* nothing but area. Each mark lands on the slot that means what its name says
|
|
63
|
-
* (see {@link LINE_GRID_NODE_KEY}). The consequence worth knowing is that a dot
|
|
64
|
-
* grid has no "paper" — a rectangle behind it is how everything else in this app
|
|
65
|
-
* gets a background.
|
|
66
|
-
*
|
|
67
|
-
* ## What it does not inherit
|
|
68
|
-
*
|
|
69
|
-
* {@link clipSelf} is overridden to the node's *box* rather than left to the
|
|
70
|
-
* silhouette, and it does two jobs at once. It clips the outermost dots to the
|
|
71
|
-
* frame as they pan out, the way `LineGrid` clips its rules; and because
|
|
72
|
-
* `ShapeNode.hitTestSelf` grabs on the clip, it is also what makes the node
|
|
73
|
-
* selectable in the editor between the dots. Without it a backdrop could only be
|
|
74
|
-
* clicked on a dot, which for the one node type whose job is to sit behind
|
|
75
|
-
* everything else would be close to unclickable.
|
|
76
|
-
*
|
|
77
|
-
* `start` / `end` are not passed down to the dots, and the Progress section is
|
|
78
|
-
* inherited anyway. Trimming a disc's outline leaves a crescent, so a partial
|
|
79
|
-
* dot grid drawn that way would be a field of moons rather than a grid halfway
|
|
80
|
-
* drawn — there is no honest fraction of a dot, so the trim is left to act on
|
|
81
|
-
* nothing rather than to act wrongly.
|
|
82
|
-
*/
|
|
83
|
-
export declare class DotGrid extends ShapeNode<DotGridProps> {
|
|
84
|
-
readonly divisions: number;
|
|
85
|
-
readonly subdivisions: number;
|
|
86
|
-
readonly radius: number;
|
|
87
|
-
readonly subScale: number;
|
|
88
|
-
readonly offset: Vector2;
|
|
89
|
-
/**
|
|
90
|
-
* Every dot in the field, as one un-painted union.
|
|
91
|
-
*
|
|
92
|
-
* One `Graphics2D` rather than one per dot because the paint stacks are the
|
|
93
|
-
* grid's rather than any dot's: a single gradient crosses the whole field, and
|
|
94
|
-
* a single stroke rings every dot at one weight. Returning `null` for an empty
|
|
95
|
-
* box matches the base class's contract — a node with no silhouette paints
|
|
96
|
-
* nothing rather than painting a degenerate one.
|
|
97
|
-
*/
|
|
98
|
-
protected shapeGraphics(): Graphics2D | null;
|
|
99
|
-
/**
|
|
100
|
-
* The node's box — what the dots are clipped to, and what the editor grabs.
|
|
101
|
-
* See the class note for why this is not the silhouette.
|
|
102
|
-
*/
|
|
103
|
-
protected clipSelf(): Clip;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=dot-grid-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dot-grid-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/dot-grid-node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAgCxE,gFAAgF;AAChF,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAA;IACd;;;;;;;;;;;OAWG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAA;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAClD,SAA2C,SAAS,EAAE,MAAM,CAAA;IAC5D,SAA2C,YAAY,EAAE,MAAM,CAAA;IAC/D,SAA2C,MAAM,EAAE,MAAM,CAAA;IACzD,SAA6C,QAAQ,EAAE,MAAM,CAAA;IAC7D,SACiB,MAAM,EAAE,OAAO,CAAA;IAEhC;;;;;;;;OAQG;cACgB,aAAa,IAAI,UAAU,GAAG,IAAI;IAmDrD;;;OAGG;cACgB,QAAQ,IAAI,IAAI;CAOpC"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { addTiledLines } from "./grid-lines.js";
|
|
8
|
-
import { property } from "../../attributes/properties/decorator.js";
|
|
9
|
-
import { ShapeNode } from "./shape-node.js";
|
|
10
|
-
import { Graphics2D } from "../../render/graphics2d.js";
|
|
11
|
-
import { Clip } from "../../render/clip.js";
|
|
12
|
-
import { lerpVector2 } from "../../attributes/layout/vector2.js";
|
|
13
|
-
/**
|
|
14
|
-
* Where a grid's marks sit on one axis, collected.
|
|
15
|
-
*
|
|
16
|
-
* {@link addTiledLines} is the tiling {@link LineGrid} uses, and calling it here
|
|
17
|
-
* is what keeps a dot grid laid over a line grid putting its dots **on** the
|
|
18
|
-
* intersections at every offset — rather than on a second tiling that merely
|
|
19
|
-
* looks the same and drifts apart somewhere nobody tested.
|
|
20
|
-
*/
|
|
21
|
-
function gridPositions(min, max, step, offset, subdivisions, overscan) {
|
|
22
|
-
const out = [];
|
|
23
|
-
addTiledLines(min, max, step, offset, subdivisions, overscan, (pos, isMajor) => {
|
|
24
|
-
out.push({ pos, isMajor });
|
|
25
|
-
});
|
|
26
|
-
return out;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A **dotted grid** — the field of dots a layout is sketched on.
|
|
30
|
-
*
|
|
31
|
-
* The counterpart to motion-script's `LineGrid`, written here because the engine
|
|
32
|
-
* has no dotted one. It is deliberately the *same node* with a different mark:
|
|
33
|
-
* the same `divisions` / `subdivisions` / `offset` props, resolved through the
|
|
34
|
-
* same tiling (see `./tiling`), so the two line up dot-on-intersection when one
|
|
35
|
-
* is laid over the other and stay lined up while both are panned.
|
|
36
|
-
*
|
|
37
|
-
* ## Its silhouette is the dots
|
|
38
|
-
*
|
|
39
|
-
* Which is the whole implementation, and the reason there is no `renderSelf`
|
|
40
|
-
* here at all. {@link ShapeNode} already paints `shadow` + `fill` of
|
|
41
|
-
* {@link shapeGraphics}, lays `overlay` over it and runs `stroke` round it — so
|
|
42
|
-
* returning the union of every dot from that one method gets all four stacks
|
|
43
|
-
* right, in the right order, with no render code of this class's own.
|
|
44
|
-
*
|
|
45
|
-
* That is also where the pair's asymmetry comes from and why it is not a defect:
|
|
46
|
-
* a line grid's rules are painted by its `stroke`, because a line encloses no
|
|
47
|
-
* area, and a dot grid's dots are painted by its `fill`, because a disc is
|
|
48
|
-
* nothing but area. Each mark lands on the slot that means what its name says
|
|
49
|
-
* (see {@link LINE_GRID_NODE_KEY}). The consequence worth knowing is that a dot
|
|
50
|
-
* grid has no "paper" — a rectangle behind it is how everything else in this app
|
|
51
|
-
* gets a background.
|
|
52
|
-
*
|
|
53
|
-
* ## What it does not inherit
|
|
54
|
-
*
|
|
55
|
-
* {@link clipSelf} is overridden to the node's *box* rather than left to the
|
|
56
|
-
* silhouette, and it does two jobs at once. It clips the outermost dots to the
|
|
57
|
-
* frame as they pan out, the way `LineGrid` clips its rules; and because
|
|
58
|
-
* `ShapeNode.hitTestSelf` grabs on the clip, it is also what makes the node
|
|
59
|
-
* selectable in the editor between the dots. Without it a backdrop could only be
|
|
60
|
-
* clicked on a dot, which for the one node type whose job is to sit behind
|
|
61
|
-
* everything else would be close to unclickable.
|
|
62
|
-
*
|
|
63
|
-
* `start` / `end` are not passed down to the dots, and the Progress section is
|
|
64
|
-
* inherited anyway. Trimming a disc's outline leaves a crescent, so a partial
|
|
65
|
-
* dot grid drawn that way would be a field of moons rather than a grid halfway
|
|
66
|
-
* drawn — there is no honest fraction of a dot, so the trim is left to act on
|
|
67
|
-
* nothing rather than to act wrongly.
|
|
68
|
-
*/
|
|
69
|
-
export class DotGrid extends ShapeNode {
|
|
70
|
-
/**
|
|
71
|
-
* Every dot in the field, as one un-painted union.
|
|
72
|
-
*
|
|
73
|
-
* One `Graphics2D` rather than one per dot because the paint stacks are the
|
|
74
|
-
* grid's rather than any dot's: a single gradient crosses the whole field, and
|
|
75
|
-
* a single stroke rings every dot at one weight. Returning `null` for an empty
|
|
76
|
-
* box matches the base class's contract — a node with no silhouette paints
|
|
77
|
-
* nothing rather than painting a degenerate one.
|
|
78
|
-
*/
|
|
79
|
-
shapeGraphics() {
|
|
80
|
-
const bounds = this.layoutBounds;
|
|
81
|
-
const width = bounds?.width ?? 0;
|
|
82
|
-
const height = bounds?.height ?? 0;
|
|
83
|
-
if (width <= 0 || height <= 0)
|
|
84
|
-
return null;
|
|
85
|
-
const divisions = Math.max(1, Math.floor(this.divisions));
|
|
86
|
-
const subdivisions = Math.max(1, Math.floor(this.subdivisions));
|
|
87
|
-
const major = Math.max(0, this.radius);
|
|
88
|
-
const minor = major * Math.max(0, this.subScale);
|
|
89
|
-
if (major <= 0 && minor <= 0)
|
|
90
|
-
return null;
|
|
91
|
-
// Inset by a dot's radius so an edge dot sits *inside* the box rather than
|
|
92
|
-
// straddling it and being halved by the clip — the same bargain `LineGrid`
|
|
93
|
-
// makes with half its thickest stroke, and the reason a grid's outermost
|
|
94
|
-
// marks land on the frame rather than under it.
|
|
95
|
-
const cols = divisions * subdivisions;
|
|
96
|
-
const insetX = Math.max(0, width / 2 - major);
|
|
97
|
-
const insetY = Math.max(0, height / 2 - major);
|
|
98
|
-
const xs = gridPositions(-insetX, insetX, (insetX * 2) / cols, this.offset.x, subdivisions, major);
|
|
99
|
-
const ys = gridPositions(-insetY, insetY, (insetY * 2) / cols, this.offset.y, subdivisions, major);
|
|
100
|
-
const dots = new Graphics2D();
|
|
101
|
-
let drew = false;
|
|
102
|
-
for (const column of xs) {
|
|
103
|
-
for (const row of ys) {
|
|
104
|
-
// A dot is major only where *both* axes are — an intersection of two
|
|
105
|
-
// major rules, which is exactly the point a line grid draws heaviest.
|
|
106
|
-
const size = column.isMajor && row.isMajor ? major : minor;
|
|
107
|
-
if (size <= 0)
|
|
108
|
-
continue;
|
|
109
|
-
dots.ellipse({ x: column.pos, y: row.pos, width: size * 2, height: size * 2 });
|
|
110
|
-
drew = true;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return drew ? dots : null;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* The node's box — what the dots are clipped to, and what the editor grabs.
|
|
117
|
-
* See the class note for why this is not the silhouette.
|
|
118
|
-
*/
|
|
119
|
-
clipSelf() {
|
|
120
|
-
const bounds = this.layoutBounds;
|
|
121
|
-
return new Clip().rect({
|
|
122
|
-
width: bounds?.width ?? 0,
|
|
123
|
-
height: bounds?.height ?? 0,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
__decorate([
|
|
128
|
-
property({ default: 4 })
|
|
129
|
-
], DotGrid.prototype, "divisions", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
property({ default: 1 })
|
|
132
|
-
], DotGrid.prototype, "subdivisions", void 0);
|
|
133
|
-
__decorate([
|
|
134
|
-
property({ default: 3 })
|
|
135
|
-
], DotGrid.prototype, "radius", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
property({ default: 0.5 })
|
|
138
|
-
], DotGrid.prototype, "subScale", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
property({ default: { x: 0, y: 0 }, tween: lerpVector2 })
|
|
141
|
-
], DotGrid.prototype, "offset", void 0);
|
|
142
|
-
//# source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AC,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;uCAC1B","sourcesContent":["import { addTiledLines } from \"./grid-lines\";\nimport { property } from \"@/attributes/properties/decorator\";\nimport { ShapeNode, type ShapeProps } from \"./shape-node\";\nimport { Graphics2D } from \"@/render/graphics2d\";\nimport { Clip } from \"@/render/clip\";\nimport { lerpVector2, type Vector2 } from \"@/attributes/layout/vector2\";\n\n\n/** One mark's place on an axis, and whether it lands on the coarse grid. */\ninterface GridPosition {\n pos: number;\n isMajor: boolean;\n}\n\n/**\n * Where a grid's marks sit on one axis, collected.\n *\n * {@link addTiledLines} is the tiling {@link LineGrid} uses, and calling it here\n * is what keeps a dot grid laid over a line grid putting its dots **on** the\n * intersections at every offset — rather than on a second tiling that merely\n * looks the same and drifts apart somewhere nobody tested.\n */\nfunction gridPositions(\n min: number,\n max: number,\n step: number,\n offset: number,\n subdivisions: number,\n overscan: number,\n): GridPosition[] {\n const out: GridPosition[] = [];\n addTiledLines(min, max, step, offset, subdivisions, overscan, (pos, isMajor) => {\n out.push({ pos, isMajor });\n });\n return out;\n}\n\n/** A dot grid's own props, over the four paint stacks every `ShapeNode` has. */\nexport interface DotGridProps extends ShapeProps {\n /**\n * Number of cells along each axis — the count of equal gaps between the major\n * dots. `divisions` of 4 puts 5 major dots along each axis (the two edges plus\n * three inside). Deliberately the same word, and the same meaning, as\n * `LineGrid.divisions`.\n */\n divisions: number\n /**\n * How finely each division is split again. `1` (the default) draws only the\n * major dots; `2` puts one minor dot between each pair, `4` puts three.\n */\n subdivisions: number\n /** Radius of a major dot, in the node's own units. */\n radius: number\n /**\n * A minor dot's radius as a fraction of a major one's.\n *\n * The dot grid's answer to `LineGrid.subStroke`, and a different kind of\n * answer on purpose. A minor *rule* reads as a lighter version of a major one,\n * so the engine dims its paint; a minor *dot* reads as a smaller version of a\n * major one, because a disc has an area to shrink where a hairline does not.\n * Making it a fraction rather than a second paint stack is also what keeps the\n * whole field paintable as **one** fill — see {@link DotGrid.shapeGraphics} —\n * so a gradient laid across the grid crosses every dot in it rather than\n * banding the majors against the minors.\n */\n subScale: number\n /**\n * Pixel offset that pans the whole field. Dots tile and wrap, so the node\n * always stays full and animating this scrolls the grid behind a fixed box —\n * `LineGrid.offset` exactly, so a dot grid stacked on a line grid with the\n * same numbers keeps its dots on the intersections while both scroll.\n */\n offset: Vector2\n}\n\n/**\n * A **dotted grid** — the field of dots a layout is sketched on.\n *\n * The counterpart to motion-script's `LineGrid`, written here because the engine\n * has no dotted one. It is deliberately the *same node* with a different mark:\n * the same `divisions` / `subdivisions` / `offset` props, resolved through the\n * same tiling (see `./tiling`), so the two line up dot-on-intersection when one\n * is laid over the other and stay lined up while both are panned.\n *\n * ## Its silhouette is the dots\n *\n * Which is the whole implementation, and the reason there is no `renderSelf`\n * here at all. {@link ShapeNode} already paints `shadow` + `fill` of\n * {@link shapeGraphics}, lays `overlay` over it and runs `stroke` round it — so\n * returning the union of every dot from that one method gets all four stacks\n * right, in the right order, with no render code of this class's own.\n *\n * That is also where the pair's asymmetry comes from and why it is not a defect:\n * a line grid's rules are painted by its `stroke`, because a line encloses no\n * area, and a dot grid's dots are painted by its `fill`, because a disc is\n * nothing but area. Each mark lands on the slot that means what its name says\n * (see {@link LINE_GRID_NODE_KEY}). The consequence worth knowing is that a dot\n * grid has no \"paper\" — a rectangle behind it is how everything else in this app\n * gets a background.\n *\n * ## What it does not inherit\n *\n * {@link clipSelf} is overridden to the node's *box* rather than left to the\n * silhouette, and it does two jobs at once. It clips the outermost dots to the\n * frame as they pan out, the way `LineGrid` clips its rules; and because\n * `ShapeNode.hitTestSelf` grabs on the clip, it is also what makes the node\n * selectable in the editor between the dots. Without it a backdrop could only be\n * clicked on a dot, which for the one node type whose job is to sit behind\n * everything else would be close to unclickable.\n *\n * `start` / `end` are not passed down to the dots, and the Progress section is\n * inherited anyway. Trimming a disc's outline leaves a crescent, so a partial\n * dot grid drawn that way would be a field of moons rather than a grid halfway\n * drawn — there is no honest fraction of a dot, so the trim is left to act on\n * nothing rather than to act wrongly.\n */\nexport class DotGrid extends ShapeNode<DotGridProps> {\n @property({ default: 4 }) declare readonly divisions: number\n @property({ default: 1 }) declare readonly subdivisions: number\n @property({ default: 3 }) declare readonly radius: number\n @property({ default: 0.5 }) declare readonly subScale: number\n @property({ default: { x: 0, y: 0 }, tween: lerpVector2 })\n declare readonly offset: Vector2\n\n /**\n * Every dot in the field, as one un-painted union.\n *\n * One `Graphics2D` rather than one per dot because the paint stacks are the\n * grid's rather than any dot's: a single gradient crosses the whole field, and\n * a single stroke rings every dot at one weight. Returning `null` for an empty\n * box matches the base class's contract — a node with no silhouette paints\n * nothing rather than painting a degenerate one.\n */\n protected override shapeGraphics(): Graphics2D | null {\n const bounds = this.layoutBounds\n const width = bounds?.width ?? 0\n const height = bounds?.height ?? 0\n if (width <= 0 || height <= 0) return null\n\n const divisions = Math.max(1, Math.floor(this.divisions))\n const subdivisions = Math.max(1, Math.floor(this.subdivisions))\n const major = Math.max(0, this.radius)\n const minor = major * Math.max(0, this.subScale)\n if (major <= 0 && minor <= 0) return null\n\n // Inset by a dot's radius so an edge dot sits *inside* the box rather than\n // straddling it and being halved by the clip — the same bargain `LineGrid`\n // makes with half its thickest stroke, and the reason a grid's outermost\n // marks land on the frame rather than under it.\n const cols = divisions * subdivisions\n const insetX = Math.max(0, width / 2 - major)\n const insetY = Math.max(0, height / 2 - major)\n const xs = gridPositions(\n -insetX,\n insetX,\n (insetX * 2) / cols,\n this.offset.x,\n subdivisions,\n major\n )\n const ys = gridPositions(\n -insetY,\n insetY,\n (insetY * 2) / cols,\n this.offset.y,\n subdivisions,\n major\n )\n\n const dots = new Graphics2D()\n let drew = false\n for (const column of xs) {\n for (const row of ys) {\n // A dot is major only where *both* axes are — an intersection of two\n // major rules, which is exactly the point a line grid draws heaviest.\n const size = column.isMajor && row.isMajor ? major : minor\n if (size <= 0) continue\n dots.ellipse({ x: column.pos, y: row.pos, width: size * 2, height: size * 2 })\n drew = true\n }\n }\n return drew ? dots : null\n }\n\n /**\n * The node's box — what the dots are clipped to, and what the editor grabs.\n * See the class note for why this is not the silhouette.\n */\n protected override clipSelf(): Clip {\n const bounds = this.layoutBounds\n return new Clip().rect({\n width: bounds?.width ?? 0,\n height: bounds?.height ?? 0,\n })\n }\n}\n"]}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { PathCommand } from "../../render/descriptors/path.js";
|
|
2
|
-
import { StrokeResolved } from "../../attributes/shape/stroke/stroke.js";
|
|
3
|
-
/**
|
|
4
|
-
* Shared geometry for line grids. Both {@link LineGrid} (a fixed grid filling
|
|
5
|
-
* its layout rect) and {@link GridPattern} (an infinite grid tiled across the
|
|
6
|
-
* camera's visible region) build the same multi-subpath line paths from these
|
|
7
|
-
* helpers — they differ only in how the extent and step are chosen.
|
|
8
|
-
*
|
|
9
|
-
* Lines are tiled by the minor step and panned by an origin offset: every
|
|
10
|
-
* position within the extent (grown by `overscan` so thick lines clip out
|
|
11
|
-
* smoothly) is emitted regardless of the offset, so the area always stays full
|
|
12
|
-
* and animating the offset scrolls the grid. A tile whose index aligns to the
|
|
13
|
-
* division grid is major; the rest are minor. Each is built as a single
|
|
14
|
-
* multi-subpath path so the trailing stroke paints every line as one union with
|
|
15
|
-
* no destructive boolean op (which would erase the open lines).
|
|
16
|
-
*/
|
|
17
|
-
/** A grid extent on one axis: lines tile within `[min, max]` about 0. */
|
|
18
|
-
/** @internal */
|
|
19
|
-
export interface GridAxis {
|
|
20
|
-
/** Minimum coordinate (typically negative; the lines centre on 0). */
|
|
21
|
-
min: number;
|
|
22
|
-
/** Maximum coordinate. */
|
|
23
|
-
max: number;
|
|
24
|
-
/** Spacing between adjacent (minor) lines. */
|
|
25
|
-
step: number;
|
|
26
|
-
/** Pan offset in pixels along this axis. */
|
|
27
|
-
offset: number;
|
|
28
|
-
}
|
|
29
|
-
/** The resolved grid: where each line sits and how far it runs. Vertical lines
|
|
30
|
-
* sit at x = `verticalX[i]` and run from `top` to `bottom`; horizontal lines sit
|
|
31
|
-
* at y = `horizontalY[i]` and run from `left` to `right`. Positions are split
|
|
32
|
-
* into major (division) and minor (subdivision) lines. */
|
|
33
|
-
/** @internal */
|
|
34
|
-
export interface GridLines {
|
|
35
|
-
/** y-extent every vertical line spans. */
|
|
36
|
-
top: number;
|
|
37
|
-
bottom: number;
|
|
38
|
-
/** x-extent every horizontal line spans. */
|
|
39
|
-
left: number;
|
|
40
|
-
right: number;
|
|
41
|
-
verticalMajor: number[];
|
|
42
|
-
verticalMinor: number[];
|
|
43
|
-
horizontalMajor: number[];
|
|
44
|
-
horizontalMinor: number[];
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Resolve the grid for the given per-axis extents: the cross-axis span and the
|
|
48
|
-
* major/minor line positions on each axis. Vertical lines span the full y
|
|
49
|
-
* extent; horizontal lines span the full x extent. Both spans are grown by
|
|
50
|
-
* `overscan` so a thick line slides out under the clip instead of popping, and
|
|
51
|
-
* snapped outward to the grid so the endpoints sit on stable world positions
|
|
52
|
-
* (a line's start stays fixed as the camera pans, so a dashed stroke anchored to
|
|
53
|
-
* it doesn't crawl).
|
|
54
|
-
*
|
|
55
|
-
* `cycle` (the dash period, when dashed) snaps the cross-axis span to a whole
|
|
56
|
-
* number of dash cycles too, so each parallel line is the same dash-aligned
|
|
57
|
-
* length and the renderer's per-path dash-fit becomes a no-op (no per-frame
|
|
58
|
-
* resizing of the dashes as lines enter and leave view).
|
|
59
|
-
*/
|
|
60
|
-
/** @internal */
|
|
61
|
-
export declare function gridLines(x: GridAxis, y: GridAxis, subdivisions: number, overscan: number, cycle?: number): GridLines;
|
|
62
|
-
/**
|
|
63
|
-
* Build the grid lines as multi-subpath path commands, split into the major
|
|
64
|
-
* (division) lines and the minor (subdivision) lines, for the given per-axis
|
|
65
|
-
* extents. Every line in a group shares one stroke (drawn as one union path), so
|
|
66
|
-
* this is the path for solid strokes; dashed strokes that must stay world-locked
|
|
67
|
-
* draw per line from {@link gridLines} instead.
|
|
68
|
-
*/
|
|
69
|
-
/** @internal */
|
|
70
|
-
export declare function gridLinePaths(x: GridAxis, y: GridAxis, subdivisions: number, overscan: number): {
|
|
71
|
-
major: PathCommand[];
|
|
72
|
-
minor: PathCommand[];
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* Emit every grid line position in `[min, max]` (grown by `overscan` on each
|
|
76
|
-
* end) for a grid of spacing `step`, panned by `offset` px. Without panning the
|
|
77
|
-
* un-offset grid is centred on 0 and its tile indices count outward from there;
|
|
78
|
-
* the line at tile index `n` is major when `n` is a multiple of `subdivisions`.
|
|
79
|
-
* The pan shifts each position by `offset` while keeping the area full, so `n`
|
|
80
|
-
* is taken relative to the un-panned centred grid (offset folded out) to keep
|
|
81
|
-
* classification stable as it scrolls.
|
|
82
|
-
*/
|
|
83
|
-
/** @internal */
|
|
84
|
-
export declare function addTiledLines(min: number, max: number, step: number, offset: number, subdivisions: number, overscan: number, emit: (pos: number, isMajor: boolean) => void): void;
|
|
85
|
-
/** Largest stroke weight across the layers of a resolved stroke array. Used to
|
|
86
|
-
* overscan the tiling so a thick line stays drawn until fully off the area. */
|
|
87
|
-
/** @internal */
|
|
88
|
-
export declare function maxWeight(strokes: StrokeResolved[]): number;
|
|
89
|
-
/** Force every layer of a resolved stroke array to centered alignment. Grid
|
|
90
|
-
* lines are open paths, not a closed region, so inside/outside alignment is
|
|
91
|
-
* meaningless — they always straddle their position. (Open paths are already
|
|
92
|
-
* stroked centered by the renderer; this makes the intent explicit and ignores
|
|
93
|
-
* any author `align`.) */
|
|
94
|
-
/** @internal */
|
|
95
|
-
export declare function centered(strokes: StrokeResolved[]): StrokeResolved[];
|
|
96
|
-
/** Copy a resolved stroke array with every fill layer's opacity scaled by
|
|
97
|
-
* `factor`. Used to derive the default minor-line stroke from the major one.
|
|
98
|
-
* Every resolved fill carries an `opacity` field, so this is type-uniform. */
|
|
99
|
-
/** @internal */
|
|
100
|
-
export declare function dimStroke(strokes: StrokeResolved[], factor: number): StrokeResolved[];
|
|
101
|
-
//# sourceMappingURL=grid-lines.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-lines.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/grid-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAc,cAAc,EAAa,MAAM,kCAAkC,CAAC;AAEzF;;;;;;;;;;;;;GAaG;AAEH,yEAAyE;AACzE,gBAAgB;AAChB,MAAM,WAAW,QAAQ;IACrB,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;0DAG0D;AAC1D,gBAAgB;AAChB,MAAM,WAAW,SAAS;IACtB,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,wBAAgB,SAAS,CACrB,CAAC,EAAE,QAAQ,EACX,CAAC,EAAE,QAAQ,EACX,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,SAAI,GACV,SAAS,CAqBX;AAED;;;;;;GAMG;AACH,gBAAgB;AAChB,wBAAgB,aAAa,CACzB,CAAC,EAAE,QAAQ,EACX,CAAC,EAAE,QAAQ,EACX,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACjB;IAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,CAShD;AAeD;;;;;;;;GAQG;AACH,gBAAgB;AAChB,wBAAgB,aAAa,CACzB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAC9C,IAAI,CAeN;AAED;+EAC+E;AAC/E,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,MAAM,CAI3D;AAED;;;;0BAI0B;AAC1B,gBAAgB;AAChB,wBAAgB,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAEpE;AAED;;8EAE8E;AAC9E,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CAKrF"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { strokeOps } from "../../attributes/shape/stroke/stroke.js";
|
|
2
|
-
/**
|
|
3
|
-
* Resolve the grid for the given per-axis extents: the cross-axis span and the
|
|
4
|
-
* major/minor line positions on each axis. Vertical lines span the full y
|
|
5
|
-
* extent; horizontal lines span the full x extent. Both spans are grown by
|
|
6
|
-
* `overscan` so a thick line slides out under the clip instead of popping, and
|
|
7
|
-
* snapped outward to the grid so the endpoints sit on stable world positions
|
|
8
|
-
* (a line's start stays fixed as the camera pans, so a dashed stroke anchored to
|
|
9
|
-
* it doesn't crawl).
|
|
10
|
-
*
|
|
11
|
-
* `cycle` (the dash period, when dashed) snaps the cross-axis span to a whole
|
|
12
|
-
* number of dash cycles too, so each parallel line is the same dash-aligned
|
|
13
|
-
* length and the renderer's per-path dash-fit becomes a no-op (no per-frame
|
|
14
|
-
* resizing of the dashes as lines enter and leave view).
|
|
15
|
-
*/
|
|
16
|
-
/** @internal */
|
|
17
|
-
export function gridLines(x, y, subdivisions, overscan, cycle = 0) {
|
|
18
|
-
const verticalMajor = [];
|
|
19
|
-
const verticalMinor = [];
|
|
20
|
-
const horizontalMajor = [];
|
|
21
|
-
const horizontalMinor = [];
|
|
22
|
-
// Span each line across the cross axis, snapped outward to the grid (and to
|
|
23
|
-
// the dash cycle when dashed) so the endpoints sit on stable world positions.
|
|
24
|
-
const top = snapSpan(y.min - overscan, y.step, y.offset, cycle, Math.floor);
|
|
25
|
-
const bottom = snapSpan(y.max + overscan, y.step, y.offset, cycle, Math.ceil);
|
|
26
|
-
const left = snapSpan(x.min - overscan, x.step, x.offset, cycle, Math.floor);
|
|
27
|
-
const right = snapSpan(x.max + overscan, x.step, x.offset, cycle, Math.ceil);
|
|
28
|
-
addTiledLines(x.min, x.max, x.step, x.offset, subdivisions, overscan, (px, isMajor) => {
|
|
29
|
-
(isMajor ? verticalMajor : verticalMinor).push(px);
|
|
30
|
-
});
|
|
31
|
-
addTiledLines(y.min, y.max, y.step, y.offset, subdivisions, overscan, (py, isMajor) => {
|
|
32
|
-
(isMajor ? horizontalMajor : horizontalMinor).push(py);
|
|
33
|
-
});
|
|
34
|
-
return { top, bottom, left, right, verticalMajor, verticalMinor, horizontalMajor, horizontalMinor };
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Build the grid lines as multi-subpath path commands, split into the major
|
|
38
|
-
* (division) lines and the minor (subdivision) lines, for the given per-axis
|
|
39
|
-
* extents. Every line in a group shares one stroke (drawn as one union path), so
|
|
40
|
-
* this is the path for solid strokes; dashed strokes that must stay world-locked
|
|
41
|
-
* draw per line from {@link gridLines} instead.
|
|
42
|
-
*/
|
|
43
|
-
/** @internal */
|
|
44
|
-
export function gridLinePaths(x, y, subdivisions, overscan) {
|
|
45
|
-
const g = gridLines(x, y, subdivisions, overscan);
|
|
46
|
-
const major = [];
|
|
47
|
-
const minor = [];
|
|
48
|
-
for (const px of g.verticalMajor)
|
|
49
|
-
major.push({ type: "M", x: px, y: g.top }, { type: "L", x: px, y: g.bottom });
|
|
50
|
-
for (const px of g.verticalMinor)
|
|
51
|
-
minor.push({ type: "M", x: px, y: g.top }, { type: "L", x: px, y: g.bottom });
|
|
52
|
-
for (const py of g.horizontalMajor)
|
|
53
|
-
major.push({ type: "M", x: g.left, y: py }, { type: "L", x: g.right, y: py });
|
|
54
|
-
for (const py of g.horizontalMinor)
|
|
55
|
-
minor.push({ type: "M", x: g.left, y: py }, { type: "L", x: g.right, y: py });
|
|
56
|
-
return { major, minor };
|
|
57
|
-
}
|
|
58
|
-
// Snap `pos` outward to a stable world position so a dashed line's start stays
|
|
59
|
-
// fixed as the viewport moves (the renderer anchors dash phase to the subpath
|
|
60
|
-
// start). Snap to the grid line lattice (`n*step + offset`); when a dash `cycle`
|
|
61
|
-
// is given, snap to the dash lattice instead (`n*cycle`, anchored to world 0) so
|
|
62
|
-
// every parallel line is the same whole number of cycles long and the renderer's
|
|
63
|
-
// per-path dash-fit stays a no-op. `round` is `Math.floor` to snap below, `ceil`
|
|
64
|
-
// to snap above.
|
|
65
|
-
function snapSpan(pos, step, offset, cycle, round) {
|
|
66
|
-
if (cycle > 0)
|
|
67
|
-
return round(pos / cycle) * cycle;
|
|
68
|
-
if (step <= 0)
|
|
69
|
-
return pos;
|
|
70
|
-
return round((pos - offset) / step) * step + offset;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Emit every grid line position in `[min, max]` (grown by `overscan` on each
|
|
74
|
-
* end) for a grid of spacing `step`, panned by `offset` px. Without panning the
|
|
75
|
-
* un-offset grid is centred on 0 and its tile indices count outward from there;
|
|
76
|
-
* the line at tile index `n` is major when `n` is a multiple of `subdivisions`.
|
|
77
|
-
* The pan shifts each position by `offset` while keeping the area full, so `n`
|
|
78
|
-
* is taken relative to the un-panned centred grid (offset folded out) to keep
|
|
79
|
-
* classification stable as it scrolls.
|
|
80
|
-
*/
|
|
81
|
-
/** @internal */
|
|
82
|
-
export function addTiledLines(min, max, step, offset, subdivisions, overscan, emit) {
|
|
83
|
-
if (step <= 0)
|
|
84
|
-
return;
|
|
85
|
-
// First/last tile index whose panned position is within the overscanned
|
|
86
|
-
// [min, max]. Positions are `n*step + offset` on the centred grid (n=0 sits
|
|
87
|
-
// at the centre, 0). A small epsilon keeps a line that lands exactly on an
|
|
88
|
-
// edge (common at offset 0 with an even tile count) from being dropped by FP error.
|
|
89
|
-
const eps = step * 1e-6;
|
|
90
|
-
const startN = Math.ceil((min - overscan - offset - eps) / step);
|
|
91
|
-
const endN = Math.floor((max + overscan - offset + eps) / step);
|
|
92
|
-
for (let n = startN; n <= endN; n++) {
|
|
93
|
-
const pos = n * step + offset;
|
|
94
|
-
// mod that stays non-negative for negative n.
|
|
95
|
-
const isMajor = ((n % subdivisions) + subdivisions) % subdivisions === 0;
|
|
96
|
-
emit(pos, isMajor);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/** Largest stroke weight across the layers of a resolved stroke array. Used to
|
|
100
|
-
* overscan the tiling so a thick line stays drawn until fully off the area. */
|
|
101
|
-
/** @internal */
|
|
102
|
-
export function maxWeight(strokes) {
|
|
103
|
-
let max = 0;
|
|
104
|
-
for (const s of strokes)
|
|
105
|
-
if (s.weight > max)
|
|
106
|
-
max = s.weight;
|
|
107
|
-
return max;
|
|
108
|
-
}
|
|
109
|
-
/** Force every layer of a resolved stroke array to centered alignment. Grid
|
|
110
|
-
* lines are open paths, not a closed region, so inside/outside alignment is
|
|
111
|
-
* meaningless — they always straddle their position. (Open paths are already
|
|
112
|
-
* stroked centered by the renderer; this makes the intent explicit and ignores
|
|
113
|
-
* any author `align`.) */
|
|
114
|
-
/** @internal */
|
|
115
|
-
export function centered(strokes) {
|
|
116
|
-
return strokes.map(s => (s.align === 0 ? s : { ...s, align: 0 }));
|
|
117
|
-
}
|
|
118
|
-
/** Copy a resolved stroke array with every fill layer's opacity scaled by
|
|
119
|
-
* `factor`. Used to derive the default minor-line stroke from the major one.
|
|
120
|
-
* Every resolved fill carries an `opacity` field, so this is type-uniform. */
|
|
121
|
-
/** @internal */
|
|
122
|
-
export function dimStroke(strokes, factor) {
|
|
123
|
-
return strokeOps.resolve(strokes.map(s => ({
|
|
124
|
-
...s,
|
|
125
|
-
fill: s.fill.map(f => ({ ...f, opacity: (f.opacity ?? 1) * factor })),
|
|
126
|
-
})));
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=grid-lines.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-lines.js","sourceRoot":"","sources":["../../../src/nodes/geometry/grid-lines.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAgDzF;;;;;;;;;;;;;GAaG;AACH,gBAAgB;AAChB,MAAM,UAAU,SAAS,CACrB,CAAW,EACX,CAAW,EACX,YAAoB,EACpB,QAAgB,EAChB,KAAK,GAAG,CAAC;IAET,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,MAAM,eAAe,GAAa,EAAE,CAAC;IAErC,4EAA4E;IAC5E,8EAA8E;IAC9E,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,C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/stroke/stroke\";\n\n/**\n * Shared geometry for line grids. Both {@link LineGrid} (a fixed grid filling\n * its layout rect) and {@link GridPattern} (an infinite grid tiled across the\n * camera's visible region) build the same multi-subpath line paths from these\n * helpers — they differ only in how the extent and step are chosen.\n *\n * Lines are tiled by the minor step and panned by an origin offset: every\n * position within the extent (grown by `overscan` so thick lines clip out\n * smoothly) is emitted regardless of the offset, so the area always stays full\n * and animating the offset scrolls the grid. A tile whose index aligns to the\n * division grid is major; the rest are minor. Each is built as a single\n * multi-subpath path so the trailing stroke paints every line as one union with\n * no destructive boolean op (which would erase the open lines).\n */\n\n/** A grid extent on one axis: lines tile within `[min, max]` about 0. */\n/** @internal */\nexport interface GridAxis {\n /** Minimum coordinate (typically negative; the lines centre on 0). */\n min: number;\n /** Maximum coordinate. */\n max: number;\n /** Spacing between adjacent (minor) lines. */\n step: number;\n /** Pan offset in pixels along this axis. */\n offset: number;\n}\n\n/** The resolved grid: where each line sits and how far it runs. Vertical lines\n * sit at x = `verticalX[i]` and run from `top` to `bottom`; horizontal lines sit\n * at y = `horizontalY[i]` and run from `left` to `right`. Positions are split\n * into major (division) and minor (subdivision) lines. */\n/** @internal */\nexport interface GridLines {\n /** y-extent every vertical line spans. */\n top: number;\n bottom: number;\n /** x-extent every horizontal line spans. */\n left: number;\n right: number;\n verticalMajor: number[];\n verticalMinor: number[];\n horizontalMajor: number[];\n horizontalMinor: number[];\n}\n\n/**\n * Resolve the grid for the given per-axis extents: the cross-axis span and the\n * major/minor line positions on each axis. Vertical lines span the full y\n * extent; horizontal lines span the full x extent. Both spans are grown by\n * `overscan` so a thick line slides out under the clip instead of popping, and\n * snapped outward to the grid so the endpoints sit on stable world positions\n * (a line's start stays fixed as the camera pans, so a dashed stroke anchored to\n * it doesn't crawl).\n *\n * `cycle` (the dash period, when dashed) snaps the cross-axis span to a whole\n * number of dash cycles too, so each parallel line is the same dash-aligned\n * length and the renderer's per-path dash-fit becomes a no-op (no per-frame\n * resizing of the dashes as lines enter and leave view).\n */\n/** @internal */\nexport function gridLines(\n x: GridAxis,\n y: GridAxis,\n subdivisions: number,\n overscan: number,\n cycle = 0,\n): GridLines {\n const verticalMajor: number[] = [];\n const verticalMinor: number[] = [];\n const horizontalMajor: number[] = [];\n const horizontalMinor: number[] = [];\n\n // Span each line across the cross axis, snapped outward to the grid (and to\n // the dash cycle when dashed) so the endpoints sit on stable world positions.\n const top = snapSpan(y.min - overscan, y.step, y.offset, cycle, Math.floor);\n const bottom = snapSpan(y.max + overscan, y.step, y.offset, cycle, Math.ceil);\n const left = snapSpan(x.min - overscan, x.step, x.offset, cycle, Math.floor);\n const right = snapSpan(x.max + overscan, x.step, x.offset, cycle, Math.ceil);\n\n addTiledLines(x.min, x.max, x.step, x.offset, subdivisions, overscan, (px, isMajor) => {\n (isMajor ? verticalMajor : verticalMinor).push(px);\n });\n addTiledLines(y.min, y.max, y.step, y.offset, subdivisions, overscan, (py, isMajor) => {\n (isMajor ? horizontalMajor : horizontalMinor).push(py);\n });\n\n return { top, bottom, left, right, verticalMajor, verticalMinor, horizontalMajor, horizontalMinor };\n}\n\n/**\n * Build the grid lines as multi-subpath path commands, split into the major\n * (division) lines and the minor (subdivision) lines, for the given per-axis\n * extents. Every line in a group shares one stroke (drawn as one union path), so\n * this is the path for solid strokes; dashed strokes that must stay world-locked\n * draw per line from {@link gridLines} instead.\n */\n/** @internal */\nexport function gridLinePaths(\n x: GridAxis,\n y: GridAxis,\n subdivisions: number,\n overscan: number,\n): { major: PathCommand[]; minor: PathCommand[] } {\n const g = gridLines(x, y, subdivisions, overscan);\n const major: PathCommand[] = [];\n const minor: PathCommand[] = [];\n for (const px of g.verticalMajor) major.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\n for (const px of g.verticalMinor) minor.push({ type: \"M\", x: px, y: g.top }, { type: \"L\", x: px, y: g.bottom });\n for (const py of g.horizontalMajor) major.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\n for (const py of g.horizontalMinor) minor.push({ type: \"M\", x: g.left, y: py }, { type: \"L\", x: g.right, y: py });\n return { major, minor };\n}\n\n// Snap `pos` outward to a stable world position so a dashed line's start stays\n// fixed as the viewport moves (the renderer anchors dash phase to the subpath\n// start). Snap to the grid line lattice (`n*step + offset`); when a dash `cycle`\n// is given, snap to the dash lattice instead (`n*cycle`, anchored to world 0) so\n// every parallel line is the same whole number of cycles long and the renderer's\n// per-path dash-fit stays a no-op. `round` is `Math.floor` to snap below, `ceil`\n// to snap above.\nfunction snapSpan(pos: number, step: number, offset: number, cycle: number, round: (n: number) => number): number {\n if (cycle > 0) return round(pos / cycle) * cycle;\n if (step <= 0) return pos;\n return round((pos - offset) / step) * step + offset;\n}\n\n/**\n * Emit every grid line position in `[min, max]` (grown by `overscan` on each\n * end) for a grid of spacing `step`, panned by `offset` px. Without panning the\n * un-offset grid is centred on 0 and its tile indices count outward from there;\n * the line at tile index `n` is major when `n` is a multiple of `subdivisions`.\n * The pan shifts each position by `offset` while keeping the area full, so `n`\n * is taken relative to the un-panned centred grid (offset folded out) to keep\n * classification stable as it scrolls.\n */\n/** @internal */\nexport function addTiledLines(\n min: number,\n max: number,\n step: number,\n offset: number,\n subdivisions: number,\n overscan: number,\n emit: (pos: number, isMajor: boolean) => void,\n): void {\n if (step <= 0) return;\n // First/last tile index whose panned position is within the overscanned\n // [min, max]. Positions are `n*step + offset` on the centred grid (n=0 sits\n // at the centre, 0). A small epsilon keeps a line that lands exactly on an\n // edge (common at offset 0 with an even tile count) from being dropped by FP error.\n const eps = step * 1e-6;\n const startN = Math.ceil((min - overscan - offset - eps) / step);\n const endN = Math.floor((max + overscan - offset + eps) / step);\n for (let n = startN; n <= endN; n++) {\n const pos = n * step + offset;\n // mod that stays non-negative for negative n.\n const isMajor = ((n % subdivisions) + subdivisions) % subdivisions === 0;\n emit(pos, isMajor);\n }\n}\n\n/** Largest stroke weight across the layers of a resolved stroke array. Used to\n * overscan the tiling so a thick line stays drawn until fully off the area. */\n/** @internal */\nexport function maxWeight(strokes: StrokeResolved[]): number {\n let max = 0;\n for (const s of strokes) if (s.weight > max) max = s.weight;\n return max;\n}\n\n/** Force every layer of a resolved stroke array to centered alignment. Grid\n * lines are open paths, not a closed region, so inside/outside alignment is\n * meaningless — they always straddle their position. (Open paths are already\n * stroked centered by the renderer; this makes the intent explicit and ignores\n * any author `align`.) */\n/** @internal */\nexport function centered(strokes: StrokeResolved[]): StrokeResolved[] {\n return strokes.map(s => (s.align === 0 ? s : { ...s, align: 0 }));\n}\n\n/** Copy a resolved stroke array with every fill layer's opacity scaled by\n * `factor`. Used to derive the default minor-line stroke from the major one.\n * Every resolved fill carries an `opacity` field, so this is type-uniform. */\n/** @internal */\nexport function dimStroke(strokes: StrokeResolved[], factor: number): StrokeResolved[] {\n return strokeOps.resolve(strokes.map(s => ({\n ...s,\n fill: s.fill.map(f => ({ ...f, opacity: (f.opacity ?? 1) * factor })),\n })) as unknown as StrokeProp[]);\n}\n"]}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { NodeConfig } from "../../nodes/2d/node2d.js";
|
|
2
|
-
import { RenderContext2D } from "../../render/render-context2d.js";
|
|
3
|
-
import { BoxBounds } from "../../layout/bounds.js";
|
|
4
|
-
import { Stroke, StrokeResolved } from "../../attributes/shape/stroke/stroke.js";
|
|
5
|
-
import type { AssetScope } from "../../assets/scope.js";
|
|
6
|
-
import { Vector2 } from "../../attributes/layout/vector2.js";
|
|
7
|
-
import { ViewportPattern } from "./viewport-pattern-node.js";
|
|
8
|
-
import { ShapeProps } from "./shape-node.js";
|
|
9
|
-
export interface GridPatternProps extends ShapeProps {
|
|
10
|
-
/**
|
|
11
|
-
* Spacing between adjacent grid cells, in world units. A single number is
|
|
12
|
-
* used for both axes; a `{ x, y }` gives a different spacing per axis.
|
|
13
|
-
* Defaults to 100.
|
|
14
|
-
*/
|
|
15
|
-
cellSize: number | Vector2;
|
|
16
|
-
/**
|
|
17
|
-
* Number of finer cells each cell is split into. `1` (the default) draws no
|
|
18
|
-
* minor lines; `2` adds one minor line per cell, and so on — same as
|
|
19
|
-
* {@link LineGrid.subdivisions}.
|
|
20
|
-
*/
|
|
21
|
-
subdivisions: number;
|
|
22
|
-
/**
|
|
23
|
-
* Stroke for the minor (subdivision) lines. When omitted but `stroke` is set
|
|
24
|
-
* and `subdivisions > 1`, it defaults to the major `stroke` at half opacity.
|
|
25
|
-
*/
|
|
26
|
-
subStroke?: Stroke;
|
|
27
|
-
/**
|
|
28
|
-
* Pixel offset that pans the whole grid relative to the world. The grid is
|
|
29
|
-
* otherwise anchored to world coordinates, so it stays put as the camera
|
|
30
|
-
* moves over it; animate `offset` to scroll the pattern itself.
|
|
31
|
-
*/
|
|
32
|
-
offset: Vector2;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* An infinite line grid that fills the camera's visible region. Like
|
|
36
|
-
* {@link LineGrid} it draws major/minor strokes, a fill behind them, and pans
|
|
37
|
-
* with `offset` — but instead of being sized to a fixed rect it tiles a
|
|
38
|
-
* world-anchored grid (spacing `cellSize`) across exactly what the parent
|
|
39
|
-
* {@link Camera} can currently see, regenerated each frame. With no camera it
|
|
40
|
-
* falls back to filling its own layout rect, so it works as a plain background.
|
|
41
|
-
*
|
|
42
|
-
* This replaces hand-sizing a huge `LineGrid` large enough to cover every place
|
|
43
|
-
* the camera might pan or zoom to — the grid is always full, never reveals an
|
|
44
|
-
* empty edge, and only generates the lines that are on screen.
|
|
45
|
-
*/
|
|
46
|
-
export declare class GridPattern extends ViewportPattern<GridPatternProps> {
|
|
47
|
-
readonly cellSize: number | Vector2;
|
|
48
|
-
readonly subdivisions: number;
|
|
49
|
-
get subStroke(): StrokeResolved[];
|
|
50
|
-
set subStroke(value: Stroke);
|
|
51
|
-
readonly offset: Vector2;
|
|
52
|
-
/** The minor-line stroke, on top of the four slots `ShapeNode` declares. */
|
|
53
|
-
declareAssets(assets: AssetScope): void;
|
|
54
|
-
constructor(props: NodeConfig<GridPattern, GridPatternProps>);
|
|
55
|
-
protected renderPattern(draw: RenderContext2D, bounds: BoxBounds): void;
|
|
56
|
-
private drawGroup;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=grid-pattern-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-pattern-node.d.ts","sourceRoot":"","sources":["../../../src/nodes/geometry/grid-pattern-node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAe,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAChD;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,eAAe,CAAC,gBAAgB,CAAC;IAE9D,SACiB,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5C,SAA2C,YAAY,EAAE,MAAM,CAAC;IAGhE,IACI,SAAS,IAAI,cAAc,EAAE,CAAuB;IACxD,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAkC;IAC7D,SACiB,MAAM,EAAE,OAAO,CAAC;IAE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