@algorisys/tinyfly 0.115.0 → 0.116.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/README.md +11 -6
- package/docs/api-reference.md +2 -1
- package/docs/editor-guide.md +1 -1
- package/docs/examples.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +16 -0
- package/docs/maps.md +2 -2
- package/docs/math.md +280 -0
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +2607 -2548
- package/lib/addons/math.js +2864 -0
- package/lib/browser/tinyfly-math.iife.js +53 -0
- package/lib/browser/tinyfly.iife.js +3 -3
- package/lib/browser/tinyfly.js +705 -638
- package/lib/browser/tinyfly.umd.js +3 -3
- package/lib/embed/tinyfly-embed.iife.js +1 -1
- package/lib/embed/tinyfly-embed.js +8 -0
- package/lib/player/tinyfly-player.es.js +8 -0
- package/lib/player/tinyfly-player.iife.js +1 -1
- package/lib/player/tinyfly-player.umd.js +1 -1
- package/lib/types/characters/capabilities.d.ts +8 -0
- package/lib/types/math/browser-entry.d.ts +3 -0
- package/lib/types/math/embed/auto-mount-math.d.ts +7 -0
- package/lib/types/math/embed/explorable.d.ts +46 -0
- package/lib/types/math/embed/mount-math.d.ts +31 -0
- package/lib/types/math/expr/differentiate.d.ts +7 -0
- package/lib/types/math/expr/evaluate.d.ts +21 -0
- package/lib/types/math/expr/parse-expression.d.ts +50 -0
- package/lib/types/math/figure/derived.d.ts +17 -0
- package/lib/types/math/figure/display-list.d.ts +87 -0
- package/lib/types/math/figure/figure-spec.d.ts +239 -0
- package/lib/types/math/figure/item-context.d.ts +33 -0
- package/lib/types/math/figure/items/calculus.d.ts +7 -0
- package/lib/types/math/figure/items/curves.d.ts +7 -0
- package/lib/types/math/figure/items/grid.d.ts +5 -0
- package/lib/types/math/figure/items/regions.d.ts +5 -0
- package/lib/types/math/figure/items/text.d.ts +5 -0
- package/lib/types/math/figure/items/vectors.d.ts +9 -0
- package/lib/types/math/figure/layout-figure.d.ts +13 -0
- package/lib/types/math/figure/plane.d.ts +20 -0
- package/lib/types/math/figure/validate-spec.d.ts +2 -0
- package/lib/types/math/index.d.ts +43 -0
- package/lib/types/math/linear/mat2.d.ts +41 -0
- package/lib/types/math/linear/vec2.d.ts +18 -0
- package/lib/types/math/presets/calculus.d.ts +59 -0
- package/lib/types/math/presets/linear-algebra.d.ts +42 -0
- package/lib/types/math/render/arrow.d.ts +10 -0
- package/lib/types/math/render/display-list-to-svg.d.ts +10 -0
- package/lib/types/math/render/draw-display-list.d.ts +6 -0
- package/lib/types/math/steps/math-steps.d.ts +34 -0
- package/lib/types/math/targets/math-target.d.ts +43 -0
- package/lib/types/math/tex/equation-morph.d.ts +21 -0
- package/lib/types/math/tex/glyph-metrics.d.ts +24 -0
- package/lib/types/math/tex/tex-layout.d.ts +59 -0
- package/lib/types/math/tex/tex-parser.d.ts +88 -0
- package/lib/types/player/player.d.ts +6 -0
- package/llms-full.txt +358 -10
- package/llms.txt +32 -31
- package/package.json +6 -2
- package/skills/tinyfly/SKILL.md +10 -0
package/llms-full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Key facts:
|
|
6
6
|
|
|
7
|
-
- Package: `@algorisys/tinyfly` on npm (`npm install @algorisys/tinyfly`). Entry points: `@algorisys/tinyfly` (engine), `/player`, `/export` (CSS, Lottie, GIF, video exporters), `/adapters` (DOM, Canvas, SVG, WebGL), `/gsap-compat` (GSAP-style API), `/drivers` (scroll, visibility, smooth scroll), `/interaction` (Observer, Draggable), `/teach` (lesson steps and diagram primitives), `/embed` (teaching embeds), `/characters` (poseable stick figure with facial expressions), `/headless` (render scenes to MP4 and PNG stills in Node), `/react`, `/vue`, `/svelte`, `/solid` (framework wrappers), and `/browser` (the GSAP-style runtime plus engine, player, drivers, interaction and the stick figure — no exporters — for script tags). A CLI: `npx @algorisys/tinyfly capabilities`, `check`, `validate`, `render` and `video`.
|
|
7
|
+
- Package: `@algorisys/tinyfly` on npm (`npm install @algorisys/tinyfly`). Entry points: `@algorisys/tinyfly` (engine), `/player`, `/export` (CSS, Lottie, GIF, video exporters), `/adapters` (DOM, Canvas, SVG, WebGL), `/gsap-compat` (GSAP-style API), `/drivers` (scroll, visibility, smooth scroll), `/interaction` (Observer, Draggable), `/teach` (lesson steps and diagram primitives), `/math` (maths figures, a TeX subset, equation steps, lesson embeds and explorables), `/embed` (teaching embeds), `/characters` (poseable stick figure with facial expressions), `/headless` (render scenes to MP4 and PNG stills in Node), `/react`, `/vue`, `/svelte`, `/solid` (framework wrappers), and `/browser` (the GSAP-style runtime plus engine, player, drivers, interaction and the stick figure — no exporters — for script tags). A CLI: `npx @algorisys/tinyfly capabilities`, `check`, `validate`, `render` and `video`.
|
|
8
8
|
- Script tag: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v{version}/cdn/tinyfly.iife.js` defines a global `tinyfly`, e.g. `tinyfly.to('.box', { x: 200, duration: 1 })`. Replace `{version}` with a release tag.
|
|
9
9
|
- The GSAP-style `live` API covers `scrollTrigger` (scrub, pin, toggleActions), `splitText` (chars, words, lines, masks), `drawSVG`, `spring`, `morphSVG`, `motionPath`, text/scramble, inertia and Draggable, Flip (including shared elements by `data-flip-id`), plain-object targets and `live.ticker`.
|
|
10
10
|
- Times in JSON timelines are milliseconds; durations in the GSAP-style API are seconds, as in GSAP.
|
|
@@ -591,7 +591,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
591
591
|
```html
|
|
592
592
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
593
593
|
|
|
594
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
594
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly.iife.js"></script>
|
|
595
595
|
<script>
|
|
596
596
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
597
597
|
</script>
|
|
@@ -799,7 +799,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
799
799
|
global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
800
800
|
|
|
801
801
|
```html
|
|
802
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
802
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly.iife.js"></script>
|
|
803
803
|
<script>
|
|
804
804
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
805
805
|
</script>
|
|
@@ -2714,7 +2714,7 @@ For simple website embedding without a build system.
|
|
|
2714
2714
|
</html>
|
|
2715
2715
|
```
|
|
2716
2716
|
|
|
2717
|
-
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
2717
|
+
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly-player.iife.js`.
|
|
2718
2718
|
|
|
2719
2719
|
---
|
|
2720
2720
|
|
|
@@ -2827,7 +2827,8 @@ Complete reference for the tinyfly animation engine, player, and adapters.
|
|
|
2827
2827
|
Entry points: `tinyfly` (engine), `@algorisys/tinyfly/export` (CSS, Lottie, GIF, WebP,
|
|
2828
2828
|
video and sprite-sheet exporters), `@algorisys/tinyfly/player`, `@algorisys/tinyfly/adapters` (DOM,
|
|
2829
2829
|
Canvas, SVG and WebGL adapters, Flip helpers), `@algorisys/tinyfly/drivers`,
|
|
2830
|
-
`@algorisys/tinyfly/interaction`, `@algorisys/tinyfly/gsap-compat`, `@algorisys/tinyfly/scene-3d` (3D scenes), `@algorisys/tinyfly/
|
|
2830
|
+
`@algorisys/tinyfly/interaction`, `@algorisys/tinyfly/gsap-compat`, `@algorisys/tinyfly/scene-3d` (3D scenes), `@algorisys/tinyfly/math`
|
|
2831
|
+
(maths figures, equations and lessons; see [Maths Animations](math.md)), `@algorisys/tinyfly/browser` (the live
|
|
2831
2832
|
runtime and everything except the exporters, for `<script>` tags), and `@algorisys/tinyfly/headless`
|
|
2832
2833
|
(video and stills rendering in Node).
|
|
2833
2834
|
|
|
@@ -7067,7 +7068,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
7067
7068
|
**Steps to embed:**
|
|
7068
7069
|
1. Build the player: `npm run build:player`
|
|
7069
7070
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
7070
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
7071
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly-player.iife.js`
|
|
7071
7072
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
7072
7073
|
3. Copy the generated code into your HTML
|
|
7073
7074
|
4. Adjust the script `src` path if needed
|
|
@@ -8478,6 +8479,22 @@ are declared up front, each with an id the places use. The catalog lists each
|
|
|
8478
8479
|
surface's places and edits. See "A whole scene as data", "Whiteboards" and
|
|
8479
8480
|
"Charts" in `docs/acting.md`.
|
|
8480
8481
|
|
|
8482
|
+
## Maths
|
|
8483
|
+
|
|
8484
|
+
Maths lessons use `@algorisys/tinyfly/math`: write the figure as JSON (`width`,
|
|
8485
|
+
`height`, `values`, `items`: grid, axes, vector, basis, point, function,
|
|
8486
|
+
parametric, polygon, line, label, equation), check it with `mathFigure(spec)`,
|
|
8487
|
+
and write steps with `mathSteps(lesson, 'fig', figure)` (`applyMatrix`,
|
|
8488
|
+
`drawOn`, `showStep`). Matrices are `[a, b, c, d]` row by row; columns are where
|
|
8489
|
+
î and ĵ land. Functions are expression strings (`'sin(k x)'`, never JS), and
|
|
8490
|
+
equations are TeX in the built-in subset (`\frac`, `\sqrt`, `^`, `_`, matrices,
|
|
8491
|
+
`\val{M.det}` for live values). Do not name a value `x`, `y`, `t`, `opacity`
|
|
8492
|
+
or `scale`: those belong to the figure's target. The same figure plays in a
|
|
8493
|
+
lesson page (`<figure data-tinyfly-math>`), an explorable and a video
|
|
8494
|
+
(`mathTarget`). Calculus items (`tangent`, `riemann`, `area`, `taylor`, a
|
|
8495
|
+
`point` with `on` and `x`) take numbers or number-value names for `at`, `n`,
|
|
8496
|
+
`to`, `order`, and publish `\\val{ID.slope}`, `ID.sum`, `ID.value` for TeX. See `docs/math.md`.
|
|
8497
|
+
|
|
8481
8498
|
## Your own behaviours
|
|
8482
8499
|
|
|
8483
8500
|
Write new actions with `defineAction()` (from beats, or as timed pose steps),
|
|
@@ -8663,7 +8680,7 @@ path for all of that:
|
|
|
8663
8680
|
</figure>
|
|
8664
8681
|
|
|
8665
8682
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
8666
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
8683
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
8667
8684
|
```
|
|
8668
8685
|
|
|
8669
8686
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|
|
@@ -8987,6 +9004,291 @@ refuses to play it, with an error saying to update, rather than playing it wrong
|
|
|
8987
9004
|
|
|
8988
9005
|
---
|
|
8989
9006
|
|
|
9007
|
+
<!-- docs/math.md -->
|
|
9008
|
+
|
|
9009
|
+
# Maths Animations
|
|
9010
|
+
|
|
9011
|
+
`@algorisys/tinyfly/math` draws maths the way teaching videos and explorable
|
|
9012
|
+
lessons show it: a coordinate plane whose grid a matrix warps, vectors, function
|
|
9013
|
+
plots, shaded areas, and equations typeset from TeX that rewrite themselves one
|
|
9014
|
+
step at a time.
|
|
9015
|
+
|
|
9016
|
+
The same figure plays in three places:
|
|
9017
|
+
|
|
9018
|
+
| Where | How |
|
|
9019
|
+
|---|---|
|
|
9020
|
+
| **Lesson pages** | A `<figure data-tinyfly-math>` with the figure and a timeline as JSON, stepped with the embed controls (next, back, captions, questions) |
|
|
9021
|
+
| **Short videos** | A scene for `tinyfly video`, any size: 1080×1920 for 9:16, 1920×1080 for 16:9 |
|
|
9022
|
+
| **Explorables** | `mathExplorable()`: the reader drags vectors or matrix columns and moves sliders |
|
|
9023
|
+
|
|
9024
|
+
All three run the same layout: one pure function turns the figure and its
|
|
9025
|
+
current values into shapes, which are drawn on a canvas or written as SVG. The
|
|
9026
|
+
same values always give the same picture, in a browser, a Web Worker or Node.
|
|
9027
|
+
|
|
9028
|
+
## A figure is JSON
|
|
9029
|
+
|
|
9030
|
+
```js
|
|
9031
|
+
import { mathFigure } from '@algorisys/tinyfly/math'
|
|
9032
|
+
|
|
9033
|
+
const figure = mathFigure({
|
|
9034
|
+
width: 600, height: 600, // px
|
|
9035
|
+
x: [-5, 5], // world units across (y follows, square)
|
|
9036
|
+
theme: 'dark', // dark (default) | light | chalk
|
|
9037
|
+
values: { M: [1, 0, 0, 1], k: 1 },
|
|
9038
|
+
items: [
|
|
9039
|
+
{ id: 'grid', kind: 'grid', transform: 'M', ghost: true },
|
|
9040
|
+
{ id: 'basis', kind: 'basis', transform: 'M' },
|
|
9041
|
+
{ id: 'wave', kind: 'function', expr: 'sin(k x)', color: 'blue' },
|
|
9042
|
+
{ id: 'eq', kind: 'label', tex: '\\begin{bmatrix} \\val{M.a} & \\val{M.b} \\\\ \\val{M.c} & \\val{M.d} \\end{bmatrix}', at: [30, 60], screen: true, align: 'left' },
|
|
9043
|
+
],
|
|
9044
|
+
})
|
|
9045
|
+
```
|
|
9046
|
+
|
|
9047
|
+
`mathFigure()` checks the figure and throws a message that says how to fix it:
|
|
9048
|
+
unknown kinds and themes with the name probably meant, duplicate ids, values of
|
|
9049
|
+
the wrong shape, expressions that do not parse or read a missing parameter, TeX
|
|
9050
|
+
mistakes with their position.
|
|
9051
|
+
|
|
9052
|
+
### Values
|
|
9053
|
+
|
|
9054
|
+
Everything that moves is a **value**: a number (`k`), a vector `[x, y]` or a
|
|
9055
|
+
matrix `[a, b, c, d]`, written row by row:
|
|
9056
|
+
|
|
9057
|
+
| a b |
|
|
9058
|
+
| c d |
|
|
9059
|
+
|
|
9060
|
+
The first column `[a, c]` is where î lands and the second `[b, d]` is where ĵ
|
|
9061
|
+
lands. Items name the values they use (`transform: 'M'`, `to: 'v'`), and number
|
|
9062
|
+
values are the parameters of functions (`sin(k x)`). TeX shows values live with
|
|
9063
|
+
`\val{name}` (`\val{name:1}` for one decimal). Matrices also give
|
|
9064
|
+
`M.a M.b M.c M.d M.det`, and vectors give `v.x v.y v.length`.
|
|
9065
|
+
|
|
9066
|
+
Some names are reserved, because a track on them would move the whole figure:
|
|
9067
|
+
`x`, `y`, `opacity`, `scale`, `rotate` and the other canvas properties, and `t`.
|
|
9068
|
+
|
|
9069
|
+
### Items
|
|
9070
|
+
|
|
9071
|
+
| Kind | Options |
|
|
9072
|
+
|---|---|
|
|
9073
|
+
| `grid` | `step?`, `transform?` (a matrix value), `ghost?` (the original grid, faintly underneath) |
|
|
9074
|
+
| `axes` | `ticks?` (0 for none), `labels?` |
|
|
9075
|
+
| `vector` | `to`, `from?`, `transform?`, `label?` (TeX), `labelAt?: 'tip' \| 'middle'`, `width?` |
|
|
9076
|
+
| `basis` | `transform?`, `labels?`: î and ĵ |
|
|
9077
|
+
| `point` | `at`, `transform?`, `label?`, `radius?` |
|
|
9078
|
+
| `function` | `expr` in `x`, `domain?`, `width?` |
|
|
9079
|
+
| `parametric` | `x` and `y` in `t`, `t?` range, `transform?` |
|
|
9080
|
+
| `polygon` | `points?` (default the unit square), `transform?`, `fillOpacity?`, `label?` |
|
|
9081
|
+
| `line` | `along` (a span) or `eigen` (a matrix value: one line per real eigenvector), `dashed?` |
|
|
9082
|
+
| `label` | `tex`, `at`, `screen?` (px instead of world units), `size?`, `align?`, `backdrop?` |
|
|
9083
|
+
| `equation` | `steps` (TeX, one per step), `at`, `screen?`, `size?`, `align?`, `backdrop?` |
|
|
9084
|
+
| `tangent` | `expr`, `at`, `h?` (a secant through `at` and `at + h`), `length?`, `points?`, `label?` |
|
|
9085
|
+
| `riemann` | `expr`, `from`, `to`, `n` (pieces), `rule?: 'left' \| 'right' \| 'midpoint' \| 'trapezoid'`, `fillOpacity?` |
|
|
9086
|
+
| `area` | `expr`, `from`, `to`, `lower?` (another function), `negativeColor?`, `fillOpacity?` |
|
|
9087
|
+
| `taylor` | `expr`, `at`, `order` (0–20; a fractional order grows the next term in), `domain?` |
|
|
9088
|
+
|
|
9089
|
+
`point` also rides a curve: `{ on: 'sin(x)', x: 'p' }` is the point (p, sin p), and
|
|
9090
|
+
`hollow: true` draws an open circle for a hole or a limit. `function` takes
|
|
9091
|
+
`derivative: n` to plot f′, f″ … and `dashed: true`.
|
|
9092
|
+
|
|
9093
|
+
Fields such as `at`, `from`, `to`, `n`, `h` and `order` take a number or the
|
|
9094
|
+
name of a number value, so a timeline can slide the point, shrink the secant,
|
|
9095
|
+
add rectangles or Taylor terms.
|
|
9096
|
+
|
|
9097
|
+
### Derived numbers
|
|
9098
|
+
|
|
9099
|
+
Items work out numbers that TeX can show with `\val{…}`:
|
|
9100
|
+
|
|
9101
|
+
| Item | Numbers |
|
|
9102
|
+
|---|---|
|
|
9103
|
+
| `tangent` | `ID.slope` (exact, or rise over run for a secant), `ID.x`, `ID.y` |
|
|
9104
|
+
| `riemann` | `ID.sum`, `ID.exact` (the integral), `ID.n` |
|
|
9105
|
+
| `area` | `ID.value` (the signed integral) |
|
|
9106
|
+
| `point` on a curve | `ID.x`, `ID.y` |
|
|
9107
|
+
| `taylor` | `ID.order`, `ID.degree` (its whole part) |
|
|
9108
|
+
|
|
9109
|
+
Slopes, derivative plots and Taylor coefficients come from symbolic
|
|
9110
|
+
differentiation of the expression (`differentiate`, `compileDerivative`), so
|
|
9111
|
+
they are exact, not finite differences. Integrals use Simpson's rule
|
|
9112
|
+
(`integrate`). Calculus items need functions with derivatives; `floor`,
|
|
9113
|
+
`ceil` and `round` have none and are refused with a message.
|
|
9114
|
+
|
|
9115
|
+
Every item has an `id` and may set `color` (a theme colour: `blue`, `green`,
|
|
9116
|
+
`red`, `yellow`, `purple`, `orange`, `teal`, `pink`, `ink`, `grey`; or any CSS
|
|
9117
|
+
colour), `draw` and `opacity`. Items draw in order, later ones on top.
|
|
9118
|
+
|
|
9119
|
+
Function plots break at gaps and asymptotes (`tan(x)`, `1/x`, `sqrt(x)` below
|
|
9120
|
+
0) instead of joining across them.
|
|
9121
|
+
|
|
9122
|
+
### Expressions
|
|
9123
|
+
|
|
9124
|
+
Functions and curves are written as text, parsed by a small safe parser (never
|
|
9125
|
+
`eval`): `+ - * / ^`, brackets, implicit multiplication (`2x`, `3(x + 1)`),
|
|
9126
|
+
`pi`, `e`, `tau`, and these functions: `sin cos tan asin acos atan atan2 sinh
|
|
9127
|
+
cosh tanh exp ln log log2 sqrt abs floor ceil round sign min max sigmoid relu`.
|
|
9128
|
+
|
|
9129
|
+
## What a timeline animates
|
|
9130
|
+
|
|
9131
|
+
A figure's target takes ordinary tracks:
|
|
9132
|
+
|
|
9133
|
+
| Property | Animates |
|
|
9134
|
+
|---|---|
|
|
9135
|
+
| a value's name (`M`, `k`, `v`) | the value; a matrix keyed from `[1, 0, 0, 1]` to `[1, 1, 0, 1]` shears the plane, every point moving in a straight line |
|
|
9136
|
+
| `ITEM.draw` | 0..1, draws the item on like a pen |
|
|
9137
|
+
| `ITEM.opacity` | 0..1 |
|
|
9138
|
+
| `ITEM.step` | an equation's step; in between, terms glide |
|
|
9139
|
+
|
|
9140
|
+
`mathSteps()` writes these as lesson steps on a `lesson()` builder from
|
|
9141
|
+
`@algorisys/tinyfly/teach`:
|
|
9142
|
+
|
|
9143
|
+
```js
|
|
9144
|
+
import { lesson } from '@algorisys/tinyfly/teach'
|
|
9145
|
+
import { determinantFigure, mathSteps } from '@algorisys/tinyfly/math'
|
|
9146
|
+
|
|
9147
|
+
const figure = determinantFigure({ theme: 'light' })
|
|
9148
|
+
const l = lesson({ id: 'determinant' })
|
|
9149
|
+
const m = mathSteps(l, 'fig', figure, { hidden: ['square'] })
|
|
9150
|
+
l.marker('start', { label: 'î and ĵ span the unit square' })
|
|
9151
|
+
m.drawOn('square')
|
|
9152
|
+
l.marker('square', { label: 'Its area is 1', pause: true })
|
|
9153
|
+
m.applyMatrix([2, 0, 0, 1])
|
|
9154
|
+
l.marker('stretch', { label: 'Stretch î by 2: the area doubles', pause: true })
|
|
9155
|
+
m.applyMatrix([2, 1, 2, 1])
|
|
9156
|
+
l.marker('flat', { label: 'ĵ lies on î’s line', pause: true, question: 'What is the area now?' })
|
|
9157
|
+
const timeline = l.definition() // plain JSON
|
|
9158
|
+
```
|
|
9159
|
+
|
|
9160
|
+
`mathSteps` helpers: `toValue(name, value)`, `applyMatrix(m, { name? })`,
|
|
9161
|
+
`drawOn(id)`, `fadeIn(id)`, `fadeOut(id)`, `showStep(id, step)`. Each takes the
|
|
9162
|
+
lesson's step options (`duration`, `easing`, `delay`).
|
|
9163
|
+
|
|
9164
|
+
## In a lesson page
|
|
9165
|
+
|
|
9166
|
+
```html
|
|
9167
|
+
<figure data-tinyfly-math data-options='{"stepMode": true}'>
|
|
9168
|
+
<script type="application/json" data-tinyfly-figure>{ …the figure… }</script>
|
|
9169
|
+
<script type="application/json" data-tinyfly-timeline>{ …the timeline… }</script>
|
|
9170
|
+
<figcaption>The determinant is the area of the unit square after the map.</figcaption>
|
|
9171
|
+
</figure>
|
|
9172
|
+
|
|
9173
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly-math.iife.js" data-tinyfly-auto></script>
|
|
9174
|
+
```
|
|
9175
|
+
|
|
9176
|
+
The figure draws itself into an SVG and redraws from the timeline whenever the
|
|
9177
|
+
player moves: playing, stepping, seeking, or showing the last frame under
|
|
9178
|
+
reduced motion. Everything else is the ordinary embed (see
|
|
9179
|
+
[Teaching Animations](teaching.md)): markers, captions in several languages,
|
|
9180
|
+
questions, scenarios, pausing off screen. Tracks target `fig` unless the figure
|
|
9181
|
+
says `data-target="…"`.
|
|
9182
|
+
|
|
9183
|
+
`tinyfly-math.iife.js` (about 40 KB gzipped) works on its own: it carries the
|
|
9184
|
+
embed player and controls, `lesson()` and everything in the maths module. A figure
|
|
9185
|
+
with no timeline is drawn as a still. Without `data-tinyfly-auto`, call
|
|
9186
|
+
`tinyfly.mountAllMath()`.
|
|
9187
|
+
|
|
9188
|
+
`mathFigureToSvg(figure, values, { title })` writes a standalone SVG of a figure
|
|
9189
|
+
at some values, for static pages, RSS, email and print.
|
|
9190
|
+
|
|
9191
|
+
## Explorables
|
|
9192
|
+
|
|
9193
|
+
```js
|
|
9194
|
+
import { linearMapFigure, mathExplorable } from '@algorisys/tinyfly/math'
|
|
9195
|
+
|
|
9196
|
+
const explorable = mathExplorable(element, linearMapFigure(), {
|
|
9197
|
+
drag: [{ matrix: 'M', column: 0 }, { matrix: 'M', column: 1 }], // drag î and ĵ
|
|
9198
|
+
sliders: [], // { value, min, max, step?, label? }
|
|
9199
|
+
snap: 0.1, // world units (0 for none)
|
|
9200
|
+
onChange: (values) => console.log(values.M),
|
|
9201
|
+
})
|
|
9202
|
+
explorable.set('M', [0, -1, 1, 0])
|
|
9203
|
+
```
|
|
9204
|
+
|
|
9205
|
+
Drag handles take a vector value (`{ vector: 'v' }`) or a matrix column. Sliders
|
|
9206
|
+
take number values. Every change re-lays the figure out from its values, so the
|
|
9207
|
+
reader sees exactly what the same values give in a video.
|
|
9208
|
+
|
|
9209
|
+
## In a video
|
|
9210
|
+
|
|
9211
|
+
```js
|
|
9212
|
+
// examples/headless-video/linear-map-short.mjs (abridged)
|
|
9213
|
+
import { linearMapFigure, mathTarget, mathSteps } from '@algorisys/tinyfly/math'
|
|
9214
|
+
import { lesson } from '@algorisys/tinyfly/teach'
|
|
9215
|
+
|
|
9216
|
+
const figure = linearMapFigure({ width: 1080, height: 1920, x: [-4, 4] })
|
|
9217
|
+
const l = lesson({ id: 'short' })
|
|
9218
|
+
mathSteps(l, 'fig', figure).applyMatrix([1, 1, 0, 1])
|
|
9219
|
+
export default { width: 1080, height: 1920, fps: 30, targets: { fig: mathTarget(figure) }, timeline: l.definition() }
|
|
9220
|
+
```
|
|
9221
|
+
|
|
9222
|
+
```bash
|
|
9223
|
+
npx tinyfly video examples/headless-video/linear-map-short.mjs
|
|
9224
|
+
```
|
|
9225
|
+
|
|
9226
|
+
Line widths and text sizes are given for a 600 px figure and scale with the
|
|
9227
|
+
figure's smaller side, so a figure reads the same as a 600 px card and as a
|
|
9228
|
+
1080×1920 short. `mathTarget()` is a canvas custom target: register it on any
|
|
9229
|
+
`CanvasAdapter` too, and `describeTarget` / `checkTracks` know its props.
|
|
9230
|
+
|
|
9231
|
+
## Equations
|
|
9232
|
+
|
|
9233
|
+
Equations are typeset by a built-in TeX subset, with no KaTeX or MathJax:
|
|
9234
|
+
|
|
9235
|
+
- `^` and `_`, `\frac`, `\sqrt`, `\vec`, `\hat`, `\bar`
|
|
9236
|
+
- `\sum`, `\prod` and `\int`, with limits above and below in display style
|
|
9237
|
+
- Named operators: `\sin \cos \tan \log \ln \exp \det \lim \max \min` …
|
|
9238
|
+
- Greek letters
|
|
9239
|
+
- Symbols: `\cdot \times \pm \le \ge \ne \approx \to \infty \partial \nabla \in` …
|
|
9240
|
+
- Matrices: `\begin{pmatrix|bmatrix|vmatrix|matrix} … \end{…}`
|
|
9241
|
+
- `\text{…}`, `\color{name}{…}`, and spacing `\, \; \quad`
|
|
9242
|
+
- `\left( … \right)`, with delimiters at their natural size
|
|
9243
|
+
- `\id{name}{…}`, which names a term
|
|
9244
|
+
- `\val{name}` and `\val{name:digits}` for live values
|
|
9245
|
+
|
|
9246
|
+
Layout uses fixed glyph metrics, never a font's measurements, so an equation
|
|
9247
|
+
lands in the same place everywhere. The glyphs are drawn in a serif maths face
|
|
9248
|
+
(`MATH_FONT`: Latin Modern Math, STIX Two Math, Cambria Math, then Times-like
|
|
9249
|
+
fallbacks).
|
|
9250
|
+
|
|
9251
|
+
An `equation` item steps between lines of TeX. Terms pair up by their text and
|
|
9252
|
+
order (`x#1`, `=#1`, `2#2`), so `2x + 3 = 7` → `2x = 4` keeps `2`, `x` and `=`,
|
|
9253
|
+
fades `+ 3` and `7`, and fades in `4`. Name a term with `\id{lhs}{…}` to carry it
|
|
9254
|
+
when its text changes. `layoutTex()` and `morphEquation()` are available on
|
|
9255
|
+
their own.
|
|
9256
|
+
|
|
9257
|
+
## Ready figures
|
|
9258
|
+
|
|
9259
|
+
| Preset | Shows |
|
|
9260
|
+
|---|---|
|
|
9261
|
+
| `linearMapFigure()` | The grid, î, ĵ and the unit square carried by `M`, with the matrix in TeX |
|
|
9262
|
+
| `determinantFigure()` | The same, with the square's area labelled `det = …` |
|
|
9263
|
+
| `eigenFigure({ matrix })` | The eigenlines of `matrix` (value `A`) while `M` animates toward it |
|
|
9264
|
+
| `vectorSumFigure({ u, v })` | u + v tip to tail |
|
|
9265
|
+
| `spanFigure({ u, v? })` | Vectors and the lines they span |
|
|
9266
|
+
| `tangentFigure({ expr, at })` | The tangent at `a`, with its slope |
|
|
9267
|
+
| `secantFigure({ expr, at, h })` | The secant through `a` and `a + h`; key `h` to 0 |
|
|
9268
|
+
| `riemannFigure({ expr, from, to, n, rule })` | `n` rectangles, the sum and the exact integral |
|
|
9269
|
+
| `areaFigure({ expr, from, to })` | The area up to `b`, its value shown |
|
|
9270
|
+
| `taylorFigure({ expr, at, order })` | Taylor polynomials of degree `order` |
|
|
9271
|
+
| `limitFigure({ expr, at, limit })` | A point `p` sliding toward a hole |
|
|
9272
|
+
|
|
9273
|
+
Each returns a plain figure to change or extend. In each, `M` starts at the
|
|
9274
|
+
identity unless `matrix` is given.
|
|
9275
|
+
|
|
9276
|
+
## Examples
|
|
9277
|
+
|
|
9278
|
+
- Gallery: **Linear Map**, **Eigenvectors**, **Equation Steps**, **Matrix Lesson**,
|
|
9279
|
+
**Derivative**, **Riemann Sums** and **Taylor Series**.
|
|
9280
|
+
- Videos: `linear-map-short.mjs` and `riemann-short.mjs` (9:16), `eigen-explainer.mjs`
|
|
9281
|
+
and `taylor-explainer.mjs` (16:9), in `examples/headless-video/`.
|
|
9282
|
+
|
|
9283
|
+
## Next
|
|
9284
|
+
|
|
9285
|
+
Probability and statistics (sampling, histograms, the Galton board), discrete
|
|
9286
|
+
maths (graphs, trees, sets) and AI/ML (networks, gradient descent on a loss
|
|
9287
|
+
surface) build on the same figure model.
|
|
9288
|
+
See `todo.md` for their status.
|
|
9289
|
+
|
|
9290
|
+
---
|
|
9291
|
+
|
|
8990
9292
|
<!-- docs/video-rendering.md -->
|
|
8991
9293
|
|
|
8992
9294
|
# Rendering Video from Code
|
|
@@ -9935,8 +10237,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
9935
10237
|
adds to the same `tinyfly` global:
|
|
9936
10238
|
|
|
9937
10239
|
```html
|
|
9938
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
9939
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
10240
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly.iife.js"></script>
|
|
10241
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.116.0/cdn/tinyfly-maps.iife.js"></script>
|
|
9940
10242
|
```
|
|
9941
10243
|
|
|
9942
10244
|
It is a separate script because the offline world map it carries adds about
|
|
@@ -15165,7 +15467,7 @@ magnet.addEventListener('pointerleave', () => {
|
|
|
15165
15467
|
|
|
15166
15468
|
<!-- capabilities: generated from the library -->
|
|
15167
15469
|
|
|
15168
|
-
# tinyfly capabilities (v0.
|
|
15470
|
+
# tinyfly capabilities (v0.116.0)
|
|
15169
15471
|
|
|
15170
15472
|
Generated from the library itself: every name below is accepted, and names not listed are rejected (beat scripts, code panels and `checkTracks` say which name was probably meant).
|
|
15171
15473
|
|
|
@@ -15638,6 +15940,52 @@ Decision review cameras: front-foot, striker-crease, bowler-crease. cricketCamer
|
|
|
15638
15940
|
- `cells, pointer, stack, queue, table, pipeline`: diagram primitives (SVG markup + step helpers)
|
|
15639
15941
|
- `figure({ width, height, children })`: the SVG holding the pieces
|
|
15640
15942
|
|
|
15943
|
+
## Maths (`@algorisys/tinyfly/math`)
|
|
15944
|
+
|
|
15945
|
+
A figure is JSON: a plane and items. Tracks on its target animate values by name and item props. One layout feeds a canvas (videos) and SVG (lesson embeds), so they match.
|
|
15946
|
+
|
|
15947
|
+
- `mathFigure(spec)`: checks a figure (JSON: width, height, x?, y?, theme?: dark | light | chalk, values, items) and says how to fix it
|
|
15948
|
+
- `layoutFigure(spec, props)`: the figure at some values as shapes; drawDisplayList(ctx, list) or displayListToSvg(list) draws them
|
|
15949
|
+
- `mathTarget(spec, { x, y })`: a canvas target for videos and canvas pages; tracks animate its values and item props
|
|
15950
|
+
- `mathSteps(lesson, target, spec, { hidden })`: lesson steps: toValue, applyMatrix, drawOn, fadeIn, fadeOut, showStep (equations)
|
|
15951
|
+
- `mountMath(element) / mountAllMath()`: lesson-page embeds: <figure data-tinyfly-math> with data-tinyfly-figure and data-tinyfly-timeline JSON scripts, stepped like any embed
|
|
15952
|
+
- `mathExplorable(element, spec, { sliders, drag })`: reader-driven figures: sliders on number values, drag vector tips or matrix columns
|
|
15953
|
+
- `mathFigureToSvg(spec, props)`: a standalone SVG of a figure at some values
|
|
15954
|
+
- `linearMapFigure, determinantFigure, eigenFigure, vectorSumFigure, spanFigure`: ready linear algebra figures; the matrix is the value M
|
|
15955
|
+
- `tangentFigure, secantFigure, riemannFigure, areaFigure, taylorFigure, limitFigure`: ready calculus figures; their moving parts are number values (a, h, n, b, order, p)
|
|
15956
|
+
- `differentiate / compileDerivative / integrate`: exact symbolic derivatives of expressions; Simpson integration
|
|
15957
|
+
- `layoutTex(tex) / morphEquation(a, b, t)`: the built-in TeX subset, and term-by-term transitions
|
|
15958
|
+
- `vec2, mat2`: 2D vectors and 2×2 matrices (apply, multiply, determinant, inverse, eigen)
|
|
15959
|
+
|
|
15960
|
+
Items (each has `id`, `kind`, and optional `color`, `draw`, `opacity`):
|
|
15961
|
+
|
|
15962
|
+
- `grid` { step?, transform?: matrix value, ghost? }: lines of the plane, warped by a matrix
|
|
15963
|
+
- `axes` { ticks?, labels? }
|
|
15964
|
+
- `vector` { to, from?, transform?, label? (TeX), labelAt?: tip | middle }
|
|
15965
|
+
- `basis` { transform? }: î and ĵ
|
|
15966
|
+
- `point` { at, transform?, label?, hollow? } or { on: expr, x } (a point riding a curve)
|
|
15967
|
+
- `function` { expr: "sin(k x)", domain?, derivative?, dashed? }: y = f(x); number values are its parameters
|
|
15968
|
+
- `parametric` { x, y (expressions in t), t?, transform? }
|
|
15969
|
+
- `polygon` { points? (default the unit square), transform?, label? }: \val{M.det} shows the determinant
|
|
15970
|
+
- `line` { along } or { eigen: matrix value }: a span, or eigenlines
|
|
15971
|
+
- `label` { tex, at, screen?, size?, align?, backdrop? }
|
|
15972
|
+
- `equation` { steps: [TeX…], at, screen? }: ITEM.step moves between steps, terms gliding
|
|
15973
|
+
- `tangent` { expr, at, h? (secant), label? }: \val{ID.slope} is the exact slope
|
|
15974
|
+
- `riemann` { expr, from, to, n, rule?: left | right | midpoint | trapezoid }: \val{ID.sum}, \val{ID.exact}
|
|
15975
|
+
- `area` { expr, from, to, lower? }: signed, coloured by sign; \val{ID.value}
|
|
15976
|
+
- `taylor` { expr, at, order }: exact Taylor polynomials; a fractional order grows the next term in
|
|
15977
|
+
|
|
15978
|
+
Props a timeline animates:
|
|
15979
|
+
|
|
15980
|
+
- `NAME`: a value: a number, [x, y] vector or [a, b, c, d] matrix (row by row; columns are where î and ĵ land)
|
|
15981
|
+
- `ITEM.draw`: 0..1, draws an item on
|
|
15982
|
+
- `ITEM.opacity`: 0..1
|
|
15983
|
+
- `ITEM.step`: an equation's step; fractional values are part way
|
|
15984
|
+
|
|
15985
|
+
Expression functions: `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `atan2`, `sinh`, `cosh`, `tanh`, `exp`, `ln`, `log`, `log2`, `sqrt`, `abs`, `floor`, `ceil`, `round`, `sign`, `min`, `max`, `sigmoid`, `relu`; constants `pi`, `e`, `tau`.
|
|
15986
|
+
|
|
15987
|
+
TeX subset: ^ _ \frac \sqrt \vec \hat \bar, \sum \prod \int with limits, \sin \lim … , Greek, \cdot \times \le \to \infty …, pmatrix / bmatrix / vmatrix, \text, \color{c}{…}, \id{name}{…} (names a term for transitions), \val{name:digits} (a live value)
|
|
15988
|
+
|
|
15641
15989
|
## Command line
|
|
15642
15990
|
|
|
15643
15991
|
- `tinyfly capabilities [--json]`: this catalog
|
package/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Key facts:
|
|
6
6
|
|
|
7
|
-
- Package: `@algorisys/tinyfly` on npm (`npm install @algorisys/tinyfly`). Entry points: `@algorisys/tinyfly` (engine), `/player`, `/export` (CSS, Lottie, GIF, video exporters), `/adapters` (DOM, Canvas, SVG, WebGL), `/gsap-compat` (GSAP-style API), `/drivers` (scroll, visibility, smooth scroll), `/interaction` (Observer, Draggable), `/teach` (lesson steps and diagram primitives), `/embed` (teaching embeds), `/characters` (poseable stick figure with facial expressions), `/headless` (render scenes to MP4 and PNG stills in Node), `/react`, `/vue`, `/svelte`, `/solid` (framework wrappers), and `/browser` (the GSAP-style runtime plus engine, player, drivers, interaction and the stick figure — no exporters — for script tags). A CLI: `npx @algorisys/tinyfly capabilities`, `check`, `validate`, `render` and `video`.
|
|
7
|
+
- Package: `@algorisys/tinyfly` on npm (`npm install @algorisys/tinyfly`). Entry points: `@algorisys/tinyfly` (engine), `/player`, `/export` (CSS, Lottie, GIF, video exporters), `/adapters` (DOM, Canvas, SVG, WebGL), `/gsap-compat` (GSAP-style API), `/drivers` (scroll, visibility, smooth scroll), `/interaction` (Observer, Draggable), `/teach` (lesson steps and diagram primitives), `/math` (maths figures, a TeX subset, equation steps, lesson embeds and explorables), `/embed` (teaching embeds), `/characters` (poseable stick figure with facial expressions), `/headless` (render scenes to MP4 and PNG stills in Node), `/react`, `/vue`, `/svelte`, `/solid` (framework wrappers), and `/browser` (the GSAP-style runtime plus engine, player, drivers, interaction and the stick figure — no exporters — for script tags). A CLI: `npx @algorisys/tinyfly capabilities`, `check`, `validate`, `render` and `video`.
|
|
8
8
|
- Script tag: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v{version}/cdn/tinyfly.iife.js` defines a global `tinyfly`, e.g. `tinyfly.to('.box', { x: 200, duration: 1 })`. Replace `{version}` with a release tag.
|
|
9
9
|
- The GSAP-style `live` API covers `scrollTrigger` (scrub, pin, toggleActions), `splitText` (chars, words, lines, masks), `drawSVG`, `spring`, `morphSVG`, `motionPath`, text/scramble, inertia and Draggable, Flip (including shared elements by `data-flip-id`), plain-object targets and `live.ticker`.
|
|
10
10
|
- Times in JSON timelines are milliseconds; durations in the GSAP-style API are seconds, as in GSAP.
|
|
@@ -13,48 +13,49 @@ Key facts:
|
|
|
13
13
|
- For language models: read the capability catalog first (`npx @algorisys/tinyfly capabilities`, or the end of llms-full.txt). It is generated from the library, so every name in it (poses, expressions, gags, gaits, beat actions, canvas properties, code-panel edits) is accepted, and names not in it are rejected with the name probably meant. Check beat scripts with `npx @algorisys/tinyfly check beats.json`, tracks with `checkTracks(tracks, targets)`, and ask any target what it animates with `describeTarget(target)`. The npm package ships `docs/`, `llms.txt`, `llms-full.txt` and an agent skill (`skills/tinyfly/SKILL.md`); `docs/llm-guide.md` describes the workflow.
|
|
14
14
|
- Source: https://github.com/algorisys-oss/tinyfly. License: MIT.
|
|
15
15
|
|
|
16
|
-
All documentation and the interactive course in a single file: [llms-full.txt](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
16
|
+
All documentation and the interactive course in a single file: [llms-full.txt](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/llms-full.txt)
|
|
17
17
|
|
|
18
18
|
## Start here
|
|
19
19
|
|
|
20
|
-
- [Getting Started](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
21
|
-
- [GSAP Compatibility](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
22
|
-
- [Code Examples](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
23
|
-
- [Building Animations with an LLM](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
20
|
+
- [Getting Started](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/getting-started.md): What tinyfly is, making a first animation in the editor, and using it from code, a script tag or the CDN.
|
|
21
|
+
- [GSAP Compatibility](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/gsap-compat.md): The GSAP-style API (`live.to`, `tf.timeline`): supported vars, motion paths, morphSVG, text, inertia, Draggable, Flip, and where it differs from GSAP.
|
|
22
|
+
- [Code Examples](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/examples.md): Recipes with the engine API: fades, loops, colour and bezier easing, loading JSON, canvas and SVG rendering, multi-scene sequences, motion paths and script-tag embeds; a festive garba/dandiya scene with partner contacts, circle travel and spins, also rendered to video.
|
|
23
|
+
- [Building Animations with an LLM](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/llm-guide.md): For assistants and the people setting them up: read the capability catalog (`tinyfly capabilities`), ask targets what they animate (`describeTarget`), check beats and tracks with did-you-mean errors (`tinyfly check`, `checkTracks`), render stills to look at, and the agent skill shipped in the package.
|
|
24
24
|
|
|
25
25
|
## Reference
|
|
26
26
|
|
|
27
|
-
- [API Reference](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
28
|
-
- [File Format](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
27
|
+
- [API Reference](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/api-reference.md): Every public engine, player and adapter API: Timeline, tracks, keyframes, easing, drivers, serialization and exports.
|
|
28
|
+
- [File Format](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/file-format.md): The JSON animation format: timelines, every track kind, keyframes, easing and the project file — for generating or consuming animations.
|
|
29
29
|
|
|
30
30
|
## Editor features
|
|
31
31
|
|
|
32
|
-
- [Editor Guide](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
33
|
-
- [Shape Morphing](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
34
|
-
- [Pen Tool](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
35
|
-
- [Polygons & Stars](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
36
|
-
- [Grid & Snapping](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
37
|
-
- [Onion Skinning](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
38
|
-
- [Sprite-sheet Export](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
32
|
+
- [Editor Guide](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/editor-guide.md): Every panel and feature of the visual editor, from elements and keyframes to text and inertia tracks, preview and export.
|
|
33
|
+
- [Shape Morphing](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/shape-morph.md): Tweening one path into another, including shapes with different point counts and several subpaths.
|
|
34
|
+
- [Pen Tool](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/pen-tool.md): Drawing custom paths point by point with straight segments and bezier curves.
|
|
35
|
+
- [Polygons & Stars](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/polygon-star.md): Parametric polygon and star shapes that stay editable while animating like any path.
|
|
36
|
+
- [Grid & Snapping](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/grid-and-snapping.md): The grid overlay, snapping to grid, elements and artboard centre, and alignment guides.
|
|
37
|
+
- [Onion Skinning](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/onion-skinning.md): Ghost frames before and after the playhead for judging arcs and easing.
|
|
38
|
+
- [Sprite-sheet Export](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/sprite-sheet-export.md): Exporting frames as a PNG grid plus JSON metadata for game engines and canvas players.
|
|
39
39
|
|
|
40
40
|
## Guides
|
|
41
41
|
|
|
42
|
-
- [Cricket Stories](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
43
|
-
- [Scroll Animation](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
44
|
-
- [Props: Everyday Objects with Behaviours](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
45
|
-
- [Teaching Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
- [3D
|
|
54
|
-
- [
|
|
55
|
-
- [
|
|
42
|
+
- [Cricket Stories](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/cricket.md): Reusable sports APIs, organic adult/child players, sixteen cricket plays, Test/ODI/T20 facts, contact-keyed JSON, captions, headless video and a 360° ground camera.
|
|
43
|
+
- [Scroll Animation](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/scroll-animation.md): Scroll-driven and play-when-visible animation with ScrollDriver and VisibilityDriver.
|
|
44
|
+
- [Props: Everyday Objects with Behaviours](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/props.md): Cars, trucks, buses, tractors, carts, train carriages, bikes, motorbikes, trees, houses, a helicopter and a plane: 3D rigs drawn with the characters’ pens (clean, pencil) that turn toward the camera, with beats acted through the 12 principles (anticipation, squash and stretch, follow-through, an exaggeration dial), wheels that roll exactly, effects, and figures riding them.
|
|
45
|
+
- [Teaching Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/teaching.md): Step-through explanatory figures: markers, captions in several languages, the teaching player, step controls, one-script declarative embeds, tinyfly/teach diagram primitives, and validate / render for build pipelines.
|
|
46
|
+
- [Maths Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/math.md): tinyfly/math: figures as JSON (grids a matrix warps, vectors, function plots, polygons, eigenlines, TeX labels and equations that rewrite step by step), animated by plain tracks, played in lesson-page embeds, explorables and videos from one layout; a built-in TeX subset and ready linear algebra figures.
|
|
47
|
+
- [Rendering Video from Code](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/video-rendering.md): Rendering a scene to MP4 without a browser: `tinyfly video`, custom canvas targets drawn by code, timing from narration and recorded voice-over, the stick-figure character, SRT/WebVTT captions, stills, porting Cairo scripts, and a benchmark against pycairo.
|
|
48
|
+
- [Animated Maps](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/maps.md): Maps that animate: a camera that flies in to a city, pins that drop in, routes that draw themselves while a marker travels them, on OpenStreetMap tiles or an offline world outline (also in pencil), in the browser and in headless video.
|
|
49
|
+
- [Cartoon Hands](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/cartoon-hands.md): A hand you can pose: a palm and five fingers in 3D, posed by numbers (curls, thumb, spread, wrist turn), ready-made shapes from a fist to a pencil grip, left and right, four or five fingers, in clean, pencil and silhouette looks; the animator's hand and character gloves are built on it.
|
|
50
|
+
- [Character Appearance](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/character-appearance.md): Hair (34 styles), facial hair (20), glasses, hats and ears for the v2 character as plain data on the head, so they turn with it through all eight views; builds (child, tall, short…), a recurring cast (castMember), expressions with blush, tears and sweat, everyday poses, held items (mug, phone, bags, umbrella, parcel) and two characters’ hands meeting (meetHands: handshake, high five, hand-over).
|
|
51
|
+
- [Cartoon Acting](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/acting.md): actTracks(): the same key poses, acted: anticipation, overshoot and settle, overlapping joints, eyes that lead and blink, moving holds and jump squash, in full, snappy or limited styles; gags as data (take, double take, wind-up); a line of action (bend); gaits with personality; lip-sync from text (Latin and Devanagari); beat scripts compiled to acted tracks; your own actions (defineAction), gaits (defineGait) and personas (persona()); acting on code (codePanel lines and words as anchors: leap onto a line, point at it, swipe it away wiped, knocked off or blurred; grab, throw, kick, carry and drop words, push them along their line, write new text in by hand; ride a line as gaps close); camera shots (push in, cut, shake, follow); the cartoon zip; speed lines, dust puffs and impact stars; drawing on twos (a timeline setting); acting, gags, walks and lines in the editor.
|
|
52
|
+
- [Dance and Flips](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/dance.md): The stick figure dances disco, hip hop, breaking, jazz, K-pop, Bollywood, Bhangra, Bharatanatyam (with mudras), the Charleston, tap and popping, and does flips, leaps and splits; native v2 garba (two/three clap) and dandiya add body-local routines, circle formations, world foot plants, paired stick-tip contacts and signed spins; JSON bakes, timing, contact limits and editor menus.
|
|
53
|
+
- [3D Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/scene-3d.md): @algorisys/tinyfly/scene-3d: cameras, lights and meshes as JSON, in metres, animated by tracks at <scene>/<object> (cuts with activeCamera), drawn on a 2D canvas with flat, smooth or toon shading, ink outlines and fog, in browsers, Workers and Node (MP4 with tinyfly video); v2 characters in pen or solid looks, scripted native dances, timed signed spins and circle formations with foot contacts.
|
|
54
|
+
- [3D Transforms and Rotations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/3d-rotations.md): CSS-style 3D for flat elements in every renderer (rotateX, rotateY, z, perspective, backface visibility; true perspective on Canvas and WebGL, matching CSS within a pixel), one documented transform order, the editor's 3D fields; smooth quaternion rotations with interpolation: "slerp"; the vec3, quat and mat4 helpers; format version 2.
|
|
55
|
+
- [Extending tinyfly](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/extending.md): Writing a render adapter, animating any object with live and the ticker, custom and parametric eases, stagger offsets, adding a track kind, and contributing gallery examples.
|
|
56
|
+
- [Deployment](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/docs/DEPLOYMENT.md): Building and hosting the editor, and serving the player bundles.
|
|
56
57
|
|
|
57
58
|
## Optional
|
|
58
59
|
|
|
59
|
-
- [README](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
60
|
-
- [Release notes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
60
|
+
- [README](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/README.md): Feature overview, project layout and development setup.
|
|
61
|
+
- [Release notes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.116.0/release-notes/README.md): What changed in each version.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algorisys/tinyfly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lightweight, API-driven animation engine and editor. The engine is framework-agnostic and runs in browsers, Web Workers, and Node.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,6 +77,10 @@
|
|
|
77
77
|
"types": "./lib/types/teach/index.d.ts",
|
|
78
78
|
"import": "./lib/addons/teach.js"
|
|
79
79
|
},
|
|
80
|
+
"./math": {
|
|
81
|
+
"types": "./lib/types/math/index.d.ts",
|
|
82
|
+
"import": "./lib/addons/math.js"
|
|
83
|
+
},
|
|
80
84
|
"./embed": {
|
|
81
85
|
"types": "./lib/types/embed/index.d.ts",
|
|
82
86
|
"import": "./lib/embed/tinyfly-embed.js"
|
|
@@ -153,7 +157,7 @@
|
|
|
153
157
|
"test": "vitest",
|
|
154
158
|
"test:run": "vitest run",
|
|
155
159
|
"build:addons": "vite build --config vite.config.addons.ts",
|
|
156
|
-
"build:browser": "vite build --config vite.config.browser.ts && vite build --config vite.config.browser-maps.ts && vite build --config vite.config.browser-scene-3d.ts && vite build --config vite.config.browser-scene-3d-webgl.ts",
|
|
160
|
+
"build:browser": "vite build --config vite.config.browser.ts && vite build --config vite.config.browser-maps.ts && vite build --config vite.config.browser-scene-3d.ts && vite build --config vite.config.browser-scene-3d-webgl.ts && vite build --config vite.config.browser-math.ts",
|
|
157
161
|
"prepublishOnly": "npm run test:run && npm run build:libs",
|
|
158
162
|
"e2e": "node e2e/run.mjs",
|
|
159
163
|
"release:oss": "./scripts/publish-oss.sh --push",
|