manim-web 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/export/SlideDeckExporter.d.ts +210 -0
- package/dist/export/SlideDeckExporter.d.ts.map +1 -0
- package/dist/export/index.d.ts +1 -0
- package/dist/export/index.d.ts.map +1 -1
- package/dist/html2canvas-DECPJJGt.js +4025 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es-BiZp4vgJ.js +5753 -0
- package/dist/index.js +3 -3
- package/dist/integrations/react.js +17 -17
- package/dist/integrations/vue.js +16 -16
- package/dist/jspdf.es.min-CvMJL6nS.js +18228 -0
- package/dist/manim-web.browser.js +5532 -3742
- package/dist/mobjects/graph/ForceDirectedLayout.d.ts +65 -0
- package/dist/mobjects/graph/ForceDirectedLayout.d.ts.map +1 -0
- package/dist/mobjects/graph/GenericGraph.d.ts +11 -0
- package/dist/mobjects/graph/GenericGraph.d.ts.map +1 -1
- package/dist/mobjects/graph/SankeyDiagram.d.ts +122 -0
- package/dist/mobjects/graph/SankeyDiagram.d.ts.map +1 -0
- package/dist/mobjects/graph/index.d.ts +4 -1
- package/dist/mobjects/graph/index.d.ts.map +1 -1
- package/dist/mobjects/graph/layoutAlgorithms.d.ts +54 -0
- package/dist/mobjects/graph/layoutAlgorithms.d.ts.map +1 -1
- package/dist/mobjects/graph/sankeyLayout.d.ts +97 -0
- package/dist/mobjects/graph/sankeyLayout.d.ts.map +1 -0
- package/dist/mobjects/graphing/BoxPlot.d.ts +99 -0
- package/dist/mobjects/graphing/BoxPlot.d.ts.map +1 -0
- package/dist/mobjects/graphing/CandlestickChart.d.ts +191 -0
- package/dist/mobjects/graphing/CandlestickChart.d.ts.map +1 -0
- package/dist/mobjects/graphing/DomainColoring.d.ts +114 -0
- package/dist/mobjects/graphing/DomainColoring.d.ts.map +1 -0
- package/dist/mobjects/graphing/FourierEpicycles.d.ts +149 -0
- package/dist/mobjects/graphing/FourierEpicycles.d.ts.map +1 -0
- package/dist/mobjects/graphing/FourierSeries.d.ts +60 -0
- package/dist/mobjects/graphing/FourierSeries.d.ts.map +1 -0
- package/dist/mobjects/graphing/Histogram.d.ts +71 -0
- package/dist/mobjects/graphing/Histogram.d.ts.map +1 -0
- package/dist/mobjects/graphing/ScatterPlot.d.ts +66 -0
- package/dist/mobjects/graphing/ScatterPlot.d.ts.map +1 -0
- package/dist/mobjects/graphing/ViolinPlot.d.ts +83 -0
- package/dist/mobjects/graphing/ViolinPlot.d.ts.map +1 -0
- package/dist/mobjects/graphing/fourier.d.ts +104 -0
- package/dist/mobjects/graphing/fourier.d.ts.map +1 -0
- package/dist/mobjects/graphing/index.d.ts +10 -0
- package/dist/mobjects/graphing/index.d.ts.map +1 -1
- package/dist/mobjects/graphing/stats.d.ts +128 -0
- package/dist/mobjects/graphing/stats.d.ts.map +1 -0
- package/dist/purify.es-MUrypqLF.js +864 -0
- package/dist/serialization/index.d.ts +2 -0
- package/dist/serialization/index.d.ts.map +1 -1
- package/dist/serialization/urlState.d.ts +127 -0
- package/dist/serialization/urlState.d.ts.map +1 -0
- package/dist/{src-BRT6RDfk.js → src-Dq6hmMfV.js} +3347 -1557
- package/dist/typeof-CcP5rTWg.js +11 -0
- package/package.json +2 -1
|
@@ -12,4 +12,6 @@
|
|
|
12
12
|
export { serializeScene, deserializeScene, serializeMobject, deserializeMobject, } from './serialize';
|
|
13
13
|
export { registerSerializableMobject, unregisterSerializableMobject, getSerializer, getSerializableTypes, } from './registry';
|
|
14
14
|
export type { SerializedScene, SerializedMobject, SerializedTransform, SerializedStyle, MobjectSerializer, SceneLike, ContainerLike, Vec3, } from './types';
|
|
15
|
+
export { encodeStateToHash, decodeStateFromHash, writeStateToUrl, readStateFromUrl, onUrlStateChange, bindStateToUrl, } from './urlState';
|
|
16
|
+
export type { WriteStateOptions, BindUrlStateOptions, UrlStateBinding, UrlStateController, } from './urlState';
|
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/serialization/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACb,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,IAAI,GACL,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/serialization/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACb,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,IAAI,GACL,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL-state permalinks for explorables.
|
|
3
|
+
*
|
|
4
|
+
* Turn the live state of an explorable (MovablePoint positions, Slider values,
|
|
5
|
+
* PanZoom camera) into a compact, shareable URL and restore it on load. This is
|
|
6
|
+
* the Desmos/Observable "share this view" behavior: one link reproduces the
|
|
7
|
+
* reader's interactive state.
|
|
8
|
+
*
|
|
9
|
+
* The state is any JSON-serializable value. It is `JSON.stringify`-ed, encoded
|
|
10
|
+
* as UTF-8 bytes, then written as an unpadded base64url string, so the result
|
|
11
|
+
* is URL-safe (only `A-Z a-z 0-9 - _`) and needs no percent-escaping in a hash.
|
|
12
|
+
*
|
|
13
|
+
* Every `window` / `location` / `history` access is guarded, so each function
|
|
14
|
+
* degrades to a no-op (or `null`) without throwing in a headless environment.
|
|
15
|
+
*/
|
|
16
|
+
/** Options for {@link bindStateToUrl}. */
|
|
17
|
+
export interface BindUrlStateOptions {
|
|
18
|
+
/** Use `history.replaceState` (no new history entry) when saving. Default: true. */
|
|
19
|
+
replace?: boolean;
|
|
20
|
+
/** Apply the URL state to the controls immediately on bind. Default: true. */
|
|
21
|
+
restoreOnBind?: boolean;
|
|
22
|
+
/** Re-apply the URL state to the controls on every `hashchange`. Default: true. */
|
|
23
|
+
listen?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One control's serializable state, keyed by a stable user-provided id.
|
|
27
|
+
*
|
|
28
|
+
* The controls (MovablePoint, Slider, PanZoomControls) have no registered scene
|
|
29
|
+
* serializer for their interactive state, so a permalink captures a small
|
|
30
|
+
* explicit `{ id: value }` map: `get` reads the live value, `set` restores it.
|
|
31
|
+
*/
|
|
32
|
+
export interface UrlStateBinding {
|
|
33
|
+
/** Stable id used as the key in the encoded `{ id: value }` map. */
|
|
34
|
+
id: string;
|
|
35
|
+
/** Read the current JSON-serializable value of this control. */
|
|
36
|
+
get: () => unknown;
|
|
37
|
+
/** Apply a decoded value back to this control. */
|
|
38
|
+
set: (value: unknown) => void;
|
|
39
|
+
}
|
|
40
|
+
/** Handle returned by {@link bindStateToUrl}. */
|
|
41
|
+
export interface UrlStateController {
|
|
42
|
+
/** Read the current value of every binding into an `{ id: value }` map. */
|
|
43
|
+
capture: () => Record<string, unknown>;
|
|
44
|
+
/** Capture the current state and write it to the URL hash. */
|
|
45
|
+
save: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Read the URL hash and apply it to the bindings. Returns `true` when a valid
|
|
48
|
+
* state was found and applied, `false` otherwise.
|
|
49
|
+
*/
|
|
50
|
+
restore: () => boolean;
|
|
51
|
+
/** Stop listening for `hashchange` (when `listen` was enabled). */
|
|
52
|
+
dispose: () => void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Encode a JSON-serializable state to a compact, URL-safe string.
|
|
56
|
+
*
|
|
57
|
+
* The result contains only `A-Z a-z 0-9 - _`, so it is safe to drop into a URL
|
|
58
|
+
* hash without percent-escaping.
|
|
59
|
+
*
|
|
60
|
+
* @param state - Any JSON-serializable value.
|
|
61
|
+
* @returns The base64url-encoded JSON.
|
|
62
|
+
*/
|
|
63
|
+
export declare function encodeStateToHash(state: unknown): string;
|
|
64
|
+
/**
|
|
65
|
+
* Decode a hash string produced by {@link encodeStateToHash} back to its state.
|
|
66
|
+
*
|
|
67
|
+
* A leading `#` is tolerated. A malformed or empty hash yields `null` and never
|
|
68
|
+
* throws.
|
|
69
|
+
*
|
|
70
|
+
* @param hash - The encoded string, with or without a leading `#`.
|
|
71
|
+
* @returns The decoded state, or `null` when the hash is empty or invalid.
|
|
72
|
+
*/
|
|
73
|
+
export declare function decodeStateFromHash(hash: string): unknown;
|
|
74
|
+
/** Options for {@link writeStateToUrl}. */
|
|
75
|
+
export interface WriteStateOptions {
|
|
76
|
+
/**
|
|
77
|
+
* Replace the current history entry instead of pushing a new one. A replace
|
|
78
|
+
* does not create a back-button step and does not fire `hashchange`.
|
|
79
|
+
* Default: false.
|
|
80
|
+
*/
|
|
81
|
+
replace?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Write a state to `location.hash`. No-op when there is no DOM.
|
|
85
|
+
*
|
|
86
|
+
* @param state - Any JSON-serializable value.
|
|
87
|
+
* @param options - `replace` to overwrite the current history entry.
|
|
88
|
+
*/
|
|
89
|
+
export declare function writeStateToUrl(state: unknown, options?: WriteStateOptions): void;
|
|
90
|
+
/**
|
|
91
|
+
* Read and decode the state from the current `location.hash`.
|
|
92
|
+
*
|
|
93
|
+
* @returns The decoded state, or `null` when there is no DOM, no hash, or the
|
|
94
|
+
* hash is invalid.
|
|
95
|
+
*/
|
|
96
|
+
export declare function readStateFromUrl(): unknown;
|
|
97
|
+
/**
|
|
98
|
+
* Listen for `hashchange` and call `cb` with the newly decoded state.
|
|
99
|
+
*
|
|
100
|
+
* @param cb - Called with the decoded state (or `null`) on every hash change.
|
|
101
|
+
* @returns An unsubscribe function. A no-op when there is no DOM.
|
|
102
|
+
*/
|
|
103
|
+
export declare function onUrlStateChange(cb: (state: unknown) => void): () => void;
|
|
104
|
+
/**
|
|
105
|
+
* Bind a set of explorable controls to the URL hash.
|
|
106
|
+
*
|
|
107
|
+
* Each binding exposes a stable id, a getter and a setter. On bind the current
|
|
108
|
+
* URL state is applied to the controls (so a shared link restores the view),
|
|
109
|
+
* and `save()` captures the controls back into the URL. When `listen` is on,
|
|
110
|
+
* the controls also follow back/forward navigation through `hashchange`.
|
|
111
|
+
*
|
|
112
|
+
* @param bindings - One {@link UrlStateBinding} per control.
|
|
113
|
+
* @param options - Bind-time behavior (replace, restoreOnBind, listen).
|
|
114
|
+
* @returns A {@link UrlStateController} to capture, save, restore and dispose.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* const controller = bindStateToUrl([
|
|
119
|
+
* { id: 'p', get: () => point.getPoint(), set: (v) => point.setPoint(v as Vector3Tuple) },
|
|
120
|
+
* { id: 's', get: () => slider.getValue(), set: (v) => slider.setValue(v as number) },
|
|
121
|
+
* ]);
|
|
122
|
+
* // after a drag:
|
|
123
|
+
* controller.save();
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare function bindStateToUrl(bindings: readonly UrlStateBinding[], options?: BindUrlStateOptions): UrlStateController;
|
|
127
|
+
//# sourceMappingURL=urlState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlState.d.ts","sourceRoot":"","sources":["../../src/serialization/urlState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,gEAAgE;IAChE,GAAG,EAAE,MAAM,OAAO,CAAC;IACnB,kDAAkD;IAClD,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/B;AAED,iDAAiD;AACjD,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,8DAA8D;IAC9D,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,mEAAmE;IACnE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAoDD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWzD;AAYD,2CAA2C;AAC3C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,iBAAsB,GAAG,IAAI,CAarF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAI1C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAOzE;AAuBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAmBpB"}
|