@motionscript/math 0.1.0-alpha.5 → 0.1.0-alpha.7

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.
Files changed (233) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +39 -33
  3. package/dist/annotate/angle-mark.d.ts +77 -27
  4. package/dist/annotate/angle-mark.d.ts.map +1 -1
  5. package/dist/annotate/angle-mark.js +80 -115
  6. package/dist/annotate/angle-mark.js.map +1 -1
  7. package/dist/annotate/curly-brace.d.ts +94 -25
  8. package/dist/annotate/curly-brace.d.ts.map +1 -1
  9. package/dist/annotate/curly-brace.js +85 -100
  10. package/dist/annotate/curly-brace.js.map +1 -1
  11. package/dist/annotate/emphasis-mark.d.ts +69 -9
  12. package/dist/annotate/emphasis-mark.d.ts.map +1 -1
  13. package/dist/annotate/emphasis-mark.js +33 -34
  14. package/dist/annotate/emphasis-mark.js.map +1 -1
  15. package/dist/browser/chunks/chunk-ABYBW64J.js +2 -0
  16. package/dist/browser/chunks/chunk-ABYBW64J.js.map +7 -0
  17. package/dist/browser/chunks/chunk-K77KLQX4.js +2 -0
  18. package/dist/browser/chunks/chunk-K77KLQX4.js.map +7 -0
  19. package/dist/browser/index.js +1 -1
  20. package/dist/browser/index.js.map +3 -3
  21. package/dist/browser/kit.js +1 -1
  22. package/dist/browser/manifest.json +1 -1
  23. package/dist/browser/tex.js +1 -1
  24. package/dist/browser/tex.js.map +2 -2
  25. package/dist/engine.d.ts +26 -19
  26. package/dist/engine.d.ts.map +1 -1
  27. package/dist/engine.js +17 -14
  28. package/dist/engine.js.map +1 -1
  29. package/dist/kit/component.d.ts +51 -0
  30. package/dist/kit/component.d.ts.map +1 -0
  31. package/dist/kit/component.js +30 -0
  32. package/dist/kit/component.js.map +1 -0
  33. package/dist/kit/curve.d.ts +22 -11
  34. package/dist/kit/curve.d.ts.map +1 -1
  35. package/dist/kit/curve.js +25 -18
  36. package/dist/kit/curve.js.map +1 -1
  37. package/dist/kit/field-mark.d.ts +56 -35
  38. package/dist/kit/field-mark.d.ts.map +1 -1
  39. package/dist/kit/field-mark.js +100 -120
  40. package/dist/kit/field-mark.js.map +1 -1
  41. package/dist/kit/follow.d.ts +67 -29
  42. package/dist/kit/follow.d.ts.map +1 -1
  43. package/dist/kit/follow.js +114 -110
  44. package/dist/kit/follow.js.map +1 -1
  45. package/dist/kit/furniture.d.ts +3 -1
  46. package/dist/kit/furniture.d.ts.map +1 -1
  47. package/dist/kit/furniture.js +5 -0
  48. package/dist/kit/furniture.js.map +1 -1
  49. package/dist/kit/graph.d.ts +46 -0
  50. package/dist/kit/graph.d.ts.map +1 -0
  51. package/dist/kit/graph.js +90 -0
  52. package/dist/kit/graph.js.map +1 -0
  53. package/dist/kit/mark.d.ts +64 -39
  54. package/dist/kit/mark.d.ts.map +1 -1
  55. package/dist/kit/mark.js +80 -96
  56. package/dist/kit/mark.js.map +1 -1
  57. package/dist/kit/place.d.ts +10 -8
  58. package/dist/kit/place.d.ts.map +1 -1
  59. package/dist/kit/place.js +28 -30
  60. package/dist/kit/place.js.map +1 -1
  61. package/dist/kit/system.d.ts +27 -29
  62. package/dist/kit/system.d.ts.map +1 -1
  63. package/dist/kit/system.js +62 -58
  64. package/dist/kit/system.js.map +1 -1
  65. package/dist/kit/withdrawn.d.ts +3 -3
  66. package/dist/kit/withdrawn.js +3 -3
  67. package/dist/kit/withdrawn.js.map +1 -1
  68. package/dist/marks/curve-area.d.ts +37 -18
  69. package/dist/marks/curve-area.d.ts.map +1 -1
  70. package/dist/marks/curve-area.js +50 -73
  71. package/dist/marks/curve-area.js.map +1 -1
  72. package/dist/marks/drop-lines.d.ts +45 -10
  73. package/dist/marks/drop-lines.d.ts.map +1 -1
  74. package/dist/marks/drop-lines.js +37 -52
  75. package/dist/marks/drop-lines.js.map +1 -1
  76. package/dist/marks/plot-point.d.ts +56 -20
  77. package/dist/marks/plot-point.d.ts.map +1 -1
  78. package/dist/marks/plot-point.js +65 -91
  79. package/dist/marks/plot-point.js.map +1 -1
  80. package/dist/marks/riemann-sum.d.ts +47 -26
  81. package/dist/marks/riemann-sum.d.ts.map +1 -1
  82. package/dist/marks/riemann-sum.js +57 -85
  83. package/dist/marks/riemann-sum.js.map +1 -1
  84. package/dist/marks/tangent-line.d.ts +58 -14
  85. package/dist/marks/tangent-line.d.ts.map +1 -1
  86. package/dist/marks/tangent-line.js +73 -87
  87. package/dist/marks/tangent-line.js.map +1 -1
  88. package/dist/marks/vector-arrow.d.ts +48 -20
  89. package/dist/marks/vector-arrow.d.ts.map +1 -1
  90. package/dist/marks/vector-arrow.js +58 -78
  91. package/dist/marks/vector-arrow.js.map +1 -1
  92. package/dist/nodes.d.ts +13 -5
  93. package/dist/nodes.d.ts.map +1 -1
  94. package/dist/nodes.js +0 -6
  95. package/dist/nodes.js.map +1 -1
  96. package/dist/plots/function-plot.d.ts +135 -43
  97. package/dist/plots/function-plot.d.ts.map +1 -1
  98. package/dist/plots/function-plot.js +146 -177
  99. package/dist/plots/function-plot.js.map +1 -1
  100. package/dist/plots/points-plot.d.ts +55 -19
  101. package/dist/plots/points-plot.d.ts.map +1 -1
  102. package/dist/plots/points-plot.js +31 -58
  103. package/dist/plots/points-plot.js.map +1 -1
  104. package/dist/plots/stream-lines.d.ts +60 -19
  105. package/dist/plots/stream-lines.d.ts.map +1 -1
  106. package/dist/plots/stream-lines.js +60 -79
  107. package/dist/plots/stream-lines.js.map +1 -1
  108. package/dist/plots/traced-path.d.ts +54 -15
  109. package/dist/plots/traced-path.d.ts.map +1 -1
  110. package/dist/plots/traced-path.js +33 -48
  111. package/dist/plots/traced-path.js.map +1 -1
  112. package/dist/plots/vector-field.d.ts +48 -11
  113. package/dist/plots/vector-field.d.ts.map +1 -1
  114. package/dist/plots/vector-field.js +50 -64
  115. package/dist/plots/vector-field.js.map +1 -1
  116. package/dist/structures/network-graph.d.ts +140 -49
  117. package/dist/structures/network-graph.d.ts.map +1 -1
  118. package/dist/structures/network-graph.js +168 -217
  119. package/dist/structures/network-graph.js.map +1 -1
  120. package/dist/structures/sample-space.d.ts +90 -38
  121. package/dist/structures/sample-space.d.ts.map +1 -1
  122. package/dist/structures/sample-space.js +132 -170
  123. package/dist/structures/sample-space.js.map +1 -1
  124. package/dist/systems/axes2d.d.ts +159 -37
  125. package/dist/systems/axes2d.d.ts.map +1 -1
  126. package/dist/systems/axes2d.js +147 -183
  127. package/dist/systems/axes2d.js.map +1 -1
  128. package/dist/systems/number-line.d.ts +80 -28
  129. package/dist/systems/number-line.d.ts.map +1 -1
  130. package/dist/systems/number-line.js +82 -118
  131. package/dist/systems/number-line.js.map +1 -1
  132. package/dist/systems/number-plane.d.ts +140 -31
  133. package/dist/systems/number-plane.d.ts.map +1 -1
  134. package/dist/systems/number-plane.js +142 -149
  135. package/dist/systems/number-plane.js.map +1 -1
  136. package/dist/systems/polar-plane.d.ts +76 -26
  137. package/dist/systems/polar-plane.d.ts.map +1 -1
  138. package/dist/systems/polar-plane.js +107 -133
  139. package/dist/systems/polar-plane.js.map +1 -1
  140. package/dist/tex/index.d.ts.map +1 -1
  141. package/dist/tex/index.js +1 -0
  142. package/dist/tex/index.js.map +1 -1
  143. package/dist/tex/matrix.d.ts +88 -18
  144. package/dist/tex/matrix.d.ts.map +1 -1
  145. package/dist/tex/matrix.js +33 -50
  146. package/dist/tex/matrix.js.map +1 -1
  147. package/dist/tex/node.d.ts +84 -201
  148. package/dist/tex/node.d.ts.map +1 -1
  149. package/dist/tex/node.js +23 -593
  150. package/dist/tex/node.js.map +1 -1
  151. package/dist/tex/typeset.d.ts +133 -0
  152. package/dist/tex/typeset.d.ts.map +1 -0
  153. package/dist/tex/typeset.js +403 -0
  154. package/dist/tex/typeset.js.map +1 -0
  155. package/dist/three/axes3d.d.ts +214 -54
  156. package/dist/three/axes3d.d.ts.map +1 -1
  157. package/dist/three/axes3d.js +163 -204
  158. package/dist/three/axes3d.js.map +1 -1
  159. package/dist/three/curve-plot3d.d.ts +108 -42
  160. package/dist/three/curve-plot3d.d.ts.map +1 -1
  161. package/dist/three/curve-plot3d.js +97 -132
  162. package/dist/three/curve-plot3d.js.map +1 -1
  163. package/dist/three/entries.d.ts +17 -0
  164. package/dist/three/entries.d.ts.map +1 -0
  165. package/dist/three/entries.js +15 -0
  166. package/dist/three/entries.js.map +1 -0
  167. package/dist/three/plot-point3d.d.ts +85 -12
  168. package/dist/three/plot-point3d.d.ts.map +1 -1
  169. package/dist/three/plot-point3d.js +27 -53
  170. package/dist/three/plot-point3d.js.map +1 -1
  171. package/dist/three/space.d.ts +17 -2
  172. package/dist/three/space.d.ts.map +1 -1
  173. package/dist/three/space.js +19 -8
  174. package/dist/three/space.js.map +1 -1
  175. package/dist/three/surface-plot3d.d.ts +176 -49
  176. package/dist/three/surface-plot3d.d.ts.map +1 -1
  177. package/dist/three/surface-plot3d.js +227 -261
  178. package/dist/three/surface-plot3d.js.map +1 -1
  179. package/dist/three/vector-arrow3d.d.ts +87 -16
  180. package/dist/three/vector-arrow3d.d.ts.map +1 -1
  181. package/dist/three/vector-arrow3d.js +48 -67
  182. package/dist/three/vector-arrow3d.js.map +1 -1
  183. package/package.json +4 -4
  184. package/src/annotate/angle-mark.ts +95 -105
  185. package/src/annotate/curly-brace.ts +107 -85
  186. package/src/annotate/emphasis-mark.ts +55 -26
  187. package/src/engine.ts +35 -21
  188. package/src/kit/component.ts +57 -0
  189. package/src/kit/curve.ts +38 -20
  190. package/src/kit/field-mark.ts +124 -108
  191. package/src/kit/follow.ts +146 -120
  192. package/src/kit/furniture.ts +6 -1
  193. package/src/kit/graph.ts +116 -0
  194. package/src/kit/mark.ts +135 -114
  195. package/src/kit/place.ts +32 -56
  196. package/src/kit/system.ts +77 -71
  197. package/src/kit/withdrawn.ts +3 -3
  198. package/src/marks/curve-area.ts +65 -65
  199. package/src/marks/drop-lines.ts +50 -42
  200. package/src/marks/plot-point.ts +77 -82
  201. package/src/marks/riemann-sum.ts +73 -72
  202. package/src/marks/tangent-line.ts +87 -71
  203. package/src/marks/vector-arrow.ts +73 -73
  204. package/src/nodes.ts +41 -5
  205. package/src/plots/function-plot.ts +155 -171
  206. package/src/plots/points-plot.ts +46 -50
  207. package/src/plots/stream-lines.ts +75 -66
  208. package/src/plots/traced-path.ts +51 -33
  209. package/src/plots/vector-field.ts +68 -49
  210. package/src/structures/network-graph.ts +168 -185
  211. package/src/structures/sample-space.ts +149 -148
  212. package/src/systems/axes2d.ts +165 -156
  213. package/src/systems/number-line.ts +91 -92
  214. package/src/systems/number-plane.ts +149 -120
  215. package/src/systems/polar-plane.ts +117 -116
  216. package/src/tex/index.ts +2 -1
  217. package/src/tex/matrix.ts +62 -40
  218. package/src/tex/node.ts +54 -621
  219. package/src/tex/typeset.ts +461 -0
  220. package/src/three/axes3d.ts +187 -160
  221. package/src/three/curve-plot3d.ts +107 -110
  222. package/src/three/entries.ts +42 -0
  223. package/src/three/plot-point3d.ts +42 -45
  224. package/src/three/space.ts +34 -9
  225. package/src/three/surface-plot3d.ts +312 -323
  226. package/src/three/vector-arrow3d.ts +65 -54
  227. package/dist/browser/chunks/chunk-3GJB6AVO.js +0 -2
  228. package/dist/browser/chunks/chunk-3GJB6AVO.js.map +0 -7
  229. package/dist/browser/chunks/chunk-D5WHCVBC.js +0 -2
  230. package/dist/browser/chunks/chunk-D5WHCVBC.js.map +0 -7
  231. package/dist/browser/chunks/chunk-WL4KEX7Y.js +0 -2
  232. package/dist/browser/chunks/chunk-WL4KEX7Y.js.map +0 -7
  233. package/src/kit/placement.ts +0 -8
