vizmatic 0.7.2 → 0.7.3

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/stage.cjs CHANGED
@@ -4631,6 +4631,9 @@ var MIN_RESTING_MOMENTS = 5;
4631
4631
  var AUTO_SAMPLES = 12;
4632
4632
  var CUBIC_STEPS = 6;
4633
4633
  var CROSSING_ERROR_WIDTH = 2;
4634
+ var BLANK_ALPHA = 0.25;
4635
+ var BLANK_EDGE_SECONDS = 0.5;
4636
+ var BLANK_MIN_SECONDS = 0.2;
4634
4637
  var CROSSING_ERROR_CONTRAST = 2;
4635
4638
  var MIN_STROKE_CONTRAST = 1.6;
4636
4639
  var OPAQUE = 0.9;
@@ -4907,6 +4910,16 @@ function inspect(frame, time, zoomed, bleed) {
4907
4910
  }
4908
4911
  return findings;
4909
4912
  }
4913
+ function hasContent(frame, top) {
4914
+ return frame.ops.some((op) => {
4915
+ if (op.kind !== "path") return op.alpha >= BLANK_ALPHA;
4916
+ const filled = op.fill !== null && op.fillAlpha >= BLANK_ALPHA;
4917
+ const stroked = op.stroke !== null && op.strokeAlpha >= BLANK_ALPHA && op.strokeWidth > 0;
4918
+ if (!filled && !stroked) return false;
4919
+ const box = pathBounds(filled ? op.path : op.strokePath);
4920
+ return box !== null && box.y + box.height > top && box.y < frame.height && box.x + box.width > 0 && box.x < frame.width;
4921
+ });
4922
+ }
4910
4923
  async function checkFilm(film2, options = {}) {
4911
4924
  const compiled = isFilm(film2) ? await film2.compile(options) : film2;
4912
4925
  const times = options.times ? [...options.times] : restingMoments(compiled, options.samples ?? 0);
@@ -4927,6 +4940,57 @@ async function checkFilm(film2, options = {}) {
4927
4940
  }
4928
4941
  }
4929
4942
  }
4943
+ const frameCount = options.motion ? Math.max(1, Math.round(compiled.duration * compiled.fps)) : 0;
4944
+ const step = 1 / compiled.fps;
4945
+ if (options.motion) {
4946
+ const top = options.contentTop ?? 0;
4947
+ const moving = /* @__PURE__ */ new Map();
4948
+ const blanks = [];
4949
+ for (let index = 0; index < frameCount; index++) {
4950
+ const time = index * step;
4951
+ const frame = await frameAt(compiled, time);
4952
+ for (const finding of inspect(frame, time, zoomAt(compiled, time) !== 1, compiled.bleed)) {
4953
+ if (merged.has(finding.key)) continue;
4954
+ let runs = moving.get(finding.key);
4955
+ if (!runs) moving.set(finding.key, runs = []);
4956
+ const last = runs[runs.length - 1];
4957
+ if (last && last.to === index - 1) last.to = index;
4958
+ else runs.push({ from: index, to: index, first: finding });
4959
+ }
4960
+ const edge = time < BLANK_EDGE_SECONDS || time > compiled.duration - BLANK_EDGE_SECONDS;
4961
+ if (!edge && !hasContent(frame, top)) {
4962
+ const last = blanks[blanks.length - 1];
4963
+ if (last && last.to === index - 1) last.to = index;
4964
+ else blanks.push({ from: index, to: index });
4965
+ }
4966
+ }
4967
+ const seconds = (frames) => Math.round(frames * step * 100) / 100;
4968
+ for (const [key, runs] of moving) {
4969
+ const longest = runs.reduce((best, run2) => run2.to - run2.from > best.to - best.from ? run2 : best);
4970
+ const { key: _, ...finding } = longest.first;
4971
+ merged.set(key, {
4972
+ ...finding,
4973
+ severity: "warning",
4974
+ until: longest.to * step,
4975
+ stage: { x: 0, y: 0 },
4976
+ motion: { spans: runs.length, seconds: seconds(runs.reduce((sum, run2) => sum + run2.to - run2.from + 1, 0)) }
4977
+ });
4978
+ }
4979
+ for (const run2 of blanks) {
4980
+ const length = seconds(run2.to - run2.from + 1);
4981
+ if (length < BLANK_MIN_SECONDS) continue;
4982
+ merged.set(`film.blank:${run2.from}`, {
4983
+ code: "film.blank",
4984
+ severity: "warning",
4985
+ message: `Nothing is visible${top > 0 ? ` below y=${top}` : ""} for ${length} s.`,
4986
+ time: run2.from * step,
4987
+ until: run2.to * step,
4988
+ box: { x: 0, y: top, width: compiled.width, height: compiled.height - top },
4989
+ stage: { x: 0, y: 0 },
4990
+ motion: { spans: 1, seconds: length }
4991
+ });
4992
+ }
4993
+ }
4930
4994
  const round = (value) => Math.round(value * 100) / 100;
