@motionscript/math 0.0.0-stage → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +48 -0
  4. package/README.md +385 -3
  5. package/dist/annotate/angle-mark.d.ts +46 -0
  6. package/dist/annotate/angle-mark.d.ts.map +1 -0
  7. package/dist/annotate/angle-mark.js +132 -0
  8. package/dist/annotate/angle-mark.js.map +1 -0
  9. package/dist/annotate/curly-brace.d.ts +46 -0
  10. package/dist/annotate/curly-brace.d.ts.map +1 -0
  11. package/dist/annotate/curly-brace.js +114 -0
  12. package/dist/annotate/curly-brace.js.map +1 -0
  13. package/dist/annotate/emphasis-mark.d.ts +20 -0
  14. package/dist/annotate/emphasis-mark.d.ts.map +1 -0
  15. package/dist/annotate/emphasis-mark.js +81 -0
  16. package/dist/annotate/emphasis-mark.js.map +1 -0
  17. package/dist/browser/THIRD_PARTY_LICENSES.txt +420 -0
  18. package/dist/browser/chunks/chunk-3GJB6AVO.js +2 -0
  19. package/dist/browser/chunks/chunk-3GJB6AVO.js.map +7 -0
  20. package/dist/browser/chunks/chunk-D5WHCVBC.js +2 -0
  21. package/dist/browser/chunks/chunk-D5WHCVBC.js.map +7 -0
  22. package/dist/browser/chunks/chunk-WL4KEX7Y.js +2 -0
  23. package/dist/browser/chunks/chunk-WL4KEX7Y.js.map +7 -0
  24. package/dist/browser/chunks/mathjax-DNP3YRES.js +61 -0
  25. package/dist/browser/chunks/mathjax-DNP3YRES.js.map +7 -0
  26. package/dist/browser/index.js +2 -0
  27. package/dist/browser/index.js.map +7 -0
  28. package/dist/browser/kit.js +2 -0
  29. package/dist/browser/kit.js.map +7 -0
  30. package/dist/browser/manifest.json +30 -0
  31. package/dist/browser/tex.js +2 -0
  32. package/dist/browser/tex.js.map +7 -0
  33. package/dist/engine.d.ts +64 -0
  34. package/dist/engine.d.ts.map +1 -0
  35. package/dist/engine.js +42 -0
  36. package/dist/engine.js.map +1 -0
  37. package/dist/index.d.ts +30 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +30 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/kit/brace.d.ts +8 -0
  42. package/dist/kit/brace.d.ts.map +1 -0
  43. package/dist/kit/brace.js +36 -0
  44. package/dist/kit/brace.js.map +1 -0
  45. package/dist/kit/cache.d.ts +30 -0
  46. package/dist/kit/cache.d.ts.map +1 -0
  47. package/dist/kit/cache.js +53 -0
  48. package/dist/kit/cache.js.map +1 -0
  49. package/dist/kit/contour.d.ts +8 -0
  50. package/dist/kit/contour.d.ts.map +1 -0
  51. package/dist/kit/contour.js +93 -0
  52. package/dist/kit/contour.js.map +1 -0
  53. package/dist/kit/coords.d.ts +69 -0
  54. package/dist/kit/coords.d.ts.map +1 -0
  55. package/dist/kit/coords.js +224 -0
  56. package/dist/kit/coords.js.map +1 -0
  57. package/dist/kit/curve.d.ts +17 -0
  58. package/dist/kit/curve.d.ts.map +1 -0
  59. package/dist/kit/curve.js +22 -0
  60. package/dist/kit/curve.js.map +1 -0
  61. package/dist/kit/equation.d.ts +61 -0
  62. package/dist/kit/equation.d.ts.map +1 -0
  63. package/dist/kit/equation.js +168 -0
  64. package/dist/kit/equation.js.map +1 -0
  65. package/dist/kit/equation3d.d.ts +50 -0
  66. package/dist/kit/equation3d.d.ts.map +1 -0
  67. package/dist/kit/equation3d.js +103 -0
  68. package/dist/kit/equation3d.js.map +1 -0
  69. package/dist/kit/expression.d.ts +35 -0
  70. package/dist/kit/expression.d.ts.map +1 -0
  71. package/dist/kit/expression.js +124 -0
  72. package/dist/kit/expression.js.map +1 -0
  73. package/dist/kit/field-mark.d.ts +58 -0
  74. package/dist/kit/field-mark.d.ts.map +1 -0
  75. package/dist/kit/field-mark.js +129 -0
  76. package/dist/kit/field-mark.js.map +1 -0
  77. package/dist/kit/field.d.ts +14 -0
  78. package/dist/kit/field.d.ts.map +1 -0
  79. package/dist/kit/field.js +46 -0
  80. package/dist/kit/field.js.map +1 -0
  81. package/dist/kit/follow.d.ts +71 -0
  82. package/dist/kit/follow.d.ts.map +1 -0
  83. package/dist/kit/follow.js +159 -0
  84. package/dist/kit/follow.js.map +1 -0
  85. package/dist/kit/furniture.d.ts +30 -0
  86. package/dist/kit/furniture.d.ts.map +1 -0
  87. package/dist/kit/furniture.js +87 -0
  88. package/dist/kit/furniture.js.map +1 -0
  89. package/dist/kit/geometry.d.ts +13 -0
  90. package/dist/kit/geometry.d.ts.map +1 -0
  91. package/dist/kit/geometry.js +54 -0
  92. package/dist/kit/geometry.js.map +1 -0
  93. package/dist/kit/mark.d.ts +47 -0
  94. package/dist/kit/mark.d.ts.map +1 -0
  95. package/dist/kit/mark.js +103 -0
  96. package/dist/kit/mark.js.map +1 -0
  97. package/dist/kit/part-fills.d.ts +23 -0
  98. package/dist/kit/part-fills.d.ts.map +1 -0
  99. package/dist/kit/part-fills.js +46 -0
  100. package/dist/kit/part-fills.js.map +1 -0
  101. package/dist/kit/place.d.ts +18 -0
  102. package/dist/kit/place.d.ts.map +1 -0
  103. package/dist/kit/place.js +68 -0
  104. package/dist/kit/place.js.map +1 -0
  105. package/dist/kit/placement.d.ts +8 -0
  106. package/dist/kit/placement.d.ts.map +1 -0
  107. package/dist/kit/placement.js +8 -0
  108. package/dist/kit/placement.js.map +1 -0
  109. package/dist/kit/sampler.d.ts +17 -0
  110. package/dist/kit/sampler.d.ts.map +1 -0
  111. package/dist/kit/sampler.js +250 -0
  112. package/dist/kit/sampler.js.map +1 -0
  113. package/dist/kit/scale.d.ts +12 -0
  114. package/dist/kit/scale.d.ts.map +1 -0
  115. package/dist/kit/scale.js +37 -0
  116. package/dist/kit/scale.js.map +1 -0
  117. package/dist/kit/source.d.ts +22 -0
  118. package/dist/kit/source.d.ts.map +1 -0
  119. package/dist/kit/source.js +45 -0
  120. package/dist/kit/source.js.map +1 -0
  121. package/dist/kit/system.d.ts +33 -0
  122. package/dist/kit/system.d.ts.map +1 -0
  123. package/dist/kit/system.js +67 -0
  124. package/dist/kit/system.js.map +1 -0
  125. package/dist/kit/ticks.d.ts +19 -0
  126. package/dist/kit/ticks.d.ts.map +1 -0
  127. package/dist/kit/ticks.js +78 -0
  128. package/dist/kit/ticks.js.map +1 -0
  129. package/dist/kit/withdrawn.d.ts +9 -0
  130. package/dist/kit/withdrawn.d.ts.map +1 -0
  131. package/dist/kit/withdrawn.js +9 -0
  132. package/dist/kit/withdrawn.js.map +1 -0
  133. package/dist/marks/curve-area.d.ts +32 -0
  134. package/dist/marks/curve-area.d.ts.map +1 -0
  135. package/dist/marks/curve-area.js +82 -0
  136. package/dist/marks/curve-area.js.map +1 -0
  137. package/dist/marks/drop-lines.d.ts +22 -0
  138. package/dist/marks/drop-lines.d.ts.map +1 -0
  139. package/dist/marks/drop-lines.js +58 -0
  140. package/dist/marks/drop-lines.js.map +1 -0
  141. package/dist/marks/plot-point.d.ts +35 -0
  142. package/dist/marks/plot-point.d.ts.map +1 -0
  143. package/dist/marks/plot-point.js +97 -0
  144. package/dist/marks/plot-point.js.map +1 -0
  145. package/dist/marks/riemann-sum.d.ts +37 -0
  146. package/dist/marks/riemann-sum.d.ts.map +1 -0
  147. package/dist/marks/riemann-sum.js +91 -0
  148. package/dist/marks/riemann-sum.js.map +1 -0
  149. package/dist/marks/tangent-line.d.ts +27 -0
  150. package/dist/marks/tangent-line.d.ts.map +1 -0
  151. package/dist/marks/tangent-line.js +103 -0
  152. package/dist/marks/tangent-line.js.map +1 -0
  153. package/dist/marks/vector-arrow.d.ts +32 -0
  154. package/dist/marks/vector-arrow.d.ts.map +1 -0
  155. package/dist/marks/vector-arrow.js +87 -0
  156. package/dist/marks/vector-arrow.js.map +1 -0
  157. package/dist/nodes.d.ts +35 -0
  158. package/dist/nodes.d.ts.map +1 -0
  159. package/dist/nodes.js +63 -0
  160. package/dist/nodes.js.map +1 -0
  161. package/dist/plots/function-plot.d.ts +67 -0
  162. package/dist/plots/function-plot.d.ts.map +1 -0
  163. package/dist/plots/function-plot.js +215 -0
  164. package/dist/plots/function-plot.js.map +1 -0
  165. package/dist/plots/points-plot.d.ts +28 -0
  166. package/dist/plots/points-plot.d.ts.map +1 -0
  167. package/dist/plots/points-plot.js +99 -0
  168. package/dist/plots/points-plot.js.map +1 -0
  169. package/dist/plots/stream-lines.d.ts +35 -0
  170. package/dist/plots/stream-lines.d.ts.map +1 -0
  171. package/dist/plots/stream-lines.js +141 -0
  172. package/dist/plots/stream-lines.js.map +1 -0
  173. package/dist/plots/traced-path.d.ts +31 -0
  174. package/dist/plots/traced-path.d.ts.map +1 -0
  175. package/dist/plots/traced-path.js +56 -0
  176. package/dist/plots/traced-path.js.map +1 -0
  177. package/dist/plots/vector-field.d.ts +23 -0
  178. package/dist/plots/vector-field.d.ts.map +1 -0
  179. package/dist/plots/vector-field.js +91 -0
  180. package/dist/plots/vector-field.js.map +1 -0
  181. package/dist/structures/graph-layout.d.ts +11 -0
  182. package/dist/structures/graph-layout.d.ts.map +1 -0
  183. package/dist/structures/graph-layout.js +135 -0
  184. package/dist/structures/graph-layout.js.map +1 -0
  185. package/dist/structures/network-graph.d.ts +83 -0
  186. package/dist/structures/network-graph.d.ts.map +1 -0
  187. package/dist/structures/network-graph.js +289 -0
  188. package/dist/structures/network-graph.js.map +1 -0
  189. package/dist/structures/sample-space.d.ts +62 -0
  190. package/dist/structures/sample-space.d.ts.map +1 -0
  191. package/dist/structures/sample-space.js +199 -0
  192. package/dist/structures/sample-space.js.map +1 -0
  193. package/dist/systems/axes2d.d.ts +75 -0
  194. package/dist/systems/axes2d.d.ts.map +1 -0
  195. package/dist/systems/axes2d.js +193 -0
  196. package/dist/systems/axes2d.js.map +1 -0
  197. package/dist/systems/number-line.d.ts +49 -0
  198. package/dist/systems/number-line.d.ts.map +1 -0
  199. package/dist/systems/number-line.js +127 -0
  200. package/dist/systems/number-line.js.map +1 -0
  201. package/dist/systems/number-plane.d.ts +59 -0
  202. package/dist/systems/number-plane.d.ts.map +1 -0
  203. package/dist/systems/number-plane.js +193 -0
  204. package/dist/systems/number-plane.js.map +1 -0
  205. package/dist/systems/polar-plane.d.ts +48 -0
  206. package/dist/systems/polar-plane.d.ts.map +1 -0
  207. package/dist/systems/polar-plane.js +165 -0
  208. package/dist/systems/polar-plane.js.map +1 -0
  209. package/dist/tex/geometry.d.ts +85 -0
  210. package/dist/tex/geometry.d.ts.map +1 -0
  211. package/dist/tex/geometry.js +632 -0
  212. package/dist/tex/geometry.js.map +1 -0
  213. package/dist/tex/index.d.ts +11 -0
  214. package/dist/tex/index.d.ts.map +1 -0
  215. package/dist/tex/index.js +9 -0
  216. package/dist/tex/index.js.map +1 -0
  217. package/dist/tex/mathjax.d.ts +33 -0
  218. package/dist/tex/mathjax.d.ts.map +1 -0
  219. package/dist/tex/mathjax.js +74 -0
  220. package/dist/tex/mathjax.js.map +1 -0
  221. package/dist/tex/matrix.d.ts +31 -0
  222. package/dist/tex/matrix.d.ts.map +1 -0
  223. package/dist/tex/matrix.js +73 -0
  224. package/dist/tex/matrix.js.map +1 -0
  225. package/dist/tex/node.d.ts +215 -0
  226. package/dist/tex/node.d.ts.map +1 -0
  227. package/dist/tex/node.js +595 -0
  228. package/dist/tex/node.js.map +1 -0
  229. package/dist/tex/tween.d.ts +50 -0
  230. package/dist/tex/tween.d.ts.map +1 -0
  231. package/dist/tex/tween.js +253 -0
  232. package/dist/tex/tween.js.map +1 -0
  233. package/dist/three/axes3d.d.ts +87 -0
  234. package/dist/three/axes3d.d.ts.map +1 -0
  235. package/dist/three/axes3d.js +228 -0
  236. package/dist/three/axes3d.js.map +1 -0
  237. package/dist/three/curve-plot3d.d.ts +60 -0
  238. package/dist/three/curve-plot3d.d.ts.map +1 -0
  239. package/dist/three/curve-plot3d.js +143 -0
  240. package/dist/three/curve-plot3d.js.map +1 -0
  241. package/dist/three/label3d.d.ts +11 -0
  242. package/dist/three/label3d.d.ts.map +1 -0
  243. package/dist/three/label3d.js +40 -0
  244. package/dist/three/label3d.js.map +1 -0
  245. package/dist/three/plot-point3d.d.ts +26 -0
  246. package/dist/three/plot-point3d.d.ts.map +1 -0
  247. package/dist/three/plot-point3d.js +60 -0
  248. package/dist/three/plot-point3d.js.map +1 -0
  249. package/dist/three/space.d.ts +28 -0
  250. package/dist/three/space.d.ts.map +1 -0
  251. package/dist/three/space.js +47 -0
  252. package/dist/three/space.js.map +1 -0
  253. package/dist/three/surface-plot3d.d.ts +80 -0
  254. package/dist/three/surface-plot3d.d.ts.map +1 -0
  255. package/dist/three/surface-plot3d.js +290 -0
  256. package/dist/three/surface-plot3d.js.map +1 -0
  257. package/dist/three/vector-arrow3d.d.ts +25 -0
  258. package/dist/three/vector-arrow3d.d.ts.map +1 -0
  259. package/dist/three/vector-arrow3d.js +72 -0
  260. package/dist/three/vector-arrow3d.js.map +1 -0
  261. package/package.json +79 -3
  262. package/registry.json +251 -0
  263. package/src/annotate/angle-mark.ts +147 -0
  264. package/src/annotate/curly-brace.ts +126 -0
  265. package/src/annotate/emphasis-mark.ts +89 -0
  266. package/src/engine.ts +72 -0
  267. package/src/index.ts +29 -0
  268. package/src/kit/brace.ts +37 -0
  269. package/src/kit/cache.ts +61 -0
  270. package/src/kit/contour.ts +94 -0
  271. package/src/kit/coords.ts +278 -0
  272. package/src/kit/curve.ts +29 -0
  273. package/src/kit/equation.ts +181 -0
  274. package/src/kit/equation3d.ts +137 -0
  275. package/src/kit/expression.ts +159 -0
  276. package/src/kit/field-mark.ts +155 -0
  277. package/src/kit/field.ts +50 -0
  278. package/src/kit/follow.ts +203 -0
  279. package/src/kit/furniture.ts +108 -0
  280. package/src/kit/geometry.ts +49 -0
  281. package/src/kit/mark.ts +131 -0
  282. package/src/kit/part-fills.ts +61 -0
  283. package/src/kit/place.ts +101 -0
  284. package/src/kit/placement.ts +8 -0
  285. package/src/kit/sampler.ts +281 -0
  286. package/src/kit/scale.ts +39 -0
  287. package/src/kit/source.ts +57 -0
  288. package/src/kit/system.ts +99 -0
  289. package/src/kit/ticks.ts +85 -0
  290. package/src/kit/withdrawn.ts +8 -0
  291. package/src/marks/curve-area.ts +89 -0
  292. package/src/marks/drop-lines.ts +63 -0
  293. package/src/marks/plot-point.ts +107 -0
  294. package/src/marks/riemann-sum.ts +98 -0
  295. package/src/marks/tangent-line.ts +103 -0
  296. package/src/marks/vector-arrow.ts +98 -0
  297. package/src/nodes.ts +63 -0
  298. package/src/plots/function-plot.ts +236 -0
  299. package/src/plots/points-plot.ts +107 -0
  300. package/src/plots/stream-lines.ts +151 -0
  301. package/src/plots/traced-path.ts +52 -0
  302. package/src/plots/vector-field.ts +88 -0
  303. package/src/structures/graph-layout.ts +145 -0
  304. package/src/structures/network-graph.ts +308 -0
  305. package/src/structures/sample-space.ts +209 -0
  306. package/src/systems/axes2d.ts +217 -0
  307. package/src/systems/number-line.ts +131 -0
  308. package/src/systems/number-plane.ts +203 -0
  309. package/src/systems/polar-plane.ts +176 -0
  310. package/src/tex/geometry.ts +703 -0
  311. package/src/tex/index.ts +14 -0
  312. package/src/tex/mathjax.ts +82 -0
  313. package/src/tex/matrix.ts +75 -0
  314. package/src/tex/node.ts +641 -0
  315. package/src/tex/tween.ts +308 -0
  316. package/src/three/axes3d.ts +240 -0
  317. package/src/three/curve-plot3d.ts +147 -0
  318. package/src/three/label3d.ts +50 -0
  319. package/src/three/plot-point3d.ts +66 -0
  320. package/src/three/space.ts +67 -0
  321. package/src/three/surface-plot3d.ts +323 -0
  322. package/src/three/vector-arrow3d.ts +77 -0
