vizmatic 0.7.2 → 0.8.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/PROMPT.md +2 -2
- package/ROADMAP.md +1 -1
- package/dist/{chunk-QVYHYC7T.js → chunk-6N6P2GJG.js} +1 -1
- package/dist/{chunk-5ZAFH2JC.js → chunk-USDVNKO7.js} +1404 -862
- package/dist/chunk-YOP55T6W.js +1788 -0
- package/dist/{chunk-F6QI6QJY.js → chunk-ZB3HK7RM.js} +0 -1786
- package/dist/cli.js +10 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -5
- package/dist/scene-cli.js +1 -1
- package/dist/stage-browser/browser.d.ts +79 -9
- package/dist/stage-browser/stage.js +5 -5
- package/dist/stage-export.cjs +531 -509
- package/dist/stage-export.js +5 -3
- package/dist/stage.cjs +2147 -19
- package/dist/stage.d.cts +29 -8
- package/dist/stage.d.ts +29 -8
- package/dist/stage.js +122 -1
- package/dist/{svg-import-5_oTbEJR.d.ts → svg-import-C-RG1t7s.d.cts} +53 -3
- package/dist/{svg-import-5_oTbEJR.d.cts → svg-import-C-RG1t7s.d.ts} +53 -3
- package/examples/_teaching/categorical-tail-loss.ts +3 -3
- package/examples/_teaching/teaching-byte-diff.ts +3 -3
- package/examples/_teaching/teaching-routed-transfer.ts +3 -3
- package/examples/_teaching/teaching-token-history.ts +2 -2
- package/examples/_teaching/teaching-weighted-vector.ts +3 -3
- package/examples/films/attention.ts +5 -4
- package/examples/films/fourier-epicycles.ts +5 -2
- package/examples/films/pythagoras.ts +2 -2
- package/examples/films/taylor-series.ts +3 -2
- package/package.json +1 -1
package/dist/stage.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Path, N as Node, c as ColorInput, V as Vec, C as CompileOverrides, B as Bounds, b as FilmDefinition, a as CompiledFilm,
|
|
2
|
-
export {
|
|
1
|
+
import { P as Path, N as Node, c as ColorInput, I as ImageFitOptions, V as Vec, d as ImageAsset, C as CompileOverrides, B as Bounds, b as FilmDefinition, a as CompiledFilm, e as Side, A as AnimOptions, f as Anim, g as Value, R as Rgba, E as Edge, T as Target, h as Stage, i as PathOp, M as Mat } from './svg-import-C-RG1t7s.cjs';
|
|
2
|
+
export { j as AnimContext, k as Aspect, l as BlendMode, m as Canvas2D, n as Caption, o as Chapter, p as Clip, D as DrawOp, q as EMPTY_BOUNDS, r as Ease, s as FadeOptions, t as FilmOptions, u as Frame, F as FromSvgOptions, G as Gradient, v as IDENTITY, w as ImageAssetError, x as ImageAssetOptions, y as ImageCrop, z as ImageOp, L as LOOKS, H as Look, J as LookName, K as LookToken, O as NodeProps, Q as Paint, U as PlayOptions, W as PropName, X as Ring, Y as StageImage, Z as Suspend, S as SvgNode, _ as along, $ as appear, a0 as apply, a1 as applyMatrix, a2 as arcPath, a3 as blueprint, a4 as bounce, a5 as buildOps, a6 as call, a7 as chalk, a8 as circlePath, a9 as circumscribe, aa as colorAlong, ab as compileFilm, ac as compose, ad as concat, ae as css, af as cubicBezier, ag as curveThrough, ah as delay, ai as draw, aj as during, ak as dynamic, al as easeInCubic, am as easeInExpo, an as easeInOutCubic, ao as easeInOutQuint, ap as easeInQuad, aq as easeOutCubic, ar as easeOutExpo, as as easeOutQuad, at as easeOutQuint, au as erase, av as fade, aw as fadeIn, ax as fadeOut, ay as film, az as flash, aA as frameInkBounds, aB as frameToSvg, aC as fromSvg, aD as group, aE as grow, aF as indicate, aG as invert, aH as isFilm, aI as isSuspend, aJ as lagged, aK as linePath, aL as linear, aM as linearGradient, aN as lingering, aO as matScale, aP as midnight, aQ as mixColor, aR as morph, aS as morphMatching, aT as moveTo, aU as mul, aV as neon, aW as notQuiteThere, aX as overshoot, aY as paintFrame, aZ as paper, a_ as par, a$ as parametricPath, b0 as parseColor, b1 as parseSvgPath, b2 as pathBounds, b3 as pathLength, b4 as pathToD, b5 as pointAt, b6 as polyPath, b7 as pulse, b8 as radialGradient, b9 as ramp, ba as recolor, bb as rectPath, bc as resolveImageAsset, bd as resolveLook, be as retime, bf as reverseRing, bg as ring, bh as ringCenter, bi as ringLength, bj as ripple, bk as rotate, bl as runningStart, bm as rushFrom, bn as rushInto, bo as scaleBy, bp as segmentCount, bq as seq, br as shake, bs as shift, bt as signedArea, bu as slowInto, bv as smooth, bw as smoothBy, bx as smoothPath, by as smoother, bz as spring, bA as subdivideEach, bB as tangentAt, bC as thereAndBack, bD as thereAndBackWithPause, bE as to, bF as toPaint, bG as transformPath, bH as trimPath, bI as trimRing, bJ as unionBounds, bK as vanish, bL as warp, bM as warpPath, bN as wiggle, bO as write } from './svg-import-C-RG1t7s.cjs';
|
|
3
3
|
|
|
4
4
|
interface GlyphOutline {
|
|
5
5
|
/** Each contour is a closed cubic ring in font units, with y pointing up. */
|
|
@@ -104,7 +104,7 @@ declare function rect(width: number, height: number, style?: ShapeStyle & {
|
|
|
104
104
|
}): Node;
|
|
105
105
|
declare function polygon(points: readonly Vec[], style?: ShapeStyle): Node;
|
|
106
106
|
declare function regularPolygon(sides: number, radius: number, style?: ShapeStyle): Node;
|
|
107
|
-
interface ImageOptions {
|
|
107
|
+
interface ImageOptions extends ImageFitOptions {
|
|
108
108
|
/** Width on the stage. With only one of width and height, the other keeps the picture's proportions. */
|
|
109
109
|
width?: number;
|
|
110
110
|
height?: number;
|
|
@@ -115,7 +115,7 @@ interface ImageOptions {
|
|
|
115
115
|
* data URL. A data URL keeps a film in one file and renders the same in every tool.
|
|
116
116
|
* It fades, moves, and scales like any node. Give `width`, `height`, or both.
|
|
117
117
|
*/
|
|
118
|
-
declare function image(src: string, options?: ImageOptions): Node;
|
|
118
|
+
declare function image(src: string | ImageAsset, options?: ImageOptions): Node;
|
|
119
119
|
/** A filled point. */
|
|
120
120
|
declare function dot(radius?: number, color?: ColorInput, style?: ShapeStyle): Node;
|
|
121
121
|
interface ArrowStyle extends ShapeStyle {
|
|
@@ -233,7 +233,7 @@ interface DecimalOptions {
|
|
|
233
233
|
/** A number readout that follows a function of the timeline, drawn fresh each frame. */
|
|
234
234
|
declare function decimal(read: () => number, options?: DecimalOptions): Node;
|
|
235
235
|
|
|
236
|
-
type FilmDiagnosticCode = 'film.off_canvas' | 'film.text_overlap' | 'film.text_crossed' | 'film.missing_glyph';
|
|
236
|
+
type FilmDiagnosticCode = 'film.off_canvas' | 'film.text_overlap' | 'film.text_crossed' | 'film.missing_glyph' | 'film.blank' | 'film.image_asset';
|
|
237
237
|
interface FilmDiagnostic {
|
|
238
238
|
code: FilmDiagnosticCode;
|
|
239
239
|
severity: 'error' | 'warning';
|
|
@@ -253,14 +253,24 @@ interface FilmDiagnostic {
|
|
|
253
253
|
text?: string;
|
|
254
254
|
/** The second text involved in an overlap. */
|
|
255
255
|
other?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Set when a motion scan finds the problem only while something moves. `time` and `until` then
|
|
258
|
+
* bound the longest stretch. `spans` counts the separate stretches, and `seconds` is their total length.
|
|
259
|
+
*/
|
|
260
|
+
motion?: {
|
|
261
|
+
spans: number;
|
|
262
|
+
seconds: number;
|
|
263
|
+
};
|
|
256
264
|
}
|
|
257
265
|
interface FilmCheckReport {
|
|
258
266
|
ok: boolean;
|
|
259
267
|
width: number;
|
|
260
268
|
height: number;
|
|
261
269
|
duration: number;
|
|
262
|
-
/** The
|
|
270
|
+
/** The moments at rest that were inspected, in seconds. */
|
|
263
271
|
sampled: number[];
|
|
272
|
+
/** The number of frames that a motion scan inspected. */
|
|
273
|
+
frames?: number;
|
|
264
274
|
diagnostics: FilmDiagnostic[];
|
|
265
275
|
summary: {
|
|
266
276
|
errors: number;
|
|
@@ -272,11 +282,22 @@ interface FilmCheckOptions extends CompileOverrides {
|
|
|
272
282
|
times?: readonly number[];
|
|
273
283
|
/** Add this many evenly spaced samples to the moments at rest. */
|
|
274
284
|
samples?: number;
|
|
285
|
+
/**
|
|
286
|
+
* Also inspect every frame. A problem that appears only while something moves is a warning, because
|
|
287
|
+
* the check cannot tell a collision from one picture that replaces another. A stretch of 0.2 seconds
|
|
288
|
+
* or more with nothing visible is reported as `film.blank`.
|
|
289
|
+
*/
|
|
290
|
+
motion?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* For a motion scan, the canvas y where the content starts. Marks above it, such as a heading that
|
|
293
|
+
* stays up, do not count as content when the scan looks for blank frames.
|
|
294
|
+
*/
|
|
295
|
+
contentTop?: number;
|
|
275
296
|
}
|
|
276
297
|
/**
|
|
277
298
|
* Inspect a film for layout defects: marks off the canvas, text on text, strokes
|
|
278
299
|
* through text, and characters that no font can draw. It looks where the film comes to rest, because objects may
|
|
279
|
-
* cross each other while moving. Runs anywhere, with no rendering.
|
|
300
|
+
* cross each other while moving. With `motion`, it also looks at every frame. Runs anywhere, with no rendering.
|
|
280
301
|
*/
|
|
281
302
|
declare function checkFilm(film: FilmDefinition | CompiledFilm, options?: FilmCheckOptions): Promise<FilmCheckReport>;
|
|
282
303
|
|
|
@@ -1793,5 +1814,5 @@ declare function label3d(content: string | Node, position: Reactive3, options?:
|
|
|
1793
1814
|
offset?: Vec;
|
|
1794
1815
|
}): Label3D;
|
|
1795
1816
|
|
|
1796
|
-
export { Anim, AnimOptions, ArrayCells, Axes, Axes3D, BarChart, Bounds, Callout, CodeBlock, ColorInput, CompileOverrides, CompiledFilm, ComplexPlane, Connector, Counter, Curve3D, Edge, Epicycles, FilmDefinition, Graph, GraphEdge, GraphNode, GridPlane3D, Heatmap, Histogram, InfoBox, Label3D, LabeledDot, Line3D, LineChart, Mat, MatrixNode, Narration, NeuralNet, Node, NumberLine, NumberPlane, Object3D, Path, PathOp, PieChart, Points3D, Rgba, Scatter, Scene3D, SceneClock, Side, Stage, StreamLines, Surface3D, Target, TexNode, TextNode, TokenRow, Trail3D, TreeGraph, Value, Vec, Vector3D, VectorField, View3D, angleMark, applyComplex, arc, areaUnder, arrayCells, arrow, attentionMatrix, axes, axes3d, barChart, brace, braceLabel, callout, captionLines, checkFilm, circle, codeBlock, complex, complexPlane, connector, countUp, counter, curve, curve3d, dashedGuides, decimal, donut, dot, ellipse, epicycles, fontFor, fourier, fourierPoint, glyphPath, graph, gridPlane3d, heatmap, highlightSweep, histogram, image, infoBox, label3d, labeledDot, legend, line, line3d, lineChart, matrix, morphCode, narration, neuralNet, numberLine, parametric, parametricSurface, parseFont, pie, plane, point3d, points3d, polygon, polyline, rect, regularPolygon, riemann, rightAngle, ringThrough, samplePath, scatter, scene3d, secantLine, setAssetBase, shape, sparkline, sphere, spin, streamLines, surface, surroundingBox, svgPath, swap, tangentLine, tex, text, tokenize, tokens, traced, trail3d, tree, typewriter, vector3d, vectorField, wipe };
|
|
1817
|
+
export { Anim, AnimOptions, ArrayCells, Axes, Axes3D, BarChart, Bounds, Callout, CodeBlock, ColorInput, CompileOverrides, CompiledFilm, ComplexPlane, Connector, Counter, Curve3D, Edge, Epicycles, FilmDefinition, Graph, GraphEdge, GraphNode, GridPlane3D, Heatmap, Histogram, ImageAsset, ImageFitOptions, InfoBox, Label3D, LabeledDot, Line3D, LineChart, Mat, MatrixNode, Narration, NeuralNet, Node, NumberLine, NumberPlane, Object3D, Path, PathOp, PieChart, Points3D, Rgba, Scatter, Scene3D, SceneClock, Side, Stage, StreamLines, Surface3D, Target, TexNode, TextNode, TokenRow, Trail3D, TreeGraph, Value, Vec, Vector3D, VectorField, View3D, angleMark, applyComplex, arc, areaUnder, arrayCells, arrow, attentionMatrix, axes, axes3d, barChart, brace, braceLabel, callout, captionLines, checkFilm, circle, codeBlock, complex, complexPlane, connector, countUp, counter, curve, curve3d, dashedGuides, decimal, donut, dot, ellipse, epicycles, fontFor, fourier, fourierPoint, glyphPath, graph, gridPlane3d, heatmap, highlightSweep, histogram, image, infoBox, label3d, labeledDot, legend, line, line3d, lineChart, matrix, morphCode, narration, neuralNet, numberLine, parametric, parametricSurface, parseFont, pie, plane, point3d, points3d, polygon, polyline, rect, regularPolygon, riemann, rightAngle, ringThrough, samplePath, scatter, scene3d, secantLine, setAssetBase, shape, sparkline, sphere, spin, streamLines, surface, surroundingBox, svgPath, swap, tangentLine, tex, text, tokenize, tokens, traced, trail3d, tree, typewriter, vector3d, vectorField, wipe };
|
|
1797
1818
|
export type { AngleOptions, AreaOptions, ArrayCellsOptions, ArrowStyle, AttentionMatrixOptions, Axes3DOptions, AxesOptions, BarChartOptions, BarDatum, BraceLabelOptions, CalloutOptions, ChartOptions, CodeBlockOptions, CodeToken, ComplexPlaneOptions, ConnectorEnd, ConnectorOptions, CounterOptions, DecimalOptions, EpicyclesOptions, FieldFn, FilmCheckOptions, FilmCheckReport, FilmDiagnostic, FilmDiagnosticCode, FontFamily, FontWeight, FourierTerm, GraphEdgeSpec, GraphNodeSpec, GraphOptions, GridPlaneOptions, HeatmapOptions, HighlightOptions, HistogramOptions, ImageOptions, InfoBoxOptions, InfoRow, LabeledDotOptions, LegendItem, LegendOptions, Line3DStyle, LineChartOptions, LineSeries, LoadedFont, MatrixOptions, NarrationBeat, NarrationOptions, NarrationScene, NarrationTiming, NarrationWord, NeuralNetOptions, NumberLineOptions, ParametricFn, PieDatum, PieOptions, PlacedBeat, PlaneOptions, Points3DStyle, RiemannOptions, ScatterOptions, ScatterPoint, Scene3DOptions, SecantOptions, ShapeStyle, SparklineOptions, StreamLinesOptions, SurfaceOptions, SurroundOptions, TangentOptions, TexOptions, TextOptions, TokenKind, TokenSpec, TokensOptions, TracedOptions, TreeOptions, TreeSpec, TypewriterOptions, Vec3, VectorFieldOptions, WipeOptions };
|
package/dist/stage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as Path, N as Node, c as ColorInput, V as Vec, C as CompileOverrides, B as Bounds, b as FilmDefinition, a as CompiledFilm,
|
|
2
|
-
export {
|
|
1
|
+
import { P as Path, N as Node, c as ColorInput, I as ImageFitOptions, V as Vec, d as ImageAsset, C as CompileOverrides, B as Bounds, b as FilmDefinition, a as CompiledFilm, e as Side, A as AnimOptions, f as Anim, g as Value, R as Rgba, E as Edge, T as Target, h as Stage, i as PathOp, M as Mat } from './svg-import-C-RG1t7s.js';
|
|
2
|
+
export { j as AnimContext, k as Aspect, l as BlendMode, m as Canvas2D, n as Caption, o as Chapter, p as Clip, D as DrawOp, q as EMPTY_BOUNDS, r as Ease, s as FadeOptions, t as FilmOptions, u as Frame, F as FromSvgOptions, G as Gradient, v as IDENTITY, w as ImageAssetError, x as ImageAssetOptions, y as ImageCrop, z as ImageOp, L as LOOKS, H as Look, J as LookName, K as LookToken, O as NodeProps, Q as Paint, U as PlayOptions, W as PropName, X as Ring, Y as StageImage, Z as Suspend, S as SvgNode, _ as along, $ as appear, a0 as apply, a1 as applyMatrix, a2 as arcPath, a3 as blueprint, a4 as bounce, a5 as buildOps, a6 as call, a7 as chalk, a8 as circlePath, a9 as circumscribe, aa as colorAlong, ab as compileFilm, ac as compose, ad as concat, ae as css, af as cubicBezier, ag as curveThrough, ah as delay, ai as draw, aj as during, ak as dynamic, al as easeInCubic, am as easeInExpo, an as easeInOutCubic, ao as easeInOutQuint, ap as easeInQuad, aq as easeOutCubic, ar as easeOutExpo, as as easeOutQuad, at as easeOutQuint, au as erase, av as fade, aw as fadeIn, ax as fadeOut, ay as film, az as flash, aA as frameInkBounds, aB as frameToSvg, aC as fromSvg, aD as group, aE as grow, aF as indicate, aG as invert, aH as isFilm, aI as isSuspend, aJ as lagged, aK as linePath, aL as linear, aM as linearGradient, aN as lingering, aO as matScale, aP as midnight, aQ as mixColor, aR as morph, aS as morphMatching, aT as moveTo, aU as mul, aV as neon, aW as notQuiteThere, aX as overshoot, aY as paintFrame, aZ as paper, a_ as par, a$ as parametricPath, b0 as parseColor, b1 as parseSvgPath, b2 as pathBounds, b3 as pathLength, b4 as pathToD, b5 as pointAt, b6 as polyPath, b7 as pulse, b8 as radialGradient, b9 as ramp, ba as recolor, bb as rectPath, bc as resolveImageAsset, bd as resolveLook, be as retime, bf as reverseRing, bg as ring, bh as ringCenter, bi as ringLength, bj as ripple, bk as rotate, bl as runningStart, bm as rushFrom, bn as rushInto, bo as scaleBy, bp as segmentCount, bq as seq, br as shake, bs as shift, bt as signedArea, bu as slowInto, bv as smooth, bw as smoothBy, bx as smoothPath, by as smoother, bz as spring, bA as subdivideEach, bB as tangentAt, bC as thereAndBack, bD as thereAndBackWithPause, bE as to, bF as toPaint, bG as transformPath, bH as trimPath, bI as trimRing, bJ as unionBounds, bK as vanish, bL as warp, bM as warpPath, bN as wiggle, bO as write } from './svg-import-C-RG1t7s.js';
|
|
3
3
|
|
|
4
4
|
interface GlyphOutline {
|
|
5
5
|
/** Each contour is a closed cubic ring in font units, with y pointing up. */
|
|
@@ -104,7 +104,7 @@ declare function rect(width: number, height: number, style?: ShapeStyle & {
|
|
|
104
104
|
}): Node;
|
|
105
105
|
declare function polygon(points: readonly Vec[], style?: ShapeStyle): Node;
|
|
106
106
|
declare function regularPolygon(sides: number, radius: number, style?: ShapeStyle): Node;
|
|
107
|
-
interface ImageOptions {
|
|
107
|
+
interface ImageOptions extends ImageFitOptions {
|
|
108
108
|
/** Width on the stage. With only one of width and height, the other keeps the picture's proportions. */
|
|
109
109
|
width?: number;
|
|
110
110
|
height?: number;
|
|
@@ -115,7 +115,7 @@ interface ImageOptions {
|
|
|
115
115
|
* data URL. A data URL keeps a film in one file and renders the same in every tool.
|
|
116
116
|
* It fades, moves, and scales like any node. Give `width`, `height`, or both.
|
|
117
117
|
*/
|
|
118
|
-
declare function image(src: string, options?: ImageOptions): Node;
|
|
118
|
+
declare function image(src: string | ImageAsset, options?: ImageOptions): Node;
|
|
119
119
|
/** A filled point. */
|
|
120
120
|
declare function dot(radius?: number, color?: ColorInput, style?: ShapeStyle): Node;
|
|
121
121
|
interface ArrowStyle extends ShapeStyle {
|
|
@@ -233,7 +233,7 @@ interface DecimalOptions {
|
|
|
233
233
|
/** A number readout that follows a function of the timeline, drawn fresh each frame. */
|
|
234
234
|
declare function decimal(read: () => number, options?: DecimalOptions): Node;
|
|
235
235
|
|
|
236
|
-
type FilmDiagnosticCode = 'film.off_canvas' | 'film.text_overlap' | 'film.text_crossed' | 'film.missing_glyph';
|
|
236
|
+
type FilmDiagnosticCode = 'film.off_canvas' | 'film.text_overlap' | 'film.text_crossed' | 'film.missing_glyph' | 'film.blank' | 'film.image_asset';
|
|
237
237
|
interface FilmDiagnostic {
|
|
238
238
|
code: FilmDiagnosticCode;
|
|
239
239
|
severity: 'error' | 'warning';
|
|
@@ -253,14 +253,24 @@ interface FilmDiagnostic {
|
|
|
253
253
|
text?: string;
|
|
254
254
|
/** The second text involved in an overlap. */
|
|
255
255
|
other?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Set when a motion scan finds the problem only while something moves. `time` and `until` then
|
|
258
|
+
* bound the longest stretch. `spans` counts the separate stretches, and `seconds` is their total length.
|
|
259
|
+
*/
|
|
260
|
+
motion?: {
|
|
261
|
+
spans: number;
|
|
262
|
+
seconds: number;
|
|
263
|
+
};
|
|
256
264
|
}
|
|
257
265
|
interface FilmCheckReport {
|
|
258
266
|
ok: boolean;
|
|
259
267
|
width: number;
|
|
260
268
|
height: number;
|
|
261
269
|
duration: number;
|
|
262
|
-
/** The
|
|
270
|
+
/** The moments at rest that were inspected, in seconds. */
|
|
263
271
|
sampled: number[];
|
|
272
|
+
/** The number of frames that a motion scan inspected. */
|
|
273
|
+
frames?: number;
|
|
264
274
|
diagnostics: FilmDiagnostic[];
|
|
265
275
|
summary: {
|
|
266
276
|
errors: number;
|
|
@@ -272,11 +282,22 @@ interface FilmCheckOptions extends CompileOverrides {
|
|
|
272
282
|
times?: readonly number[];
|
|
273
283
|
/** Add this many evenly spaced samples to the moments at rest. */
|
|
274
284
|
samples?: number;
|
|
285
|
+
/**
|
|
286
|
+
* Also inspect every frame. A problem that appears only while something moves is a warning, because
|
|
287
|
+
* the check cannot tell a collision from one picture that replaces another. A stretch of 0.2 seconds
|
|
288
|
+
* or more with nothing visible is reported as `film.blank`.
|
|
289
|
+
*/
|
|
290
|
+
motion?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* For a motion scan, the canvas y where the content starts. Marks above it, such as a heading that
|
|
293
|
+
* stays up, do not count as content when the scan looks for blank frames.
|
|
294
|
+
*/
|
|
295
|
+
contentTop?: number;
|
|
275
296
|
}
|
|
276
297
|
/**
|
|
277
298
|
* Inspect a film for layout defects: marks off the canvas, text on text, strokes
|
|
278
299
|
* through text, and characters that no font can draw. It looks where the film comes to rest, because objects may
|
|
279
|
-
* cross each other while moving. Runs anywhere, with no rendering.
|
|
300
|
+
* cross each other while moving. With `motion`, it also looks at every frame. Runs anywhere, with no rendering.
|
|
280
301
|
*/
|
|
281
302
|
declare function checkFilm(film: FilmDefinition | CompiledFilm, options?: FilmCheckOptions): Promise<FilmCheckReport>;
|
|
282
303
|
|
|
@@ -1793,5 +1814,5 @@ declare function label3d(content: string | Node, position: Reactive3, options?:
|
|
|
1793
1814
|
offset?: Vec;
|
|
1794
1815
|
}): Label3D;
|
|
1795
1816
|
|
|
1796
|
-
export { Anim, AnimOptions, ArrayCells, Axes, Axes3D, BarChart, Bounds, Callout, CodeBlock, ColorInput, CompileOverrides, CompiledFilm, ComplexPlane, Connector, Counter, Curve3D, Edge, Epicycles, FilmDefinition, Graph, GraphEdge, GraphNode, GridPlane3D, Heatmap, Histogram, InfoBox, Label3D, LabeledDot, Line3D, LineChart, Mat, MatrixNode, Narration, NeuralNet, Node, NumberLine, NumberPlane, Object3D, Path, PathOp, PieChart, Points3D, Rgba, Scatter, Scene3D, SceneClock, Side, Stage, StreamLines, Surface3D, Target, TexNode, TextNode, TokenRow, Trail3D, TreeGraph, Value, Vec, Vector3D, VectorField, View3D, angleMark, applyComplex, arc, areaUnder, arrayCells, arrow, attentionMatrix, axes, axes3d, barChart, brace, braceLabel, callout, captionLines, checkFilm, circle, codeBlock, complex, complexPlane, connector, countUp, counter, curve, curve3d, dashedGuides, decimal, donut, dot, ellipse, epicycles, fontFor, fourier, fourierPoint, glyphPath, graph, gridPlane3d, heatmap, highlightSweep, histogram, image, infoBox, label3d, labeledDot, legend, line, line3d, lineChart, matrix, morphCode, narration, neuralNet, numberLine, parametric, parametricSurface, parseFont, pie, plane, point3d, points3d, polygon, polyline, rect, regularPolygon, riemann, rightAngle, ringThrough, samplePath, scatter, scene3d, secantLine, setAssetBase, shape, sparkline, sphere, spin, streamLines, surface, surroundingBox, svgPath, swap, tangentLine, tex, text, tokenize, tokens, traced, trail3d, tree, typewriter, vector3d, vectorField, wipe };
|
|
1817
|
+
export { Anim, AnimOptions, ArrayCells, Axes, Axes3D, BarChart, Bounds, Callout, CodeBlock, ColorInput, CompileOverrides, CompiledFilm, ComplexPlane, Connector, Counter, Curve3D, Edge, Epicycles, FilmDefinition, Graph, GraphEdge, GraphNode, GridPlane3D, Heatmap, Histogram, ImageAsset, ImageFitOptions, InfoBox, Label3D, LabeledDot, Line3D, LineChart, Mat, MatrixNode, Narration, NeuralNet, Node, NumberLine, NumberPlane, Object3D, Path, PathOp, PieChart, Points3D, Rgba, Scatter, Scene3D, SceneClock, Side, Stage, StreamLines, Surface3D, Target, TexNode, TextNode, TokenRow, Trail3D, TreeGraph, Value, Vec, Vector3D, VectorField, View3D, angleMark, applyComplex, arc, areaUnder, arrayCells, arrow, attentionMatrix, axes, axes3d, barChart, brace, braceLabel, callout, captionLines, checkFilm, circle, codeBlock, complex, complexPlane, connector, countUp, counter, curve, curve3d, dashedGuides, decimal, donut, dot, ellipse, epicycles, fontFor, fourier, fourierPoint, glyphPath, graph, gridPlane3d, heatmap, highlightSweep, histogram, image, infoBox, label3d, labeledDot, legend, line, line3d, lineChart, matrix, morphCode, narration, neuralNet, numberLine, parametric, parametricSurface, parseFont, pie, plane, point3d, points3d, polygon, polyline, rect, regularPolygon, riemann, rightAngle, ringThrough, samplePath, scatter, scene3d, secantLine, setAssetBase, shape, sparkline, sphere, spin, streamLines, surface, surroundingBox, svgPath, swap, tangentLine, tex, text, tokenize, tokens, traced, trail3d, tree, typewriter, vector3d, vectorField, wipe };
|
|
1797
1818
|
export type { AngleOptions, AreaOptions, ArrayCellsOptions, ArrowStyle, AttentionMatrixOptions, Axes3DOptions, AxesOptions, BarChartOptions, BarDatum, BraceLabelOptions, CalloutOptions, ChartOptions, CodeBlockOptions, CodeToken, ComplexPlaneOptions, ConnectorEnd, ConnectorOptions, CounterOptions, DecimalOptions, EpicyclesOptions, FieldFn, FilmCheckOptions, FilmCheckReport, FilmDiagnostic, FilmDiagnosticCode, FontFamily, FontWeight, FourierTerm, GraphEdgeSpec, GraphNodeSpec, GraphOptions, GridPlaneOptions, HeatmapOptions, HighlightOptions, HistogramOptions, ImageOptions, InfoBoxOptions, InfoRow, LabeledDotOptions, LegendItem, LegendOptions, Line3DStyle, LineChartOptions, LineSeries, LoadedFont, MatrixOptions, NarrationBeat, NarrationOptions, NarrationScene, NarrationTiming, NarrationWord, NeuralNetOptions, NumberLineOptions, ParametricFn, PieDatum, PieOptions, PlacedBeat, PlaneOptions, Points3DStyle, RiemannOptions, ScatterOptions, ScatterPoint, Scene3DOptions, SecantOptions, ShapeStyle, SparklineOptions, StreamLinesOptions, SurfaceOptions, SurroundOptions, TangentOptions, TexOptions, TextOptions, TokenKind, TokenSpec, TokensOptions, TracedOptions, TreeOptions, TreeSpec, TypewriterOptions, Vec3, VectorFieldOptions, WipeOptions };
|
package/dist/stage.js
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
CompiledFilm,
|
|
3
3
|
EMPTY_BOUNDS,
|
|
4
4
|
IDENTITY,
|
|
5
|
+
ImageAssetError,
|
|
5
6
|
LOOKS,
|
|
6
7
|
Node,
|
|
7
8
|
Stage,
|
|
@@ -56,6 +57,9 @@ import {
|
|
|
56
57
|
glyphPath,
|
|
57
58
|
group,
|
|
58
59
|
grow,
|
|
60
|
+
imageFromAsset,
|
|
61
|
+
imageHasVisiblePixels,
|
|
62
|
+
imageOpBounds,
|
|
59
63
|
indicate,
|
|
60
64
|
invert,
|
|
61
65
|
isFilm,
|
|
@@ -94,6 +98,7 @@ import {
|
|
|
94
98
|
ramp,
|
|
95
99
|
recolor,
|
|
96
100
|
rectPath,
|
|
101
|
+
resolveImageAsset,
|
|
97
102
|
resolveLook,
|
|
98
103
|
retime,
|
|
99
104
|
reverseRing,
|
|
@@ -135,7 +140,8 @@ import {
|
|
|
135
140
|
warpPath,
|
|
136
141
|
wiggle,
|
|
137
142
|
write
|
|
138
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-USDVNKO7.js";
|
|
144
|
+
import "./chunk-YOP55T6W.js";
|
|
139
145
|
import "./chunk-MLKGABMK.js";
|
|
140
146
|
|
|
141
147
|
// src/stage/tex.ts
|
|
@@ -378,6 +384,12 @@ function intrinsicSize(src) {
|
|
|
378
384
|
return null;
|
|
379
385
|
}
|
|
380
386
|
function image(src, options = {}) {
|
|
387
|
+
if (typeof src !== "string") {
|
|
388
|
+
const node = imageFromAsset(src, options);
|
|
389
|
+
if (options.opacity !== void 0) node.opacity(options.opacity);
|
|
390
|
+
return node;
|
|
391
|
+
}
|
|
392
|
+
if (options.crop !== void 0 || options.fit !== void 0) throw new Error("Await resolveImageAsset before using image fit or crop options.");
|
|
381
393
|
const natural = intrinsicSize(src);
|
|
382
394
|
let width = options.width, height = options.height;
|
|
383
395
|
if (width === void 0 && height === void 0) {
|
|
@@ -670,6 +682,9 @@ var MIN_RESTING_MOMENTS = 5;
|
|
|
670
682
|
var AUTO_SAMPLES = 12;
|
|
671
683
|
var CUBIC_STEPS = 6;
|
|
672
684
|
var CROSSING_ERROR_WIDTH = 2;
|
|
685
|
+
var BLANK_ALPHA = 0.25;
|
|
686
|
+
var BLANK_EDGE_SECONDS = 0.5;
|
|
687
|
+
var BLANK_MIN_SECONDS = 0.2;
|
|
673
688
|
var CROSSING_ERROR_CONTRAST = 2;
|
|
674
689
|
var MIN_STROKE_CONTRAST = 1.6;
|
|
675
690
|
var OPAQUE = 0.9;
|
|
@@ -823,6 +838,20 @@ function inspect(frame, time, zoomed, bleed) {
|
|
|
823
838
|
const off = /* @__PURE__ */ new Map();
|
|
824
839
|
let outsideMarks = 0;
|
|
825
840
|
ops.forEach((op, order) => {
|
|
841
|
+
if (op.kind === "image") {
|
|
842
|
+
if (op.alpha < MIN_ALPHA || !imageHasVisiblePixels(op.image.asset, op.image.crop)) return;
|
|
843
|
+
const box2 = imageOpBounds(op);
|
|
844
|
+
const outside2 = box2.x < -EDGE_TOLERANCE || box2.y < -EDGE_TOLERANCE || box2.x + box2.width > width + EDGE_TOLERANCE || box2.y + box2.height > height + EDGE_TOLERANCE;
|
|
845
|
+
if (outside2 && !zoomed && !bleed) findings.push({
|
|
846
|
+
key: `film.off_canvas:image:${ownerKey(op.node)}`,
|
|
847
|
+
code: "film.off_canvas",
|
|
848
|
+
severity: "warning",
|
|
849
|
+
time,
|
|
850
|
+
box: box2,
|
|
851
|
+
message: `Image ${JSON.stringify(op.image.asset?.id ?? op.node?.label ?? "image")} runs off the canvas.`
|
|
852
|
+
});
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
826
855
|
if (op.kind !== "path" || op.path.length === 0) return;
|
|
827
856
|
const glyph = isGlyph(op);
|
|
828
857
|
const alpha = Math.max(op.fillAlpha, op.strokeAlpha);
|
|
@@ -946,7 +975,45 @@ function inspect(frame, time, zoomed, bleed) {
|
|
|
946
975
|
}
|
|
947
976
|
return findings;
|
|
948
977
|
}
|
|
978
|
+
function hasContent(frame, top) {
|
|
979
|
+
return frame.ops.some((op) => {
|
|
980
|
+
if (op.kind === "image") {
|
|
981
|
+
const box2 = imageOpBounds(op);
|
|
982
|
+
return op.alpha >= BLANK_ALPHA && imageHasVisiblePixels(op.image.asset, op.image.crop) && box2.y + box2.height > top && box2.y < frame.height && box2.x + box2.width > 0 && box2.x < frame.width;
|
|
983
|
+
}
|
|
984
|
+
const filled = op.fill !== null && op.fillAlpha >= BLANK_ALPHA;
|
|
985
|
+
const stroked = op.stroke !== null && op.strokeAlpha >= BLANK_ALPHA && op.strokeWidth > 0;
|
|
986
|
+
if (!filled && !stroked) return false;
|
|
987
|
+
const box = pathBounds(filled ? op.path : op.strokePath);
|
|
988
|
+
return box !== null && box.y + box.height > top && box.y < frame.height && box.x + box.width > 0 && box.x < frame.width;
|
|
989
|
+
});
|
|
990
|
+
}
|
|
949
991
|
async function checkFilm(film2, options = {}) {
|
|
992
|
+
try {
|
|
993
|
+
return await inspectFilm(film2, options);
|
|
994
|
+
} catch (error) {
|
|
995
|
+
if (!(error instanceof ImageAssetError) && error?.name !== "ImageAssetError") throw error;
|
|
996
|
+
const dimensions = isFilm(film2) ? new Stage(film2.options) : film2;
|
|
997
|
+
return {
|
|
998
|
+
ok: false,
|
|
999
|
+
width: dimensions.width,
|
|
1000
|
+
height: dimensions.height,
|
|
1001
|
+
duration: isFilm(film2) ? 0 : film2.duration,
|
|
1002
|
+
sampled: [],
|
|
1003
|
+
diagnostics: [{
|
|
1004
|
+
code: "film.image_asset",
|
|
1005
|
+
severity: "error",
|
|
1006
|
+
message: error.message,
|
|
1007
|
+
time: 0,
|
|
1008
|
+
until: 0,
|
|
1009
|
+
box: { x: 0, y: 0, width: 0, height: 0 },
|
|
1010
|
+
stage: { x: 0, y: 0 }
|
|
1011
|
+
}],
|
|
1012
|
+
summary: { errors: 1, warnings: 0 }
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
async function inspectFilm(film2, options) {
|
|
950
1017
|
const compiled = isFilm(film2) ? await film2.compile(options) : film2;
|
|
951
1018
|
const times = options.times ? [...options.times] : restingMoments(compiled, options.samples ?? 0);
|
|
952
1019
|
const merged = /* @__PURE__ */ new Map();
|
|
@@ -966,6 +1033,57 @@ async function checkFilm(film2, options = {}) {
|
|
|
966
1033
|
}
|
|
967
1034
|
}
|
|
968
1035
|
}
|
|
1036
|
+
const frameCount = options.motion ? Math.max(1, Math.round(compiled.duration * compiled.fps)) : 0;
|
|
1037
|
+
const step = 1 / compiled.fps;
|
|
1038
|
+
if (options.motion) {
|
|
1039
|
+
const top = options.contentTop ?? 0;
|
|
1040
|
+
const moving = /* @__PURE__ */ new Map();
|
|
1041
|
+
const blanks = [];
|
|
1042
|
+
for (let index = 0; index < frameCount; index++) {
|
|
1043
|
+
const time = index * step;
|
|
1044
|
+
const frame = await frameAt(compiled, time);
|
|
1045
|
+
for (const finding of inspect(frame, time, zoomAt(compiled, time) !== 1, compiled.bleed)) {
|
|
1046
|
+
if (merged.has(finding.key)) continue;
|
|
1047
|
+
let runs = moving.get(finding.key);
|
|
1048
|
+
if (!runs) moving.set(finding.key, runs = []);
|
|
1049
|
+
const last = runs[runs.length - 1];
|
|
1050
|
+
if (last && last.to === index - 1) last.to = index;
|
|
1051
|
+
else runs.push({ from: index, to: index, first: finding });
|
|
1052
|
+
}
|
|
1053
|
+
const edge = time < BLANK_EDGE_SECONDS || time > compiled.duration - BLANK_EDGE_SECONDS;
|
|
1054
|
+
if (!edge && !hasContent(frame, top)) {
|
|
1055
|
+
const last = blanks[blanks.length - 1];
|
|
1056
|
+
if (last && last.to === index - 1) last.to = index;
|
|
1057
|
+
else blanks.push({ from: index, to: index });
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
const seconds = (frames) => Math.round(frames * step * 100) / 100;
|
|
1061
|
+
for (const [key, runs] of moving) {
|
|
1062
|
+
const longest = runs.reduce((best, run) => run.to - run.from > best.to - best.from ? run : best);
|
|
1063
|
+
const { key: _, ...finding } = longest.first;
|
|
1064
|
+
merged.set(key, {
|
|
1065
|
+
...finding,
|
|
1066
|
+
severity: "warning",
|
|
1067
|
+
until: longest.to * step,
|
|
1068
|
+
stage: { x: 0, y: 0 },
|
|
1069
|
+
motion: { spans: runs.length, seconds: seconds(runs.reduce((sum, run) => sum + run.to - run.from + 1, 0)) }
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
for (const run of blanks) {
|
|
1073
|
+
const length = seconds(run.to - run.from + 1);
|
|
1074
|
+
if (length < BLANK_MIN_SECONDS) continue;
|
|
1075
|
+
merged.set(`film.blank:${run.from}`, {
|
|
1076
|
+
code: "film.blank",
|
|
1077
|
+
severity: "warning",
|
|
1078
|
+
message: `Nothing is visible${top > 0 ? ` below y=${top}` : ""} for ${length} s.`,
|
|
1079
|
+
time: run.from * step,
|
|
1080
|
+
until: run.to * step,
|
|
1081
|
+
box: { x: 0, y: top, width: compiled.width, height: compiled.height - top },
|
|
1082
|
+
stage: { x: 0, y: 0 },
|
|
1083
|
+
motion: { spans: 1, seconds: length }
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
969
1087
|
const round = (value) => Math.round(value * 100) / 100;
|
|
970
1088
|
const diagnostics = [...merged.values()].map((entry) => ({
|
|
971
1089
|
...entry,
|
|
@@ -984,6 +1102,7 @@ async function checkFilm(film2, options = {}) {
|
|
|
984
1102
|
height: compiled.height,
|
|
985
1103
|
duration: compiled.duration,
|
|
986
1104
|
sampled: times.map((time) => Math.round(time * 1e3) / 1e3),
|
|
1105
|
+
...options.motion ? { frames: frameCount } : {},
|
|
987
1106
|
diagnostics,
|
|
988
1107
|
summary: { errors, warnings: diagnostics.length - errors }
|
|
989
1108
|
};
|
|
@@ -5369,6 +5488,7 @@ export {
|
|
|
5369
5488
|
Heatmap,
|
|
5370
5489
|
Histogram,
|
|
5371
5490
|
IDENTITY,
|
|
5491
|
+
ImageAssetError,
|
|
5372
5492
|
InfoBox,
|
|
5373
5493
|
LOOKS,
|
|
5374
5494
|
Label3D,
|
|
@@ -5542,6 +5662,7 @@ export {
|
|
|
5542
5662
|
rect,
|
|
5543
5663
|
rectPath,
|
|
5544
5664
|
regularPolygon,
|
|
5665
|
+
resolveImageAsset,
|
|
5545
5666
|
resolveLook,
|
|
5546
5667
|
retime,
|
|
5547
5668
|
reverseRing,
|
|
@@ -178,6 +178,44 @@ declare class Track<T> {
|
|
|
178
178
|
get end(): number;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
/** Encoded bytes and intrinsic dimensions, validated before a film uses them. */
|
|
182
|
+
interface ImageAsset {
|
|
183
|
+
readonly id?: string;
|
|
184
|
+
readonly src: string;
|
|
185
|
+
readonly mediaType: 'image/png' | 'image/jpeg' | 'image/gif';
|
|
186
|
+
readonly width: number;
|
|
187
|
+
readonly height: number;
|
|
188
|
+
readonly sha256: string;
|
|
189
|
+
}
|
|
190
|
+
interface ImageAssetOptions {
|
|
191
|
+
id?: string;
|
|
192
|
+
mediaType?: string;
|
|
193
|
+
sha256?: string;
|
|
194
|
+
/** Resolve a local filename relative to this directory in Node. */
|
|
195
|
+
baseDir?: string;
|
|
196
|
+
/** Expected intrinsic dimensions, such as those declared in an asset manifest. */
|
|
197
|
+
width?: number;
|
|
198
|
+
height?: number;
|
|
199
|
+
}
|
|
200
|
+
interface ImageCrop {
|
|
201
|
+
x: number;
|
|
202
|
+
y: number;
|
|
203
|
+
width: number;
|
|
204
|
+
height: number;
|
|
205
|
+
}
|
|
206
|
+
interface ImageFitOptions {
|
|
207
|
+
width?: number;
|
|
208
|
+
height?: number;
|
|
209
|
+
fit?: 'contain' | 'cover';
|
|
210
|
+
/** A region in intrinsic image pixels, before fitting the destination box. */
|
|
211
|
+
crop?: ImageCrop;
|
|
212
|
+
}
|
|
213
|
+
declare class ImageAssetError extends Error {
|
|
214
|
+
constructor(message: string);
|
|
215
|
+
}
|
|
216
|
+
/** Load once before authoring. No network request or file read occurs while painting. */
|
|
217
|
+
declare function resolveImageAsset(source: string | Uint8Array, options?: ImageAssetOptions): Promise<ImageAsset>;
|
|
218
|
+
|
|
181
219
|
type BlendMode = 'normal' | 'screen' | 'multiply' | 'overlay';
|
|
182
220
|
type Edge = 'left' | 'right' | 'top' | 'bottom';
|
|
183
221
|
type Side = Edge | 'up' | 'down' | Vec;
|
|
@@ -213,10 +251,12 @@ interface NodeProps {
|
|
|
213
251
|
image: StageImage | null;
|
|
214
252
|
}
|
|
215
253
|
interface StageImage {
|
|
216
|
-
/**
|
|
254
|
+
/** Embedded raster, local filename or legacy URL, resolved before the film is rendered. */
|
|
217
255
|
readonly src: string;
|
|
218
256
|
readonly width: number;
|
|
219
257
|
readonly height: number;
|
|
258
|
+
readonly crop?: Readonly<ImageCrop>;
|
|
259
|
+
readonly asset?: ImageAsset;
|
|
220
260
|
}
|
|
221
261
|
type PropName = keyof NodeProps;
|
|
222
262
|
/**
|
|
@@ -338,6 +378,7 @@ interface ImageOp {
|
|
|
338
378
|
readonly image: StageImage;
|
|
339
379
|
readonly matrix: Mat;
|
|
340
380
|
readonly alpha: number;
|
|
381
|
+
readonly node?: Node;
|
|
341
382
|
}
|
|
342
383
|
type DrawOp = PathOp | ImageOp;
|
|
343
384
|
interface Frame {
|
|
@@ -565,6 +606,8 @@ declare class Value {
|
|
|
565
606
|
|
|
566
607
|
type Aspect = '16:9' | '9:16' | '1:1' | '4:3' | '21:9';
|
|
567
608
|
interface FilmOptions {
|
|
609
|
+
/** Legacy URL images are allowed by default. Prepared image assets never use the network. */
|
|
610
|
+
imageNetwork?: 'allow' | 'deny';
|
|
568
611
|
/** Lines and shapes run past the frame edges on purpose, as a warped grid does. Text is still checked. */
|
|
569
612
|
bleed?: boolean;
|
|
570
613
|
title?: string;
|
|
@@ -676,6 +719,7 @@ declare class Suspend {
|
|
|
676
719
|
/** True for a Suspend thrown by any copy of the engine. */
|
|
677
720
|
declare function isSuspend(error: unknown): error is Suspend;
|
|
678
721
|
interface CompileOverrides {
|
|
722
|
+
imageNetwork?: 'allow' | 'deny';
|
|
679
723
|
look?: LookName | Look;
|
|
680
724
|
fps?: number;
|
|
681
725
|
bloom?: number;
|
|
@@ -683,6 +727,9 @@ interface CompileOverrides {
|
|
|
683
727
|
}
|
|
684
728
|
/** A film ready to sample. `frame(t)` is pure: seek to any time, in any order. */
|
|
685
729
|
declare class CompiledFilm {
|
|
730
|
+
private readonly allowImageNetwork;
|
|
731
|
+
private readonly imageAssets;
|
|
732
|
+
private readonly imageLoads;
|
|
686
733
|
readonly width: number;
|
|
687
734
|
readonly height: number;
|
|
688
735
|
readonly fps: number;
|
|
@@ -701,6 +748,9 @@ declare class CompiledFilm {
|
|
|
701
748
|
readonly stage: Stage;
|
|
702
749
|
constructor(stage: Stage, options: FilmOptions, overrides: CompileOverrides);
|
|
703
750
|
get frameCount(): number;
|
|
751
|
+
private prepareImage;
|
|
752
|
+
/** Preload static and keyed images, including those not visible in the first frame. */
|
|
753
|
+
preloadImages(): Promise<void>;
|
|
704
754
|
/** The draw list at a time in seconds. May throw Suspend if a drawing needs a new asset. */
|
|
705
755
|
frame(time: number): Frame;
|
|
706
756
|
/** Standalone SVG for a time. */
|
|
@@ -738,5 +788,5 @@ declare class SvgNode extends Node {
|
|
|
738
788
|
*/
|
|
739
789
|
declare function fromSvg(source: string, options?: FromSvgOptions): SvgNode;
|
|
740
790
|
|
|
741
|
-
export {
|
|
742
|
-
export type { AnimOptions as A, Bounds as B, CompileOverrides as C, DrawOp as D, Edge as E, FromSvgOptions as F, Gradient as G,
|
|
791
|
+
export { appear as $, LOOKS as L, Node as N, SvgNode as S, Suspend as Z, along as _, CompiledFilm as a, parametricPath as a$, apply as a0, applyMatrix as a1, arcPath as a2, blueprint as a3, bounce as a4, buildOps as a5, call as a6, chalk as a7, circlePath as a8, circumscribe as a9, frameInkBounds as aA, frameToSvg as aB, fromSvg as aC, group as aD, grow as aE, indicate as aF, invert as aG, isFilm as aH, isSuspend as aI, lagged as aJ, linePath as aK, linear as aL, linearGradient as aM, lingering as aN, matScale as aO, midnight as aP, mixColor as aQ, morph as aR, morphMatching as aS, moveTo as aT, mul as aU, neon as aV, notQuiteThere as aW, overshoot as aX, paintFrame as aY, paper as aZ, par as a_, along$1 as aa, compileFilm as ab, compose as ac, concat as ad, css as ae, cubicBezier as af, curveThrough as ag, delay as ah, draw as ai, during as aj, dynamic as ak, easeInCubic as al, easeInExpo as am, easeInOutCubic as an, easeInOutQuint as ao, easeInQuad as ap, easeOutCubic as aq, easeOutExpo as ar, easeOutQuad as as, easeOutQuint as at, erase as au, fade as av, fadeIn as aw, fadeOut as ax, film as ay, flash as az, parseColor as b0, parseSvgPath as b1, pathBounds as b2, pathLength as b3, pathToD as b4, pointAt as b5, polyPath as b6, pulse as b7, radialGradient as b8, ramp as b9, subdivideEach as bA, tangentAt as bB, thereAndBack as bC, thereAndBackWithPause as bD, to as bE, toPaint as bF, transformPath as bG, trimPath as bH, trimRing as bI, unionBounds as bJ, vanish as bK, warp as bL, warpPath as bM, wiggle as bN, write as bO, recolor as ba, rectPath as bb, resolveImageAsset as bc, resolveLook as bd, retime as be, reverseRing as bf, ring as bg, ringCenter as bh, ringLength as bi, ripple as bj, rotate as bk, runningStart as bl, rushFrom as bm, rushInto as bn, scaleBy as bo, segmentCount as bp, seq as bq, shake as br, shift as bs, signedArea as bt, slowInto as bu, smooth as bv, smoothBy as bw, smoothPath as bx, smoother as by, spring as bz, Value as g, Stage as h, EMPTY_BOUNDS as q, IDENTITY as v, ImageAssetError as w };
|
|
792
|
+
export type { AnimOptions as A, Bounds as B, CompileOverrides as C, DrawOp as D, Edge as E, FromSvgOptions as F, Gradient as G, Look as H, ImageFitOptions as I, LookName as J, LookToken as K, Mat as M, NodeProps as O, Path as P, Paint as Q, Rgba as R, Target as T, PlayOptions as U, Vec as V, PropName as W, Ring as X, StageImage as Y, FilmDefinition as b, ColorInput as c, ImageAsset as d, Side as e, Anim as f, PathOp as i, AnimContext as j, Aspect as k, BlendMode as l, Canvas2D as m, Caption as n, Chapter as o, Clip as p, Ease as r, FadeOptions as s, FilmOptions as t, Frame as u, ImageAssetOptions as x, ImageCrop as y, ImageOp as z };
|