4931
4995
  const diagnostics = [...merged.values()].map((entry) => ({
4932
4996
  ...entry,
@@ -4945,6 +5009,7 @@ async function checkFilm(film2, options = {}) {
4945
5009
  height: compiled.height,
4946
5010
  duration: compiled.duration,
4947
5011
  sampled: times.map((time) => Math.round(time * 1e3) / 1e3),
5012
+ ...options.motion ? { frames: frameCount } : {},
4948
5013
  diagnostics,
4949
5014
  summary: { errors, warnings: diagnostics.length - errors }
4950
5015
  };
package/dist/stage.d.cts CHANGED
@@ -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';
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 times that were inspected, in seconds. */
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
 
package/dist/stage.d.ts CHANGED
@@ -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';
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 times that were inspected, in seconds. */
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
 
package/dist/stage.js CHANGED
@@ -670,6 +670,9 @@ var MIN_RESTING_MOMENTS = 5;
670
670
  var AUTO_SAMPLES = 12;
671
671
  var CUBIC_STEPS = 6;
672
672
  var CROSSING_ERROR_WIDTH = 2;
673
+ var BLANK_ALPHA = 0.25;
674
+ var BLANK_EDGE_SECONDS = 0.5;
675
+ var BLANK_MIN_SECONDS = 0.2;
673
676
  var CROSSING_ERROR_CONTRAST = 2;
674
677
  var MIN_STROKE_CONTRAST = 1.6;
675
678
  var OPAQUE = 0.9;
@@ -946,6 +949,16 @@ function inspect(frame, time, zoomed, bleed) {
946
949
  }
947
950
  return findings;
948
951
  }
952
+ function hasContent(frame, top) {
953
+ return frame.ops.some((op) => {
954
+ if (op.kind !== "path") return op.alpha >= BLANK_ALPHA;
955
+ const filled = op.fill !== null && op.fillAlpha >= BLANK_ALPHA;
956
+ const stroked = op.stroke !== null && op.strokeAlpha >= BLANK_ALPHA && op.strokeWidth > 0;
957
+ if (!filled && !stroked) return false;
958
+ const box = pathBounds(filled ? op.path : op.strokePath);
959
+ return box !== null && box.y + box.height > top && box.y < frame.height && box.x + box.width > 0 && box.x < frame.width;
960
+ });
961
+ }
949
962
  async function checkFilm(film2, options = {}) {
950
963
  const compiled = isFilm(film2) ? await film2.compile(options) : film2;
951
964
  const times = options.times ? [...options.times] : restingMoments(compiled, options.samples ?? 0);
@@ -966,6 +979,57 @@ async function checkFilm(film2, options = {}) {
966
979
  }
967
980
  }
968
981
  }
982
+ const frameCount = options.motion ? Math.max(1, Math.round(compiled.duration * compiled.fps)) : 0;
983
+ const step = 1 / compiled.fps;
984
+ if (options.motion) {
985
+ const top = options.contentTop ?? 0;
986
+ const moving = /* @__PURE__ */ new Map();
987
+ const blanks = [];
988
+ for (let index = 0; index < frameCount; index++) {
989
+ const time = index * step;
990
+ const frame = await frameAt(compiled, time);
991
+ for (const finding of inspect(frame, time, zoomAt(compiled, time) !== 1, compiled.bleed)) {
992
+ if (merged.has(finding.key)) continue;
993
+ let runs = moving.get(finding.key);
994
+ if (!runs) moving.set(finding.key, runs = []);
995
+ const last = runs[runs.length - 1];
996
+ if (last && last.to === index - 1) last.to = index;
997
+ else runs.push({ from: index, to: index, first: finding });
998
+ }
999
+ const edge = time < BLANK_EDGE_SECONDS || time > compiled.duration - BLANK_EDGE_SECONDS;
1000
+ if (!edge && !hasContent(frame, top)) {
1001
+ const last = blanks[blanks.length - 1];
1002
+ if (last && last.to === index - 1) last.to = index;
1003
+ else blanks.push({ from: index, to: index });
1004
+ }
1005
+ }
1006
+ const seconds = (frames) => Math.round(frames * step * 100) / 100;
1007
+ for (const [key, runs] of moving) {
1008
+ const longest = runs.reduce((best, run) => run.to - run.from > best.to - best.from ? run : best);
1009
+ const { key: _, ...finding } = longest.first;
1010
+ merged.set(key, {
1011
+ ...finding,
1012
+ severity: "warning",
1013
+ until: longest.to * step,
1014
+ stage: { x: 0, y: 0 },
1015
+ motion: { spans: runs.length, seconds: seconds(runs.reduce((sum, run) => sum + run.to - run.from + 1, 0)) }
1016
+ });
1017
+ }
1018
+ for (const run of blanks) {
1019
+ const length = seconds(run.to - run.from + 1);
1020
+ if (length < BLANK_MIN_SECONDS) continue;
1021
+ merged.set(`film.blank:${run.from}`, {
1022
+ code: "film.blank",
1023
+ severity: "warning",
1024
+ message: `Nothing is visible${top > 0 ? ` below y=${top}` : ""} for ${length} s.`,
1025
+ time: run.from * step,
1026
+ until: run.to * step,
1027
+ box: { x: 0, y: top, width: compiled.width, height: compiled.height - top },
1028
+ stage: { x: 0, y: 0 },
1029
+ motion: { spans: 1, seconds: length }
1030
+ });
1031
+ }
1032
+ }
969
1033
  const round = (value) => Math.round(value * 100) / 100;
970
1034
  const diagnostics = [...merged.values()].map((entry) => ({
971
1035
  ...entry,
@@ -984,6 +1048,7 @@ async function checkFilm(film2, options = {}) {
984
1048
  height: compiled.height,
985
1049
  duration: compiled.duration,
986
1050
  sampled: times.map((time) => Math.round(time * 1e3) / 1e3),
1051
+ ...options.motion ? { frames: frameCount } : {},
987
1052
  diagnostics,
988
1053
  summary: { errors, warnings: diagnostics.length - errors }
989
1054
  };
@@ -1,6 +1,6 @@
1
- import { createTeachingCategoricalSampling, categoricalSampling } from '../../src/teaching-categorical-sampling'
2
- import type { TeachingPainter } from '../../src/teaching-canvas'
3
- import type { CanvasBounds } from '../../src/canvas-components'
1
+ import { createTeachingCategoricalSampling, categoricalSampling } from 'vizmatic'
2
+ import type { TeachingPainter } from 'vizmatic'
3
+ import type { CanvasBounds } from 'vizmatic'
4
4
 
5
5
  /** Supplied deterministic draws illustrate one possible sample, not a randomly executed experiment. */
6
6
  export const tailLossFixture = {
@@ -1,13 +1,13 @@
1
1
  import { createHash } from 'node:crypto'
2
2
  import { pathToFileURL } from 'node:url'
3
- import { createTeachingByteDifference } from '../../src/teaching-byte-diff'
4
- import type { CanvasBounds, CanvasPainter } from '../../src/canvas-components'
3
+ import { createTeachingByteDifference } from 'vizmatic'
4
+ import type { CanvasBounds, CanvasPainter } from 'vizmatic'
5
5
 
6
6
  const xml = (value: string) => value.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;')
7
7
  const bytes = (value: string) => new TextEncoder().encode(value)
8
8
  const digest = (value: Uint8Array) => createHash('sha256').update(value).digest('hex').slice(0, 12)
9
9
 
10
- /** Run: pnpm exec tsx examples/teaching-byte-diff.ts [--reveal] > /tmp/byte-diff.svg */
10
+ /** Run: npx tsx examples/_teaching/teaching-byte-diff.ts [--reveal] > /tmp/byte-diff.svg */
11
11
  export function renderByteDifferenceExample(revealVerdict = false, scanProgress = 1): string {
12
12
  const content: string[] = []
13
13
  const painter: CanvasPainter<CanvasBounds> = {
@@ -1,6 +1,6 @@
1
- import type { CanvasBounds } from '../../src/canvas-components'
2
- import type { TeachingPainter } from '../../src/teaching-canvas'
3
- import { createTeachingRoutedTransfer } from '../../src/teaching-routed-transfer'
1
+ import type { CanvasBounds } from 'vizmatic'
2
+ import type { TeachingPainter } from 'vizmatic'
3
+ import { createTeachingRoutedTransfer } from 'vizmatic'
4
4
 
5
5
  /** A new parameter copy passes around three completed rank replicas. */
6
6
  export function drawRoutedParameterBroadcast<Shape extends CanvasBounds>(painter: TeachingPainter<Shape>, progress: number) {
@@ -1,5 +1,5 @@
1
- import type { CanvasPainter } from '../../src/canvas-components'
2
- import { createTeachingTokenHistory, type TokenHistoryPhase } from '../../src/teaching-token-history'
1
+ import type { CanvasPainter } from 'vizmatic'
2
+ import { createTeachingTokenHistory, type TokenHistoryPhase } from 'vizmatic'
3
3
 
4
4
  // Vocabulary IDs can repeat; these IDs identify their immutable occurrences.
5
5
  const prompt = [101, 102, 103].map((token, i) => ({ id: `prompt-${i}`, token }))
@@ -1,6 +1,6 @@
1
- import { createTeachingCanvas, type TeachingPainter } from '../../src/teaching-canvas'
2
- import { createTeachingVectorAccumulation, type WeightedVectorTerm } from '../../src/teaching-vector'
3
- import type { CanvasBounds } from '../../src/canvas-components'
1
+ import { createTeachingCanvas, type TeachingPainter } from 'vizmatic'
2
+ import { createTeachingVectorAccumulation, type WeightedVectorTerm } from 'vizmatic'
3
+ import type { CanvasBounds } from 'vizmatic'
4
4
 
5
5
  // A supplied two-coordinate EMA example, with beta=0.75.
6
6
  const terms: readonly WeightedVectorTerm[] = [
@@ -4,7 +4,7 @@
4
4
  * Q K^T, scaling by sqrt(d), softmax per row, and the weighted sum of values.
5
5
  */
6
6
  import {
7
- Node, dynamic, fade, fadeIn, fadeOut, film, line, linear, morphMatching, parseColor, parseSvgPath, rect, smoother, text, tex, to, write, mixColor,
7
+ Node, dynamic, fade, fadeIn, fadeOut, film, line, linear, morphMatching, parseColor, parseSvgPath, rect, seq, smoother, text, tex, to, write, mixColor,
8
8
  type Rgba,
9
9
  } from 'vizmatic/stage'
10
10
 
@@ -256,12 +256,13 @@ export default film({
256
256
  s.wait(0.6)
257
257
 
258
258
  s.chapter('Scale')
259
- s.play(morphMatching(eq0, eq1), fadeOut(note0), fadeIn(note1), { duration: 1.3 })
259
+ // One note leaves before the next arrives, so two sentences never share the same lines.
260
+ s.play(morphMatching(eq0, eq1), seq(fadeOut(note0), fadeIn(note1)), { duration: 1.3 })
260
261
  s.play(scaled.to(1, { ease: smoother }), { duration: 1.8 })
261
262
  s.wait(0.8)
262
263
 
263
264
  s.chapter('Softmax')
264
- s.play(morphMatching(eq1, eq2), fadeOut(note1), fadeIn(note2), { duration: 1.3 })
265
+ s.play(morphMatching(eq1, eq2), seq(fadeOut(note1), fadeIn(note2)), { duration: 1.3 })
265
266
  s.add(sums, shares)
266
267
  s.play(soft.to(1, { ease: smoother }), fadeIn(shareLabel), focus.to(1), { duration: 2.6 })
267
268
  s.wait(0.6)
@@ -270,7 +271,7 @@ export default film({
270
271
  s.wait(1.2)
271
272
 
272
273
  s.chapter('Values')
273
- s.play(morphMatching(eq2, eq3), fadeOut(note2), fadeIn(note3), fadeIn(vStrips, { lag: 0.01 }), fadeIn(vTag), { duration: 1.5 })
274
+ s.play(morphMatching(eq2, eq3), seq(fadeOut(note2), fadeIn(note3)), fadeIn(vStrips, { lag: 0.01 }), fadeIn(vTag), { duration: 1.5 })
274
275
  s.add(output)
275
276
  s.play(flow.to(1, { ease: linear }), fadeIn(outTag), { duration: 3.2 })
276
277
  s.play(fadeIn(caveat), { duration: 0.8 })
@@ -267,9 +267,12 @@ export default film({
267
267
  camera.at((tx + 240 / z) * a, (ty) * a)
268
268
  camera.set('sx', z)
269
269
  })
270
- s.play(fade(title, 0), fade(target, 0), follow.to(1, { ease: smoother }), zoom.to(9, { ease: smoother }), phase.to(phase.value + 0.06, { ease: linear }), { duration: 3 })
270
+ // The title leaves before the zoom carries the curve through it, and returns when the curve is back in place.
271
+ s.at(s.time, () => s.play(fade(title, 0), { duration: 0.3 }))
272
+ s.play(fade(target, 0), follow.to(1, { ease: smoother }), zoom.to(9, { ease: smoother }), phase.to(phase.value + 0.06, { ease: linear }), { duration: 3 })
271
273
  s.play(phase.to(phase.value + 0.14, { ease: linear }), { duration: 6 })
272
- s.play(fade(title, 1), follow.to(0, { ease: smoother }), zoom.to(1, { ease: smoother }), phase.to(phase.value + 0.08, { ease: linear }), { duration: 3 })
274
+ s.at(s.time + 2.6, () => s.play(fade(title, 1), { duration: 0.4 }))
275
+ s.play(follow.to(0, { ease: smoother }), zoom.to(1, { ease: smoother }), phase.to(phase.value + 0.08, { ease: linear }), { duration: 3 })
273
276
 
274
277
  s.chapter('The whole curve')
275
278
  s.play(phase.to(phase.value + 1, { ease: linear }), { duration: 4.6 })
@@ -4,7 +4,7 @@
4
4
  * must have the same area both times, so c^2 = a^2 + b^2. Legs are 3 and 4 units.
5
5
  */
6
6
  import {
7
- Node, draw, fade, fadeIn, fadeOut, film, morph, polygon, polyPath, rect, shape, smoother, text, tex, to, write,
7
+ Node, delay, draw, fade, fadeIn, fadeOut, film, morph, polygon, polyPath, rect, shape, smoother, text, tex, to, write,
8
8
  type Vec,
9
9
  } from 'vizmatic/stage'
10
10
 
@@ -180,6 +180,6 @@ export default film({
180
180
  s.play(fadeIn([...equation.part('='), ...equation.part('+')]), { duration: 0.6 })
181
181
  s.wait(1)
182
182
  check.moveTo([430, 448])
183
- s.play(to(equation, (eq) => eq.shift(-300, 0)), fadeIn([tilesA, tilesB], { lag: 0.02 }), fadeIn(check, { shift: [-30, 0] }), fade(aSquared, 0), fade(bSquared, 0), { duration: 1.4 })
183
+ s.play(to(equation, (eq) => eq.shift(-300, 0)), fadeIn([tilesA, tilesB], { lag: 0.02 }), delay(fadeIn(check, { shift: [-30, 0] }), 0.5), fade(aSquared, 0), fade(bSquared, 0), { duration: 1.4 })
184
184
  s.wait(3)
185
185
  })
@@ -4,7 +4,7 @@
4
4
  * widest |x| where the partial sum stays within 0.01 of sin x.
5
5
  */
6
6
  import {
7
- Node, axes, curveThrough, draw, dynamic, fadeIn, film, line, morphMatching, parametricPath, rect, smoother, text, tex, write,
7
+ Node, axes, curveThrough, draw, dynamic, fadeIn, film, line, morphMatching, parametricPath, rect, seq, smoother, text, tex, write,
8
8
  type Vec,
9
9
  } from 'vizmatic/stage'
10
10
 
@@ -154,6 +154,7 @@ export default film({
154
154
  }
155
155
 
156
156
  s.chapter('The whole wave')
157
- s.play(fadeIn(closingPlate), fadeIn(closing, { shift: [0, 12] }), { duration: 1.2 })
157
+ // The plate covers the curve before the sentence arrives on it.
158
+ s.play(seq(fadeIn(closingPlate), fadeIn(closing, { shift: [0, 12] })), { duration: 1.2 })
158
159
  s.wait(3.2)
159
160
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vizmatic",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Code-driven animation, diagrams, and charts: vector films that play live in a browser and export to MP4, with typed components for dense technical figures.",
5
5
  "type": "module",
6
6
  "license": "MIT",