@sarmal/core 0.25.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-init.cjs +170 -206
- package/dist/auto-init.cjs.map +1 -1
- package/dist/auto-init.js +169 -205
- package/dist/auto-init.js.map +1 -1
- package/dist/curves/artemis2.cjs +14 -20
- package/dist/curves/artemis2.cjs.map +1 -1
- package/dist/curves/artemis2.d.cts +1 -1
- package/dist/curves/artemis2.d.ts +1 -1
- package/dist/curves/artemis2.js +13 -19
- package/dist/curves/artemis2.js.map +1 -1
- package/dist/curves/astroid.cjs +7 -7
- package/dist/curves/astroid.cjs.map +1 -1
- package/dist/curves/astroid.d.cts +1 -1
- package/dist/curves/astroid.d.ts +1 -1
- package/dist/curves/astroid.js +6 -6
- package/dist/curves/astroid.js.map +1 -1
- package/dist/curves/deltoid.cjs +6 -6
- package/dist/curves/deltoid.cjs.map +1 -1
- package/dist/curves/deltoid.d.cts +1 -1
- package/dist/curves/deltoid.d.ts +1 -1
- package/dist/curves/deltoid.js +5 -5
- package/dist/curves/deltoid.js.map +1 -1
- package/dist/curves/epicycloid3.cjs +6 -6
- package/dist/curves/epicycloid3.cjs.map +1 -1
- package/dist/curves/epicycloid3.d.cts +1 -1
- package/dist/curves/epicycloid3.d.ts +1 -1
- package/dist/curves/epicycloid3.js +5 -5
- package/dist/curves/epicycloid3.js.map +1 -1
- package/dist/curves/epitrochoid7.cjs +10 -10
- package/dist/curves/epitrochoid7.cjs.map +1 -1
- package/dist/curves/epitrochoid7.d.cts +1 -1
- package/dist/curves/epitrochoid7.d.ts +1 -1
- package/dist/curves/epitrochoid7.js +9 -9
- package/dist/curves/epitrochoid7.js.map +1 -1
- package/dist/curves/index.cjs +81 -97
- package/dist/curves/index.cjs.map +1 -1
- package/dist/curves/index.d.cts +29 -29
- package/dist/curves/index.d.ts +29 -29
- package/dist/curves/index.js +81 -113
- package/dist/curves/index.js.map +1 -1
- package/dist/curves/lame.cjs +7 -8
- package/dist/curves/lame.cjs.map +1 -1
- package/dist/curves/lame.d.cts +1 -1
- package/dist/curves/lame.d.ts +1 -1
- package/dist/curves/lame.js +6 -7
- package/dist/curves/lame.js.map +1 -1
- package/dist/curves/lissajous32.cjs +7 -7
- package/dist/curves/lissajous32.cjs.map +1 -1
- package/dist/curves/lissajous32.d.cts +1 -1
- package/dist/curves/lissajous32.d.ts +1 -1
- package/dist/curves/lissajous32.js +6 -6
- package/dist/curves/lissajous32.js.map +1 -1
- package/dist/curves/lissajous43.cjs +7 -7
- package/dist/curves/lissajous43.cjs.map +1 -1
- package/dist/curves/lissajous43.d.cts +1 -1
- package/dist/curves/lissajous43.d.ts +1 -1
- package/dist/curves/lissajous43.js +6 -6
- package/dist/curves/lissajous43.js.map +1 -1
- package/dist/curves/rose3.cjs +7 -7
- package/dist/curves/rose3.cjs.map +1 -1
- package/dist/curves/rose3.d.cts +1 -1
- package/dist/curves/rose3.d.ts +1 -1
- package/dist/curves/rose3.js +6 -6
- package/dist/curves/rose3.js.map +1 -1
- package/dist/curves/rose5.cjs +7 -7
- package/dist/curves/rose5.cjs.map +1 -1
- package/dist/curves/rose5.d.cts +1 -1
- package/dist/curves/rose5.d.ts +1 -1
- package/dist/curves/rose5.js +6 -6
- package/dist/curves/rose5.js.map +1 -1
- package/dist/curves/rose52.cjs +7 -7
- package/dist/curves/rose52.cjs.map +1 -1
- package/dist/curves/rose52.d.cts +1 -1
- package/dist/curves/rose52.d.ts +1 -1
- package/dist/curves/rose52.js +6 -6
- package/dist/curves/rose52.js.map +1 -1
- package/dist/curves/star.cjs +7 -10
- package/dist/curves/star.cjs.map +1 -1
- package/dist/curves/star.d.cts +1 -1
- package/dist/curves/star.d.ts +1 -1
- package/dist/curves/star.js +6 -9
- package/dist/curves/star.js.map +1 -1
- package/dist/curves/star4.cjs +7 -10
- package/dist/curves/star4.cjs.map +1 -1
- package/dist/curves/star4.d.cts +2 -2
- package/dist/curves/star4.d.ts +2 -2
- package/dist/curves/star4.js +6 -9
- package/dist/curves/star4.js.map +1 -1
- package/dist/curves/star7.cjs +7 -10
- package/dist/curves/star7.cjs.map +1 -1
- package/dist/curves/star7.d.cts +2 -2
- package/dist/curves/star7.d.ts +2 -2
- package/dist/curves/star7.js +6 -9
- package/dist/curves/star7.js.map +1 -1
- package/dist/index.cjs +158 -192
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -95
- package/dist/index.d.ts +43 -95
- package/dist/index.js +158 -213
- package/dist/index.js.map +1 -1
- package/dist/types-zbxUgcmZ.d.cts +325 -0
- package/dist/types-zbxUgcmZ.d.ts +325 -0
- package/package.json +1 -1
- package/dist/types-Z9i1_AQZ.d.cts +0 -339
- package/dist/types-Z9i1_AQZ.d.ts +0 -339
package/dist/index.d.cts
CHANGED
|
@@ -1,46 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export { CurveName, curves } from "./curves/index.cjs";
|
|
19
|
-
export { artemis2 } from "./curves/artemis2.cjs";
|
|
20
|
-
export { astroid } from "./curves/astroid.cjs";
|
|
21
|
-
export { deltoid } from "./curves/deltoid.cjs";
|
|
22
|
-
export { epicycloid3 } from "./curves/epicycloid3.cjs";
|
|
23
|
-
export { epitrochoid7 } from "./curves/epitrochoid7.cjs";
|
|
24
|
-
export { lame } from "./curves/lame.cjs";
|
|
25
|
-
export { lissajous32 } from "./curves/lissajous32.cjs";
|
|
26
|
-
export { lissajous43 } from "./curves/lissajous43.cjs";
|
|
27
|
-
export { rose3 } from "./curves/rose3.cjs";
|
|
28
|
-
export { rose5 } from "./curves/rose5.cjs";
|
|
29
|
-
import "./curves/rose52.cjs";
|
|
30
|
-
import "./curves/star.cjs";
|
|
31
|
-
import "./curves/star4.cjs";
|
|
32
|
-
import "./curves/star7.cjs";
|
|
1
|
+
import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-zbxUgcmZ.cjs';
|
|
2
|
+
export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-zbxUgcmZ.cjs';
|
|
3
|
+
export { CurveName, curves } from './curves/index.cjs';
|
|
4
|
+
export { artemis2 } from './curves/artemis2.cjs';
|
|
5
|
+
export { astroid } from './curves/astroid.cjs';
|
|
6
|
+
export { deltoid } from './curves/deltoid.cjs';
|
|
7
|
+
export { epicycloid3 } from './curves/epicycloid3.cjs';
|
|
8
|
+
export { epitrochoid7 } from './curves/epitrochoid7.cjs';
|
|
9
|
+
export { lame } from './curves/lame.cjs';
|
|
10
|
+
export { lissajous32 } from './curves/lissajous32.cjs';
|
|
11
|
+
export { lissajous43 } from './curves/lissajous43.cjs';
|
|
12
|
+
export { rose3 } from './curves/rose3.cjs';
|
|
13
|
+
export { rose5 } from './curves/rose5.cjs';
|
|
14
|
+
import './curves/rose52.cjs';
|
|
15
|
+
import './curves/star.cjs';
|
|
16
|
+
import './curves/star4.cjs';
|
|
17
|
+
import './curves/star7.cjs';
|
|
33
18
|
|
|
34
19
|
interface SVGRendererOptions extends BaseRendererOptions {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
/** SVG element the renderer draws into directly */
|
|
21
|
+
container: SVGSVGElement;
|
|
22
|
+
engine: Engine;
|
|
23
|
+
/** @default 'Loading' */
|
|
24
|
+
ariaLabel?: string;
|
|
40
25
|
}
|
|
41
26
|
interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
/** @default 120 */
|
|
28
|
+
trailLength?: number;
|
|
44
29
|
}
|
|
45
30
|
/**
|
|
46
31
|
* Creates a live SVG renderer for sarmal animations
|
|
@@ -65,16 +50,12 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
|
|
|
65
50
|
* controlled.pause() // Pause later
|
|
66
51
|
* ```
|
|
67
52
|
*/
|
|
68
|
-
declare function createSarmalSVG(
|
|
69
|
-
container: SVGSVGElement,
|
|
70
|
-
curveDef: CurveDef,
|
|
71
|
-
options?: SVGSarmalOptions,
|
|
72
|
-
): SarmalInstance;
|
|
53
|
+
declare function createSarmalSVG(container: SVGSVGElement, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
|
|
73
54
|
|
|
74
55
|
interface BoundaryResult {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
56
|
+
scale: number;
|
|
57
|
+
offsetX: number;
|
|
58
|
+
offsetY: number;
|
|
78
59
|
}
|
|
79
60
|
/**
|
|
80
61
|
* Computes how to map engine coordinates into a viewport of the given logical size.
|
|
@@ -85,23 +66,18 @@ interface BoundaryResult {
|
|
|
85
66
|
* `minPaddingPx` defaults to `FIT_PADDING_MIN` (4px) for pixel-space callers.
|
|
86
67
|
* Pass `0` when the logical space is itself a normalized viewBox (e.g. SVG export).
|
|
87
68
|
*/
|
|
88
|
-
declare function computeBoundaries(
|
|
89
|
-
pts: Point[],
|
|
90
|
-
logicalWidth: number,
|
|
91
|
-
logicalHeight: number,
|
|
92
|
-
minPaddingPx?: number,
|
|
93
|
-
): BoundaryResult | null;
|
|
69
|
+
declare function computeBoundaries(pts: Point[], logicalWidth: number, logicalHeight: number, minPaddingPx?: number): BoundaryResult | null;
|
|
94
70
|
/**
|
|
95
71
|
* Can be passed directly to `trailColor`,
|
|
96
72
|
* or can be mixed/sliced before passing as a prop.
|
|
97
73
|
*/
|
|
98
74
|
declare const palettes: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
75
|
+
readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
|
|
76
|
+
readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
|
|
77
|
+
readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
|
|
78
|
+
readonly ice: ["#1e3a8a", "#67e8f9"];
|
|
79
|
+
readonly fire: ["#7f1d1d", "#fbbf24"];
|
|
80
|
+
readonly forest: ["#14532d", "#86efac"];
|
|
105
81
|
};
|
|
106
82
|
type SarmalPalette = keyof typeof palettes;
|
|
107
83
|
|
|
@@ -121,11 +97,11 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
|
|
|
121
97
|
* and each segment uses a phantom predecessor / successor so the
|
|
122
98
|
* curve passes exactly through every control point.
|
|
123
99
|
*
|
|
124
|
-
* @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `
|
|
125
|
-
* @param
|
|
126
|
-
* @returns The `(x, y)` position on the spline at
|
|
100
|
+
* @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `phase`
|
|
101
|
+
* @param phase Parametric position along the closed loop. Wraps into `[0, 2π)` automatically, so values outside that range are remapped rather than rejected
|
|
102
|
+
* @returns The `(x, y)` position on the spline at position `phase`
|
|
127
103
|
*/
|
|
128
|
-
declare function evaluateCatmullRom(points: Array<ControlPoint>,
|
|
104
|
+
declare function evaluateCatmullRom(points: Array<ControlPoint>, phase: number): Point;
|
|
129
105
|
/**
|
|
130
106
|
* The returned curve definition produces a closed Catmull-Rom spline that
|
|
131
107
|
* passes through every point in order, looping back from the last point to the first.
|
|
@@ -151,12 +127,9 @@ declare function evaluateCatmullRom(points: Array<ControlPoint>, t: number): Poi
|
|
|
151
127
|
* createSarmal(canvas, curve)
|
|
152
128
|
* ```
|
|
153
129
|
*/
|
|
154
|
-
declare function drawCurve(
|
|
155
|
-
points: Array<ControlPoint>,
|
|
156
|
-
opts?: {
|
|
130
|
+
declare function drawCurve(points: Array<ControlPoint>, opts?: {
|
|
157
131
|
name?: string;
|
|
158
|
-
|
|
159
|
-
): CurveDef;
|
|
132
|
+
}): CurveDef;
|
|
160
133
|
|
|
161
134
|
/**
|
|
162
135
|
* Creates a sarmal animation on a canvas element
|
|
@@ -172,31 +145,6 @@ declare function drawCurve(
|
|
|
172
145
|
* controlled.pause() // Pause later
|
|
173
146
|
* ```
|
|
174
147
|
*/
|
|
175
|
-
declare function createSarmal(
|
|
176
|
-
canvas: HTMLCanvasElement,
|
|
177
|
-
curveDef: CurveDef,
|
|
178
|
-
options?: SarmalOptions,
|
|
179
|
-
): SarmalInstance;
|
|
148
|
+
declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
|
|
180
149
|
|
|
181
|
-
export {
|
|
182
|
-
BaseRendererOptions,
|
|
183
|
-
type BoundaryResult,
|
|
184
|
-
CurveDef,
|
|
185
|
-
Engine,
|
|
186
|
-
Point,
|
|
187
|
-
RendererOptions,
|
|
188
|
-
type SVGRendererOptions,
|
|
189
|
-
type SVGSarmalOptions,
|
|
190
|
-
SarmalInstance,
|
|
191
|
-
SarmalOptions,
|
|
192
|
-
type SarmalPalette,
|
|
193
|
-
computeBoundaries,
|
|
194
|
-
createEngine,
|
|
195
|
-
createRenderer,
|
|
196
|
-
createSVGRenderer,
|
|
197
|
-
createSarmal,
|
|
198
|
-
createSarmalSVG,
|
|
199
|
-
drawCurve,
|
|
200
|
-
evaluateCatmullRom,
|
|
201
|
-
palettes,
|
|
202
|
-
};
|
|
150
|
+
export { BaseRendererOptions, type BoundaryResult, CurveDef, Engine, Point, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, type SarmalPalette, computeBoundaries, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG, drawCurve, evaluateCatmullRom, palettes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,46 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export { CurveName, curves } from "./curves/index.js";
|
|
19
|
-
export { artemis2 } from "./curves/artemis2.js";
|
|
20
|
-
export { astroid } from "./curves/astroid.js";
|
|
21
|
-
export { deltoid } from "./curves/deltoid.js";
|
|
22
|
-
export { epicycloid3 } from "./curves/epicycloid3.js";
|
|
23
|
-
export { epitrochoid7 } from "./curves/epitrochoid7.js";
|
|
24
|
-
export { lame } from "./curves/lame.js";
|
|
25
|
-
export { lissajous32 } from "./curves/lissajous32.js";
|
|
26
|
-
export { lissajous43 } from "./curves/lissajous43.js";
|
|
27
|
-
export { rose3 } from "./curves/rose3.js";
|
|
28
|
-
export { rose5 } from "./curves/rose5.js";
|
|
29
|
-
import "./curves/rose52.js";
|
|
30
|
-
import "./curves/star.js";
|
|
31
|
-
import "./curves/star4.js";
|
|
32
|
-
import "./curves/star7.js";
|
|
1
|
+
import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-zbxUgcmZ.js';
|
|
2
|
+
export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-zbxUgcmZ.js';
|
|
3
|
+
export { CurveName, curves } from './curves/index.js';
|
|
4
|
+
export { artemis2 } from './curves/artemis2.js';
|
|
5
|
+
export { astroid } from './curves/astroid.js';
|
|
6
|
+
export { deltoid } from './curves/deltoid.js';
|
|
7
|
+
export { epicycloid3 } from './curves/epicycloid3.js';
|
|
8
|
+
export { epitrochoid7 } from './curves/epitrochoid7.js';
|
|
9
|
+
export { lame } from './curves/lame.js';
|
|
10
|
+
export { lissajous32 } from './curves/lissajous32.js';
|
|
11
|
+
export { lissajous43 } from './curves/lissajous43.js';
|
|
12
|
+
export { rose3 } from './curves/rose3.js';
|
|
13
|
+
export { rose5 } from './curves/rose5.js';
|
|
14
|
+
import './curves/rose52.js';
|
|
15
|
+
import './curves/star.js';
|
|
16
|
+
import './curves/star4.js';
|
|
17
|
+
import './curves/star7.js';
|
|
33
18
|
|
|
34
19
|
interface SVGRendererOptions extends BaseRendererOptions {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
/** SVG element the renderer draws into directly */
|
|
21
|
+
container: SVGSVGElement;
|
|
22
|
+
engine: Engine;
|
|
23
|
+
/** @default 'Loading' */
|
|
24
|
+
ariaLabel?: string;
|
|
40
25
|
}
|
|
41
26
|
interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
/** @default 120 */
|
|
28
|
+
trailLength?: number;
|
|
44
29
|
}
|
|
45
30
|
/**
|
|
46
31
|
* Creates a live SVG renderer for sarmal animations
|
|
@@ -65,16 +50,12 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
|
|
|
65
50
|
* controlled.pause() // Pause later
|
|
66
51
|
* ```
|
|
67
52
|
*/
|
|
68
|
-
declare function createSarmalSVG(
|
|
69
|
-
container: SVGSVGElement,
|
|
70
|
-
curveDef: CurveDef,
|
|
71
|
-
options?: SVGSarmalOptions,
|
|
72
|
-
): SarmalInstance;
|
|
53
|
+
declare function createSarmalSVG(container: SVGSVGElement, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
|
|
73
54
|
|
|
74
55
|
interface BoundaryResult {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
56
|
+
scale: number;
|
|
57
|
+
offsetX: number;
|
|
58
|
+
offsetY: number;
|
|
78
59
|
}
|
|
79
60
|
/**
|
|
80
61
|
* Computes how to map engine coordinates into a viewport of the given logical size.
|
|
@@ -85,23 +66,18 @@ interface BoundaryResult {
|
|
|
85
66
|
* `minPaddingPx` defaults to `FIT_PADDING_MIN` (4px) for pixel-space callers.
|
|
86
67
|
* Pass `0` when the logical space is itself a normalized viewBox (e.g. SVG export).
|
|
87
68
|
*/
|
|
88
|
-
declare function computeBoundaries(
|
|
89
|
-
pts: Point[],
|
|
90
|
-
logicalWidth: number,
|
|
91
|
-
logicalHeight: number,
|
|
92
|
-
minPaddingPx?: number,
|
|
93
|
-
): BoundaryResult | null;
|
|
69
|
+
declare function computeBoundaries(pts: Point[], logicalWidth: number, logicalHeight: number, minPaddingPx?: number): BoundaryResult | null;
|
|
94
70
|
/**
|
|
95
71
|
* Can be passed directly to `trailColor`,
|
|
96
72
|
* or can be mixed/sliced before passing as a prop.
|
|
97
73
|
*/
|
|
98
74
|
declare const palettes: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
75
|
+
readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
|
|
76
|
+
readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
|
|
77
|
+
readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
|
|
78
|
+
readonly ice: ["#1e3a8a", "#67e8f9"];
|
|
79
|
+
readonly fire: ["#7f1d1d", "#fbbf24"];
|
|
80
|
+
readonly forest: ["#14532d", "#86efac"];
|
|
105
81
|
};
|
|
106
82
|
type SarmalPalette = keyof typeof palettes;
|
|
107
83
|
|
|
@@ -121,11 +97,11 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
|
|
|
121
97
|
* and each segment uses a phantom predecessor / successor so the
|
|
122
98
|
* curve passes exactly through every control point.
|
|
123
99
|
*
|
|
124
|
-
* @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `
|
|
125
|
-
* @param
|
|
126
|
-
* @returns The `(x, y)` position on the spline at
|
|
100
|
+
* @param points At least 1 point. An empty array yields `(0, 0)`. A single point returns that point for every `phase`
|
|
101
|
+
* @param phase Parametric position along the closed loop. Wraps into `[0, 2π)` automatically, so values outside that range are remapped rather than rejected
|
|
102
|
+
* @returns The `(x, y)` position on the spline at position `phase`
|
|
127
103
|
*/
|
|
128
|
-
declare function evaluateCatmullRom(points: Array<ControlPoint>,
|
|
104
|
+
declare function evaluateCatmullRom(points: Array<ControlPoint>, phase: number): Point;
|
|
129
105
|
/**
|
|
130
106
|
* The returned curve definition produces a closed Catmull-Rom spline that
|
|
131
107
|
* passes through every point in order, looping back from the last point to the first.
|
|
@@ -151,12 +127,9 @@ declare function evaluateCatmullRom(points: Array<ControlPoint>, t: number): Poi
|
|
|
151
127
|
* createSarmal(canvas, curve)
|
|
152
128
|
* ```
|
|
153
129
|
*/
|
|
154
|
-
declare function drawCurve(
|
|
155
|
-
points: Array<ControlPoint>,
|
|
156
|
-
opts?: {
|
|
130
|
+
declare function drawCurve(points: Array<ControlPoint>, opts?: {
|
|
157
131
|
name?: string;
|
|
158
|
-
|
|
159
|
-
): CurveDef;
|
|
132
|
+
}): CurveDef;
|
|
160
133
|
|
|
161
134
|
/**
|
|
162
135
|
* Creates a sarmal animation on a canvas element
|
|
@@ -172,31 +145,6 @@ declare function drawCurve(
|
|
|
172
145
|
* controlled.pause() // Pause later
|
|
173
146
|
* ```
|
|
174
147
|
*/
|
|
175
|
-
declare function createSarmal(
|
|
176
|
-
canvas: HTMLCanvasElement,
|
|
177
|
-
curveDef: CurveDef,
|
|
178
|
-
options?: SarmalOptions,
|
|
179
|
-
): SarmalInstance;
|
|
148
|
+
declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
|
|
180
149
|
|
|
181
|
-
export {
|
|
182
|
-
BaseRendererOptions,
|
|
183
|
-
type BoundaryResult,
|
|
184
|
-
CurveDef,
|
|
185
|
-
Engine,
|
|
186
|
-
Point,
|
|
187
|
-
RendererOptions,
|
|
188
|
-
type SVGRendererOptions,
|
|
189
|
-
type SVGSarmalOptions,
|
|
190
|
-
SarmalInstance,
|
|
191
|
-
SarmalOptions,
|
|
192
|
-
type SarmalPalette,
|
|
193
|
-
computeBoundaries,
|
|
194
|
-
createEngine,
|
|
195
|
-
createRenderer,
|
|
196
|
-
createSVGRenderer,
|
|
197
|
-
createSarmal,
|
|
198
|
-
createSarmalSVG,
|
|
199
|
-
drawCurve,
|
|
200
|
-
evaluateCatmullRom,
|
|
201
|
-
palettes,
|
|
202
|
-
};
|
|
150
|
+
export { BaseRendererOptions, type BoundaryResult, CurveDef, Engine, Point, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, type SarmalPalette, computeBoundaries, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG, drawCurve, evaluateCatmullRom, palettes };
|