@@ -0,0 +1,78 @@
1
+ import { niceStep } from "@motionscript/sdk/component";
2
+ /** Past this an axis is not marked at all, rather than drawn as a solid bar of ticks. */
3
+ const MAX_TICKS = 200;
4
+ /** How far apart, in pixels, marks sit when the axis picks its own step. */
5
+ const AUTO_SPACING = 64;
6
+ /**
7
+ * The marks along `range`, drawn over `length` pixels. A `step` of zero lets the
8
+ * axis choose a tidy one (1, 2 or 5 times a power of ten) for its size; a log
9
+ * axis is marked at the powers of ten whatever the step.
10
+ */
11
+ export function ticksFor(range, step, length, scaling = "linear") {
12
+ const [min, max] = range;
13
+ if (scaling === "log")
14
+ return decades(min, max);
15
+ const span = max - min;
16
+ if (!(span > 0))
17
+ return { values: [], step: 1 };
18
+ const chosen = step > 0 ? step : niceStep((AUTO_SPACING / Math.max(1, length)) * span);
19
+ return { values: multiplesWithin(min, max, chosen), step: chosen };
20
+ }
21
+ function decades(min, max) {
22
+ const values = [];
23
+ for (let k = Math.ceil(Math.log10(min) - 1e-9); k <= Math.floor(Math.log10(max) + 1e-9) && values.length < MAX_TICKS; k++) {
24
+ values.push(10 ** k);
25
+ }
26
+ return { values, step: 0 };
27
+ }
28
+ function multiplesWithin(min, max, step) {
29
+ const first = Math.ceil(min / step - 1e-9);
30
+ const last = Math.floor(max / step + 1e-9);
31
+ const count = last - first + 1;
32
+ if (!Number.isFinite(count) || count <= 0 || count > MAX_TICKS)
33
+ return [];
34
+ const out = new Array(count);
35
+ // Multiplied rather than accumulated, so the tenth tick of 0.1 is 1 and not 0.9999999999999999.
36
+ for (let i = 0; i < count; i++)
37
+ out[i] = (first + i) * step;
38
+ return out;
39
+ }
40
+ function decadeOf(value) {
41
+ return Math.floor(Math.log10(value) + 1e-12);
42
+ }
43
+ /**
44
+ * `value` as a tick label, with as many decimals as `step` needs and no more:
45
+ * 0.30000000000000004 on a 0.1 ladder is `0.3`. A `step` of zero (a log axis)
46
+ * prints the value as it is.
47
+ */
48
+ export function formatTick(value, step) {
49
+ if (value === 0)
50
+ return "0";
51
+ if (!Number.isFinite(value))
52
+ return "";
53
+ if (!(step > 0)) {
54
+ const decade = decadeOf(Math.abs(value));
55
+ return decade >= 6 || decade <= -5 ? trimExponent(value.toExponential(0)) : String(Number(value.toPrecision(12)));
56
+ }
57
+ const decade = decadeOf(Math.abs(value));
58
+ const digits = Math.max(1, decade - decadeOf(step) + 1);
59
+ if ((decade >= 6 || decade <= -5) && digits <= 6)
60
+ return trimExponent(value.toExponential(digits - 1));
61
+ const decimals = decimalsOf(step);
62
+ const text = value.toFixed(decimals);
63
+ return decimals > 0 ? text.replace(/\.?0+$/, "") : text;
64
+ }
65
+ /** The decimal places it takes to write `step` out: 1 for 0.5, 2 for 0.25. */
66
+ function decimalsOf(step) {
67
+ for (let d = 0; d < 12; d++) {
68
+ const scaled = step * 10 ** d;
69
+ if (Math.abs(scaled - Math.round(scaled)) < 1e-9 * Math.max(1, scaled))
70
+ return d;
71
+ }
72
+ return 12;
73
+ }
74
+ function trimExponent(text) {
75
+ const [mantissa, exponent] = text.split("e");
76
+ return `${mantissa.replace(/\.?0+$/, "")}e${Number(exponent)}`;
77
+ }
78
+ //# sourceMappingURL=ticks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ticks.js","sourceRoot":"","sources":["../../src/kit/ticks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AASvD,yFAAyF;AACzF,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,4EAA4E;AAC5E,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAe,EAAE,IAAY,EAAE,MAAc,EAAE,UAAuB,QAAQ;IACnG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;IACzB,IAAI,OAAO,KAAK,KAAK;QAAE,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;IACvB,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,C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AC,CAAC,CAAC;IACvG,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC;AAED,8EAA8E;AAC9E,SAAS,UAAU,CAAC,IAAY;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC;YAAE,OAAO,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAC9B,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;AACnE,CAAC","sourcesContent":["import { niceStep } from \"@motionscript/sdk/component\";\r\nimport type { AxisScaling, Interval } from \"./coords\";\r\n\r\n/** Where an axis is marked, and the spacing its labels are rounded to. */\r\nexport interface Ticks {\r\n values: number[];\r\n step: number;\r\n}\r\n\r\n/** Past this an axis is not marked at all, rather than drawn as a solid bar of ticks. */\r\nconst MAX_TICKS = 200;\r\n\r\n/** How far apart, in pixels, marks sit when the axis picks its own step. */\r\nconst AUTO_SPACING = 64;\r\n\r\n/**\r\n * The marks along `range`, drawn over `length` pixels. A `step` of zero lets the\r\n * axis choose a tidy one (1, 2 or 5 times a power of ten) for its size; a log\r\n * axis is marked at the powers of ten whatever the step.\r\n */\r\nexport function ticksFor(range: Interval, step: number, length: number, scaling: AxisScaling = \"linear\"): Ticks {\r\n const [min, max] = range;\r\n if (scaling === \"log\") return decades(min, max);\r\n const span = max - min;\r\n if (!(span > 0)) return { values: [], step: 1 };\r\n const chosen = step > 0 ? step : niceStep((AUTO_SPACING / Math.max(1, length)) * span);\r\n return { values: multiplesWithin(min, max, chosen), step: chosen };\r\n}\r\n\r\nfunction decades(min: number, max: number): Ticks {\r\n const values: number[] = [];\r\n for (let k = Math.ceil(Math.log10(min) - 1e-9); k <= Math.floor(Math.log10(max) + 1e-9) && values.length < MAX_TICKS; k++) {\r\n values.push(10 ** k);\r\n }\r\n return { values, step: 0 };\r\n}\r\n\r\nfunction multiplesWithin(min: number, max: number, step: number): number[] {\r\n const first = Math.ceil(min / step - 1e-9);\r\n const last = Math.floor(max / step + 1e-9);\r\n const count = last - first + 1;\r\n if (!Number.isFinite(count) || count <= 0 || count > MAX_TICKS) return [];\r\n const out = new Array<number>(count);\r\n // Multiplied rather than accumulated, so the tenth tick of 0.1 is 1 and not 0.9999999999999999.\r\n for (let i = 0; i < count; i++) out[i] = (first + i) * step;\r\n return out;\r\n}\r\n\r\nfunction decadeOf(value: number): number {\r\n return Math.floor(Math.log10(value) + 1e-12);\r\n}\r\n\r\n/**\r\n * `value` as a tick label, with as many decimals as `step` needs and no more:\r\n * 0.30000000000000004 on a 0.1 ladder is `0.3`. A `step` of zero (a log axis)\r\n * prints the value as it is.\r\n */\r\nexport function formatTick(value: number, step: number): string {\r\n if (value === 0) return \"0\";\r\n if (!Number.isFinite(value)) return \"\";\r\n if (!(step > 0)) {\r\n const decade = decadeOf(Math.abs(value));\r\n return decade >= 6 || decade <= -5 ? trimExponent(value.toExponential(0)) : String(Number(value.toPrecision(12)));\r\n }\r\n const decade = decadeOf(Math.abs(value));\r\n const digits = Math.max(1, decade - decadeOf(step) + 1);\r\n if ((decade >= 6 || decade <= -5) && digits <= 6) return trimExponent(value.toExponential(digits - 1));\r\n const decimals = decimalsOf(step);\r\n const text = value.toFixed(decimals);\r\n return decimals > 0 ? text.replace(/\\.?0+$/, \"\") : text;\r\n}\r\n\r\n/** The decimal places it takes to write `step` out: 1 for 0.5, 2 for 0.25. */\r\nfunction decimalsOf(step: number): number {\r\n for (let d = 0; d < 12; d++) {\r\n const scaled = step * 10 ** d;\r\n if (Math.abs(scaled - Math.round(scaled)) < 1e-9 * Math.max(1, scaled)) return d;\r\n }\r\n return 12;\r\n}\r\n\r\nfunction trimExponent(text: string): string {\r\n const [mantissa, exponent] = text.split(\"e\");\r\n return `${mantissa.replace(/\\.?0+$/, \"\")}e${Number(exponent)}`;\r\n}\r\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * What a math node built on a general shape inherits and may have no use for,
3
+ * as `withdraw` takes it: a node that is only a line has no fill, an area no
4
+ * outline, and one that reveals itself in its own way no outline trim.
5
+ */
6
+ export declare const FILL_PAINT: readonly ["fill", "fillTo"];
7
+ export declare const STROKE_PAINT: readonly ["stroke", "strokeTo"];
8
+ export declare const OUTLINE_TRIM: readonly ["start", "end", "progressTo", "flash"];
9
+ //# sourceMappingURL=withdrawn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawn.d.ts","sourceRoot":"","sources":["../../src/kit/withdrawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,6BAA8B,CAAC;AACtD,eAAO,MAAM,YAAY,iCAAkC,CAAC;AAC5D,eAAO,MAAM,YAAY,kDAAmD,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * What a math node built on a general shape inherits and may have no use for,
3
+ * as `withdraw` takes it: a node that is only a line has no fill, an area no
4
+ * outline, and one that reveals itself in its own way no outline trim.
5
+ */
6
+ export const FILL_PAINT = ["fill", "fillTo"];
7
+ export const STROKE_PAINT = ["stroke", "strokeTo"];
8
+ export const OUTLINE_TRIM = ["start", "end", "progressTo", "flash"];
9
+ //# sourceMappingURL=withdrawn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawn.js","sourceRoot":"","sources":["../../src/kit/withdrawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AACtD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAC;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,CAAU,CAAC","sourcesContent":["/**\r\n * What a math node built on a general shape inherits and may have no use for,\r\n * as `withdraw` takes it: a node that is only a line has no fill, an area no\r\n * outline, and one that reveals itself in its own way no outline trim.\r\n */\r\nexport const FILL_PAINT = [\"fill\", \"fillTo\"] as const;\r\nexport const STROKE_PAINT = [\"stroke\", \"strokeTo\"] as const;\r\nexport const OUTLINE_TRIM = [\"start\", \"end\", \"progressTo\", \"flash\"] as const;\r\n"]}
@@ -0,0 +1,32 @@
1
+ import { type Command, type CommandArgs, type Fill, type NodeConfig, type PaintProps, type Vector2 } from "@motionscript/sdk";
2
+ import type { CoordinateMap, Interval } from "../kit/coords.js";
3
+ import { Mark } from "../kit/mark.js";
4
+ export interface CurveAreaProps extends PaintProps {
5
+ on?: string;
6
+ under?: string;
7
+ domain?: Interval;
8
+ }
9
+ /**
10
+ * The region between a plot and the x axis, or between two plots, over a span
11
+ * of x. It sits beside the plots it reads rather than inside one: it may read
12
+ * two, and it has a life of its own on the timeline, swept open or kept while
13
+ * a curve changes.
14
+ */
15
+ export declare class CurveArea extends Mark<CurveAreaProps> {
16
+ /** The plot that bounds the area, by id. */
17
+ on: string;
18
+ /** A second plot to fill down to, in place of the x axis. */
19
+ under: string;
20
+ domain: Interval;
21
+ fill: Fill;
22
+ constructor(props?: NodeConfig<CurveArea, CurveAreaProps>);
23
+ /** Animate the span of x that is filled: sweep an area open, or slide it along. */
24
+ domainTo(args: CommandArgs<{
25
+ domain: Interval;
26
+ }> & {
27
+ duration: number;
28
+ }): Command<CurveAreaProps>;
29
+ protected isClosed(): boolean;
30
+ protected trace(map: CoordinateMap): Vector2[][];
31
+ }
32
+ //# sourceMappingURL=curve-area.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curve-area.d.ts","sourceRoot":"","sources":["../../src/marks/curve-area.ts"],"names":[],"mappings":"AAAA,OAAO,EAMH,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,OAAO,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMnC,MAAM,WAAW,cAAe,SAAQ,UAAU;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;GAKG;AACH,qBASa,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC;IAC/C,4CAA4C;IACwD,EAAE,EAAE,MAAM,CAAC;IAC/G,6DAA6D;IACuC,KAAK,EAAE,MAAM,CAAC;IAE1G,MAAM,EAAE,QAAQ,CAAC;IAE+D,IAAI,EAAE,IAAI,CAAC;gBAEvF,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,EAAE,cAAc,CAAC;IAIzD,mFAAmF;IAEnF,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,CAAC,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;cAI9E,QAAQ,IAAI,OAAO;IAItC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,EAAE,EAAE;CAsBnD"}
@@ -0,0 +1,82 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { command, fillProperty, node, property, withdraw, } from "@motionscript/sdk";
8
+ import { clamp, stated } from "../kit/geometry.js";
9
+ import { Mark } from "../kit/mark.js";
10
+ import { curveNamed, curveOf } from "../kit/curve.js";
11
+ import { lerpInterval, PLOT_COLOR, readInterval } from "../kit/furniture.js";
12
+ import { SYSTEMS } from "../kit/placement.js";
13
+ import { OUTLINE_TRIM, STROKE_PAINT } from "../kit/withdrawn.js";
14
+ /**
15
+ * The region between a plot and the x axis, or between two plots, over a span
16
+ * of x. It sits beside the plots it reads rather than inside one: it may read
17
+ * two, and it has a life of its own on the timeline, swept open or kept while
18
+ * a curve changes.
19
+ */
20
+ let CurveArea = class CurveArea extends Mark {
21
+ constructor(props) {
22
+ super(props ?? {});
23
+ }
24
+ /** Animate the span of x that is filled: sweep an area open, or slide it along. */
25
+ domainTo(args) {
26
+ return this.to({ data: stated(args.data), duration: args.duration, easing: args.easing });
27
+ }
28
+ isClosed() {
29
+ return true;
30
+ }
31
+ trace(map) {
32
+ const top = curveOf(this, this.on);
33
+ if (!top)
34
+ return [];
35
+ const floor = curveNamed(this, this.under);
36
+ const [yMin, yMax] = map.yRange;
37
+ const a = Math.max(this.domain[0], map.xRange[0]);
38
+ const b = Math.min(this.domain[1], map.xRange[1]);
39
+ if (!(b > a))
40
+ return [];
41
+ const width = Math.abs(map.toPoint(b, 0).x - map.toPoint(a, 0).x);
42
+ const steps = Math.max(8, Math.min(600, Math.round(width / 2)));
43
+ // Held inside the system's range, and at the axis where a curve has no value.
44
+ const height = (value) => (Number.isFinite(value) ? clamp(value, yMin, yMax) : clamp(0, yMin, yMax));
45
+ const upper = [];
46
+ const lower = [];
47
+ for (let i = 0; i <= steps; i++) {
48
+ const x = a + ((b - a) * i) / steps;
49
+ upper.push(map.toPoint(x, height(top.valueAt(x))));
50
+ lower.push(map.toPoint(x, height(floor ? floor.valueAt(x) : 0)));
51
+ }
52
+ return [[...upper, ...lower.reverse()]];
53
+ }
54
+ };
55
+ __decorate([
56
+ property({ default: "", kind: "nodeRef", nodeTypes: ["functionPlot"], animatable: false })
57
+ ], CurveArea.prototype, "on", void 0);
58
+ __decorate([
59
+ property({ default: "", kind: "nodeRef", nodeTypes: ["functionPlot"], animatable: false })
60
+ ], CurveArea.prototype, "under", void 0);
61
+ __decorate([
62
+ property({ default: [0, 1], mapper: readInterval, tween: lerpInterval })
63
+ ], CurveArea.prototype, "domain", void 0);
64
+ __decorate([
65
+ fillProperty({ default: { type: "solid", color: PLOT_COLOR, opacity: 0.35 } })
66
+ ], CurveArea.prototype, "fill", void 0);
67
+ __decorate([
68
+ command({ args: ["domain"] })
69
+ ], CurveArea.prototype, "domainTo", null);
70
+ CurveArea = __decorate([
71
+ node({
72
+ key: "curveArea",
73
+ within: SYSTEMS,
74
+ beside: ["functionPlot"],
75
+ parentKey: "shape",
76
+ forkable: true,
77
+ layout: { children: "freeform", defaultWidthMode: "hug", defaultHeightMode: "hug", acceptsChildren: false },
78
+ }),
79
+ withdraw(...STROKE_PAINT, ...OUTLINE_TRIM)
80
+ ], CurveArea);
81
+ export { CurveArea };
82
+ //# sourceMappingURL=curve-area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"curve-area.js","sourceRoot":"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EAAE,CAAC,cAAc,CAAC;QACxB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;KAC9G,CAAC;IACD,QAAQ,CAAC,GAAG,YAAY,EAAE,GAAG,YAAY,CAAC;GAC9B,SAAS,CA8CrB","sourcesContent":["import {\r\n command,\r\n fillProperty,\r\n node,\r\n property,\r\n withdraw,\r\n type Command,\r\n type CommandArgs,\r\n type Fill,\r\n type NodeConfig,\r\n type PaintProps,\r\n type Vector2,\r\n} from \"@motionscript/sdk\";\r\nimport type { CoordinateMap, Interval } from \"../kit/coords\";\r\nimport { clamp, stated } from \"../kit/geometry\";\r\nimport { Mark } from \"../kit/mark\";\r\nimport { curveNamed, curveOf } from \"../kit/curve\";\r\nimport { lerpInterval, PLOT_COLOR, readInterval } from \"../kit/furniture\";\r\nimport { SYSTEMS } from \"../kit/placement\";\r\nimport { OUTLINE_TRIM, STROKE_PAINT } from \"../kit/withdrawn\";\r\n\r\nexport interface CurveAreaProps extends PaintProps {\r\n on?: string;\r\n under?: string;\r\n domain?: Interval;\r\n}\r\n\r\n/**\r\n * The region between a plot and the x axis, or between two plots, over a span\r\n * of x. It sits beside the plots it reads rather than inside one: it may read\r\n * two, and it has a life of its own on the timeline, swept open or kept while\r\n * a curve changes.\r\n */\r\n@node({\r\n key: \"curveArea\",\r\n within: SYSTEMS,\r\n beside: [\"functionPlot\"],\r\n parentKey: \"shape\",\r\n forkable: true,\r\n layout: { children: \"freeform\", defaultWidthMode: \"hug\", defaultHeightMode: \"hug\", acceptsChildren: false },\r\n})\r\n@withdraw(...STROKE_PAINT, ...OUTLINE_TRIM)\r\nexport class CurveArea extends Mark<CurveAreaProps> {\r\n /** The plot that bounds the area, by id. */\r\n @property({ default: \"\", kind: \"nodeRef\", nodeTypes: [\"functionPlot\"], animatable: false }) declare on: string;\r\n /** A second plot to fill down to, in place of the x axis. */\r\n @property({ default: \"\", kind: \"nodeRef\", nodeTypes: [\"functionPlot\"], animatable: false }) declare under: string;\r\n @property({ default: [0, 1], mapper: readInterval, tween: lerpInterval })\r\n declare domain: Interval;\r\n\r\n @fillProperty({ default: { type: \"solid\", color: PLOT_COLOR, opacity: 0.35 } }) declare fill: Fill;\r\n\r\n constructor(props?: NodeConfig<CurveArea, CurveAreaProps>) {\r\n super(props ?? {});\r\n }\r\n\r\n /** Animate the span of x that is filled: sweep an area open, or slide it along. */\r\n @command({ args: [\"domain\"] })\r\n domainTo(args: CommandArgs<{ domain: Interval }> & { duration: number }): Command<CurveAreaProps> {\r\n return this.to({ data: stated(args.data), duration: args.duration, easing: args.easing });\r\n }\r\n\r\n protected override isClosed(): boolean {\r\n return true;\r\n }\r\n\r\n protected trace(map: CoordinateMap): Vector2[][] {\r\n const top = curveOf(this, this.on);\r\n if (!top) return [];\r\n const floor = curveNamed(this, this.under);\r\n const [yMin, yMax] = map.yRange;\r\n const a = Math.max(this.domain[0], map.xRange[0]);\r\n const b = Math.min(this.domain[1], map.xRange[1]);\r\n if (!(b > a)) return [];\r\n\r\n const width = Math.abs(map.toPoint(b, 0).x - map.toPoint(a, 0).x);\r\n const steps = Math.max(8, Math.min(600, Math.round(width / 2)));\r\n // Held inside the system's range, and at the axis where a curve has no value.\r\n const height = (value: number) => (Number.isFinite(value) ? clamp(value, yMin, yMax) : clamp(0, yMin, yMax));\r\n const upper: Vector2[] = [];\r\n const lower: Vector2[] = [];\r\n for (let i = 0; i <= steps; i++) {\r\n const x = a + ((b - a) * i) / steps;\r\n upper.push(map.toPoint(x, height(top.valueAt(x))));\r\n lower.push(map.toPoint(x, height(floor ? floor.valueAt(x) : 0)));\r\n }\r\n return [[...upper, ...lower.reverse()]];\r\n }\r\n}\r\n"]}
@@ -0,0 +1,22 @@
1
+ import { type NodeConfig, type PaintProps, type Stroke, type Vector2 } from "@motionscript/sdk";
2
+ import type { CoordinateMap } from "../kit/coords.js";
3
+ import { Mark } from "../kit/mark.js";
4
+ export type DropAxis = "x" | "y" | "both";
5
+ export interface DropLinesProps extends PaintProps {
6
+ on?: string;
7
+ axis?: DropAxis;
8
+ }
9
+ /**
10
+ * Guide lines from a graph point to the axes, reading its coordinates off them.
11
+ * The point is this node's `x`/`y`, or the point of a plot above its `x`.
12
+ */
13
+ export declare class DropLines extends Mark<DropLinesProps> {
14
+ /** A plot to take the point's height from, by id. */
15
+ on: string;
16
+ /** Which axis to drop to: `x` draws the vertical line, `y` the horizontal one. */
17
+ axis: DropAxis;
18
+ stroke: Stroke;
19
+ constructor(props?: NodeConfig<DropLines, DropLinesProps>);
20
+ protected trace(map: CoordinateMap): Vector2[][];
21
+ }
22
+ //# sourceMappingURL=drop-lines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-lines.d.ts","sourceRoot":"","sources":["../../src/marks/drop-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,OAAO,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMnC,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,cAAe,SAAQ,UAAU;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED;;;GAGG;AACH,qBAQa,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC;IAC/C,qDAAqD;IAC+C,EAAE,EAAE,MAAM,CAAC;IAC/G,kFAAkF;IACK,IAAI,EAAE,QAAQ,CAAC;IAG9F,MAAM,EAAE,MAAM,CAAC;gBAEX,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,EAAE,cAAc,CAAC;IAIzD,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,EAAE,EAAE;CAYnD"}
@@ -0,0 +1,58 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { node, property, strokeProperty, withdraw, } from "@motionscript/sdk";
8
+ import { clamp } from "../kit/geometry.js";
9
+ import { Mark } from "../kit/mark.js";
10
+ import { curveOf } from "../kit/curve.js";
11
+ import { AXIS_COLOR } from "../kit/furniture.js";
12
+ import { SYSTEMS_AND_PLOT } from "../kit/placement.js";
13
+ import { FILL_PAINT } from "../kit/withdrawn.js";
14
+ /**
15
+ * Guide lines from a graph point to the axes, reading its coordinates off them.
16
+ * The point is this node's `x`/`y`, or the point of a plot above its `x`.
17
+ */
18
+ let DropLines = class DropLines extends Mark {
19
+ constructor(props) {
20
+ super(props ?? {});
21
+ }
22
+ trace(map) {
23
+ const x = this.x;
24
+ const plot = curveOf(this, this.on);
25
+ const y = plot ? plot.valueAt(x) : this.y;
26
+ if (!Number.isFinite(y))
27
+ return [];
28
+ const at = map.toPoint(x, y);
29
+ const runs = [];
30
+ // Each line starts on its axis, so drawing it on grows it towards the point.
31
+ if (this.axis !== "y")
32
+ runs.push([map.toPoint(x, clamp(0, map.yRange[0], map.yRange[1])), at]);
33
+ if (this.axis !== "x")
34
+ runs.push([map.toPoint(clamp(0, map.xRange[0], map.xRange[1]), y), at]);
35
+ return runs;
36
+ }
37
+ };
38
+ __decorate([
39
+ property({ default: "", kind: "nodeRef", nodeTypes: ["functionPlot"], animatable: false })
40
+ ], DropLines.prototype, "on", void 0);
41
+ __decorate([
42
+ property({ default: "both", options: ["x", "y", "both"], animatable: false })
43
+ ], DropLines.prototype, "axis", void 0);
44
+ __decorate([
45
+ strokeProperty({ default: { weight: 2, fill: AXIS_COLOR, align: "center", dash: [8, 6] } })
46
+ ], DropLines.prototype, "stroke", void 0);
47
+ DropLines = __decorate([
48
+ node({
49
+ key: "dropLines",
50
+ within: SYSTEMS_AND_PLOT,
51
+ parentKey: "shape",
52
+ forkable: true,
53
+ layout: { children: "freeform", defaultWidthMode: "hug", defaultHeightMode: "hug", acceptsChildren: false },
54
+ }),
55
+ withdraw(...FILL_PAINT)
56
+ ], DropLines);
57
+ export { DropLines };
58
+ //# sourceMappingURL=drop-lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drop-lines.js","sourceRoot":"","sources":["../../src/marks/drop-lines.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,QAAQ,GAKX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAS9C;;;GAGG;AASI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,IAAoB;IAS/C,YAAY,KAA6C;QACrD,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACvB,CAAC;IAES,KAAK,CAAC,GAAkB;QAC9B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QACjB,MAAM,IAAI,GAAG,OA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E,UAAU,EAAE,KAAK,EAAE,CAAC;uCAAwB;AAG9F;IADP,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;yCACrE;AAPd,SAAS;IARrB,IAAI,CAAC;QACF,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,gBAAgB;QACxB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE;KAC9G,CAAC;IACD,QAAQ,CAAC,GAAG,UAAU,CAAC;GACX,SAAS,CAyBrB","sourcesContent":["import {\r\n node,\r\n property,\r\n strokeProperty,\r\n withdraw,\r\n type NodeConfig,\r\n type PaintProps,\r\n type Stroke,\r\n type Vector2,\r\n} from \"@motionscript/sdk\";\r\nimport type { CoordinateMap } from \"../kit/coords\";\r\nimport { clamp } from \"../kit/geometry\";\r\nimport { Mark } from \"../kit/mark\";\r\nimport { curveOf } from \"../kit/curve\";\r\nimport { AXIS_COLOR } from \"../kit/furniture\";\r\nimport { SYSTEMS_AND_PLOT } from \"../kit/placement\";\r\nimport { FILL_PAINT } from \"../kit/withdrawn\";\r\n\r\nexport type DropAxis = \"x\" | \"y\" | \"both\";\r\n\r\nexport interface DropLinesProps extends PaintProps {\r\n on?: string;\r\n axis?: DropAxis;\r\n}\r\n\r\n/**\r\n * Guide lines from a graph point to the axes, reading its coordinates off them.\r\n * The point is this node's `x`/`y`, or the point of a plot above its `x`.\r\n */\r\n@node({\r\n key: \"dropLines\",\r\n within: SYSTEMS_AND_PLOT,\r\n parentKey: \"shape\",\r\n forkable: true,\r\n layout: { children: \"freeform\", defaultWidthMode: \"hug\", defaultHeightMode: \"hug\", acceptsChildren: false },\r\n})\r\n@withdraw(...FILL_PAINT)\r\nexport class DropLines extends Mark<DropLinesProps> {\r\n /** A plot to take the point's height from, by id. */\r\n @property({ default: \"\", kind: \"nodeRef\", nodeTypes: [\"functionPlot\"], animatable: false }) declare on: string;\r\n /** Which axis to drop to: `x` draws the vertical line, `y` the horizontal one. */\r\n @property({ default: \"both\", options: [\"x\", \"y\", \"both\"], animatable: false }) declare axis: DropAxis;\r\n\r\n @strokeProperty({ default: { weight: 2, fill: AXIS_COLOR, align: \"center\", dash: [8, 6] } })\r\n declare stroke: Stroke;\r\n\r\n constructor(props?: NodeConfig<DropLines, DropLinesProps>) {\r\n super(props ?? {});\r\n }\r\n\r\n protected trace(map: CoordinateMap): Vector2[][] {\r\n const x = this.x;\r\n const plot = curveOf(this, this.on);\r\n const y = plot ? plot.valueAt(x) : this.y;\r\n if (!Number.isFinite(y)) return [];\r\n const at = map.toPoint(x, y);\r\n const runs: Vector2[][] = [];\r\n // Each line starts on its axis, so drawing it on grows it towards the point.\r\n if (this.axis !== \"y\") runs.push([map.toPoint(x, clamp(0, map.yRange[0], map.yRange[1])), at]);\r\n if (this.axis !== \"x\") runs.push([map.toPoint(clamp(0, map.xRange[0], map.xRange[1]), y), at]);\r\n return runs;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,35 @@
1
+ import { Graphics2D, PaintNode, type AssetScope, type Color, type Fill, type NodeConfig, type PaintProps, type RenderContext2D, type Size2D, type Vector2 } from "@motionscript/sdk";
2
+ import type { Anchored } from "../kit/place.js";
3
+ export interface PlotPointProps extends PaintProps {
4
+ on?: string;
5
+ radius?: number;
6
+ label?: string;
7
+ labelSide?: "above" | "below" | "left" | "right";
8
+ labelSize?: number;
9
+ labelColor?: Color;
10
+ fontFamily?: string;
11
+ }
12
+ /**
13
+ * A dot at graph coordinates, with an optional label. Named a plot in `on`, it
14
+ * rides that curve: its `x` is where along it, and its height is the curve's.
15
+ */
16
+ export declare class PlotPoint extends PaintNode<PlotPointProps> implements Anchored {
17
+ /** The plot this point rides, by id; empty for a point that sits at its own `x`/`y`. */
18
+ on: string;
19
+ radius: number;
20
+ label: string;
21
+ labelSide: "above" | "below" | "left" | "right";
22
+ labelSize: number;
23
+ labelColor: Color;
24
+ fontFamily: string;
25
+ fill: Fill;
26
+ constructor(props?: NodeConfig<PlotPoint, PlotPointProps>);
27
+ /** The graph height the point is at: the curve's when it rides one. */
28
+ get value(): number;
29
+ anchorAt(x: number, y: number): Vector2;
30
+ measure(): Partial<Size2D>;
31
+ declareAssets(assets: AssetScope): void;
32
+ protected shapeGraphics(): Graphics2D | null;
33
+ protected renderSelf(ctx: RenderContext2D): void;
34
+ }
35
+ //# sourceMappingURL=plot-point.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plot-point.d.ts","sourceRoot":"","sources":["../../src/marks/plot-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,UAAU,EAEV,SAAS,EAGT,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,UAAU,EAEf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,MAAM,EACX,KAAK,OAAO,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAM7C,MAAM,WAAW,cAAe,SAAQ,UAAU;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAQa,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAE,YAAW,QAAQ;IACxE,wFAAwF;IACY,EAAE,EAAE,MAAM,CAAC;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IAE5D,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACD,SAAS,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,KAAK,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IAE3B,IAAI,EAAE,IAAI,CAAC;gBAE7C,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,EAAE,cAAc,CAAC;IAIzD,uEAAuE;IACvE,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO;IAM9B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1B,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;cAM7B,aAAa,IAAI,UAAU,GAAG,IAAI;cAKlC,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;CAiB5D"}
@@ -0,0 +1,97 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { colorProperty, fillProperty, Graphics2D, node, PaintNode, property, withdraw, } from "@motionscript/sdk";
8
+ import { curveOf } from "../kit/curve.js";
9
+ import { declareFormulas, drawLabels } from "../kit/furniture.js";
10
+ import { SYSTEMS_AND_PLOT } from "../kit/placement.js";
11
+ import { OUTLINE_TRIM } from "../kit/withdrawn.js";
12
+ /**
13
+ * A dot at graph coordinates, with an optional label. Named a plot in `on`, it
14
+ * rides that curve: its `x` is where along it, and its height is the curve's.
15
+ */
16
+ let PlotPoint = class PlotPoint extends PaintNode {
17
+ constructor(props) {
18
+ super(props ?? {});
19
+ }
20
+ /** The graph height the point is at: the curve's when it rides one. */
21
+ get value() {
22
+ return this.anchorAt(this.x, this.y).y;
23
+ }
24
+ anchorAt(x, y) {
25
+ const height = curveOf(this, this.on)?.valueAt(x);
26
+ // Off the end of its curve a point stays where its own `y` puts it rather than vanishing.
27
+ return { x, y: height !== undefined && Number.isFinite(height) ? height : y };
28
+ }
29
+ measure() {
30
+ return { width: this.radius * 2, height: this.radius * 2 };
31
+ }
32
+ declareAssets(assets) {
33
+ super.declareAssets(assets);
34
+ if (this.label !== "" && this.fontFamily !== "")
35
+ assets.font(this.fontFamily);
36
+ declareFormulas(assets, [this.label]);
37
+ }
38
+ shapeGraphics() {
39
+ const size = this.radius * 2;
40
+ return size > 0 ? new Graphics2D().ellipse({ x: 0, y: 0, width: size, height: size }) : null;
41
+ }
42
+ renderSelf(ctx) {
43
+ super.renderSelf(ctx);
44
+ if (this.label === "")
45
+ return;
46
+ const gap = this.radius + this.labelSize * 0.45;
47
+ const side = this.labelSide;
48
+ const horizontal = side === "left" || side === "right";
49
+ const label = {
50
+ text: this.label,
51
+ align: side === "left" ? "right" : side === "right" ? "left" : "center",
52
+ at: {
53
+ x: horizontal ? (side === "left" ? -1 : 1) * gap : 0,
54
+ y: horizontal ? 0 : (side === "below" ? -1 : 1) * (gap + this.labelSize / 2),
55
+ },
56
+ };
57
+ const style = { fontSize: this.labelSize, fontFamily: this.fontFamily, color: this.labelColor };
58
+ for (const part of drawLabels([label], style))
59
+ ctx.draw(part);
60
+ }
61
+ };
62
+ __decorate([
63
+ property({ default: "", kind: "nodeRef", nodeTypes: ["functionPlot"], animatable: false })
64
+ ], PlotPoint.prototype, "on", void 0);
65
+ __decorate([
66
+ property({ default: 7, min: 0, unit: "px" })
67
+ ], PlotPoint.prototype, "radius", void 0);
68
+ __decorate([
69
+ property({ default: "", animatable: false })
70
+ ], PlotPoint.prototype, "label", void 0);
71
+ __decorate([
72
+ property({ default: "above", options: ["above", "below", "left", "right"], animatable: false })
73
+ ], PlotPoint.prototype, "labelSide", void 0);
74
+ __decorate([
75
+ property({ default: 18, min: 1, unit: "px" })
76
+ ], PlotPoint.prototype, "labelSize", void 0);
77
+ __decorate([
78
+ colorProperty({ default: "#e5e7eb" })
79
+ ], PlotPoint.prototype, "labelColor", void 0);
80
+ __decorate([
81
+ property({ default: "", animatable: false })
82
+ ], PlotPoint.prototype, "fontFamily", void 0);
83
+ __decorate([
84
+ fillProperty({ default: "#e5e7eb" })
85
+ ], PlotPoint.prototype, "fill", void 0);
86
+ PlotPoint = __decorate([
87
+ node({
88
+ key: "plotPoint",
89
+ within: SYSTEMS_AND_PLOT,
90
+ parentKey: "shape",
91
+ forkable: true,
92
+ layout: { children: "freeform", defaultWidthMode: "hug", defaultHeightMode: "hug", acceptsChildren: false },
93
+ }),
94
+ withdraw(...OUTLINE_TRIM)
95
+ ], PlotPoint);
96
+ export { PlotPoint };
97
+ //# sourceMappingURL=plot-point.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plot-point.js","sourceRoot":"","sources":["../../src/marks/plot-point.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACH,aAAa,EACb,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,QAAQ,GAUX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAc,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAYhD;;;GAGG;AASI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,SAAyB;IAapD,YAAY,KAA6C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9G,CAAC;IACD,QAAQ,CAAC,GAAG,YAAY,CAAC;GACb,SAAS,CA4DrB","sourcesContent":["import {\r\n colorProperty,\r\n fillProperty,\r\n Graphics2D,\r\n node,\r\n PaintNode,\r\n property,\r\n withdraw,\r\n type AssetScope,\r\n type Color,\r\n type Fill,\r\n type NodeConfig,\r\n type NormalizedColor,\r\n type PaintProps,\r\n type RenderContext2D,\r\n type Size2D,\r\n type Vector2,\r\n} from \"@motionscript/sdk\";\r\nimport type { Anchored } from \"../kit/place\";\r\nimport { curveOf } from \"../kit/curve\";\r\nimport { declareFormulas, drawLabels, type Label } from \"../kit/furniture\";\r\nimport { SYSTEMS_AND_PLOT } from \"../kit/placement\";\r\nimport { OUTLINE_TRIM } from \"../kit/withdrawn\";\r\n\r\nexport interface PlotPointProps extends PaintProps {\r\n on?: string;\r\n radius?: number;\r\n label?: string;\r\n labelSide?: \"above\" | \"below\" | \"left\" | \"right\";\r\n labelSize?: number;\r\n labelColor?: Color;\r\n fontFamily?: string;\r\n}\r\n\r\n/**\r\n * A dot at graph coordinates, with an optional label. Named a plot in `on`, it\r\n * rides that curve: its `x` is where along it, and its height is the curve's.\r\n */\r\n@node({\r\n key: \"plotPoint\",\r\n within: SYSTEMS_AND_PLOT,\r\n parentKey: \"shape\",\r\n forkable: true,\r\n layout: { children: \"freeform\", defaultWidthMode: \"hug\", defaultHeightMode: \"hug\", acceptsChildren: false },\r\n})\r\n@withdraw(...OUTLINE_TRIM)\r\nexport class PlotPoint extends PaintNode<PlotPointProps> implements Anchored {\r\n /** The plot this point rides, by id; empty for a point that sits at its own `x`/`y`. */\r\n @property({ default: \"\", kind: \"nodeRef\", nodeTypes: [\"functionPlot\"], animatable: false }) declare on: string;\r\n @property({ default: 7, min: 0, unit: \"px\" }) declare radius: number;\r\n @property({ default: \"\", animatable: false }) declare label: string;\r\n @property({ default: \"above\", options: [\"above\", \"below\", \"left\", \"right\"], animatable: false })\r\n declare labelSide: \"above\" | \"below\" | \"left\" | \"right\";\r\n @property({ default: 18, min: 1, unit: \"px\" }) declare labelSize: number;\r\n @colorProperty({ default: \"#e5e7eb\" }) declare labelColor: Color;\r\n @property({ default: \"\", animatable: false }) declare fontFamily: string;\r\n\r\n @fillProperty({ default: \"#e5e7eb\" }) declare fill: Fill;\r\n\r\n constructor(props?: NodeConfig<PlotPoint, PlotPointProps>) {\r\n super(props ?? {});\r\n }\r\n\r\n /** The graph height the point is at: the curve's when it rides one. */\r\n get value(): number {\r\n return this.anchorAt(this.x, this.y).y;\r\n }\r\n\r\n anchorAt(x: number, y: number): Vector2 {\r\n const height = curveOf(this, this.on)?.valueAt(x);\r\n // Off the end of its curve a point stays where its own `y` puts it rather than vanishing.\r\n return { x, y: height !== undefined && Number.isFinite(height) ? height : y };\r\n }\r\n\r\n override measure(): Partial<Size2D> {\r\n return { width: this.radius * 2, height: this.radius * 2 };\r\n }\r\n\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n if (this.label !== \"\" && this.fontFamily !== \"\") assets.font(this.fontFamily);\r\n declareFormulas(assets, [this.label]);\r\n }\r\n\r\n protected override shapeGraphics(): Graphics2D | null {\r\n const size = this.radius * 2;\r\n return size > 0 ? new Graphics2D().ellipse({ x: 0, y: 0, width: size, height: size }) : null;\r\n }\r\n\r\n protected override renderSelf(ctx: RenderContext2D): void {\r\n super.renderSelf(ctx);\r\n if (this.label === \"\") return;\r\n const gap = this.radius + this.labelSize * 0.45;\r\n const side = this.labelSide;\r\n const horizontal = side === \"left\" || side === \"right\";\r\n const label: Label = {\r\n text: this.label,\r\n align: side === \"left\" ? \"right\" : side === \"right\" ? \"left\" : \"center\",\r\n at: {\r\n x: horizontal ? (side === \"left\" ? -1 : 1) * gap : 0,\r\n y: horizontal ? 0 : (side === \"below\" ? -1 : 1) * (gap + this.labelSize / 2),\r\n },\r\n };\r\n const style = { fontSize: this.labelSize, fontFamily: this.fontFamily, color: this.labelColor as NormalizedColor };\r\n for (const part of drawLabels([label], style)) ctx.draw(part);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,37 @@
1
+ import { type Command, type CommandArgs, type Fill, type NodeConfig, type PaintProps, type Stroke, type Vector2 } from "@motionscript/sdk";
2
+ import type { CoordinateMap, Interval } from "../kit/coords.js";
3
+ import { Mark } from "../kit/mark.js";
4
+ export type RiemannSample = "left" | "right" | "center";
5
+ export interface RiemannSumProps extends PaintProps {
6
+ on?: string;
7
+ domain?: Interval;
8
+ dx?: number;
9
+ sample?: RiemannSample;
10
+ }
11
+ /** Rectangles under a plot, each `dx` wide and as tall as the curve where it is sampled. */
12
+ export declare class RiemannSum extends Mark<RiemannSumProps> {
13
+ on: string;
14
+ domain: Interval;
15
+ /** Each rectangle's width, in graph units. */
16
+ dx: number;
17
+ /** Where in its width a rectangle reads the curve's height. */
18
+ sample: RiemannSample;
19
+ fill: Fill;
20
+ stroke: Stroke;
21
+ constructor(props?: NodeConfig<RiemannSum, RiemannSumProps>);
22
+ /** Animate the rectangles' width: narrower is the sum closing in on the area. */
23
+ refineTo(args: CommandArgs<{
24
+ dx: number;
25
+ }> & {
26
+ duration: number;
27
+ }): Command<RiemannSumProps>;
28
+ /** Animate the span of x the rectangles cover. */
29
+ domainTo(args: CommandArgs<{
30
+ domain: Interval;
31
+ }> & {
32
+ duration: number;
33
+ }): Command<RiemannSumProps>;
34
+ protected isClosed(): boolean;
35
+ protected trace(map: CoordinateMap): Vector2[][];
36
+ }
37
+ //# sourceMappingURL=riemann-sum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"riemann-sum.d.ts","sourceRoot":"","sources":["../../src/marks/riemann-sum.ts"],"names":[],"mappings":"AAAA,OAAO,EAOH,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,MAAM,EACX,KAAK,OAAO,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAA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