@@ -1,2 +1,2 @@
1
- import{$ as ra,A as S,Aa as Sa,B as T,Ba as Ta,C as U,Ca as Ua,D as V,Da as Va,E as W,Ea as Wa,F as X,Fa as Xa,G as Y,Ga as Ya,H as Z,I as _,J as $,K as aa,L as ba,M as ca,N as da,O as ea,P as fa,Q as ga,R as ha,S as ia,T as ja,U as ka,V as la,W as ma,X as na,Y as oa,Z as pa,_ as qa,a as t,aa as sa,b as u,ba as ta,c as v,ca as ua,d as w,da as va,e as x,ea as wa,f as y,fa as xa,g as z,ga as ya,h as A,ha as za,i as B,ia as Aa,j as C,ja as Ba,k as D,ka as Ca,l as E,la as Da,m as F,ma as Ea,n as G,na as Fa,o as H,oa as Ga,p as I,pa as Ha,q as J,qa as Ia,r as K,ra as Ja,s as L,sa as Ka,t as M,ta as La,u as N,ua as Ma,v as O,va as Na,w as P,wa as Oa,x as Q,xa as Pa,ya as Qa,z as R,za as Ra}from"./chunks/chunk-3GJB6AVO.js";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}from"./chunks/chunk-WL4KEX7Y.js";export{O as AXIS_COLOR,W as Axes2d,L as CoordinateSystem,Pa as EQUATION_KINDS,$ as EQUATION_VARIABLES,Ia as EQUATION_VARIABLES_3D,da as FIELD_VARIABLES,p as FILL_PAINT,Wa as FieldMark,ya as FollowMark,ta as FunctionPlot,Xa as GRAPH_LAYOUTS,x as IDENTITY_MATRIX,s as Latex,g as LatexError,f as LatexNotLoaded,b as MATHJAX_LOADER,X as MATH_DIALECT,pa as Mark,r as OUTLINE_TRIM,w as PIXEL_MAP,P as PLOT_COLOR,q as STROKE_PAINT,ra as SYSTEMS,sa as SYSTEMS_AND_PLOT,ka as UNSET_PARAM,za as add,Ha as aim,T as along,u as axisScale,Aa as between,e as blankLatex,F as boundsOfRuns,Da as braceOutline,h as buildLatexPath,v as cartesianMap,H as clamp,Sa as colorAt,Z as compileExpression,_ as compileExpressionCached,a as createBoundedCache,ua as curveNamed,va as curveOf,k as defaultLatexMorph,Ea as drawLabel3D,R as drawLabels,S as drawn,ba as equationError,ca as equationParams,Y as expressionVocabulary,ga as fieldError,ea as fieldParams,Va as fillAt,j as findLatexParts,wa as followed,N as formatTick,Fa as graphSpace,Ca as grown,Ba as heading,G as inflate,A as isIdentityMatrix,i as latexPartNames,Ya as layOut,ja as lerpDomain,Ua as lerpFillScale,U as lerpInterval,z as lerpMatrix,la as lerpParams,m as lerpPartFills,Ra as lerpScale,ia as lerpSource,D as lineThrough,c as loadMathJax,d as mathJaxLoaded,K as openPlane,aa as parseEquation,fa as parseField,Ma as parseSpaceCurve,La as parseSurface,o as partPaint,J as placeOnMap,xa as quadOf,Ta as readFillScale,V as readInterval,y as readMatrix,l as readPartFills,Qa as readScale,ha as readSource,t as resolveInterval,na as revisionOf,E as runsToPath,qa as sampleCurve,ma as scopeFor,Oa as spaceCurveError,Ka as spaceCurveParams,Ga as spaceOf,I as stated,Na as surfaceError,Ja as surfaceParams,M as ticksFor,oa as traceContour,B as transformedMap,C as warpedMap,n as withPartFill,Q as withoutTips};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motionscript/math",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.7",
4
4
  "exports": {
5
5
  ".": "dist/browser/index.js",
6
6
  "./kit": "dist/browser/kit.js",
@@ -1,2 +1,2 @@
1
- import{a as l,b as a}from"./chunks/chunk-D5WHCVBC.js";import{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,s as t}from"./chunks/chunk-WL4KEX7Y.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};
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
@@ -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": "2KAaO,IAAMA,EAAY,CAACC,EAAOC,CAAW",
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 class
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 { CoordinateSystem } from './kit/system.js';
20
- export { Axes2d } from './systems/axes2d.js';
21
- export type { Axes2dProps, AxisLayout } from './systems/axes2d.js';
22
- export type { Anchored } from './kit/place.js';
23
- export { openPlane, placeOnMap } from './kit/place.js';
24
- export { Mark } from './kit/mark.js';
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 { curveNamed, curveOf } from './kit/curve.js';
39
- export type { Curve } from './kit/curve.js';
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, followed, FollowMark, grown, heading, quadOf } from './kit/follow.js';
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 { FieldMark } from './kit/field-mark.js';
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';
@@ -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,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY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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 class
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 { CoordinateSystem } from './kit/system.js';
15
- // A number plane is axes with a grid, so a copied one extends these rather than a copy of them.
16
- export { Axes2d } from './systems/axes2d.js';
17
- export { openPlane, placeOnMap } from './kit/place.js';
18
- export { Mark } from './kit/mark.js';
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 { curveNamed, curveOf } from './kit/curve.js';
27
- export { along, AXIS_COLOR, drawLabels, drawn, lerpInterval, PLOT_COLOR, readInterval, withoutTips } from './kit/furniture.js';
28
- export { add, between, followed, FollowMark, grown, heading, quadOf } from './kit/follow.js';
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 extends this rather than a copy of it.
33
- export { FunctionPlot } from './plots/function-plot.js';
34
- export { FieldMark } from './kit/field-mark.js';
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';
@@ -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,kBAAk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EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE1F,OAAO,EACH,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,GACvI,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,6GAA6G;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,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,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,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 class\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 { 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 type { BoundedCache } from './kit/cache';\r\n\r\nexport { CoordinateSystem } from './kit/system';\r\n// A number plane is axes with a grid, so a copied one extends these rather than a copy of them.\r\nexport { Axes2d } from './systems/axes2d';\r\nexport type { Axes2dProps, AxisLayout } from './systems/axes2d';\r\nexport type { Anchored } from './kit/place';\r\nexport { openPlane, placeOnMap } from './kit/place';\r\nexport { Mark } from './kit/mark';\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 { curveNamed, curveOf } from './kit/curve';\r\nexport type { Curve } from './kit/curve';\r\nexport { along, AXIS_COLOR, drawLabels, drawn, lerpInterval, PLOT_COLOR, readInterval, withoutTips } from './kit/furniture';\r\nexport type { Label, LabelStyle } from './kit/furniture';\r\nexport { add, between, followed, FollowMark, grown, heading, quadOf } from './kit/follow';\r\nexport type { FollowProps, 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, graphSpace, spaceOf } from './three/space';\r\nexport type { GraphSpace } from './three/space';\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 extends this rather than a copy of it.\r\nexport { FunctionPlot } from './plots/function-plot';\r\nexport type { FunctionPlotProps } from './plots/function-plot';\r\nexport { FieldMark } from './kit/field-mark';\r\nexport type { FieldProps, FieldSampler, FieldStroke } 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 { SYSTEMS, SYSTEMS_AND_PLOT } from './kit/placement';\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"]}
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACH,UAAU,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,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,GACvI,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,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,EAET,KAAK,IAAI,IAAI,KAAK,EAClB,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACtC,KAAK,MAAM,IAAI,OAAO,EACtB,KAAK,cAAc,IAAI,eAAe,EACzC,MAAM,mBAAmB,CAAC;AAU3B,wFAAwF;AACxF,eAAO,MAAM,KAAK;;;;;;CAAQ,CAAC;AAC3B,eAAO,MAAM,cAAc;;;oBAQkC,CAAC;;;;oBAC5B,CAAC;;;;oBAA6G,CAAC;;;;oBAQ3E,CAAC;;;;;;;;CAjB5B,CAAC;AAE5C;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACnI,yEAAyE;AACzE,wBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;AAK/I,UAAU,aAAa;IACnB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,iEAAiE;AACjE,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAInG;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,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"]}
@@ -1,17 +1,28 @@
1
- import { type Node2D } from "@motionscript/sdk";
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 node with a height at each `x`: what a point, a tangent or an area rides.
4
- * A protocol rather than a class, so a copied plot is ridden like the kit's own.
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 Curve {
7
- /** The curve's height at graph `x`, or `NaN` where it has none. */
8
- valueAt(x: number): number;
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 curve `id` names in `from`'s tree, or `null`. */
11
- export declare function curveNamed(from: Node2D, id: string): Curve | null;
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 a mark reads: the one `on` names, or, naming none, the nearest
14
- * curve the mark sits inside. Putting an area in a plot is how it is told which.
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 curveOf(mark: Node2D, on: string): Curve | null;
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
@@ -1 +1 @@
1
- {"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../src/kit/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;GAGG;AACH,MAAM,WAAW,KAAK;IAClB,mEAAmE;IACnE,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAIjE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAM9D"}
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 { findNode2D } from "@motionscript/sdk";
2
- /** The curve `id` names in `from`'s tree, or `null`. */
3
- export function curveNamed(from, id) {
4
- if (id === "")
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 a mark reads: the one `on` names, or, naming none, the nearest
11
- * curve the mark sits inside. Putting an area in a plot is how it is told which.
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 curveOf(mark, on) {
14
- if (on !== "")
15
- return curveNamed(mark, on);
16
- for (let at = mark.parent; at; at = at.parent) {
17
- if (typeof at.valueAt === "function")
18
- return at;
19
- }
20
- return null;
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
@@ -1 +1 @@
1
- {"version":3,"file":"curve.js","sourceRoot":"","sources":["../../src/kit/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAe,MAAM,mBAAmB,CAAC;AAW5D,wDAAwD;AACxD,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,EAAU;IAC/C,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC3B,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,EAAE,CAAqC,CAAC;IACvE,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAE,KAAwB,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,EAAU;IAC5C,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3C,KAAK,IAAI,EAAE,GAAkB,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;QAC3D,IAAI,OAAQ,EAAqB,CAAC,OAAO,KAAK,UAAU;YAAE,OAAO,EAAoB,CAAC;IAC1F,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { findNode2D, type Node2D } from \"@motionscript/sdk\";\r\n\r\n/**\r\n * A node with a height at each `x`: what a point, a tangent or an area rides.\r\n * A protocol rather than a class, so a copied plot is ridden like the kit's own.\r\n */\r\nexport interface Curve {\r\n /** The curve's height at graph `x`, or `NaN` where it has none. */\r\n valueAt(x: number): number;\r\n}\r\n\r\n/** The curve `id` names in `from`'s tree, or `null`. */\r\nexport function curveNamed(from: Node2D, id: string): Curve | null {\r\n if (id === \"\") return null;\r\n const found = findNode2D(from, id) as (Node2D & Partial<Curve>) | null;\r\n return found && typeof found.valueAt === \"function\" ? (found as Node2D & Curve) : null;\r\n}\r\n\r\n/**\r\n * The curve a mark reads: the one `on` names, or, naming none, the nearest\r\n * curve the mark sits inside. Putting an area in a plot is how it is told which.\r\n */\r\nexport function curveOf(mark: Node2D, on: string): Curve | null {\r\n if (on !== \"\") return curveNamed(mark, on);\r\n for (let at: Node2D | null = mark.parent; at; at = at.parent) {\r\n if (typeof (at as Partial<Curve>).valueAt === \"function\") return at as Node2D & Curve;\r\n }\r\n return null;\r\n}\r\n"]}
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"]}