@motionscript/math 0.1.0-alpha.4 → 0.1.0-alpha.6
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 +132 -92
- package/README.md +39 -33
- package/dist/annotate/angle-mark.d.ts +52 -27
- package/dist/annotate/angle-mark.d.ts.map +1 -1
- package/dist/annotate/angle-mark.js +80 -115
- package/dist/annotate/angle-mark.js.map +1 -1
- package/dist/annotate/curly-brace.d.ts +59 -25
- package/dist/annotate/curly-brace.d.ts.map +1 -1
- package/dist/annotate/curly-brace.js +85 -100
- package/dist/annotate/curly-brace.js.map +1 -1
- package/dist/annotate/emphasis-mark.d.ts +43 -9
- package/dist/annotate/emphasis-mark.d.ts.map +1 -1
- package/dist/annotate/emphasis-mark.js +33 -34
- package/dist/annotate/emphasis-mark.js.map +1 -1
- package/dist/browser/chunks/chunk-ABYBW64J.js +2 -0
- package/dist/browser/chunks/chunk-ABYBW64J.js.map +7 -0
- package/dist/browser/chunks/chunk-K77KLQX4.js +2 -0
- package/dist/browser/chunks/chunk-K77KLQX4.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/tex.js +1 -1
- package/dist/browser/tex.js.map +2 -2
- package/dist/engine.d.ts +26 -19
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +17 -14
- package/dist/engine.js.map +1 -1
- 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/curve.d.ts +22 -11
- package/dist/kit/curve.d.ts.map +1 -1
- package/dist/kit/curve.js +25 -18
- package/dist/kit/curve.js.map +1 -1
- package/dist/kit/field-mark.d.ts +58 -35
- package/dist/kit/field-mark.d.ts.map +1 -1
- package/dist/kit/field-mark.js +100 -120
- package/dist/kit/field-mark.js.map +1 -1
- package/dist/kit/follow.d.ts +67 -29
- package/dist/kit/follow.d.ts.map +1 -1
- package/dist/kit/follow.js +114 -110
- package/dist/kit/follow.js.map +1 -1
- package/dist/kit/furniture.d.ts +3 -1
- package/dist/kit/furniture.d.ts.map +1 -1
- package/dist/kit/furniture.js +5 -0
- package/dist/kit/furniture.js.map +1 -1
- 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 +64 -39
- package/dist/kit/mark.d.ts.map +1 -1
- package/dist/kit/mark.js +80 -96
- package/dist/kit/mark.js.map +1 -1
- package/dist/kit/place.d.ts +10 -8
- package/dist/kit/place.d.ts.map +1 -1
- package/dist/kit/place.js +28 -30
- package/dist/kit/place.js.map +1 -1
- package/dist/kit/system.d.ts +27 -29
- package/dist/kit/system.d.ts.map +1 -1
- package/dist/kit/system.js +62 -58
- package/dist/kit/system.js.map +1 -1
- package/dist/kit/withdrawn.d.ts +3 -3
- package/dist/kit/withdrawn.js +3 -3
- package/dist/kit/withdrawn.js.map +1 -1
- package/dist/marks/curve-area.d.ts +24 -18
- package/dist/marks/curve-area.d.ts.map +1 -1
- package/dist/marks/curve-area.js +50 -73
- package/dist/marks/curve-area.js.map +1 -1
- package/dist/marks/drop-lines.d.ts +28 -10
- package/dist/marks/drop-lines.d.ts.map +1 -1
- package/dist/marks/drop-lines.js +37 -52
- package/dist/marks/drop-lines.js.map +1 -1
- package/dist/marks/plot-point.d.ts +37 -20
- package/dist/marks/plot-point.d.ts.map +1 -1
- package/dist/marks/plot-point.js +65 -91
- package/dist/marks/plot-point.js.map +1 -1
- package/dist/marks/riemann-sum.d.ts +30 -26
- package/dist/marks/riemann-sum.d.ts.map +1 -1
- package/dist/marks/riemann-sum.js +57 -85
- package/dist/marks/riemann-sum.js.map +1 -1
- package/dist/marks/tangent-line.d.ts +38 -14
- package/dist/marks/tangent-line.d.ts.map +1 -1
- package/dist/marks/tangent-line.js +73 -87
- package/dist/marks/tangent-line.js.map +1 -1
- package/dist/marks/vector-arrow.d.ts +30 -20
- package/dist/marks/vector-arrow.d.ts.map +1 -1
- package/dist/marks/vector-arrow.js +58 -78
- package/dist/marks/vector-arrow.js.map +1 -1
- package/dist/nodes.d.ts +13 -5
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +0 -6
- package/dist/nodes.js.map +1 -1
- package/dist/plots/function-plot.d.ts +107 -43
- package/dist/plots/function-plot.d.ts.map +1 -1
- package/dist/plots/function-plot.js +146 -177
- package/dist/plots/function-plot.js.map +1 -1
- package/dist/plots/points-plot.d.ts +34 -19
- package/dist/plots/points-plot.d.ts.map +1 -1
- package/dist/plots/points-plot.js +31 -58
- package/dist/plots/points-plot.js.map +1 -1
- package/dist/plots/stream-lines.d.ts +38 -19
- package/dist/plots/stream-lines.d.ts.map +1 -1
- package/dist/plots/stream-lines.js +60 -79
- package/dist/plots/stream-lines.js.map +1 -1
- package/dist/plots/traced-path.d.ts +34 -15
- package/dist/plots/traced-path.d.ts.map +1 -1
- package/dist/plots/traced-path.js +33 -48
- package/dist/plots/traced-path.js.map +1 -1
- package/dist/plots/vector-field.d.ts +31 -11
- package/dist/plots/vector-field.d.ts.map +1 -1
- package/dist/plots/vector-field.js +50 -64
- package/dist/plots/vector-field.js.map +1 -1
- package/dist/structures/network-graph.d.ts +99 -49
- package/dist/structures/network-graph.d.ts.map +1 -1
- package/dist/structures/network-graph.js +168 -217
- package/dist/structures/network-graph.js.map +1 -1
- package/dist/structures/sample-space.d.ts +69 -38
- package/dist/structures/sample-space.d.ts.map +1 -1
- package/dist/structures/sample-space.js +132 -170
- package/dist/structures/sample-space.js.map +1 -1
- package/dist/systems/axes2d.d.ts +126 -37
- package/dist/systems/axes2d.d.ts.map +1 -1
- package/dist/systems/axes2d.js +147 -183
- package/dist/systems/axes2d.js.map +1 -1
- package/dist/systems/number-line.d.ts +51 -28
- package/dist/systems/number-line.d.ts.map +1 -1
- package/dist/systems/number-line.js +82 -118
- package/dist/systems/number-line.js.map +1 -1
- package/dist/systems/number-plane.d.ts +92 -31
- package/dist/systems/number-plane.d.ts.map +1 -1
- package/dist/systems/number-plane.js +142 -149
- package/dist/systems/number-plane.js.map +1 -1
- package/dist/systems/polar-plane.d.ts +47 -26
- package/dist/systems/polar-plane.d.ts.map +1 -1
- package/dist/systems/polar-plane.js +107 -133
- package/dist/systems/polar-plane.js.map +1 -1
- package/dist/tex/index.d.ts.map +1 -1
- package/dist/tex/index.js +1 -0
- package/dist/tex/index.js.map +1 -1
- package/dist/tex/matrix.d.ts +56 -18
- package/dist/tex/matrix.d.ts.map +1 -1
- package/dist/tex/matrix.js +33 -50
- package/dist/tex/matrix.js.map +1 -1
- package/dist/tex/node.d.ts +55 -201
- package/dist/tex/node.d.ts.map +1 -1
- package/dist/tex/node.js +23 -593
- package/dist/tex/node.js.map +1 -1
- 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 +140 -54
- package/dist/three/axes3d.d.ts.map +1 -1
- package/dist/three/axes3d.js +159 -204
- package/dist/three/axes3d.js.map +1 -1
- package/dist/three/curve-plot3d.d.ts +70 -42
- package/dist/three/curve-plot3d.d.ts.map +1 -1
- package/dist/three/curve-plot3d.js +97 -132
- package/dist/three/curve-plot3d.js.map +1 -1
- 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/plot-point3d.d.ts +57 -12
- package/dist/three/plot-point3d.d.ts.map +1 -1
- package/dist/three/plot-point3d.js +27 -53
- package/dist/three/plot-point3d.js.map +1 -1
- package/dist/three/space.d.ts +17 -2
- package/dist/three/space.d.ts.map +1 -1
- package/dist/three/space.js +19 -8
- package/dist/three/space.js.map +1 -1
- package/dist/three/surface-plot3d.d.ts +131 -49
- package/dist/three/surface-plot3d.d.ts.map +1 -1
- package/dist/three/surface-plot3d.js +227 -261
- package/dist/three/surface-plot3d.js.map +1 -1
- package/dist/three/vector-arrow3d.d.ts +58 -16
- package/dist/three/vector-arrow3d.d.ts.map +1 -1
- package/dist/three/vector-arrow3d.js +48 -67
- package/dist/three/vector-arrow3d.js.map +1 -1
- package/package.json +4 -4
- package/src/annotate/angle-mark.ts +95 -105
- package/src/annotate/curly-brace.ts +107 -85
- package/src/annotate/emphasis-mark.ts +55 -26
- package/src/engine.ts +35 -21
- package/src/kit/component.ts +57 -0
- package/src/kit/curve.ts +38 -20
- package/src/kit/field-mark.ts +124 -108
- package/src/kit/follow.ts +146 -120
- package/src/kit/furniture.ts +6 -1
- package/src/kit/graph.ts +116 -0
- package/src/kit/mark.ts +135 -114
- package/src/kit/place.ts +32 -56
- package/src/kit/system.ts +77 -71
- package/src/kit/withdrawn.ts +3 -3
- package/src/marks/curve-area.ts +65 -65
- package/src/marks/drop-lines.ts +50 -42
- package/src/marks/plot-point.ts +77 -82
- package/src/marks/riemann-sum.ts +73 -72
- package/src/marks/tangent-line.ts +87 -71
- package/src/marks/vector-arrow.ts +73 -73
- package/src/nodes.ts +41 -5
- package/src/plots/function-plot.ts +155 -171
- package/src/plots/points-plot.ts +46 -50
- package/src/plots/stream-lines.ts +75 -66
- package/src/plots/traced-path.ts +51 -33
- package/src/plots/vector-field.ts +68 -49
- package/src/structures/network-graph.ts +168 -185
- package/src/structures/sample-space.ts +149 -148
- package/src/systems/axes2d.ts +165 -156
- package/src/systems/number-line.ts +91 -92
- package/src/systems/number-plane.ts +149 -120
- package/src/systems/polar-plane.ts +117 -116
- package/src/tex/index.ts +2 -1
- package/src/tex/matrix.ts +62 -40
- package/src/tex/node.ts +54 -621
- package/src/tex/typeset.ts +461 -0
- package/src/three/axes3d.ts +182 -161
- package/src/three/curve-plot3d.ts +107 -110
- package/src/three/entries.ts +42 -0
- package/src/three/plot-point3d.ts +42 -45
- package/src/three/space.ts +34 -9
- package/src/three/surface-plot3d.ts +312 -323
- package/src/three/vector-arrow3d.ts +65 -54
- package/dist/browser/chunks/chunk-3GJB6AVO.js +0 -2
- package/dist/browser/chunks/chunk-3GJB6AVO.js.map +0 -7
- package/dist/browser/chunks/chunk-D5WHCVBC.js +0 -2
- package/dist/browser/chunks/chunk-D5WHCVBC.js.map +0 -7
- package/dist/browser/chunks/chunk-WL4KEX7Y.js +0 -2
- package/dist/browser/chunks/chunk-WL4KEX7Y.js.map +0 -7
- package/src/kit/placement.ts +0 -8
package/dist/browser/kit.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as
|
|
1
|
+
import{$ as Ka,$a as Kb,A as ja,Aa as jb,Ab as jc,B as ka,Ba as kb,Bb as kc,C as la,Ca as lb,Cb as lc,D as ma,Da as mb,Db as mc,E as na,Ea as nb,Eb as nc,F as oa,Fa as ob,G as pa,Ga as pb,H as qa,Ha as qb,I as ra,Ia as rb,J as sa,Ja as sb,K as ta,Ka as tb,L as ua,La as ub,M as va,Ma as vb,N as wa,Na as wb,O as xa,Oa as xb,P as ya,Pa as yb,Q as za,Qa as zb,R as Aa,Ra as Ab,S as Ba,Sa as Bb,T as Ca,Ta as Cb,U as Da,Ua as Db,V as Ea,Va as Eb,W as Fa,Wa as Fb,X as Ga,Xa as Gb,Y as Ha,Ya as Hb,Z as Ia,Za as Ib,_ as Ja,_a as Jb,a as L,aa as La,ab as Lb,b as M,ba as Ma,bb as Mb,c as N,ca as Na,cb as Nb,d as O,da as Oa,db as Ob,e as P,ea as Pa,eb as Pb,f as Q,fa as Qa,fb as Qb,g as R,ga as Ra,gb as Rb,h as S,ha as Sa,hb as Sb,i as T,ia as Ta,ib as Tb,j as U,ja as Ua,jb as Ub,k as V,ka as Va,kb as Vb,l as W,la as Wa,lb as Wb,m as X,ma as Xa,mb as Xb,n as Y,na as Ya,nb as Yb,o as Z,oa as Za,ob as Zb,p as _,pa as _a,pb as _b,q as $,qa as $a,qb as $b,r as aa,ra as ab,rb as ac,s as ba,sa as bb,sb as bc,t as ca,ta as cb,tb as cc,u as da,ua as db,ub as dc,v as ea,va as eb,vb as ec,w as fa,wa as fb,wb as fc,x as ga,xa as gb,xb as gc,y as ha,ya as hb,yb as hc,z as ia,za as ib,zb as ic}from"./chunks/chunk-ABYBW64J.js";import{A,B,C,D,E,F,G,H,I,J,K,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunks/chunk-K77KLQX4.js";export{gb as AXES,hb as AXES_COMMANDS,W as AXIS_COLOR,mb as Axes2d,ta as CURVE_KEYS,Yb as EQUATION_KINDS,ia as EQUATION_VARIABLES,Rb as EQUATION_VARIABLES_3D,gc as FIELD_COMMANDS,fc as FIELD_STATE,nb as FIELD_VARIABLES,lc as FILL_PAINT,zb as FOLLOW_COMMANDS,yb as FOLLOW_STATE,wb as FunctionPlot,Mb as GRAPH_3D,jc as GRAPH_LAYOUTS,P as IDENTITY_MATRIX,K as Latex,g as LatexError,f as LatexNotLoaded,b as MATHJAX_LOADER,ea as MATH_DIALECT,u as Morph,nc as OUTLINE_TRIM,Eb as OWN_FRAME,l as PAINT,m as PAINT_COMMANDS,O as PIXEL_MAP,za as PLANE_ENTRY,xa as PLOT,X as PLOT_COLOR,ub as PLOT_COMMANDS,Aa as PLOT_REF,tb as PLOT_STATE,vb as PLOT_STROKE,mc as STROKE_PAINT,wa as SYSTEM,ya as SYSTEM_ENTRY,y as TYPESET,z as TYPESET_COMMANDS,pa as UNSET_PARAM,Fb as add,Qb as aim,ba as along,Wa as anchored,lb as axesFurniture,jb as axesMap,kb as axesOf,M as axisScale,Gb as between,e as blankLatex,Ha as boundsOfRuns,Jb as braceOutline,h as buildLatexPath,N as cartesianMap,Va as castsShadow,Ja as clamp,$b as colorAt,ga as compileExpression,ha as compileExpressionCached,Ab as container,a as createBoundedCache,Ea as curveFor,ua as curveValue,Z as declareFormulas,k as defaultLatexMorph,ec as domainEntry,ic as drawField,E as drawFormula,Kb as drawLabel3D,$ as drawLabels,Ta as drawMark,db as drawSystem,aa as drawn,ka as equationError,la as equationParams,fa as expressionVocabulary,qb as fieldError,ob as fieldParams,cc as fillAt,j as findLatexParts,Cb as followedQuad,fb as formatTick,G as formula,A as formulaFrame,I as formulaOf,Nb as graphEntry,Ob as graphOf,Ra as graphPoint,Lb as graphSpace,Ib as grown,Hb as heading,Ia as inflate,Pa as inkCentre,Oa as inkSize,va as isCurve,H as isFormula,S as isIdentityMatrix,J as latexPartBounds,i as latexPartNames,kc as layOut,C as layoutFormula,oa as lerpDomain,bc as lerpFillScale,ca as lerpInterval,R as lerpMatrix,w as lerpMorph,qa as lerpParams,r as lerpPartFills,_b as lerpScale,na as lerpSource,V as lineThrough,n as listed,ib as loadAxes,D as loadFormula,_ as loadFormulas,c as loadMathJax,Ma as markRuns,Sa as markShape,d as mathJaxLoaded,B as measureFormula,dc as meshEntries,x as morphOf,o as omit,Ya as openPlane,Db as outlineBounds,Qa as ownPoint,p as painted,ja as parseEquation,pb as parseField,Vb as parseSpaceCurve,Ub as parseSurface,F as partBoundsIn,t as partPaint,Xa as placeOnMap,Za as plotArea,Da as plotPlane,ac as readFillScale,da as readInterval,Q as readMatrix,q as readPartFills,Zb as readScale,ma as readSource,Na as reading,Fa as refId,L as resolveInterval,Bb as resting,sa as revisionOf,Ga as runsToPath,sb as sampleCurve,ra as scopeFor,Ca as settle,v as settled,Xb as spaceCurveError,Tb as spaceCurveParams,Pb as spaceOf,Ka as stated,Ua as strokeShape,Wb as surfaceError,Sb as surfaceParams,bb as systemLayout,_a as systemMap,cb as systemOpenPlane,Ba as systemPlane,ab as systemProvides,$a as systemSize,eb as ticksFor,rb as traceContour,hc as traceField,xb as tracePlot,La as traced,T as transformedMap,U as warpedMap,s as withPartFill,Y as withoutTips};
|
|
2
2
|
//# sourceMappingURL=kit.js.map
|
package/dist/browser/tex.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{K as t,L as l,M as a,b as o,c as r,d as e,e as x,f as L,g as m,h as d,i as f,j as p,k as i}from"./chunks/chunk-K77KLQX4.js";var M=[t,a];export{t as Latex,m as LatexError,a as LatexMatrix,L as LatexNotLoaded,o as MATHJAX_LOADER,M as TEX_NODES,x as blankLatex,d as buildLatexPath,i as defaultLatexMorph,p as findLatexParts,f as latexPartNames,r as loadMathJax,e as mathJaxLoaded,l as matrixSource};
|
|
2
2
|
//# sourceMappingURL=tex.js.map
|
package/dist/browser/tex.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/tex/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { LatexMatrix } from './matrix';\r\nimport { Latex } from './node';\r\n\r\nexport * from './node';\r\nexport * from './matrix';\r\nexport {\r\n blankLatex, buildLatexPath, findLatexParts, latexPartNames, LatexError, LatexNotLoaded, loadMathJax, mathJaxLoaded, MATHJAX_LOADER,\r\n} from './geometry';\r\nexport type { LatexPart, LatexToken, LatexPathResult } from './geometry';\r\nexport { defaultLatexMorph } from './tween';\r\nexport type { AnimatedToken, LatexMorphStrategy } from './tween';\r\n\r\n/** The typeset-math node types, for a host that registers only these. */\r\nexport const TEX_NODES = [Latex, LatexMatrix];\r\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { LatexMatrix } from './matrix';\r\nimport { Latex } from './node';\r\n\r\nexport * from './node';\r\nexport * from './matrix';\r\nexport {\r\n blankLatex, buildLatexPath, findLatexParts, latexPartNames, LatexError, LatexNotLoaded, loadMathJax, mathJaxLoaded, MATHJAX_LOADER,\r\n} from './geometry';\r\nexport type { LatexPart, LatexToken, LatexPathResult } from './geometry';\r\nexport { defaultLatexMorph } from './tween';\r\nexport type { AnimatedToken, LatexMorphStrategy } from './tween';\r\n\r\n/** The typeset-math node types, for a host that registers only these. */\r\n// Typed by name, so the declaration names each component rather than spelling out its type through core.\r\nexport const TEX_NODES: (typeof Latex | typeof LatexMatrix)[] = [Latex, LatexMatrix];\r\n"],
|
|
5
|
+
"mappings": "mIAcO,IAAMA,EAAmD,CAACC,EAAOC,CAAW",
|
|
6
6
|
"names": ["TEX_NODES", "Latex", "LatexMatrix"]
|
|
7
7
|
}
|
package/dist/engine.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The math **kit**: what the nodes share, and what a copied one does not copy.
|
|
3
3
|
*
|
|
4
4
|
* `ms add` writes a node's own files into a project and rewrites its reach for
|
|
5
|
-
* these to `@motionscript/math`, so MathJax, the morph and every shared
|
|
5
|
+
* these to `@motionscript/math`, so MathJax, the morph and every shared module
|
|
6
6
|
* stay a real dependency with one identity.
|
|
7
7
|
*/
|
|
8
8
|
export { blankLatex, buildLatexPath, findLatexParts, latexPartNames, LatexError, LatexNotLoaded, loadMathJax, mathJaxLoaded, MATHJAX_LOADER, } from './tex/geometry.js';
|
|
@@ -11,17 +11,24 @@ export { defaultLatexMorph } from './tex/tween.js';
|
|
|
11
11
|
export type { AnimatedToken, LatexMorphStrategy } from './tex/tween.js';
|
|
12
12
|
export { Latex } from './tex/node.js';
|
|
13
13
|
export type { LatexProps, LatexStrategies } from './tex/node.js';
|
|
14
|
+
export { drawFormula, formula, formulaFrame, formulaOf, isFormula, latexPartBounds, layoutFormula, lerpMorph, loadFormula, measureFormula, Morph, morphOf, partBoundsIn, settled, TYPESET, TYPESET_COMMANDS, } from './tex/typeset.js';
|
|
15
|
+
export type { FormulaFrame, Morphing, TypesetValues } from './tex/typeset.js';
|
|
14
16
|
export { lerpPartFills, partPaint, readPartFills, withPartFill } from './kit/part-fills.js';
|
|
15
17
|
export type { PartFill, PartFillResolved } from './kit/part-fills.js';
|
|
16
18
|
export { FILL_PAINT, OUTLINE_TRIM, STROKE_PAINT } from './kit/withdrawn.js';
|
|
17
19
|
export { createBoundedCache } from './kit/cache.js';
|
|
20
|
+
export { listed, omit, PAINT, PAINT_COMMANDS, painted } from './kit/component.js';
|
|
18
21
|
export type { BoundedCache } from './kit/cache.js';
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export
|
|
22
|
-
export type {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
22
|
+
export { drawSystem, plotArea, systemLayout, systemMap, systemOpenPlane, systemProvides, systemSize } from './kit/system.js';
|
|
23
|
+
export type { MapFor, SystemState } from './kit/system.js';
|
|
24
|
+
export { Axes2d, AXES, AXES_COMMANDS, axesFurniture, axesMap, axesOf, loadAxes } from './systems/axes2d.js';
|
|
25
|
+
export type { Axes2dProps, AxesValues, AxisLayout } from './systems/axes2d.js';
|
|
26
|
+
export type { Anchor } from './kit/place.js';
|
|
27
|
+
export { anchored, openPlane, placeOnMap } from './kit/place.js';
|
|
28
|
+
export { castsShadow, drawMark, graphPoint, inkCentre, inkSize, markRuns, markShape, ownPoint, reading, strokeShape, traced, } from './kit/mark.js';
|
|
29
|
+
export type { MarkOptions, MarkPaint, MarkReading, MarkState, Tracer } from './kit/mark.js';
|
|
30
|
+
export { curveFor, PLANE_ENTRY, PLOT, PLOT_REF, plotPlane, refId, settle, SYSTEM, SYSTEM_ENTRY, systemPlane } from './kit/graph.js';
|
|
31
|
+
export type { GraphPlane } from './kit/graph.js';
|
|
25
32
|
export { axisScale, cartesianMap, resolveInterval, PIXEL_MAP } from './kit/coords.js';
|
|
26
33
|
export type { AxisScale, AxisScaling, CartesianOptions, CoordinateMap, Interval } from './kit/coords.js';
|
|
27
34
|
export { compileExpression, compileExpressionCached, expressionVocabulary, MATH_DIALECT } from './kit/expression.js';
|
|
@@ -35,27 +42,27 @@ export type { CurveProjection, SampleOptions } from './kit/sampler.js';
|
|
|
35
42
|
export { formatTick, ticksFor } from './kit/ticks.js';
|
|
36
43
|
export type { Ticks } from './kit/ticks.js';
|
|
37
44
|
export { boundsOfRuns, clamp, inflate, runsToPath, stated } from './kit/geometry.js';
|
|
38
|
-
export {
|
|
39
|
-
export type {
|
|
40
|
-
export { along, AXIS_COLOR, drawLabels, drawn, lerpInterval, PLOT_COLOR, readInterval, withoutTips } from './kit/furniture.js';
|
|
45
|
+
export { CURVE_KEYS, curveValue, isCurve } from './kit/curve.js';
|
|
46
|
+
export type { CurveValues } from './kit/curve.js';
|
|
47
|
+
export { along, AXIS_COLOR, declareFormulas, drawLabels, drawn, lerpInterval, loadFormulas, PLOT_COLOR, readInterval, withoutTips } from './kit/furniture.js';
|
|
41
48
|
export type { Label, LabelStyle } from './kit/furniture.js';
|
|
42
|
-
export { add, between,
|
|
43
|
-
export type { FollowProps, Parted, Quad, Retarget, Target } from './kit/follow.js';
|
|
49
|
+
export { add, between, container, FOLLOW_COMMANDS, FOLLOW_STATE, followedQuad, grown, heading, outlineBounds, OWN_FRAME, resting, } from './kit/follow.js';
|
|
50
|
+
export type { FollowProps, FollowValues, Parted, Quad, Retarget, Target } from './kit/follow.js';
|
|
44
51
|
export { parseSpaceCurve, parseSurface, spaceCurveError, spaceCurveParams, surfaceError, surfaceParams, EQUATION_KINDS, EQUATION_VARIABLES_3D, } from './kit/equation3d.js';
|
|
45
52
|
export type { EquationLanguage, SpaceCurveEquation, SurfaceEquation } from './kit/equation3d.js';
|
|
46
|
-
export { aim, graphSpace, spaceOf } from './three/space.js';
|
|
47
|
-
export type { GraphSpace } from './three/space.js';
|
|
53
|
+
export { aim, graphEntry, graphOf, graphSpace, spaceOf, GRAPH_3D } from './three/space.js';
|
|
54
|
+
export type { Graph3D, GraphSpace } from './three/space.js';
|
|
55
|
+
export { domainEntry, meshEntries } from './three/entries.js';
|
|
48
56
|
export { drawLabel3D } from './three/label3d.js';
|
|
49
57
|
export type { LabelStyle3D } from './three/label3d.js';
|
|
50
|
-
export { FunctionPlot } from './plots/function-plot.js';
|
|
51
|
-
export type { FunctionPlotProps } from './plots/function-plot.js';
|
|
52
|
-
export {
|
|
53
|
-
export type { FieldProps, FieldSampler, FieldStroke } from './kit/field-mark.js';
|
|
58
|
+
export { FunctionPlot, PLOT_COMMANDS, PLOT_STATE, PLOT_STROKE, tracePlot } from './plots/function-plot.js';
|
|
59
|
+
export type { FunctionPlotProps, PlotValues } from './plots/function-plot.js';
|
|
60
|
+
export { drawField, FIELD_COMMANDS, FIELD_STATE, traceField } from './kit/field-mark.js';
|
|
61
|
+
export type { FieldDrawing, FieldProps, FieldSampler, FieldStroke, FieldValues } from './kit/field-mark.js';
|
|
54
62
|
export { fieldError, fieldParams, parseField, FIELD_VARIABLES } from './kit/field.js';
|
|
55
63
|
export type { FieldEquation } from './kit/field.js';
|
|
56
64
|
export { traceContour } from './kit/contour.js';
|
|
57
65
|
export { colorAt, fillAt, lerpFillScale, lerpScale, readFillScale, readScale } from './kit/scale.js';
|
|
58
|
-
export { SYSTEMS, SYSTEMS_AND_PLOT } from './kit/placement.js';
|
|
59
66
|
export { IDENTITY_MATRIX, isIdentityMatrix, lerpMatrix, lineThrough, readMatrix, transformedMap, warpedMap, } from './kit/coords.js';
|
|
60
67
|
export type { Matrix2, Warp } from './kit/coords.js';
|
|
61
68
|
export { braceOutline } from './kit/brace.js';
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACH,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,GACrI,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,UAA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B,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtF,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,EACH,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,GACpG,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/engine.js
CHANGED
|
@@ -2,20 +2,23 @@
|
|
|
2
2
|
* The math **kit**: what the nodes share, and what a copied one does not copy.
|
|
3
3
|
*
|
|
4
4
|
* `ms add` writes a node's own files into a project and rewrites its reach for
|
|
5
|
-
* these to `@motionscript/math`, so MathJax, the morph and every shared
|
|
5
|
+
* these to `@motionscript/math`, so MathJax, the morph and every shared module
|
|
6
6
|
* stay a real dependency with one identity.
|
|
7
7
|
*/
|
|
8
8
|
export { blankLatex, buildLatexPath, findLatexParts, latexPartNames, LatexError, LatexNotLoaded, loadMathJax, mathJaxLoaded, MATHJAX_LOADER, } from './tex/geometry.js';
|
|
9
9
|
export { defaultLatexMorph } from './tex/tween.js';
|
|
10
10
|
export { Latex } from './tex/node.js';
|
|
11
|
+
export { drawFormula, formula, formulaFrame, formulaOf, isFormula, latexPartBounds, layoutFormula, lerpMorph, loadFormula, measureFormula, Morph, morphOf, partBoundsIn, settled, TYPESET, TYPESET_COMMANDS, } from './tex/typeset.js';
|
|
11
12
|
export { lerpPartFills, partPaint, readPartFills, withPartFill } from './kit/part-fills.js';
|
|
12
13
|
export { FILL_PAINT, OUTLINE_TRIM, STROKE_PAINT } from './kit/withdrawn.js';
|
|
13
14
|
export { createBoundedCache } from './kit/cache.js';
|
|
14
|
-
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
15
|
+
export { listed, omit, PAINT, PAINT_COMMANDS, painted } from './kit/component.js';
|
|
16
|
+
export { drawSystem, plotArea, systemLayout, systemMap, systemOpenPlane, systemProvides, systemSize } from './kit/system.js';
|
|
17
|
+
// A number plane is axes with a grid, so a copied one builds on these rather than a copy of them.
|
|
18
|
+
export { Axes2d, AXES, AXES_COMMANDS, axesFurniture, axesMap, axesOf, loadAxes } from './systems/axes2d.js';
|
|
19
|
+
export { anchored, openPlane, placeOnMap } from './kit/place.js';
|
|
20
|
+
export { castsShadow, drawMark, graphPoint, inkCentre, inkSize, markRuns, markShape, ownPoint, reading, strokeShape, traced, } from './kit/mark.js';
|
|
21
|
+
export { curveFor, PLANE_ENTRY, PLOT, PLOT_REF, plotPlane, refId, settle, SYSTEM, SYSTEM_ENTRY, systemPlane } from './kit/graph.js';
|
|
19
22
|
export { axisScale, cartesianMap, resolveInterval, PIXEL_MAP } from './kit/coords.js';
|
|
20
23
|
export { compileExpression, compileExpressionCached, expressionVocabulary, MATH_DIALECT } from './kit/expression.js';
|
|
21
24
|
export { equationError, equationParams, parseEquation, EQUATION_VARIABLES } from './kit/equation.js';
|
|
@@ -23,19 +26,19 @@ export { lerpDomain, lerpParams, lerpSource, readSource, revisionOf, scopeFor, U
|
|
|
23
26
|
export { sampleCurve } from './kit/sampler.js';
|
|
24
27
|
export { formatTick, ticksFor } from './kit/ticks.js';
|
|
25
28
|
export { boundsOfRuns, clamp, inflate, runsToPath, stated } from './kit/geometry.js';
|
|
26
|
-
export {
|
|
27
|
-
export { along, AXIS_COLOR, drawLabels, drawn, lerpInterval, PLOT_COLOR, readInterval, withoutTips } from './kit/furniture.js';
|
|
28
|
-
export { add, between,
|
|
29
|
+
export { CURVE_KEYS, curveValue, isCurve } from './kit/curve.js';
|
|
30
|
+
export { along, AXIS_COLOR, declareFormulas, drawLabels, drawn, lerpInterval, loadFormulas, PLOT_COLOR, readInterval, withoutTips } from './kit/furniture.js';
|
|
31
|
+
export { add, between, container, FOLLOW_COMMANDS, FOLLOW_STATE, followedQuad, grown, heading, outlineBounds, OWN_FRAME, resting, } from './kit/follow.js';
|
|
29
32
|
export { parseSpaceCurve, parseSurface, spaceCurveError, spaceCurveParams, surfaceError, surfaceParams, EQUATION_KINDS, EQUATION_VARIABLES_3D, } from './kit/equation3d.js';
|
|
30
|
-
export { aim, graphSpace, spaceOf } from './three/space.js';
|
|
33
|
+
export { aim, graphEntry, graphOf, graphSpace, spaceOf, GRAPH_3D } from './three/space.js';
|
|
34
|
+
export { domainEntry, meshEntries } from './three/entries.js';
|
|
31
35
|
export { drawLabel3D } from './three/label3d.js';
|
|
32
|
-
// A traced path is a plot whose span follows a value, so a copied one
|
|
33
|
-
export { FunctionPlot } from './plots/function-plot.js';
|
|
34
|
-
export {
|
|
36
|
+
// A traced path is a plot whose span follows a value, so a copied one builds on these rather than a copy of them.
|
|
37
|
+
export { FunctionPlot, PLOT_COMMANDS, PLOT_STATE, PLOT_STROKE, tracePlot } from './plots/function-plot.js';
|
|
38
|
+
export { drawField, FIELD_COMMANDS, FIELD_STATE, traceField } from './kit/field-mark.js';
|
|
35
39
|
export { fieldError, fieldParams, parseField, FIELD_VARIABLES } from './kit/field.js';
|
|
36
40
|
export { traceContour } from './kit/contour.js';
|
|
37
41
|
export { colorAt, fillAt, lerpFillScale, lerpScale, readFillScale, readScale } from './kit/scale.js';
|
|
38
|
-
export { SYSTEMS, SYSTEMS_AND_PLOT } from './kit/placement.js';
|
|
39
42
|
export { IDENTITY_MATRIX, isIdentityMatrix, lerpMatrix, lineThrough, readMatrix, transformedMap, warpedMap, } from './kit/coords.js';
|
|
40
43
|
export { braceOutline } from './kit/brace.js';
|
|
41
44
|
export { GRAPH_LAYOUTS, layOut } from './structures/graph-layout.js';
|
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACH,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,GACrI,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACH,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,GACrI,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;A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AU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAExF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,kHAAkH;AAClH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAExG,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,EACH,eAAe,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,GACpG,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["/**\r\n * The math **kit**: what the nodes share, and what a copied one does not copy.\r\n *\r\n * `ms add` writes a node's own files into a project and rewrites its reach for\r\n * these to `@motionscript/math`, so MathJax, the morph and every shared module\r\n * stay a real dependency with one identity.\r\n */\r\nexport {\r\n blankLatex, buildLatexPath, findLatexParts, latexPartNames, LatexError, LatexNotLoaded, loadMathJax, mathJaxLoaded, MATHJAX_LOADER,\r\n} from './tex/geometry';\r\nexport type { LatexPart, LatexToken, LatexPathResult } from './tex/geometry';\r\nexport { defaultLatexMorph } from './tex/tween';\r\nexport type { AnimatedToken, LatexMorphStrategy } from './tex/tween';\r\nexport { Latex } from './tex/node';\r\nexport type { LatexProps, LatexStrategies } from './tex/node';\r\nexport {\r\n drawFormula, formula, formulaFrame, formulaOf, isFormula, latexPartBounds, layoutFormula, lerpMorph, loadFormula, measureFormula, Morph, morphOf,\r\n partBoundsIn, settled, TYPESET, TYPESET_COMMANDS,\r\n} from './tex/typeset';\r\nexport type { FormulaFrame, Morphing, TypesetValues } from './tex/typeset';\r\nexport { lerpPartFills, partPaint, readPartFills, withPartFill } from './kit/part-fills';\r\nexport type { PartFill, PartFillResolved } from './kit/part-fills';\r\nexport { FILL_PAINT, OUTLINE_TRIM, STROKE_PAINT } from './kit/withdrawn';\r\nexport { createBoundedCache } from './kit/cache';\r\nexport { listed, omit, PAINT, PAINT_COMMANDS, painted } from './kit/component';\r\nexport type { BoundedCache } from './kit/cache';\r\n\r\nexport { drawSystem, plotArea, systemLayout, systemMap, systemOpenPlane, systemProvides, systemSize } from './kit/system';\r\nexport type { MapFor, SystemState } from './kit/system';\r\n// A number plane is axes with a grid, so a copied one builds on these rather than a copy of them.\r\nexport { Axes2d, AXES, AXES_COMMANDS, axesFurniture, axesMap, axesOf, loadAxes } from './systems/axes2d';\r\nexport type { Axes2dProps, AxesValues, AxisLayout } from './systems/axes2d';\r\nexport type { Anchor } from './kit/place';\r\nexport { anchored, openPlane, placeOnMap } from './kit/place';\r\nexport {\r\n castsShadow, drawMark, graphPoint, inkCentre, inkSize, markRuns, markShape, ownPoint, reading, strokeShape, traced,\r\n} from './kit/mark';\r\nexport type { MarkOptions, MarkPaint, MarkReading, MarkState, Tracer } from './kit/mark';\r\nexport { curveFor, PLANE_ENTRY, PLOT, PLOT_REF, plotPlane, refId, settle, SYSTEM, SYSTEM_ENTRY, systemPlane } from './kit/graph';\r\nexport type { GraphPlane } from './kit/graph';\r\nexport { axisScale, cartesianMap, resolveInterval, PIXEL_MAP } from './kit/coords';\r\nexport type { AxisScale, AxisScaling, CartesianOptions, CoordinateMap, Interval } from './kit/coords';\r\nexport { compileExpression, compileExpressionCached, expressionVocabulary, MATH_DIALECT } from './kit/expression';\r\nexport type { CompiledExpression, ExpressionScope, ExpressionVocabulary } from './kit/expression';\r\nexport { equationError, equationParams, parseEquation, EQUATION_VARIABLES } from './kit/equation';\r\nexport type { Equation } from './kit/equation';\r\nexport { lerpDomain, lerpParams, lerpSource, readSource, revisionOf, scopeFor, UNSET_PARAM } from './kit/source';\r\nexport type { PlotSource } from './kit/source';\r\nexport { sampleCurve } from './kit/sampler';\r\nexport type { CurveProjection, SampleOptions } from './kit/sampler';\r\nexport { formatTick, ticksFor } from './kit/ticks';\r\nexport type { Ticks } from './kit/ticks';\r\nexport { boundsOfRuns, clamp, inflate, runsToPath, stated } from './kit/geometry';\r\nexport { CURVE_KEYS, curveValue, isCurve } from './kit/curve';\r\nexport type { CurveValues } from './kit/curve';\r\nexport { along, AXIS_COLOR, declareFormulas, drawLabels, drawn, lerpInterval, loadFormulas, PLOT_COLOR, readInterval, withoutTips } from './kit/furniture';\r\nexport type { Label, LabelStyle } from './kit/furniture';\r\nexport {\r\n add, between, container, FOLLOW_COMMANDS, FOLLOW_STATE, followedQuad, grown, heading, outlineBounds, OWN_FRAME, resting,\r\n} from './kit/follow';\r\nexport type { FollowProps, FollowValues, Parted, Quad, Retarget, Target } from './kit/follow';\r\nexport {\r\n parseSpaceCurve, parseSurface, spaceCurveError, spaceCurveParams, surfaceError, surfaceParams, EQUATION_KINDS, EQUATION_VARIABLES_3D,\r\n} from './kit/equation3d';\r\nexport type { EquationLanguage, SpaceCurveEquation, SurfaceEquation } from './kit/equation3d';\r\nexport { aim, graphEntry, graphOf, graphSpace, spaceOf, GRAPH_3D } from './three/space';\r\nexport type { Graph3D, GraphSpace } from './three/space';\r\nexport { domainEntry, meshEntries } from './three/entries';\r\nexport { drawLabel3D } from './three/label3d';\r\nexport type { LabelStyle3D } from './three/label3d';\r\n// A traced path is a plot whose span follows a value, so a copied one builds on these rather than a copy of them.\r\nexport { FunctionPlot, PLOT_COMMANDS, PLOT_STATE, PLOT_STROKE, tracePlot } from './plots/function-plot';\r\nexport type { FunctionPlotProps, PlotValues } from './plots/function-plot';\r\nexport { drawField, FIELD_COMMANDS, FIELD_STATE, traceField } from './kit/field-mark';\r\nexport type { FieldDrawing, FieldProps, FieldSampler, FieldStroke, FieldValues } from './kit/field-mark';\r\nexport { fieldError, fieldParams, parseField, FIELD_VARIABLES } from './kit/field';\r\nexport type { FieldEquation } from './kit/field';\r\nexport { traceContour } from './kit/contour';\r\nexport { colorAt, fillAt, lerpFillScale, lerpScale, readFillScale, readScale } from './kit/scale';\r\nexport {\r\n IDENTITY_MATRIX, isIdentityMatrix, lerpMatrix, lineThrough, readMatrix, transformedMap, warpedMap,\r\n} from './kit/coords';\r\nexport type { Matrix2, Warp } from './kit/coords';\r\nexport { braceOutline } from './kit/brace';\r\nexport { GRAPH_LAYOUTS, layOut } from './structures/graph-layout';\r\nexport type { GraphEdge, GraphLayout } from './structures/graph-layout';\r\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type RenderContext, type Type, type Fill as _Fill, type FillResolved as _FillResolved, type Shadow as _Shadow, type ShadowResolved as _ShadowResolved, type Stroke as _Stroke, type StrokeResolved as _StrokeResolved } from "@motionscript/sdk";
|
|
2
|
+
/** A math node's paints: fill, stroke, shadow and the outline trim, with no overlay. */
|
|
3
|
+
export declare const PAINT: {
|
|
4
|
+
fill: import("@motionscript/sdk").Attribute<_Fill, _FillResolved[]>;
|
|
5
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, _StrokeResolved[]>;
|
|
6
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, _ShadowResolved[]>;
|
|
7
|
+
start: Type<number, number, false>;
|
|
8
|
+
end: Type<number, number, false>;
|
|
9
|
+
};
|
|
10
|
+
export declare const PAINT_COMMANDS: {
|
|
11
|
+
fillTo: {
|
|
12
|
+
readonly args: readonly ["fill"];
|
|
13
|
+
readonly run?: undefined;
|
|
14
|
+
};
|
|
15
|
+
strokeTo: {
|
|
16
|
+
readonly args: readonly ["stroke"];
|
|
17
|
+
readonly run?: undefined;
|
|
18
|
+
};
|
|
19
|
+
shadowTo: {
|
|
20
|
+
readonly args: readonly ["shadow"];
|
|
21
|
+
readonly run?: undefined;
|
|
22
|
+
};
|
|
23
|
+
progressTo: {
|
|
24
|
+
readonly args: readonly ["start", "end"];
|
|
25
|
+
readonly run?: undefined;
|
|
26
|
+
};
|
|
27
|
+
flash: {
|
|
28
|
+
readonly args: {
|
|
29
|
+
readonly portion: Type<number, number, false>;
|
|
30
|
+
};
|
|
31
|
+
run(timeline: any, state: any, children: any): import("@motionscript/sdk").Piece;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* One of `values`, held as text with its choices listed (no `kind: "enum"`).
|
|
36
|
+
*/
|
|
37
|
+
export declare function listed<const V extends readonly string[]>(values: V, initial: V[number], options?: ListedOptions): Type<V[number]>;
|
|
38
|
+
/** With no default: an arg left out is one the command was not given. */
|
|
39
|
+
export declare function listed<const V extends readonly string[]>(values: V, initial: undefined, options?: ListedOptions): Type<V[number] | undefined>;
|
|
40
|
+
interface ListedOptions {
|
|
41
|
+
readonly animatable?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** `record` without `keys`: the paints a node has no use for. */
|
|
44
|
+
export declare function omit<T extends object, const K extends keyof T>(record: T, ...keys: K[]): Omit<T, K>;
|
|
45
|
+
/**
|
|
46
|
+
* A node's paint order: its own paint under its children, then what it lays
|
|
47
|
+
* over them, each cut at the near plane of a space it crosses.
|
|
48
|
+
*/
|
|
49
|
+
export declare function painted(ctx: RenderContext, own: () => void, over?: () => void): void;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/kit/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,aAAa,EAClB,KAAK,IAAI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E,MAAM,IAAgB,GAAG,IAAI,CAI/F"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Paint, Types, } from "@motionscript/sdk";
|
|
2
|
+
/**
|
|
3
|
+
* What a component in this kit shares beyond the factory: the paints a math
|
|
4
|
+
* node draws with, listed choices, and the order a node paints in.
|
|
5
|
+
*/
|
|
6
|
+
const { overlay: _overlay, ...paint } = Paint.state;
|
|
7
|
+
const { overlayTo: _overlayTo, ...paintCommands } = Paint.commands;
|
|
8
|
+
/** A math node's paints: fill, stroke, shadow and the outline trim, with no overlay. */
|
|
9
|
+
export const PAINT = paint;
|
|
10
|
+
export const PAINT_COMMANDS = paintCommands;
|
|
11
|
+
export function listed(values, initial, options = {}) {
|
|
12
|
+
return Types.custom(initial, { ...options, options: values });
|
|
13
|
+
}
|
|
14
|
+
/** `record` without `keys`: the paints a node has no use for. */
|
|
15
|
+
export function omit(record, ...keys) {
|
|
16
|
+
const out = { ...record };
|
|
17
|
+
for (const key of keys)
|
|
18
|
+
delete out[key];
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A node's paint order: its own paint under its children, then what it lays
|
|
23
|
+
* over them, each cut at the near plane of a space it crosses.
|
|
24
|
+
*/
|
|
25
|
+
export function painted(ctx, own, over = () => { }) {
|
|
26
|
+
ctx.inFront(own);
|
|
27
|
+
ctx.children();
|
|
28
|
+
ctx.inFront(over);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/kit/component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EACL,KAAK,GAWR,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AAEH,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;AACpD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC;AAEnE,wFAAwF;AACxF,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC;AAC3B,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAQ5C,MAAM,UAAU,MAAM,CAAC,MAAyB,EAAE,OAA2B,EAAE,UAAyB,EAAE;IACtG,OAAO,KAAK,CAAC,MAAM,CAAiG,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AAClK,CAAC;AAMD,iEAAiE;AACjE,MAAM,UAAU,IAAI,CAA4C,MAAS,EAAE,GAAG,IAAS;IACnF,MAAM,GAAG,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,GAAkB,EAAE,GAAe,EAAE,OAAmB,GAAG,EAAE,GAAG,CAAC;IACrF,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,GAAG,CAAC,QAAQ,EAAE,CAAC;IACf,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC","sourcesContent":["import {\r\n Paint,\r\n Types,\r\n type EntryOptions,\r\n type RenderContext,\r\n type Type,\r\n // Named so the emitted declaration reaches these through the sdk, not core.\r\n type Fill as _Fill,\r\n type FillResolved as _FillResolved,\r\n type Shadow as _Shadow,\r\n type ShadowResolved as _ShadowResolved,\r\n type Stroke as _Stroke,\r\n type StrokeResolved as _StrokeResolved,\r\n} from \"@motionscript/sdk\";\r\n\r\n/**\r\n * What a component in this kit shares beyond the factory: the paints a math\r\n * node draws with, listed choices, and the order a node paints in.\r\n */\r\n\r\nconst { overlay: _overlay, ...paint } = Paint.state;\r\nconst { overlayTo: _overlayTo, ...paintCommands } = Paint.commands;\r\n\r\n/** A math node's paints: fill, stroke, shadow and the outline trim, with no overlay. */\r\nexport const PAINT = paint;\r\nexport const PAINT_COMMANDS = paintCommands;\r\n\r\n/**\r\n * One of `values`, held as text with its choices listed (no `kind: \"enum\"`).\r\n */\r\nexport function listed<const V extends readonly string[]>(values: V, initial: V[number], options?: ListedOptions): Type<V[number]>;\r\n/** With no default: an arg left out is one the command was not given. */\r\nexport function listed<const V extends readonly string[]>(values: V, initial: undefined, options?: ListedOptions): Type<V[number] | undefined>;\r\nexport function listed(values: readonly string[], initial: string | undefined, options: ListedOptions = {}): Type<string | undefined> {\r\n return Types.custom<string | undefined, string | undefined, EntryOptions & { readonly options: readonly string[] }>(initial, { ...options, options: values });\r\n}\r\n\r\ninterface ListedOptions {\r\n readonly animatable?: boolean;\r\n}\r\n\r\n/** `record` without `keys`: the paints a node has no use for. */\r\nexport function omit<T extends object, const K extends keyof T>(record: T, ...keys: K[]): Omit<T, K> {\r\n const out = { ...record };\r\n for (const key of keys) delete out[key];\r\n return out;\r\n}\r\n\r\n/**\r\n * A node's paint order: its own paint under its children, then what it lays\r\n * over them, each cut at the near plane of a space it crosses.\r\n */\r\nexport function painted(ctx: RenderContext, own: () => void, over: () => void = () => { }): void {\r\n ctx.inFront(own);\r\n ctx.children();\r\n ctx.inFront(over);\r\n}\r\n"]}
|
package/dist/kit/curve.d.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NodeView } from "@motionscript/sdk";
|
|
2
|
+
import type { ExpressionScope } from "./expression.js";
|
|
3
|
+
import { type PlotSource } from "./source.js";
|
|
2
4
|
/**
|
|
3
|
-
* A
|
|
4
|
-
*
|
|
5
|
+
* A curve as a mark reads it: what a plot is drawn from, its own `x`/`y`, and
|
|
6
|
+
* whether a system laid it out, which is when those are a shift in graph units.
|
|
7
|
+
* Data rather than a class, so a copied plot is ridden like the kit's own.
|
|
5
8
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
export interface CurveValues {
|
|
10
|
+
readonly expression: PlotSource;
|
|
11
|
+
readonly params: ExpressionScope;
|
|
12
|
+
readonly x: number;
|
|
13
|
+
readonly y: number;
|
|
14
|
+
/** The plane the plot was laid out on; `null` outside any system. */
|
|
15
|
+
readonly graph?: object | null;
|
|
9
16
|
}
|
|
10
|
-
/** The
|
|
11
|
-
export declare
|
|
17
|
+
/** The node types a point, a tangent or an area can ride: they have a height at each `x`. */
|
|
18
|
+
export declare const CURVE_KEYS: readonly string[];
|
|
12
19
|
/**
|
|
13
|
-
* The curve
|
|
14
|
-
*
|
|
20
|
+
* The curve's height at graph `x`, or `NaN` where it has none or is not a
|
|
21
|
+
* function of `x`. What a point, a tangent or an area riding a plot reads.
|
|
15
22
|
*/
|
|
16
|
-
export declare function
|
|
23
|
+
export declare function curveValue(curve: CurveValues, x: number): number;
|
|
24
|
+
/** Whether `view` is a node a mark can ride. */
|
|
25
|
+
export declare function isCurve(view: unknown): view is NodeView & {
|
|
26
|
+
readonly state: CurveValues;
|
|
27
|
+
};
|
|
17
28
|
//# sourceMappingURL=curve.d.ts.map
|
package/dist/kit/curve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../src/kit/curve.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../src/kit/curve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,6FAA6F;AAC7F,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAmC,CAAC;AAE5E;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAOhE;AAED,gDAAgD;AAChD,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,QAAQ,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAA;CAAE,CAEzF"}
|
package/dist/kit/curve.js
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return null;
|
|
6
|
-
const found = findNode2D(from, id);
|
|
7
|
-
return found && typeof found.valueAt === "function" ? found : null;
|
|
8
|
-
}
|
|
1
|
+
import { equationParams, parseEquation } from "./equation.js";
|
|
2
|
+
import { scopeFor } from "./source.js";
|
|
3
|
+
/** The node types a point, a tangent or an area can ride: they have a height at each `x`. */
|
|
4
|
+
export const CURVE_KEYS = ["functionPlot", "tracedPath"];
|
|
9
5
|
/**
|
|
10
|
-
* The curve
|
|
11
|
-
*
|
|
6
|
+
* The curve's height at graph `x`, or `NaN` where it has none or is not a
|
|
7
|
+
* function of `x`. What a point, a tangent or an area riding a plot reads.
|
|
12
8
|
*/
|
|
13
|
-
export function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
9
|
+
export function curveValue(curve, x) {
|
|
10
|
+
const { source, blend } = curve.expression;
|
|
11
|
+
const shift = curve.graph ? curve : NO_SHIFT;
|
|
12
|
+
const value = heightOf(source, curve.params, x - shift.x) + shift.y;
|
|
13
|
+
if (!blend)
|
|
14
|
+
return value;
|
|
15
|
+
const from = heightOf(blend.from, curve.params, x - shift.x) + shift.y;
|
|
16
|
+
return from + (value - from) * blend.t;
|
|
17
|
+
}
|
|
18
|
+
/** Whether `view` is a node a mark can ride. */
|
|
19
|
+
export function isCurve(view) {
|
|
20
|
+
return typeof view === "object" && view !== null && CURVE_KEYS.includes(view.key ?? "");
|
|
21
|
+
}
|
|
22
|
+
const NO_SHIFT = { x: 0, y: 0 };
|
|
23
|
+
function heightOf(source, params, x) {
|
|
24
|
+
const equation = parseEquation(source, equationParams(source));
|
|
25
|
+
if (equation instanceof Error || equation.kind !== "function" || equation.of !== "x")
|
|
26
|
+
return NaN;
|
|
27
|
+
return equation.f(x, 0, scopeFor(equationParams(source), params));
|
|
21
28
|
}
|
|
22
29
|
//# sourceMappingURL=curve.js.map
|
package/dist/kit/curve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../src/kit/curve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../src/kit/curve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;AAgBrD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,UAAU,GAAsB,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE5E;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAkB,EAAE,CAAS;IACpD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC7C,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IACpE,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IACvE,OAAO,IAAI,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,OAAO,CAAC,IAAa;IACjC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,UAAU,CAAC,QAAQ,CAAE,IAAyB,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AAClH,CAAC;AAED,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAEhC,SAAS,QAAQ,CAAC,MAAc,EAAE,MAAuB,EAAE,CAAS;IAChE,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/D,IAAI,QAAQ,YAAY,KAAK,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,IAAI,QAAQ,CAAC,EAAE,KAAK,GAAG;QAAE,OAAO,GAAG,CAAC;IACjG,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import type { NodeView } from \"@motionscript/sdk\";\r\nimport { equationParams, parseEquation } from \"./equation\";\r\nimport type { ExpressionScope } from \"./expression\";\r\nimport { scopeFor, type PlotSource } from \"./source\";\r\n\r\n/**\r\n * A curve as a mark reads it: what a plot is drawn from, its own `x`/`y`, and\r\n * whether a system laid it out, which is when those are a shift in graph units.\r\n * Data rather than a class, so a copied plot is ridden like the kit's own.\r\n */\r\nexport interface CurveValues {\r\n readonly expression: PlotSource;\r\n readonly params: ExpressionScope;\r\n readonly x: number;\r\n readonly y: number;\r\n /** The plane the plot was laid out on; `null` outside any system. */\r\n readonly graph?: object | null;\r\n}\r\n\r\n/** The node types a point, a tangent or an area can ride: they have a height at each `x`. */\r\nexport const CURVE_KEYS: readonly string[] = [\"functionPlot\", \"tracedPath\"];\r\n\r\n/**\r\n * The curve's height at graph `x`, or `NaN` where it has none or is not a\r\n * function of `x`. What a point, a tangent or an area riding a plot reads.\r\n */\r\nexport function curveValue(curve: CurveValues, x: number): number {\r\n const { source, blend } = curve.expression;\r\n const shift = curve.graph ? curve : NO_SHIFT;\r\n const value = heightOf(source, curve.params, x - shift.x) + shift.y;\r\n if (!blend) return value;\r\n const from = heightOf(blend.from, curve.params, x - shift.x) + shift.y;\r\n return from + (value - from) * blend.t;\r\n}\r\n\r\n/** Whether `view` is a node a mark can ride. */\r\nexport function isCurve(view: unknown): view is NodeView & { readonly state: CurveValues } {\r\n return typeof view === \"object\" && view !== null && CURVE_KEYS.includes((view as { key?: string }).key ?? \"\");\r\n}\r\n\r\nconst NO_SHIFT = { x: 0, y: 0 };\r\n\r\nfunction heightOf(source: string, params: ExpressionScope, x: number): number {\r\n const equation = parseEquation(source, equationParams(source));\r\n if (equation instanceof Error || equation.kind !== \"function\" || equation.of !== \"x\") return NaN;\r\n return equation.f(x, 0, scopeFor(equationParams(source), params));\r\n}\r\n"]}
|