@motionscript/math 0.0.0-stage → 0.1.0-alpha.10
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 +144 -0
- package/LICENSE +201 -0
- package/NOTICE +49 -0
- package/README.md +389 -2
- package/dist/annotate/angle-mark.d.ts +96 -0
- package/dist/annotate/angle-mark.d.ts.map +1 -0
- package/dist/annotate/angle-mark.js +97 -0
- package/dist/annotate/angle-mark.js.map +1 -0
- package/dist/annotate/curly-brace.d.ts +115 -0
- package/dist/annotate/curly-brace.d.ts.map +1 -0
- package/dist/annotate/curly-brace.js +99 -0
- package/dist/annotate/curly-brace.js.map +1 -0
- package/dist/annotate/emphasis-mark.d.ts +80 -0
- package/dist/annotate/emphasis-mark.d.ts.map +1 -0
- package/dist/annotate/emphasis-mark.js +80 -0
- package/dist/annotate/emphasis-mark.js.map +1 -0
- package/dist/browser/THIRD_PARTY_LICENSES.txt +420 -0
- package/dist/browser/chunks/chunk-IRZCG6PM.js +2 -0
- package/dist/browser/chunks/chunk-IRZCG6PM.js.map +7 -0
- package/dist/browser/chunks/chunk-WMVW6ZIV.js +2 -0
- package/dist/browser/chunks/chunk-WMVW6ZIV.js.map +7 -0
- package/dist/browser/chunks/mathjax-WV55AC2P.js +61 -0
- package/dist/browser/chunks/mathjax-WV55AC2P.js.map +7 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/browser/kit.js +2 -0
- package/dist/browser/kit.js.map +7 -0
- package/dist/browser/manifest.json +30 -0
- package/dist/browser/tex.js +2 -0
- package/dist/browser/tex.js.map +7 -0
- package/dist/engine.d.ts +71 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +45 -0
- package/dist/engine.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/kit/brace.d.ts +8 -0
- package/dist/kit/brace.d.ts.map +1 -0
- package/dist/kit/brace.js +36 -0
- package/dist/kit/brace.js.map +1 -0
- package/dist/kit/cache.d.ts +30 -0
- package/dist/kit/cache.d.ts.map +1 -0
- package/dist/kit/cache.js +53 -0
- package/dist/kit/cache.js.map +1 -0
- package/dist/kit/component.d.ts +51 -0
- package/dist/kit/component.d.ts.map +1 -0
- package/dist/kit/component.js +30 -0
- package/dist/kit/component.js.map +1 -0
- package/dist/kit/contour.d.ts +8 -0
- package/dist/kit/contour.d.ts.map +1 -0
- package/dist/kit/contour.js +93 -0
- package/dist/kit/contour.js.map +1 -0
- package/dist/kit/coords.d.ts +69 -0
- package/dist/kit/coords.d.ts.map +1 -0
- package/dist/kit/coords.js +224 -0
- package/dist/kit/coords.js.map +1 -0
- package/dist/kit/curve.d.ts +28 -0
- package/dist/kit/curve.d.ts.map +1 -0
- package/dist/kit/curve.js +29 -0
- package/dist/kit/curve.js.map +1 -0
- package/dist/kit/equation.d.ts +61 -0
- package/dist/kit/equation.d.ts.map +1 -0
- package/dist/kit/equation.js +168 -0
- package/dist/kit/equation.js.map +1 -0
- package/dist/kit/equation3d.d.ts +50 -0
- package/dist/kit/equation3d.d.ts.map +1 -0
- package/dist/kit/equation3d.js +103 -0
- package/dist/kit/equation3d.js.map +1 -0
- package/dist/kit/expression.d.ts +35 -0
- package/dist/kit/expression.d.ts.map +1 -0
- package/dist/kit/expression.js +124 -0
- package/dist/kit/expression.js.map +1 -0
- package/dist/kit/field-mark.d.ts +79 -0
- package/dist/kit/field-mark.d.ts.map +1 -0
- package/dist/kit/field-mark.js +109 -0
- package/dist/kit/field-mark.js.map +1 -0
- package/dist/kit/field.d.ts +14 -0
- package/dist/kit/field.d.ts.map +1 -0
- package/dist/kit/field.js +46 -0
- package/dist/kit/field.js.map +1 -0
- package/dist/kit/follow.d.ts +109 -0
- package/dist/kit/follow.d.ts.map +1 -0
- package/dist/kit/follow.js +163 -0
- package/dist/kit/follow.js.map +1 -0
- package/dist/kit/furniture.d.ts +32 -0
- package/dist/kit/furniture.d.ts.map +1 -0
- package/dist/kit/furniture.js +92 -0
- package/dist/kit/furniture.js.map +1 -0
- package/dist/kit/geometry.d.ts +13 -0
- package/dist/kit/geometry.d.ts.map +1 -0
- package/dist/kit/geometry.js +54 -0
- package/dist/kit/geometry.js.map +1 -0
- package/dist/kit/graph.d.ts +46 -0
- package/dist/kit/graph.d.ts.map +1 -0
- package/dist/kit/graph.js +90 -0
- package/dist/kit/graph.js.map +1 -0
- package/dist/kit/mark.d.ts +72 -0
- package/dist/kit/mark.d.ts.map +1 -0
- package/dist/kit/mark.js +87 -0
- package/dist/kit/mark.js.map +1 -0
- package/dist/kit/part-fills.d.ts +23 -0
- package/dist/kit/part-fills.d.ts.map +1 -0
- package/dist/kit/part-fills.js +46 -0
- package/dist/kit/part-fills.js.map +1 -0
- package/dist/kit/place.d.ts +20 -0
- package/dist/kit/place.d.ts.map +1 -0
- package/dist/kit/place.js +66 -0
- package/dist/kit/place.js.map +1 -0
- package/dist/kit/sampler.d.ts +17 -0
- package/dist/kit/sampler.d.ts.map +1 -0
- package/dist/kit/sampler.js +250 -0
- package/dist/kit/sampler.js.map +1 -0
- package/dist/kit/scale.d.ts +12 -0
- package/dist/kit/scale.d.ts.map +1 -0
- package/dist/kit/scale.js +37 -0
- package/dist/kit/scale.js.map +1 -0
- package/dist/kit/source.d.ts +22 -0
- package/dist/kit/source.d.ts.map +1 -0
- package/dist/kit/source.js +45 -0
- package/dist/kit/source.js.map +1 -0
- package/dist/kit/system.d.ts +31 -0
- package/dist/kit/system.d.ts.map +1 -0
- package/dist/kit/system.js +71 -0
- package/dist/kit/system.js.map +1 -0
- package/dist/kit/ticks.d.ts +19 -0
- package/dist/kit/ticks.d.ts.map +1 -0
- package/dist/kit/ticks.js +78 -0
- package/dist/kit/ticks.js.map +1 -0
- package/dist/kit/withdrawn.d.ts +9 -0
- package/dist/kit/withdrawn.d.ts.map +1 -0
- package/dist/kit/withdrawn.js +9 -0
- package/dist/kit/withdrawn.js.map +1 -0
- package/dist/marks/curve-area.d.ts +51 -0
- package/dist/marks/curve-area.d.ts.map +1 -0
- package/dist/marks/curve-area.js +59 -0
- package/dist/marks/curve-area.js.map +1 -0
- package/dist/marks/drop-lines.d.ts +57 -0
- package/dist/marks/drop-lines.d.ts.map +1 -0
- package/dist/marks/drop-lines.js +43 -0
- package/dist/marks/drop-lines.js.map +1 -0
- package/dist/marks/plot-point.d.ts +71 -0
- package/dist/marks/plot-point.d.ts.map +1 -0
- package/dist/marks/plot-point.js +71 -0
- package/dist/marks/plot-point.js.map +1 -0
- package/dist/marks/riemann-sum.d.ts +58 -0
- package/dist/marks/riemann-sum.d.ts.map +1 -0
- package/dist/marks/riemann-sum.js +63 -0
- package/dist/marks/riemann-sum.js.map +1 -0
- package/dist/marks/tangent-line.d.ts +71 -0
- package/dist/marks/tangent-line.d.ts.map +1 -0
- package/dist/marks/tangent-line.js +89 -0
- package/dist/marks/tangent-line.js.map +1 -0
- package/dist/marks/vector-arrow.d.ts +60 -0
- package/dist/marks/vector-arrow.d.ts.map +1 -0
- package/dist/marks/vector-arrow.js +67 -0
- package/dist/marks/vector-arrow.js.map +1 -0
- package/dist/nodes.d.ts +43 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +57 -0
- package/dist/nodes.js.map +1 -0
- package/dist/plots/function-plot.d.ts +159 -0
- package/dist/plots/function-plot.d.ts.map +1 -0
- package/dist/plots/function-plot.js +184 -0
- package/dist/plots/function-plot.js.map +1 -0
- package/dist/plots/points-plot.d.ts +64 -0
- package/dist/plots/points-plot.d.ts.map +1 -0
- package/dist/plots/points-plot.js +72 -0
- package/dist/plots/points-plot.js.map +1 -0
- package/dist/plots/stream-lines.d.ts +76 -0
- package/dist/plots/stream-lines.d.ts.map +1 -0
- package/dist/plots/stream-lines.js +122 -0
- package/dist/plots/stream-lines.js.map +1 -0
- package/dist/plots/traced-path.d.ts +70 -0
- package/dist/plots/traced-path.d.ts.map +1 -0
- package/dist/plots/traced-path.js +41 -0
- package/dist/plots/traced-path.js.map +1 -0
- package/dist/plots/vector-field.d.ts +60 -0
- package/dist/plots/vector-field.d.ts.map +1 -0
- package/dist/plots/vector-field.js +77 -0
- package/dist/plots/vector-field.js.map +1 -0
- package/dist/structures/graph-layout.d.ts +11 -0
- package/dist/structures/graph-layout.d.ts.map +1 -0
- package/dist/structures/graph-layout.js +135 -0
- package/dist/structures/graph-layout.js.map +1 -0
- package/dist/structures/network-graph.d.ts +174 -0
- package/dist/structures/network-graph.d.ts.map +1 -0
- package/dist/structures/network-graph.js +240 -0
- package/dist/structures/network-graph.js.map +1 -0
- package/dist/structures/sample-space.d.ts +114 -0
- package/dist/structures/sample-space.d.ts.map +1 -0
- package/dist/structures/sample-space.js +161 -0
- package/dist/structures/sample-space.js.map +1 -0
- package/dist/systems/axes2d.d.ts +197 -0
- package/dist/systems/axes2d.d.ts.map +1 -0
- package/dist/systems/axes2d.js +157 -0
- package/dist/systems/axes2d.js.map +1 -0
- package/dist/systems/number-line.d.ts +101 -0
- package/dist/systems/number-line.d.ts.map +1 -0
- package/dist/systems/number-line.js +91 -0
- package/dist/systems/number-line.js.map +1 -0
- package/dist/systems/number-plane.d.ts +168 -0
- package/dist/systems/number-plane.d.ts.map +1 -0
- package/dist/systems/number-plane.js +186 -0
- package/dist/systems/number-plane.js.map +1 -0
- package/dist/systems/polar-plane.d.ts +98 -0
- package/dist/systems/polar-plane.d.ts.map +1 -0
- package/dist/systems/polar-plane.js +139 -0
- package/dist/systems/polar-plane.js.map +1 -0
- package/dist/tex/geometry.d.ts +85 -0
- package/dist/tex/geometry.d.ts.map +1 -0
- package/dist/tex/geometry.js +632 -0
- package/dist/tex/geometry.js.map +1 -0
- package/dist/tex/index.d.ts +11 -0
- package/dist/tex/index.d.ts.map +1 -0
- package/dist/tex/index.js +10 -0
- package/dist/tex/index.js.map +1 -0
- package/dist/tex/mathjax.d.ts +33 -0
- package/dist/tex/mathjax.d.ts.map +1 -0
- package/dist/tex/mathjax.js +74 -0
- package/dist/tex/mathjax.js.map +1 -0
- package/dist/tex/matrix.d.ts +101 -0
- package/dist/tex/matrix.d.ts.map +1 -0
- package/dist/tex/matrix.js +56 -0
- package/dist/tex/matrix.js.map +1 -0
- package/dist/tex/node.d.ts +98 -0
- package/dist/tex/node.d.ts.map +1 -0
- package/dist/tex/node.js +25 -0
- package/dist/tex/node.js.map +1 -0
- package/dist/tex/tween.d.ts +50 -0
- package/dist/tex/tween.d.ts.map +1 -0
- package/dist/tex/tween.js +253 -0
- package/dist/tex/tween.js.map +1 -0
- package/dist/tex/typeset.d.ts +133 -0
- package/dist/tex/typeset.d.ts.map +1 -0
- package/dist/tex/typeset.js +403 -0
- package/dist/tex/typeset.js.map +1 -0
- package/dist/three/axes3d.d.ts +247 -0
- package/dist/three/axes3d.d.ts.map +1 -0
- package/dist/three/axes3d.js +187 -0
- package/dist/three/axes3d.js.map +1 -0
- package/dist/three/curve-plot3d.d.ts +126 -0
- package/dist/three/curve-plot3d.d.ts.map +1 -0
- package/dist/three/curve-plot3d.js +109 -0
- package/dist/three/curve-plot3d.js.map +1 -0
- package/dist/three/entries.d.ts +17 -0
- package/dist/three/entries.d.ts.map +1 -0
- package/dist/three/entries.js +15 -0
- package/dist/three/entries.js.map +1 -0
- package/dist/three/label3d.d.ts +11 -0
- package/dist/three/label3d.d.ts.map +1 -0
- package/dist/three/label3d.js +42 -0
- package/dist/three/label3d.js.map +1 -0
- package/dist/three/plot-point3d.d.ts +99 -0
- package/dist/three/plot-point3d.d.ts.map +1 -0
- package/dist/three/plot-point3d.js +34 -0
- package/dist/three/plot-point3d.js.map +1 -0
- package/dist/three/space.d.ts +43 -0
- package/dist/three/space.d.ts.map +1 -0
- package/dist/three/space.js +58 -0
- package/dist/three/space.js.map +1 -0
- package/dist/three/surface-plot3d.d.ts +207 -0
- package/dist/three/surface-plot3d.d.ts.map +1 -0
- package/dist/three/surface-plot3d.js +261 -0
- package/dist/three/surface-plot3d.js.map +1 -0
- package/dist/three/vector-arrow3d.d.ts +96 -0
- package/dist/three/vector-arrow3d.d.ts.map +1 -0
- package/dist/three/vector-arrow3d.js +53 -0
- package/dist/three/vector-arrow3d.js.map +1 -0
- package/package.json +80 -3
- package/registry.json +251 -0
- package/src/annotate/angle-mark.ts +137 -0
- package/src/annotate/curly-brace.ts +148 -0
- package/src/annotate/emphasis-mark.ts +118 -0
- package/src/engine.ts +86 -0
- package/src/index.ts +29 -0
- package/src/kit/brace.ts +37 -0
- package/src/kit/cache.ts +61 -0
- package/src/kit/component.ts +57 -0
- package/src/kit/contour.ts +94 -0
- package/src/kit/coords.ts +278 -0
- package/src/kit/curve.ts +47 -0
- package/src/kit/equation.ts +181 -0
- package/src/kit/equation3d.ts +137 -0
- package/src/kit/expression.ts +159 -0
- package/src/kit/field-mark.ts +171 -0
- package/src/kit/field.ts +50 -0
- package/src/kit/follow.ts +229 -0
- package/src/kit/furniture.ts +113 -0
- package/src/kit/geometry.ts +49 -0
- package/src/kit/graph.ts +116 -0
- package/src/kit/mark.ts +152 -0
- package/src/kit/part-fills.ts +61 -0
- package/src/kit/place.ts +77 -0
- package/src/kit/sampler.ts +281 -0
- package/src/kit/scale.ts +39 -0
- package/src/kit/source.ts +57 -0
- package/src/kit/system.ts +105 -0
- package/src/kit/ticks.ts +85 -0
- package/src/kit/withdrawn.ts +8 -0
- package/src/marks/curve-area.ts +89 -0
- package/src/marks/drop-lines.ts +71 -0
- package/src/marks/plot-point.ts +102 -0
- package/src/marks/riemann-sum.ts +99 -0
- package/src/marks/tangent-line.ts +119 -0
- package/src/marks/vector-arrow.ts +98 -0
- package/src/nodes.ts +99 -0
- package/src/plots/function-plot.ts +220 -0
- package/src/plots/points-plot.ts +103 -0
- package/src/plots/stream-lines.ts +160 -0
- package/src/plots/traced-path.ts +70 -0
- package/src/plots/vector-field.ts +107 -0
- package/src/structures/graph-layout.ts +145 -0
- package/src/structures/network-graph.ts +291 -0
- package/src/structures/sample-space.ts +210 -0
- package/src/systems/axes2d.ts +226 -0
- package/src/systems/number-line.ts +130 -0
- package/src/systems/number-plane.ts +232 -0
- package/src/systems/polar-plane.ts +177 -0
- package/src/tex/geometry.ts +703 -0
- package/src/tex/index.ts +15 -0
- package/src/tex/mathjax.ts +82 -0
- package/src/tex/matrix.ts +97 -0
- package/src/tex/node.ts +74 -0
- package/src/tex/tween.ts +308 -0
- package/src/tex/typeset.ts +461 -0
- package/src/three/axes3d.ts +267 -0
- package/src/three/curve-plot3d.ts +146 -0
- package/src/three/entries.ts +42 -0
- package/src/three/label3d.ts +52 -0
- package/src/three/plot-point3d.ts +63 -0
- package/src/three/space.ts +92 -0
- package/src/three/surface-plot3d.ts +318 -0
- package/src/three/vector-arrow3d.ts +88 -0
package/dist/nodes.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AngleMark } from "./annotate/angle-mark.js";
|
|
2
|
+
import { CurlyBrace } from "./annotate/curly-brace.js";
|
|
3
|
+
import { EmphasisMark } from "./annotate/emphasis-mark.js";
|
|
4
|
+
import { CurveArea } from "./marks/curve-area.js";
|
|
5
|
+
import { DropLines } from "./marks/drop-lines.js";
|
|
6
|
+
import { PlotPoint } from "./marks/plot-point.js";
|
|
7
|
+
import { RiemannSum } from "./marks/riemann-sum.js";
|
|
8
|
+
import { TangentLine } from "./marks/tangent-line.js";
|
|
9
|
+
import { VectorArrow } from "./marks/vector-arrow.js";
|
|
10
|
+
import { FunctionPlot } from "./plots/function-plot.js";
|
|
11
|
+
import { PointsPlot } from "./plots/points-plot.js";
|
|
12
|
+
import { StreamLines } from "./plots/stream-lines.js";
|
|
13
|
+
import { TracedPath } from "./plots/traced-path.js";
|
|
14
|
+
import { VectorField } from "./plots/vector-field.js";
|
|
15
|
+
import { Axes2d } from "./systems/axes2d.js";
|
|
16
|
+
import { NumberLine } from "./systems/number-line.js";
|
|
17
|
+
import { NumberPlane } from "./systems/number-plane.js";
|
|
18
|
+
import { PolarPlane } from "./systems/polar-plane.js";
|
|
19
|
+
import { NetworkGraph } from "./structures/network-graph.js";
|
|
20
|
+
import { SampleSpace } from "./structures/sample-space.js";
|
|
21
|
+
import { LatexMatrix } from "./tex/matrix.js";
|
|
22
|
+
import { Latex } from "./tex/node.js";
|
|
23
|
+
import { Axes3d } from "./three/axes3d.js";
|
|
24
|
+
import { CurvePlot3d } from "./three/curve-plot3d.js";
|
|
25
|
+
import { PlotPoint3d } from "./three/plot-point3d.js";
|
|
26
|
+
import { SurfacePlot3d } from "./three/surface-plot3d.js";
|
|
27
|
+
import { VectorArrow3d } from "./three/vector-arrow3d.js";
|
|
28
|
+
/**
|
|
29
|
+
* Every node type this package publishes.
|
|
30
|
+
*
|
|
31
|
+
* A host registers these by handing the array to an engine —
|
|
32
|
+
* `new Engine(platform, { nodes: NODES })` — which reads each component's key.
|
|
33
|
+
* Defining a component only *declares* that key: nothing is registered by
|
|
34
|
+
* importing a module, so a registry holds exactly what its owner asked for.
|
|
35
|
+
*
|
|
36
|
+
* Listing the component **values** is also what survives bundling: this package
|
|
37
|
+
* declares `sideEffects: false`, and a document names a node type by string, so
|
|
38
|
+
* an import kept only for its side effect is exactly what gets shaken out.
|
|
39
|
+
*/
|
|
40
|
+
type KitNode = typeof Latex | typeof LatexMatrix | typeof NumberLine | typeof Axes2d | typeof NumberPlane | typeof FunctionPlot | typeof PointsPlot | typeof PlotPoint | typeof VectorArrow | typeof CurveArea | typeof RiemannSum | typeof TangentLine | typeof DropLines | typeof CurlyBrace | typeof AngleMark | typeof EmphasisMark | typeof Axes3d | typeof SurfacePlot3d | typeof CurvePlot3d | typeof PlotPoint3d | typeof VectorArrow3d | typeof PolarPlane | typeof VectorField | typeof StreamLines | typeof TracedPath | typeof NetworkGraph | typeof SampleSpace;
|
|
41
|
+
export declare const NODES: KitNode[];
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../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B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;;;;;;;;GAWG;AAEH,KAAK,OAAO,GACN,OAAO,KAAK,GACZ,OAAO,WAAW,GAClB,OAAO,UAAU,GACjB,OAAO,MAAM,GACb,OAAO,WAAW,GAClB,OAAO,YAAY,GACnB,OAAO,UAAU,GACjB,OAAO,SAAS,GAChB,OAAO,WAAW,GAClB,OAAO,SAAS,GAChB,OAAO,UAAU,GACjB,OAAO,WAAW,GAClB,OAAO,SAAS,GAChB,OAAO,UAAU,GACjB,OAAO,SAAS,GAChB,OAAO,YAAY,GACnB,OAAO,MAAM,GACb,OAAO,aAAa,GACpB,OAAO,WAAW,GAClB,OAAO,WAAW,GAClB,OAAO,aAAa,GACpB,OAAO,UAAU,GACjB,OAAO,WAAW,GAClB,OAAO,WAAW,GAClB,OAAO,UAAU,GACjB,OAAO,YAAY,GACnB,OAAO,WAAW,CAAC;AAEzB,eAAO,MAAM,KAAK,EAAE,OAAO,EA4B1B,CAAC"}
|
package/dist/nodes.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AngleMark } from "./annotate/angle-mark.js";
|
|
2
|
+
import { CurlyBrace } from "./annotate/curly-brace.js";
|
|
3
|
+
import { EmphasisMark } from "./annotate/emphasis-mark.js";
|
|
4
|
+
import { CurveArea } from "./marks/curve-area.js";
|
|
5
|
+
import { DropLines } from "./marks/drop-lines.js";
|
|
6
|
+
import { PlotPoint } from "./marks/plot-point.js";
|
|
7
|
+
import { RiemannSum } from "./marks/riemann-sum.js";
|
|
8
|
+
import { TangentLine } from "./marks/tangent-line.js";
|
|
9
|
+
import { VectorArrow } from "./marks/vector-arrow.js";
|
|
10
|
+
import { FunctionPlot } from "./plots/function-plot.js";
|
|
11
|
+
import { PointsPlot } from "./plots/points-plot.js";
|
|
12
|
+
import { StreamLines } from "./plots/stream-lines.js";
|
|
13
|
+
import { TracedPath } from "./plots/traced-path.js";
|
|
14
|
+
import { VectorField } from "./plots/vector-field.js";
|
|
15
|
+
import { Axes2d } from "./systems/axes2d.js";
|
|
16
|
+
import { NumberLine } from "./systems/number-line.js";
|
|
17
|
+
import { NumberPlane } from "./systems/number-plane.js";
|
|
18
|
+
import { PolarPlane } from "./systems/polar-plane.js";
|
|
19
|
+
import { NetworkGraph } from "./structures/network-graph.js";
|
|
20
|
+
import { SampleSpace } from "./structures/sample-space.js";
|
|
21
|
+
import { LatexMatrix } from "./tex/matrix.js";
|
|
22
|
+
import { Latex } from "./tex/node.js";
|
|
23
|
+
import { Axes3d } from "./three/axes3d.js";
|
|
24
|
+
import { CurvePlot3d } from "./three/curve-plot3d.js";
|
|
25
|
+
import { PlotPoint3d } from "./three/plot-point3d.js";
|
|
26
|
+
import { SurfacePlot3d } from "./three/surface-plot3d.js";
|
|
27
|
+
import { VectorArrow3d } from "./three/vector-arrow3d.js";
|
|
28
|
+
export const NODES = [
|
|
29
|
+
Latex,
|
|
30
|
+
LatexMatrix,
|
|
31
|
+
NumberLine,
|
|
32
|
+
Axes2d,
|
|
33
|
+
NumberPlane,
|
|
34
|
+
FunctionPlot,
|
|
35
|
+
PointsPlot,
|
|
36
|
+
PlotPoint,
|
|
37
|
+
VectorArrow,
|
|
38
|
+
CurveArea,
|
|
39
|
+
RiemannSum,
|
|
40
|
+
TangentLine,
|
|
41
|
+
DropLines,
|
|
42
|
+
CurlyBrace,
|
|
43
|
+
AngleMark,
|
|
44
|
+
EmphasisMark,
|
|
45
|
+
Axes3d,
|
|
46
|
+
SurfacePlot3d,
|
|
47
|
+
CurvePlot3d,
|
|
48
|
+
PlotPoint3d,
|
|
49
|
+
VectorArrow3d,
|
|
50
|
+
PolarPlane,
|
|
51
|
+
VectorField,
|
|
52
|
+
StreamLines,
|
|
53
|
+
TracedPath,
|
|
54
|
+
NetworkG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CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA4CvD,MAAM,CAAC,MAAM,KAAK,GAAc;IAC5B,KAAK;IACL,WAAW;IACX,UAAU;IACV,MAAM;IACN,WAAW;IACX,YAAY;IACZ,UAAU;IACV,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,WAAW;IACX,SAAS;IACT,UAAU;IACV,SAAS;IACT,YAAY;IACZ,MAAM;IACN,aAAa;IACb,WAAW;IACX,WAAW;IACX,aAAa;IACb,UAAU;IACV,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;IACZ,WAAW;CACd,CAAC","sourcesContent":["import { AngleMark } from \"./annotate/angle-mark\";\nimport { CurlyBrace } from \"./annotate/curly-brace\";\nimport { EmphasisMark } from \"./annotate/emphasis-mark\";\nimport { CurveArea } from \"./marks/curve-area\";\nimport { DropLines } from \"./marks/drop-lines\";\nimport { PlotPoint } from \"./marks/plot-point\";\nimport { RiemannSum } from \"./marks/riemann-sum\";\nimport { TangentLine } from \"./marks/tangent-line\";\nimport { VectorArrow } from \"./marks/vector-arrow\";\nimport { FunctionPlot } from \"./plots/function-plot\";\nimport { PointsPlot } from \"./plots/points-plot\";\nimport { StreamLines } from \"./plots/stream-lines\";\nimport { TracedPath } from \"./plots/traced-path\";\nimport { VectorField } from \"./plots/vector-field\";\nimport { Axes2d } from \"./systems/axes2d\";\nimport { NumberLine } from \"./systems/number-line\";\nimport { NumberPlane } from \"./systems/number-plane\";\nimport { PolarPlane } from \"./systems/polar-plane\";\nimport { NetworkGraph } from \"./structures/network-graph\";\nimport { SampleSpace } from \"./structures/sample-space\";\nimport { LatexMatrix } from \"./tex/matrix\";\nimport { Latex } from \"./tex/node\";\nimport { Axes3d } from \"./three/axes3d\";\nimport { CurvePlot3d } from \"./three/curve-plot3d\";\nimport { PlotPoint3d } from \"./three/plot-point3d\";\nimport { SurfacePlot3d } from \"./three/surface-plot3d\";\nimport { VectorArrow3d } from \"./three/vector-arrow3d\";\n\n/**\n * Every node type this package publishes.\n *\n * A host registers these by handing the array to an engine —\n * `new Engine(platform, { nodes: NODES })` — which reads each component's key.\n * Defining a component only *declares* that key: nothing is registered by\n * importing a module, so a registry holds exactly what its owner asked for.\n *\n * Listing the component **values** is also what survives bundling: this package\n * declares `sideEffects: false`, and a document names a node type by string, so\n * an import kept only for its side effect is exactly what gets shaken out.\n */\n// Typed by name, so the declaration names each component rather than spelling out its type through core.\ntype KitNode =\n | typeof Latex\n | typeof LatexMatrix\n | typeof NumberLine\n | typeof Axes2d\n | typeof NumberPlane\n | typeof FunctionPlot\n | typeof PointsPlot\n | typeof PlotPoint\n | typeof VectorArrow\n | typeof CurveArea\n | typeof RiemannSum\n | typeof TangentLine\n | typeof DropLines\n | typeof CurlyBrace\n | typeof AngleMark\n | typeof EmphasisMark\n | typeof Axes3d\n | typeof SurfacePlot3d\n | typeof CurvePlot3d\n | typeof PlotPoint3d\n | typeof VectorArrow3d\n | typeof PolarPlane\n | typeof VectorField\n | typeof StreamLines\n | typeof TracedPath\n | typeof NetworkGraph\n | typeof SampleSpace;\n\nexport const NODES: KitNode[] = [\n Latex,\n LatexMatrix,\n NumberLine,\n Axes2d,\n NumberPlane,\n FunctionPlot,\n PointsPlot,\n PlotPoint,\n VectorArrow,\n CurveArea,\n RiemannSum,\n TangentLine,\n DropLines,\n CurlyBrace,\n AngleMark,\n EmphasisMark,\n Axes3d,\n SurfacePlot3d,\n CurvePlot3d,\n PlotPoint3d,\n VectorArrow3d,\n PolarPlane,\n VectorField,\n StreamLines,\n TracedPath,\n NetworkGraph,\n SampleSpace,\n];\n"]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { type NodeOf, type PaintProps, type Vector2, type Node2D as _Node2D, type Node2DProps as _Node2DProps, type Shadow as _Shadow, type ShadowResolved as _ShadowResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved } from "@motionscript/sdk";
|
|
2
|
+
import type { Interval } from "../kit/coords.js";
|
|
3
|
+
import type { ExpressionScope } from "../kit/expression.js";
|
|
4
|
+
import { type MarkReading } from "../kit/mark.js";
|
|
5
|
+
import { type PlotSource } from "../kit/source.js";
|
|
6
|
+
export interface FunctionPlotProps extends PaintProps {
|
|
7
|
+
expression?: string | PlotSource;
|
|
8
|
+
domain?: Interval | null;
|
|
9
|
+
params?: ExpressionScope;
|
|
10
|
+
}
|
|
11
|
+
/** A plot's entries: what a traced path is built on too. It is only a line, so it has no fill. */
|
|
12
|
+
export declare const PLOT_STATE: {
|
|
13
|
+
expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
|
|
14
|
+
/**
|
|
15
|
+
* The span of the free variable that is drawn. Left out, a function runs the
|
|
16
|
+
* width of its system, a polar curve one turn and a parametric one from 0 to 1.
|
|
17
|
+
*/
|
|
18
|
+
domain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
|
|
19
|
+
/**
|
|
20
|
+
* The equation's named values: any name in it that is not a variable, a
|
|
21
|
+
* function or a constant. One left unset is 1, and a formula can bind each
|
|
22
|
+
* to a variable.
|
|
23
|
+
*/
|
|
24
|
+
params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
|
|
25
|
+
graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
|
|
26
|
+
start: import("@motionscript/sdk").Type<number, number, false>;
|
|
27
|
+
end: import("@motionscript/sdk").Type<number, number, false>;
|
|
28
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
29
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
30
|
+
};
|
|
31
|
+
/** A plot's own commands, beside a line's paints. */
|
|
32
|
+
export declare const PLOT_COMMANDS: {
|
|
33
|
+
/** Change the equation, the curve bending from the one into the other. */
|
|
34
|
+
morphTo: {
|
|
35
|
+
args: readonly ["expression"];
|
|
36
|
+
};
|
|
37
|
+
/** Animate the equation's named values. */
|
|
38
|
+
paramsTo: {
|
|
39
|
+
args: readonly ["params"];
|
|
40
|
+
};
|
|
41
|
+
/** Animate the span that is drawn. */
|
|
42
|
+
domainTo: {
|
|
43
|
+
args: readonly ["domain"];
|
|
44
|
+
};
|
|
45
|
+
strokeTo: {
|
|
46
|
+
readonly args: readonly ["stroke"];
|
|
47
|
+
readonly run?: undefined;
|
|
48
|
+
};
|
|
49
|
+
shadowTo: {
|
|
50
|
+
readonly args: readonly ["shadow"];
|
|
51
|
+
readonly run?: undefined;
|
|
52
|
+
};
|
|
53
|
+
progressTo: {
|
|
54
|
+
readonly args: readonly ["start", "end"];
|
|
55
|
+
readonly run?: undefined;
|
|
56
|
+
};
|
|
57
|
+
flash: {
|
|
58
|
+
readonly args: {
|
|
59
|
+
readonly portion: import("@motionscript/sdk").Type<number, number, false>;
|
|
60
|
+
};
|
|
61
|
+
run(timeline: any, state: any, children: any): import("@motionscript/sdk").Piece;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export declare const PLOT_STROKE: {
|
|
65
|
+
readonly weight: 3;
|
|
66
|
+
readonly fill: "#58a6ff";
|
|
67
|
+
readonly align: "center";
|
|
68
|
+
readonly cap: "round";
|
|
69
|
+
readonly join: "round";
|
|
70
|
+
};
|
|
71
|
+
/** What a plot's curve is drawn from. */
|
|
72
|
+
export interface PlotValues {
|
|
73
|
+
readonly expression: PlotSource;
|
|
74
|
+
readonly params: ExpressionScope;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The curve of an equation, drawn in the coordinate system it is a child of.
|
|
78
|
+
* How the equation is written says what it is: see `Equation`. A mark put
|
|
79
|
+
* inside it reads it: the area under it, a tangent, a point that rides it.
|
|
80
|
+
*/
|
|
81
|
+
export declare const FunctionPlot: import("@motionscript/sdk").Component<"functionPlot", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
82
|
+
expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
|
|
83
|
+
/**
|
|
84
|
+
* The span of the free variable that is drawn. Left out, a function runs the
|
|
85
|
+
* width of its system, a polar curve one turn and a parametric one from 0 to 1.
|
|
86
|
+
*/
|
|
87
|
+
domain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
|
|
88
|
+
/**
|
|
89
|
+
* The equation's named values: any name in it that is not a variable, a
|
|
90
|
+
* function or a constant. One left unset is 1, and a formula can bind each
|
|
91
|
+
* to a variable.
|
|
92
|
+
*/
|
|
93
|
+
params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
|
|
94
|
+
graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
|
|
95
|
+
start: import("@motionscript/sdk").Type<number, number, false>;
|
|
96
|
+
end: import("@motionscript/sdk").Type<number, number, false>;
|
|
97
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
98
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
99
|
+
}>, {
|
|
100
|
+
morphTo: readonly ["expression"];
|
|
101
|
+
paramsTo: readonly ["params"];
|
|
102
|
+
domainTo: readonly ["domain"];
|
|
103
|
+
strokeTo: readonly ["stroke"];
|
|
104
|
+
shadowTo: readonly ["shadow"];
|
|
105
|
+
progressTo: readonly ["start", "end"];
|
|
106
|
+
flash: {
|
|
107
|
+
readonly portion: import("@motionscript/sdk").Type<number, number, false>;
|
|
108
|
+
};
|
|
109
|
+
}, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
110
|
+
expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
|
|
111
|
+
/**
|
|
112
|
+
* The span of the free variable that is drawn. Left out, a function runs the
|
|
113
|
+
* width of its system, a polar curve one turn and a parametric one from 0 to 1.
|
|
114
|
+
*/
|
|
115
|
+
domain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
|
|
116
|
+
/**
|
|
117
|
+
* The equation's named values: any name in it that is not a variable, a
|
|
118
|
+
* function or a constant. One left unset is 1, and a formula can bind each
|
|
119
|
+
* to a variable.
|
|
120
|
+
*/
|
|
121
|
+
params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
|
|
122
|
+
graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
|
|
123
|
+
start: import("@motionscript/sdk").Type<number, number, false>;
|
|
124
|
+
end: import("@motionscript/sdk").Type<number, number, false>;
|
|
125
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
126
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
127
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
128
|
+
expression: import("@motionscript/sdk").Type<string | PlotSource, PlotSource, false>;
|
|
129
|
+
/**
|
|
130
|
+
* The span of the free variable that is drawn. Left out, a function runs the
|
|
131
|
+
* width of its system, a polar curve one turn and a parametric one from 0 to 1.
|
|
132
|
+
*/
|
|
133
|
+
domain: import("@motionscript/sdk").Type<Interval | null, Interval | null, false>;
|
|
134
|
+
/**
|
|
135
|
+
* The equation's named values: any name in it that is not a variable, a
|
|
136
|
+
* function or a constant. One left unset is 1, and a formula can bind each
|
|
137
|
+
* to a variable.
|
|
138
|
+
*/
|
|
139
|
+
params: import("@motionscript/sdk").Type<Readonly<Record<string, number>>, Readonly<Record<string, number>>, false>;
|
|
140
|
+
graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
|
|
141
|
+
start: import("@motionscript/sdk").Type<number, number, false>;
|
|
142
|
+
end: import("@motionscript/sdk").Type<number, number, false>;
|
|
143
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
144
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
145
|
+
}>, {
|
|
146
|
+
morphTo: readonly ["expression"];
|
|
147
|
+
paramsTo: readonly ["params"];
|
|
148
|
+
domainTo: readonly ["domain"];
|
|
149
|
+
strokeTo: readonly ["stroke"];
|
|
150
|
+
shadowTo: readonly ["shadow"];
|
|
151
|
+
progressTo: readonly ["start", "end"];
|
|
152
|
+
flash: {
|
|
153
|
+
readonly portion: import("@motionscript/sdk").Type<number, number, false>;
|
|
154
|
+
};
|
|
155
|
+
}, _Node2D<_Node2DProps>>>>;
|
|
156
|
+
export type FunctionPlot = NodeOf<typeof FunctionPlot>;
|
|
157
|
+
/** The runs a plot of `s` draws through `read`, over `span` of its free variable (all of it for `null`). */
|
|
158
|
+
export declare function tracePlot(s: PlotValues, read: MarkReading, span: Interval | null): Vector2[][];
|
|
159
|
+
//# sourceMappingURL=function-plot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-plot.d.ts","sourceRoot":"","sources":["../../src/plots/function-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,OAAO,EAEZ,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACtC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACzC,MAAM,mB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,GAAG,IAAI,GAAG,OAAO,EAAE,EAAE,CA2B9F"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { component2d, provides, Types, } from "@motionscript/sdk";
|
|
2
|
+
import { createBoundedCache } from "../kit/cache.js";
|
|
3
|
+
import { omit, PAINT, PAINT_COMMANDS } from "../kit/component.js";
|
|
4
|
+
import { traceContour } from "../kit/contour.js";
|
|
5
|
+
import { equationParams, parseEquation } from "../kit/equation.js";
|
|
6
|
+
import { PLOT_COLOR } from "../kit/furniture.js";
|
|
7
|
+
import { PLOT, plotPlane, SYSTEM, SYSTEM_ENTRY } from "../kit/graph.js";
|
|
8
|
+
import { drawMark, inkCentre, inkSize, reading, traced } from "../kit/mark.js";
|
|
9
|
+
import { openPlane, placeOnMap } from "../kit/place.js";
|
|
10
|
+
import { sampleCurve } from "../kit/sampler.js";
|
|
11
|
+
import { lerpDomain, lerpParams, lerpSource, readSource, scopeFor } from "../kit/source.js";
|
|
12
|
+
const TAU = Math.PI * 2;
|
|
13
|
+
/** A plot's entries: what a traced path is built on too. It is only a line, so it has no fill. */
|
|
14
|
+
export const PLOT_STATE = {
|
|
15
|
+
...omit(PAINT, "fill"),
|
|
16
|
+
expression: Types.custom("", { resolve: readSource, lerp: lerpSource, kind: "equation" }),
|
|
17
|
+
/**
|
|
18
|
+
* The span of the free variable that is drawn. Left out, a function runs the
|
|
19
|
+
* width of its system, a polar curve one turn and a parametric one from 0 to 1.
|
|
20
|
+
*/
|
|
21
|
+
domain: Types.custom(null, { lerp: lerpDomain, kind: "range", defaultMin: -5, defaultMax: 5 }),
|
|
22
|
+
/**
|
|
23
|
+
* The equation's named values: any name in it that is not a variable, a
|
|
24
|
+
* function or a constant. One left unset is 1, and a formula can bind each
|
|
25
|
+
* to a variable.
|
|
26
|
+
*/
|
|
27
|
+
params: Types.custom({}, { lerp: lerpParams }),
|
|
28
|
+
graph: SYSTEM_ENTRY,
|
|
29
|
+
};
|
|
30
|
+
/** A plot's own commands, beside a line's paints. */
|
|
31
|
+
export const PLOT_COMMANDS = {
|
|
32
|
+
...omit(PAINT_COMMANDS, "fillTo"),
|
|
33
|
+
/** Change the equation, the curve bending from the one into the other. */
|
|
34
|
+
morphTo: { args: ["expression"] },
|
|
35
|
+
/** Animate the equation's named values. */
|
|
36
|
+
paramsTo: { args: ["params"] },
|
|
37
|
+
/** Animate the span that is drawn. */
|
|
38
|
+
domainTo: { args: ["domain"] },
|
|
39
|
+
};
|
|
40
|
+
export const PLOT_STROKE = { weight: 3, fill: PLOT_COLOR, align: "center", cap: "round", join: "round" };
|
|
41
|
+
/**
|
|
42
|
+
* The curve of an equation, drawn in the coordinate system it is a child of.
|
|
43
|
+
* How the equation is written says what it is: see `Equation`. A mark put
|
|
44
|
+
* inside it reads it: the area under it, a tangent, a point that rides it.
|
|
45
|
+
*/
|
|
46
|
+
export const FunctionPlot = traced(component2d({
|
|
47
|
+
key: "functionPlot",
|
|
48
|
+
state: PLOT_STATE,
|
|
49
|
+
defaults: { stroke: PLOT_STROKE, width: "hug", height: "hug" },
|
|
50
|
+
commands: PLOT_COMMANDS,
|
|
51
|
+
// The marks inside it ride it, on its system's map.
|
|
52
|
+
provide: (s, inherited) => [provides(PLOT, plotPlane(s, inherited(SYSTEM)))],
|
|
53
|
+
measure: (_measurer, s) => inkSize(tracePlot(s, reading(s), s.domain)),
|
|
54
|
+
layout: (box, s, children) => {
|
|
55
|
+
const read = reading(s);
|
|
56
|
+
return placeOnMap(children, read.map, inkCentre(tracePlot(s, read, s.domain)), box, plotPlane(s, s.graph));
|
|
57
|
+
},
|
|
58
|
+
plane: (_box, s) => {
|
|
59
|
+
const read = reading(s);
|
|
60
|
+
return openPlane(read.map, inkCentre(tracePlot(s, read, s.domain)));
|
|
61
|
+
},
|
|
62
|
+
render: (ctx, s) => drawMark(ctx, s, tracePlot(s, reading(s), s.domain)),
|
|
63
|
+
}), (s, read) => tracePlot(s, read, s.domain));
|
|
64
|
+
const traces = createBoundedCache(256);
|
|
65
|
+
/** The runs a plot of `s` draws through `read`, over `span` of its free variable (all of it for `null`). */
|
|
66
|
+
export function tracePlot(s, read, span) {
|
|
67
|
+
const { map, shift } = read;
|
|
68
|
+
const { area } = map;
|
|
69
|
+
if (!Number.isFinite(area.maxX - area.minX))
|
|
70
|
+
return [];
|
|
71
|
+
const { source, blend } = s.expression;
|
|
72
|
+
const key = [source, blend?.from, blend?.t, map.revision, span, JSON.stringify(s.params), shift.x, shift.y].join("|");
|
|
73
|
+
const known = traces.get(key);
|
|
74
|
+
if (known)
|
|
75
|
+
return known;
|
|
76
|
+
let runs;
|
|
77
|
+
// A curve with no parameter to walk cannot bend into another: it changes over half way.
|
|
78
|
+
const shown = blend && blend.t < 0.5 ? blend.from : source;
|
|
79
|
+
if (equationOf(source)?.kind === "implicit" || (blend && equationOf(blend.from)?.kind === "implicit")) {
|
|
80
|
+
runs = contour(shown, s.params, map, shift);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
let curve = projectionOf(source, s.params, span, map, shift);
|
|
84
|
+
if (curve && blend) {
|
|
85
|
+
const from = projectionOf(blend.from, s.params, span, map, shift);
|
|
86
|
+
if (from)
|
|
87
|
+
curve = between(from, curve, blend.t);
|
|
88
|
+
}
|
|
89
|
+
const width = area.maxX - area.minX;
|
|
90
|
+
runs = curve
|
|
91
|
+
? sampleCurve(curve, 0, 1, area, { seeds: Math.min(512, Math.max(64, Math.round(width / 8))), minStep: 0.5 / Math.max(1, width) })
|
|
92
|
+
: [];
|
|
93
|
+
}
|
|
94
|
+
traces.set(key, runs);
|
|
95
|
+
return runs;
|
|
96
|
+
}
|
|
97
|
+
function equationOf(source) {
|
|
98
|
+
const equation = parseEquation(source, equationParams(source));
|
|
99
|
+
return equation instanceof Error ? null : equation;
|
|
100
|
+
}
|
|
101
|
+
/** Where an implicit `source` holds, over what the system shows, as pixel runs. */
|
|
102
|
+
function contour(source, params, map, shift) {
|
|
103
|
+
const equation = equationOf(source);
|
|
104
|
+
if (equation?.kind !== "implicit")
|
|
105
|
+
return [];
|
|
106
|
+
const scope = scopeFor(equationParams(source), params);
|
|
107
|
+
const { area } = map;
|
|
108
|
+
const cells = (pixels) => Math.min(CONTOUR_MAX, Math.max(8, Math.round(pixels / CONTOUR_CELL)));
|
|
109
|
+
const { f } = equation;
|
|
110
|
+
const runs = traceContour((x, y) => f(x - shift.x, y - shift.y, scope), map.xRange, map.yRange, cells(area.maxX - area.minX), cells(area.maxY - area.minY));
|
|
111
|
+
return runs.map((run) => run.map((point) => map.toPoint(point.x, point.y)));
|
|
112
|
+
}
|
|
113
|
+
/** `source` as a pixel curve over a parameter running 0 to 1. */
|
|
114
|
+
function projectionOf(source, params, domain, map, shift) {
|
|
115
|
+
const equation = equationOf(source);
|
|
116
|
+
if (!equation || equation.kind === "implicit")
|
|
117
|
+
return null;
|
|
118
|
+
const scope = scopeFor(equationParams(source), params);
|
|
119
|
+
switch (equation.kind) {
|
|
120
|
+
case "function": {
|
|
121
|
+
const horizontal = equation.of === "x";
|
|
122
|
+
const [lo, hi] = horizontal ? map.xRange : map.yRange;
|
|
123
|
+
const offset = horizontal ? shift.x : shift.y;
|
|
124
|
+
// Only what the system shows is sampled, however wide the domain.
|
|
125
|
+
const a = Math.max(lo - offset, domain?.[0] ?? -Infinity);
|
|
126
|
+
const b = Math.min(hi - offset, domain?.[1] ?? Infinity);
|
|
127
|
+
if (!(b > a))
|
|
128
|
+
return null;
|
|
129
|
+
const { f } = equation;
|
|
130
|
+
return (u, out) => {
|
|
131
|
+
const v = a + (b - a) * u;
|
|
132
|
+
const w = f(v, 0, scope);
|
|
133
|
+
if (!Number.isFinite(w))
|
|
134
|
+
return false;
|
|
135
|
+
if (horizontal)
|
|
136
|
+
map.toPoint(v + shift.x, w + shift.y, out);
|
|
137
|
+
else
|
|
138
|
+
map.toPoint(w + shift.x, v + shift.y, out);
|
|
139
|
+
return true;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
case "polar": {
|
|
143
|
+
const [a, b] = domain ?? [0, TAU];
|
|
144
|
+
const { f } = equation;
|
|
145
|
+
return (u, out) => {
|
|
146
|
+
const theta = a + (b - a) * u;
|
|
147
|
+
const r = f(theta, 0, scope);
|
|
148
|
+
if (!Number.isFinite(r))
|
|
149
|
+
return false;
|
|
150
|
+
map.toPoint(r * Math.cos(theta) + shift.x, r * Math.sin(theta) + shift.y, out);
|
|
151
|
+
return true;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
case "parametric": {
|
|
155
|
+
const [a, b] = domain ?? [0, 1];
|
|
156
|
+
const { x, y } = equation;
|
|
157
|
+
return (u, out) => {
|
|
158
|
+
const t = a + (b - a) * u;
|
|
159
|
+
const gx = x(t, 0, scope);
|
|
160
|
+
const gy = y(t, 0, scope);
|
|
161
|
+
if (!Number.isFinite(gx) || !Number.isFinite(gy))
|
|
162
|
+
return false;
|
|
163
|
+
map.toPoint(gx + shift.x, gy + shift.y, out);
|
|
164
|
+
return true;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Roughly one cell of the contour's grid to this many pixels, each way.
|
|
170
|
+
const CONTOUR_CELL = 5;
|
|
171
|
+
const CONTOUR_MAX = 220;
|
|
172
|
+
// Two curves blended point for point along their parameters, in pixels, so any
|
|
173
|
+
// kind bends into any other.
|
|
174
|
+
function between(from, to, t) {
|
|
175
|
+
const a = { x: 0, y: 0 };
|
|
176
|
+
return (u, out) => {
|
|
177
|
+
if (!from(u, a) || !to(u, out))
|
|
178
|
+
return false;
|
|
179
|
+
out.x = a.x + (out.x - a.x) * t;
|
|
180
|
+
out.y = a.y + (out.y - a.y) * t;
|
|
181
|
+
return true;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=function-plot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-plot.js","sourceRoot":"","sources":["../../src/plots/function-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAA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itted declaration reaches these through the sdk, not core.\n type Node2D as _Node2D,\n type Node2DProps as _Node2DProps,\n type Shadow as _Shadow,\n type ShadowResolved as _ShadowResolved,\n type Stroke as _Stroke,\n type StrokeResolved as _StrokeResolved,\n} from \"@motionscript/sdk\";\nimport { createBoundedCache } from \"../kit/cache\";\nimport { omit, PAINT, PAINT_COMMANDS } from \"../kit/component\";\nimport { traceContour } from \"../kit/contour\";\nimport type { CoordinateMap, Interval } from \"../kit/coords\";\nimport { equationParams, parseEquation, type Equation } from \"../kit/equation\";\nimport type { ExpressionScope } from \"../kit/expression\";\nimport { PLOT_COLOR } from \"../kit/furniture\";\nimport { PLOT, plotPlane, SYSTEM, SYSTEM_ENTRY } from \"../kit/graph\";\nimport { drawMark, inkCentre, inkSize, reading, traced, type MarkReading } from \"../kit/mark\";\nimport { openPlane, placeOnMap } from \"../kit/place\";\nimport { sampleCurve, type CurveProjection } from \"../kit/sampler\";\nimport { lerpDomain, lerpParams, lerpSource, readSource, scopeFor, type PlotSource } from \"../kit/source\";\n\nexport interface FunctionPlotProps extends PaintProps {\n expression?: string | PlotSource;\n domain?: Interval | null;\n params?: ExpressionScope;\n}\n\nconst TAU = Math.PI * 2;\n\n/** A plot's entries: what a traced path is built on too. It is only a line, so it has no fill. */\nexport const PLOT_STATE = {\n ...omit(PAINT, \"fill\"),\n expression: Types.custom<string | PlotSource, PlotSource>(\"\", { resolve: readSource, lerp: lerpSource, kind: \"equation\" }),\n /**\n * The span of the free variable that is drawn. Left out, a function runs the\n * width of its system, a polar curve one turn and a parametric one from 0 to 1.\n */\n domain: Types.custom<Interval | null, Interval | null, EntryOptions & { readonly defaultMin: number; readonly defaultMax: number }>(null, { lerp: lerpDomain, kind: \"range\", defaultMin: -5, defaultMax: 5 }),\n /**\n * The equation's named values: any name in it that is not a variable, a\n * function or a constant. One left unset is 1, and a formula can bind each\n * to a variable.\n */\n params: Types.custom<ExpressionScope>({}, { lerp: lerpParams }),\n graph: SYSTEM_ENTRY,\n};\n\n/** A plot's own commands, beside a line's paints. */\nexport const PLOT_COMMANDS = {\n ...omit(PAINT_COMMANDS, \"fillTo\"),\n /** Change the equation, the curve bending from the one into the other. */\n morphTo: { args: [\"expression\"] as const },\n /** Animate the equation's named values. */\n paramsTo: { args: [\"params\"] as const },\n /** Animate the span that is drawn. */\n domainTo: { args: [\"domain\"] as const },\n};\n\nexport const PLOT_STROKE = { weight: 3, fill: PLOT_COLOR, align: \"center\", cap: \"round\", join: \"round\" } as const;\n\n/** What a plot's curve is drawn from. */\nexport interface PlotValues {\n readonly expression: PlotSource;\n readonly params: ExpressionScope;\n}\n\n/**\n * The curve of an equation, drawn in the coordinate system it is a child of.\n * How the equation is written says what it is: see `Equation`. A mark put\n * inside it reads it: the area under it, a tangent, a point that rides it.\n */\nexport const FunctionPlot = traced(component2d({\n key: \"functionPlot\",\n state: PLOT_STATE,\n defaults: { stroke: PLOT_STROKE, width: \"hug\", height: \"hug\" },\n commands: PLOT_COMMANDS,\n // The marks inside it ride it, on its system's map.\n provide: (s, inherited) => [provides(PLOT, plotPlane(s, inherited(SYSTEM)))],\n measure: (_measurer, s) => inkSize(tracePlot(s, reading(s), s.domain)),\n layout: (box, s, children) => {\n const read = reading(s);\n return placeOnMap(children, read.map, inkCentre(tracePlot(s, read, s.domain)), box, plotPlane(s, s.graph));\n },\n plane: (_box, s) => {\n const read = reading(s);\n return openPlane(read.map, inkCentre(tracePlot(s, read, s.domain)));\n },\n render: (ctx, s) => drawMark(ctx, s, tracePlot(s, reading(s), s.domain)),\n}), (s: PlotValues & { readonly domain: Interval | null }, read: MarkReading) => tracePlot(s, read, s.domain));\n\nexport type FunctionPlot = NodeOf<typeof FunctionPlot>;\n\nconst traces = createBoundedCache<Vector2[][]>(256);\n\n/** The runs a plot of `s` draws through `read`, over `span` of its free variable (all of it for `null`). */\nexport function tracePlot(s: PlotValues, read: MarkReading, span: Interval | null): Vector2[][] {\n const { map, shift } = read;\n const { area } = map;\n if (!Number.isFinite(area.maxX - area.minX)) return [];\n const { source, blend } = s.expression;\n const key = [source, blend?.from, blend?.t, map.revision, span, JSON.stringify(s.params), shift.x, shift.y].join(\"|\");\n const known = traces.get(key);\n if (known) return known;\n\n let runs: Vector2[][];\n // A curve with no parameter to walk cannot bend into another: it changes over half way.\n const shown = blend && blend.t < 0.5 ? blend.from : source;\n if (equationOf(source)?.kind === \"implicit\" || (blend && equationOf(blend.from)?.kind === \"implicit\")) {\n runs = contour(shown, s.params, map, shift);\n } else {\n let curve = projectionOf(source, s.params, span, map, shift);\n if (curve && blend) {\n const from = projectionOf(blend.from, s.params, span, map, shift);\n if (from) curve = between(from, curve, blend.t);\n }\n const width = area.maxX - area.minX;\n runs = curve\n ? sampleCurve(curve, 0, 1, area, { seeds: Math.min(512, Math.max(64, Math.round(width / 8))), minStep: 0.5 / Math.max(1, width) })\n : [];\n }\n traces.set(key, runs);\n return runs;\n}\n\nfunction equationOf(source: string): Equation | null {\n const equation = parseEquation(source, equationParams(source));\n return equation instanceof Error ? null : equation;\n}\n\n/** Where an implicit `source` holds, over what the system shows, as pixel runs. */\nfunction contour(source: string, params: ExpressionScope, map: CoordinateMap, shift: Vector2): Vector2[][] {\n const equation = equationOf(source);\n if (equation?.kind !== \"implicit\") return [];\n const scope = scopeFor(equationParams(source), params);\n const { area } = map;\n const cells = (pixels: number) => Math.min(CONTOUR_MAX, Math.max(8, Math.round(pixels / CONTOUR_CELL)));\n const { f } = equation;\n const runs = traceContour(\n (x, y) => f(x - shift.x, y - shift.y, scope),\n map.xRange,\n map.yRange,\n cells(area.maxX - area.minX),\n cells(area.maxY - area.minY),\n );\n return runs.map((run) => run.map((point) => map.toPoint(point.x, point.y)));\n}\n\n/** `source` as a pixel curve over a parameter running 0 to 1. */\nfunction projectionOf(source: string, params: ExpressionScope, domain: Interval | null, map: CoordinateMap, shift: Vector2): CurveProjection | null {\n const equation = equationOf(source);\n if (!equation || equation.kind === \"implicit\") return null;\n const scope = scopeFor(equationParams(source), params);\n switch (equation.kind) {\n case \"function\": {\n const horizontal = equation.of === \"x\";\n const [lo, hi] = horizontal ? map.xRange : map.yRange;\n const offset = horizontal ? shift.x : shift.y;\n // Only what the system shows is sampled, however wide the domain.\n const a = Math.max(lo - offset, domain?.[0] ?? -Infinity);\n const b = Math.min(hi - offset, domain?.[1] ?? Infinity);\n if (!(b > a)) return null;\n const { f } = equation;\n return (u, out) => {\n const v = a + (b - a) * u;\n const w = f(v, 0, scope);\n if (!Number.isFinite(w)) return false;\n if (horizontal) map.toPoint(v + shift.x, w + shift.y, out);\n else map.toPoint(w + shift.x, v + shift.y, out);\n return true;\n };\n }\n case \"polar\": {\n const [a, b] = domain ?? [0, TAU];\n const { f } = equation;\n return (u, out) => {\n const theta = a + (b - a) * u;\n const r = f(theta, 0, scope);\n if (!Number.isFinite(r)) return false;\n map.toPoint(r * Math.cos(theta) + shift.x, r * Math.sin(theta) + shift.y, out);\n return true;\n };\n }\n case \"parametric\": {\n const [a, b] = domain ?? [0, 1];\n const { x, y } = equation;\n return (u, out) => {\n const t = a + (b - a) * u;\n const gx = x(t, 0, scope);\n const gy = y(t, 0, scope);\n if (!Number.isFinite(gx) || !Number.isFinite(gy)) return false;\n map.toPoint(gx + shift.x, gy + shift.y, out);\n return true;\n };\n }\n }\n}\n\n// Roughly one cell of the contour's grid to this many pixels, each way.\nconst CONTOUR_CELL = 5;\nconst CONTOUR_MAX = 220;\n\n// Two curves blended point for point along their parameters, in pixels, so any\n// kind bends into any other.\nfunction between(from: CurveProjection, to: CurveProjection, t: number): CurveProjection {\n const a: Vector2 = { x: 0, y: 0 };\n return (u, out) => {\n if (!from(u, a) || !to(u, out)) return false;\n out.x = a.x + (out.x - a.x) * t;\n out.y = a.y + (out.y - a.y) * t;\n return true;\n };\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type NodeOf, type PaintProps, type Vector2, type Fill as _Fill, type FillResolved as _FillResolved, type Node2D as _Node2D, type Node2DProps as _Node2DProps, type Shadow as _Shadow, type ShadowResolved as _ShadowResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved } from "@motionscript/sdk";
|
|
2
|
+
export interface PointsPlotProps extends PaintProps {
|
|
3
|
+
points?: Vector2[];
|
|
4
|
+
closed?: boolean;
|
|
5
|
+
smooth?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** A line through listed graph points: data, or a shape drawn in graph coordinates when closed, which is when it is filled. */
|
|
8
|
+
export declare const PointsPlot: import("@motionscript/sdk").Component<"pointsPlot", import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
9
|
+
points: import("@motionscript/sdk").Type<Vector2[], Vector2[], false>;
|
|
10
|
+
/** Join the last point to the first. */
|
|
11
|
+
closed: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
12
|
+
/** Curve through the points instead of turning a corner at each. */
|
|
13
|
+
smooth: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
14
|
+
graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
|
|
15
|
+
fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
|
|
16
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
17
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
18
|
+
start: import("@motionscript/sdk").Type<number, number, false>;
|
|
19
|
+
end: import("@motionscript/sdk").Type<number, number, false>;
|
|
20
|
+
}>, {
|
|
21
|
+
readonly pointsTo: readonly ["points"];
|
|
22
|
+
readonly fillTo: readonly ["fill"];
|
|
23
|
+
readonly strokeTo: readonly ["stroke"];
|
|
24
|
+
readonly shadowTo: readonly ["shadow"];
|
|
25
|
+
readonly progressTo: readonly ["start", "end"];
|
|
26
|
+
readonly flash: {
|
|
27
|
+
readonly portion: import("@motionscript/sdk").Type<number, number, false>;
|
|
28
|
+
};
|
|
29
|
+
}, null, _Node2D<_Node2DProps>, import("@motionscript/sdk").CallProps<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
30
|
+
points: import("@motionscript/sdk").Type<Vector2[], Vector2[], false>;
|
|
31
|
+
/** Join the last point to the first. */
|
|
32
|
+
closed: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
33
|
+
/** Curve through the points instead of turning a corner at each. */
|
|
34
|
+
smooth: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
35
|
+
graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
|
|
36
|
+
fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
|
|
37
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
38
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
39
|
+
start: import("@motionscript/sdk").Type<number, number, false>;
|
|
40
|
+
end: import("@motionscript/sdk").Type<number, number, false>;
|
|
41
|
+
}>, null, import("@motionscript/sdk").BuiltNode<import("@motionscript/sdk").Merge<import("@motionscript/sdk").Box2DState, {
|
|
42
|
+
points: import("@motionscript/sdk").Type<Vector2[], Vector2[], false>;
|
|
43
|
+
/** Join the last point to the first. */
|
|
44
|
+
closed: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
45
|
+
/** Curve through the points instead of turning a corner at each. */
|
|
46
|
+
smooth: import("@motionscript/sdk").Type<boolean, boolean, false>;
|
|
47
|
+
graph: import("@motionscript/sdk").Type<import("../index.js").GraphPlane | null, import("../index.js").GraphPlane | null, true>;
|
|
48
|
+
fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
|
|
49
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
50
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
51
|
+
start: import("@motionscript/sdk").Type<number, number, false>;
|
|
52
|
+
end: import("@motionscript/sdk").Type<number, number, false>;
|
|
53
|
+
}>, {
|
|
54
|
+
readonly pointsTo: readonly ["points"];
|
|
55
|
+
readonly fillTo: readonly ["fill"];
|
|
56
|
+
readonly strokeTo: readonly ["stroke"];
|
|
57
|
+
readonly shadowTo: readonly ["shadow"];
|
|
58
|
+
readonly progressTo: readonly ["start", "end"];
|
|
59
|
+
readonly flash: {
|
|
60
|
+
readonly portion: import("@motionscript/sdk").Type<number, number, false>;
|
|
61
|
+
};
|
|
62
|
+
}, _Node2D<_Node2DProps>>>>;
|
|
63
|
+
export type PointsPlot = NodeOf<typeof PointsPlot>;
|
|
64
|
+
//# sourceMappingURL=points-plot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"points-plot.d.ts","sourceRoot":"","sources":["../../src/plots/points-plot.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,OAAO,EAEZ,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,WAAW,IAAI,YAAY,EAChC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACtC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACzC,MAAM,mBAAmB,CAAC;AAM3B,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAC/C,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAkCD,+HAA+H;AAC/H,eAAO,MAAM,UAAU;;IAdnB,wCAAwC;;IAExC,oEAAoE;;;;;;;;;;;;;;;;;;;IAFpE,wCAAwC;;IAExC,oEAAoE;;;;;;;;;;IAFpE,wCAAwC;;IAExC,oEAAoE;;;;;;;;;;;;;;;;;2BAwBxD,CAAC;AAEjB,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC"}
|