manim-web 0.3.24 → 0.10.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 +5 -1
- package/dist/{MathJaxBundle-xSidSV0E.js → MathJaxBundle-BSrlS0Dh.js} +3338 -3320
- package/dist/animation/Always.d.ts +72 -0
- package/dist/animation/Always.d.ts.map +1 -0
- package/dist/animation/AlwaysRedraw.d.ts +15 -0
- package/dist/animation/AlwaysRedraw.d.ts.map +1 -0
- package/dist/animation/Animation.d.ts +9 -0
- package/dist/animation/Animation.d.ts.map +1 -1
- package/dist/animation/AnimationUtilities.d.ts +25 -0
- package/dist/animation/AnimationUtilities.d.ts.map +1 -1
- package/dist/animation/creation/Create.d.ts +40 -11
- package/dist/animation/creation/Create.d.ts.map +1 -1
- package/dist/animation/transform/PointMorphStrategy.d.ts +6 -0
- package/dist/animation/transform/PointMorphStrategy.d.ts.map +1 -1
- package/dist/animation/transform/Transform.d.ts.map +1 -1
- package/dist/animation/transform/TransformPairing.d.ts +17 -0
- package/dist/animation/transform/TransformPairing.d.ts.map +1 -1
- package/dist/animation/updaters.d.ts +69 -0
- package/dist/animation/updaters.d.ts.map +1 -0
- package/dist/compiler-CfW6eH2M.js +2 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/parity.d.ts +78 -0
- package/dist/constants/parity.d.ts.map +1 -0
- package/dist/core/Mobject.d.ts +48 -3
- package/dist/core/Mobject.d.ts.map +1 -1
- package/dist/core/MobjectTraversal.d.ts +7 -0
- package/dist/core/MobjectTraversal.d.ts.map +1 -1
- package/dist/core/MobjectTypes.d.ts +15 -0
- package/dist/core/MobjectTypes.d.ts.map +1 -1
- package/dist/core/Scene.d.ts +14 -0
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/core/SpecialThreeDScene.d.ts +64 -0
- package/dist/core/SpecialThreeDScene.d.ts.map +1 -0
- package/dist/core/VMobject.d.ts +143 -0
- package/dist/core/VMobject.d.ts.map +1 -1
- package/dist/core/VMobjectColorGradient.d.ts +20 -0
- package/dist/core/VMobjectColorGradient.d.ts.map +1 -0
- package/dist/core/VMobjectCurveMath.d.ts +128 -0
- package/dist/core/VMobjectCurveMath.d.ts.map +1 -0
- package/dist/core/VMobjectRendering.d.ts +38 -1
- package/dist/core/VMobjectRendering.d.ts.map +1 -1
- package/dist/core/VMobjectRoundCorners.d.ts +37 -0
- package/dist/core/VMobjectRoundCorners.d.ts.map +1 -0
- package/dist/esm-CiMKSfxz.js +1273 -0
- package/dist/export/GifExporter.d.ts +4 -0
- package/dist/export/GifExporter.d.ts.map +1 -1
- package/dist/global-compiler-D_nF-JaV.js +8 -0
- package/dist/global-renderer-gyshX_QF.js +8 -0
- package/dist/index.d.ts +25 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/integrations/react.js +16 -16
- package/dist/integrations/vue.js +15 -15
- package/dist/manim-web.browser.js +9253 -6422
- package/dist/mobjects/geometry/AngleShapes.d.ts.map +1 -1
- package/dist/mobjects/geometry/ArcPolygon.d.ts +30 -0
- package/dist/mobjects/geometry/ArcPolygon.d.ts.map +1 -1
- package/dist/mobjects/geometry/DashedLine.d.ts.map +1 -1
- package/dist/mobjects/geometry/Label.d.ts +32 -0
- package/dist/mobjects/geometry/Label.d.ts.map +1 -0
- package/dist/mobjects/geometry/index.d.ts +2 -1
- package/dist/mobjects/geometry/index.d.ts.map +1 -1
- package/dist/mobjects/graphing/Axes.d.ts +73 -6
- package/dist/mobjects/graphing/Axes.d.ts.map +1 -1
- package/dist/mobjects/graphing/CoordinateSystem.d.ts +40 -0
- package/dist/mobjects/graphing/CoordinateSystem.d.ts.map +1 -0
- package/dist/mobjects/graphing/axes-calculus.d.ts +79 -0
- package/dist/mobjects/graphing/axes-calculus.d.ts.map +1 -0
- package/dist/mobjects/graphing/index.d.ts +3 -0
- package/dist/mobjects/graphing/index.d.ts.map +1 -1
- package/dist/mobjects/graphing/scale.d.ts +72 -0
- package/dist/mobjects/graphing/scale.d.ts.map +1 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts +5 -0
- package/dist/mobjects/text/MathJaxRenderer.d.ts.map +1 -1
- package/dist/mobjects/text/MathTex.d.ts +23 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -1
- package/dist/mobjects/text/MathTexImage.d.ts.map +1 -1
- package/dist/mobjects/text/Text.d.ts +53 -0
- package/dist/mobjects/text/Text.d.ts.map +1 -1
- package/dist/mobjects/text/Typst.d.ts +113 -0
- package/dist/mobjects/text/Typst.d.ts.map +1 -0
- package/dist/mobjects/text/TypstRenderer.d.ts +57 -0
- package/dist/mobjects/text/TypstRenderer.d.ts.map +1 -0
- package/dist/mobjects/text/index.d.ts +5 -2
- package/dist/mobjects/text/index.d.ts.map +1 -1
- package/dist/mobjects/text/katexStyles.d.ts +5 -0
- package/dist/mobjects/text/katexStyles.d.ts.map +1 -1
- package/dist/mobjects/text/registerFont.d.ts +38 -0
- package/dist/mobjects/text/registerFont.d.ts.map +1 -0
- package/dist/mobjects/text/textStyleRuns.d.ts +111 -0
- package/dist/mobjects/text/textStyleRuns.d.ts.map +1 -0
- package/dist/mobjects/three-d/ThreeDAxes.d.ts +37 -4
- package/dist/mobjects/three-d/ThreeDAxes.d.ts.map +1 -1
- package/dist/mobjects/three-d/threeDVmobUtils.d.ts +25 -0
- package/dist/mobjects/three-d/threeDVmobUtils.d.ts.map +1 -0
- package/dist/renderer-DR_79fB0.js +2 -0
- package/dist/{src-Cc3xTIkV.js → src-D29Z9zIa.js} +8796 -5974
- package/dist/utils/ManimColor.d.ts +163 -0
- package/dist/utils/ManimColor.d.ts.map +1 -0
- package/dist/utils/bezier.d.ts +95 -0
- package/dist/utils/bezier.d.ts.map +1 -0
- package/dist/utils/color.d.ts +99 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/debug.d.ts +36 -0
- package/dist/utils/debug.d.ts.map +1 -0
- package/dist/utils/iterables.d.ts +162 -0
- package/dist/utils/iterables.d.ts.map +1 -0
- package/dist/utils/paths.d.ts +38 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/simpleFunctions.d.ts +26 -0
- package/dist/utils/simpleFunctions.d.ts.map +1 -0
- package/dist/utils/spaceOps.d.ts +119 -0
- package/dist/utils/spaceOps.d.ts.map +1 -0
- package/dist/utils/unit.d.ts +28 -0
- package/dist/utils/unit.d.ts.map +1 -0
- package/dist/wasm-CIlzm7By.js +76 -0
- package/dist/wasm-pack-shim-B3C4KoWa.js +1688 -0
- package/dist/wasm-pack-shim-BgTFpSvJ.js +911 -0
- package/package.json +11 -7
|
@@ -2,6 +2,7 @@ import { Vector3Tuple } from '../../core/Mobject';
|
|
|
2
2
|
import { TexturedMobject } from '../../core/TexturedMobject';
|
|
3
3
|
import { TextGlyphGroup } from './TextGlyphGroup';
|
|
4
4
|
import { SkeletonizeOptions } from '../../utils/skeletonize';
|
|
5
|
+
import { TextStyleMaps, TextStyleRun, StyledTextParams } from './textStyleRuns';
|
|
5
6
|
import * as THREE from 'three';
|
|
6
7
|
/**
|
|
7
8
|
* Options for creating a Text mobject
|
|
@@ -31,6 +32,21 @@ export interface TextOptions {
|
|
|
31
32
|
textAlign?: 'left' | 'center' | 'right';
|
|
32
33
|
/** URL to a font file (OTF/TTF) for glyph vector extraction. When provided, loadGlyphs() can extract glyph outlines for stroke-draw animation. */
|
|
33
34
|
fontUrl?: string;
|
|
35
|
+
/** Per-substring color map (text-to-color), as in Manim CE. Colors every occurrence of each substring. */
|
|
36
|
+
t2c?: Record<string, string>;
|
|
37
|
+
/** Per-substring font-weight map (text-to-weight), e.g. { bold: 'bold' }. */
|
|
38
|
+
t2w?: Record<string, string | number>;
|
|
39
|
+
/** Per-substring font-style map (text-to-slant), e.g. { x: 'italic' }. */
|
|
40
|
+
t2s?: Record<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* Linear color gradient fill, as in Manim CE `Text(..., gradient=(A, B, ...))`.
|
|
43
|
+
* Provide 2+ CSS colors. The text fills with a horizontal left-to-right
|
|
44
|
+
* gradient that spans its rendered box, with the colors evenly spaced across
|
|
45
|
+
* [0, 1]. The gradient takes precedence over the flat `color`. It composes
|
|
46
|
+
* with `t2c`: a substring colored by `t2c` keeps that color, and only the
|
|
47
|
+
* remaining (un-colored) characters take the gradient.
|
|
48
|
+
*/
|
|
49
|
+
gradient?: string[];
|
|
34
50
|
}
|
|
35
51
|
export declare class Text extends TexturedMobject {
|
|
36
52
|
protected _text: string;
|
|
@@ -45,6 +61,10 @@ export declare class Text extends TexturedMobject {
|
|
|
45
61
|
protected _textAlign: 'left' | 'center' | 'right';
|
|
46
62
|
/** Optional font URL for glyph vector extraction */
|
|
47
63
|
protected _fontUrl?: string;
|
|
64
|
+
/** Per-substring style maps (t2c/t2w/t2s). Empty when no styling requested. */
|
|
65
|
+
protected _styleMaps: TextStyleMaps;
|
|
66
|
+
/** Linear color gradient (2+ colors), or null when the fill is flat. */
|
|
67
|
+
protected _gradient: string[] | null;
|
|
48
68
|
/** Cached glyph group (created lazily by loadGlyphs) */
|
|
49
69
|
protected _glyphGroup: TextGlyphGroup | null;
|
|
50
70
|
/** Off-screen canvas for text rendering */
|
|
@@ -72,6 +92,24 @@ export declare class Text extends TexturedMobject {
|
|
|
72
92
|
* @returns this for chaining
|
|
73
93
|
*/
|
|
74
94
|
setText(text: string): this;
|
|
95
|
+
/**
|
|
96
|
+
* Get the per-substring style layout model: lines of styled runs.
|
|
97
|
+
*
|
|
98
|
+
* This is the testable model behind `t2c`/`t2w`/`t2s`. A run's null fields
|
|
99
|
+
* fall back to the Text base color/weight/style at render time.
|
|
100
|
+
*/
|
|
101
|
+
getStyledTextLines(): TextStyleRun[][];
|
|
102
|
+
/**
|
|
103
|
+
* Get the configured linear gradient colors, or null when the fill is flat.
|
|
104
|
+
* Returns a copy so callers cannot mutate the internal state.
|
|
105
|
+
*/
|
|
106
|
+
getGradient(): string[] | null;
|
|
107
|
+
/**
|
|
108
|
+
* True when this Text renders through the styled-run canvas path: either a
|
|
109
|
+
* per-substring style map (t2c/t2w/t2s) or an active color gradient is set.
|
|
110
|
+
* Plain Text with none of these keeps the original flat render path.
|
|
111
|
+
*/
|
|
112
|
+
protected _usesStyledPath(): boolean;
|
|
75
113
|
/**
|
|
76
114
|
* Get the current font size
|
|
77
115
|
*/
|
|
@@ -121,6 +159,21 @@ export declare class Text extends TexturedMobject {
|
|
|
121
159
|
* Draw text with custom letter spacing
|
|
122
160
|
*/
|
|
123
161
|
protected _drawTextWithLetterSpacing(text: string, startX: number, y: number, _fontSize: number): void;
|
|
162
|
+
/** Collect the style and layout fields the styled canvas path needs. */
|
|
163
|
+
protected _styledTextParams(): StyledTextParams;
|
|
164
|
+
/**
|
|
165
|
+
* Measure styled (t2c/t2w/t2s) text via the shared styled-run layout helper.
|
|
166
|
+
*/
|
|
167
|
+
protected _measureStyledText(): {
|
|
168
|
+
lines: string[];
|
|
169
|
+
width: number;
|
|
170
|
+
height: number;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Render styled (t2c/t2w/t2s) text through the shared styled-run renderer,
|
|
174
|
+
* then store the resulting world-space size.
|
|
175
|
+
*/
|
|
176
|
+
protected _renderStyledToCanvas(): void;
|
|
124
177
|
/**
|
|
125
178
|
* Update the mesh geometry to match new dimensions
|
|
126
179
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/Text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Text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M,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAOlF;;;OAGG;IACH,SAAS,CAAC,qBAAqB,IAAI,IAAI;IAsBvC;;OAEG;IACH,SAAS,CAAC,WAAW,IAAI,IAAI;IAU7B;;OAEG;cACgB,kBAAkB,IAAI,KAAK,CAAC,QAAQ;IAmC9C,oBAAoB,IAAI,MAAM;IAI9B,gBAAgB,IAAI,KAAK,CAAC,IAAI,EAAE;IAYzC,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IA0B9C,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAQ9C,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAepD;;OAEG;cACgB,oBAAoB,IAAI,IAAI;IAc/C;;OAEG;IACH,aAAa,IAAI,cAAc,GAAG,IAAI;IAItC;;;;;;;;OAQG;IACG,UAAU,CAAC,OAAO,CAAC,EAAE;QACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,eAAe,CAAC,EAAE,kBAAkB,CAAC;KACtC,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IA+BlC;;OAEG;IACH,cAAc,IAAI,KAAK,CAAC,IAAI,GAAG,IAAI;IAInC;;OAEG;IACM,SAAS,IAAI,YAAY;IAIlC;;OAEG;IACM,IAAI,IAAI,IAAI;IAwBrB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAY9C;;OAEG;IACM,OAAO,IAAI,IAAI;CAUzB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { VGroup } from '../../core/VGroup';
|
|
2
|
+
import { Vector3Tuple } from '../../core/Mobject';
|
|
3
|
+
export interface TypstOptions {
|
|
4
|
+
/** Typst markup to compile. For `MathTypst`, math-mode content without `$`. */
|
|
5
|
+
typst: string;
|
|
6
|
+
/** Color as CSS color string. Default: WHITE ('#ffffff'). */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** Scale factor (1 = standard size). Default: DEFAULT_FONT_SIZE_PT. */
|
|
9
|
+
fontSize?: number;
|
|
10
|
+
/** Position in 3D space. Default: [0, 0, 0]. */
|
|
11
|
+
position?: Vector3Tuple;
|
|
12
|
+
/** Stroke width for glyph outlines. Default: 0.00001. */
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
/** Fill opacity for glyph interiors. Default: 1. */
|
|
15
|
+
fillOpacity?: number;
|
|
16
|
+
/** Explicit target height in world units. Overrides fontSize scaling. */
|
|
17
|
+
height?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Options for `MathTypst` (identical shape to `TypstOptions`). */
|
|
20
|
+
export type MathTypstOptions = TypstOptions;
|
|
21
|
+
export declare class Typst extends VGroup {
|
|
22
|
+
/** Raw markup the user passed (before any math-mode wrapping). */
|
|
23
|
+
protected _typst: string;
|
|
24
|
+
/** Actual source compiled by Typst (wrapped for math mode in `MathTypst`). */
|
|
25
|
+
protected _source: string;
|
|
26
|
+
protected _fontSize: number;
|
|
27
|
+
protected _color: string;
|
|
28
|
+
protected _svgStrokeWidth: number;
|
|
29
|
+
protected _svgFillOpacity: number;
|
|
30
|
+
protected _targetHeight: number | undefined;
|
|
31
|
+
/** Promise that resolves when rendering is complete. */
|
|
32
|
+
protected _renderPromise: Promise<void> | null;
|
|
33
|
+
/** Error from rendering, if any. */
|
|
34
|
+
protected _renderError: Error | null;
|
|
35
|
+
constructor(options: TypstOptions);
|
|
36
|
+
/**
|
|
37
|
+
* Build the Typst source actually compiled from the user's markup.
|
|
38
|
+
* The base `Typst` compiles the markup verbatim; `MathTypst` overrides this to
|
|
39
|
+
* wrap the markup in math-mode delimiters.
|
|
40
|
+
*
|
|
41
|
+
* Pure (depends only on its argument), so it is safe to call from the base
|
|
42
|
+
* constructor before subclass fields initialize.
|
|
43
|
+
*/
|
|
44
|
+
protected _buildSource(markup: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Wait for the Typst markup to finish compiling and rendering.
|
|
47
|
+
*/
|
|
48
|
+
waitForRender(): Promise<void>;
|
|
49
|
+
/** Get the raw markup the user passed. */
|
|
50
|
+
getTypst(): string;
|
|
51
|
+
/** Get the actual Typst source compiled (math-wrapped for `MathTypst`). */
|
|
52
|
+
getSource(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Get the render error, if any. Returns null when rendering succeeded or is
|
|
55
|
+
* still in progress.
|
|
56
|
+
*/
|
|
57
|
+
getRenderError(): Error | null;
|
|
58
|
+
/**
|
|
59
|
+
* World-space center. An empty (not-yet-rendered) Typst falls back to its
|
|
60
|
+
* world-space origin instead of throwing, because Typst is built lazily and
|
|
61
|
+
* `scale()` / `moveTo()` may run before the SVG geometry exists.
|
|
62
|
+
*/
|
|
63
|
+
getCenter(): Vector3Tuple;
|
|
64
|
+
/**
|
|
65
|
+
* Override setColor to propagate to all VMobject children (fill + stroke).
|
|
66
|
+
*/
|
|
67
|
+
setColor(color: string): this;
|
|
68
|
+
/**
|
|
69
|
+
* Start the async rendering process.
|
|
70
|
+
*/
|
|
71
|
+
protected _startRender(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Compile the Typst source to SVG and build VMobject paths.
|
|
74
|
+
*/
|
|
75
|
+
protected _render(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Restyle all VMobject children for solid glyph rendering.
|
|
78
|
+
*/
|
|
79
|
+
protected _restyleChildren(group: VGroup): void;
|
|
80
|
+
/**
|
|
81
|
+
* Scale and center the assembled paths by transforming point data directly.
|
|
82
|
+
*
|
|
83
|
+
* Unit flow mirrors MathTex: convert Typst SVG units to world units via the
|
|
84
|
+
* font-size baseline and `TYPST_SVG_UNITS_PER_EM`. An explicit `height`
|
|
85
|
+
* overrides the fontSize scaling with an exact target.
|
|
86
|
+
*/
|
|
87
|
+
protected _scaleToTarget(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Bake any pending parent `scaleVector` (e.g. from a pre-render `scale()`)
|
|
90
|
+
* into descendant geometry so post-render `shift` / `moveTo` operate in the
|
|
91
|
+
* same coordinate frame as the rendered glyphs (mirrors MathTex #324).
|
|
92
|
+
*/
|
|
93
|
+
protected _consumePendingScale(): void;
|
|
94
|
+
copy(): Typst;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* MathTypst - Typst in display math mode.
|
|
98
|
+
*
|
|
99
|
+
* Wraps the input in Typst math delimiters (`$ ... $`), mirroring how `MathTex`
|
|
100
|
+
* renders math while `Tex` renders text. The raw markup is kept verbatim in
|
|
101
|
+
* `getTypst()`; the wrapped form is what the compiler receives (`getSource()`).
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const eq = new MathTypst({ typst: 'sum_(k=1)^n k = frac(n(n + 1), 2)' });
|
|
106
|
+
* await eq.waitForRender();
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare class MathTypst extends Typst {
|
|
110
|
+
protected _buildSource(markup: string): string;
|
|
111
|
+
copy(): MathTypst;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=Typst.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typst.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/Typst.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiB9E,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,yD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AI,CAAC;IAsBxC;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAmB/C;;;;;;OAMG;IACH,SAAS,CAAC,cAAc,IAAI,IAAI;IAgDhC;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,IAAI,IAAI;IAuB7B,IAAI,IAAI,KAAK;CAavB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAU,SAAQ,KAAK;cACf,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI9C,IAAI,IAAI,SAAS;CAa3B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { VGroup } from '../../core/VGroup';
|
|
2
|
+
export interface TypstRenderOptions {
|
|
3
|
+
/** Stroke / fill color for the resulting VMobjects. Default: WHITE. */
|
|
4
|
+
color?: string;
|
|
5
|
+
/** Stroke width passed to the SVG importer. Default: 0.02. */
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
/** Fill opacity passed to the SVG importer. Default: 1. */
|
|
8
|
+
fillOpacity?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TypstRenderResult {
|
|
11
|
+
/** The root SVG element produced by the Typst compiler. */
|
|
12
|
+
svgElement: SVGElement;
|
|
13
|
+
/** VMobject group with one child per glyph / path. */
|
|
14
|
+
vmobjectGroup: VGroup;
|
|
15
|
+
/** Original SVG string (for debugging or caching). */
|
|
16
|
+
svgString: string;
|
|
17
|
+
/** Bounding width in the SVG's viewBox units. */
|
|
18
|
+
width: number;
|
|
19
|
+
/** Bounding height in the SVG's viewBox units. */
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A function that compiles a Typst source string to a full SVG string.
|
|
24
|
+
* Used as the dependency-injection seam: tests set a mock compiler so the
|
|
25
|
+
* real WASM compiler is never loaded.
|
|
26
|
+
*/
|
|
27
|
+
export type TypstSvgCompiler = (source: string) => Promise<string> | string;
|
|
28
|
+
/**
|
|
29
|
+
* Inject a Typst compiler, replacing the lazy-loaded WASM compiler.
|
|
30
|
+
*
|
|
31
|
+
* Pass a function that maps a Typst source string to an SVG string. Pass `null`
|
|
32
|
+
* to restore the default WASM-backed compiler. Tests use this to avoid any real
|
|
33
|
+
* WASM compile.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setTypstCompiler(compiler: TypstSvgCompiler | null): void;
|
|
36
|
+
/**
|
|
37
|
+
* Check whether the Typst compiler has already been loaded.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isTypstLoaded(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Pre-load the Typst compiler so the first render is fast.
|
|
42
|
+
* Call this early if you know Typst will be used.
|
|
43
|
+
*/
|
|
44
|
+
export declare function preloadTypst(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Compile a Typst source string to SVG and convert the result into VMobject
|
|
47
|
+
* paths suitable for manim-web animation.
|
|
48
|
+
*
|
|
49
|
+
* The returned VMobject coordinates are raw SVG viewBox units (not world units).
|
|
50
|
+
* The caller (`Typst`) applies the final point -> world conversion.
|
|
51
|
+
*
|
|
52
|
+
* @param source - The Typst source to compile (already wrapped for math mode
|
|
53
|
+
* by `MathTypst` when applicable).
|
|
54
|
+
* @param options - Rendering options.
|
|
55
|
+
*/
|
|
56
|
+
export declare function renderTypstToSVG(source: string, options?: TypstRenderOptions): Promise<TypstRenderResult>;
|
|
57
|
+
//# sourceMappingURL=TypstRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypstRenderer.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/TypstRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAQhD,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,UAAU,EAAE,UAAU,CAAC;IACvB,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAoB5E;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAExE;AA8BD;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAGlD;AAeD;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CA0D5B"}
|
|
@@ -5,16 +5,19 @@
|
|
|
5
5
|
* applied to Three.js plane meshes, as well as LaTeX rendering using KaTeX.
|
|
6
6
|
*/
|
|
7
7
|
export { Text, type TextOptions } from './Text';
|
|
8
|
+
export { type TextStyleMaps, type TextStyleRun, buildStyledTextLines } from './textStyleRuns';
|
|
8
9
|
export { GlyphVMobject, type GlyphVMobjectOptions } from './GlyphVMobject';
|
|
9
10
|
export { TextGlyphGroup, type TextGlyphGroupOptions } from './TextGlyphGroup';
|
|
10
11
|
export { Paragraph, type ParagraphOptions } from './Paragraph';
|
|
11
12
|
export { MarkupText, type MarkupTextOptions, type StyledTextSegment } from './MarkupText';
|
|
12
|
-
export { ensureKatexStyles, areKatexStylesLoaded } from './katexStyles';
|
|
13
|
+
export { ensureKatexStyles, areKatexStylesLoaded, setKatexStylesheetUrl } from './katexStyles';
|
|
13
14
|
export { MathTex, type MathTexOptions, MathTexSVG, type MathTexSVGOptions } from './MathTex';
|
|
14
15
|
export { MathTexImage, type MathTexImageOptions, type TexRenderer } from './MathTexImage';
|
|
15
|
-
export { renderLatexToSVG, preloadMathJax, isMathJaxLoaded, katexCanRender, type MathJaxRenderOptions, type MathJaxRenderResult, } from './MathJaxRenderer';
|
|
16
|
+
export { renderLatexToSVG, preloadMathJax, isMathJaxLoaded, katexCanRender, setMathJaxScriptUrl, type MathJaxRenderOptions, type MathJaxRenderResult, } from './MathJaxRenderer';
|
|
16
17
|
export { parseSVGPathData, svgToVMobjects, type SVGToVMobjectOptions } from './svgPathParser';
|
|
17
18
|
export { Tex, type TexOptions } from './Tex';
|
|
19
|
+
export { Typst, MathTypst, type TypstOptions, type MathTypstOptions } from './Typst';
|
|
20
|
+
export { renderTypstToSVG, preloadTypst, isTypstLoaded, setTypstCompiler, type TypstRenderOptions, type TypstRenderResult, type TypstSvgCompiler, } from './TypstRenderer';
|
|
18
21
|
export { DecimalNumber, Integer, type DecimalNumberOptions } from './DecimalNumber';
|
|
19
22
|
export { Variable, type VariableOptions } from './Variable';
|
|
20
23
|
export { Code, type CodeOptions, type CodeColorScheme, type Token, type TokenType, DEFAULT_COLOR_SCHEME, MONOKAI_COLOR_SCHEME, } from './Code';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAA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AAgB,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG9F,OAAO,EAAE,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAI7C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAGpF,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EACL,IAAI,EACJ,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EACL,mBAAmB,EACnB,KAAK,0BAA0B,EAC/B,WAAW,EACX,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC"}
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Ensures the KaTeX stylesheet is loaded for proper LaTeX rendering.
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Configure the stylesheet loaded by {@link ensureKatexStyles}.
|
|
8
|
+
* Pass `null` when the application bundles KaTeX CSS itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setKatexStylesheetUrl(url: string | null): void;
|
|
6
11
|
/**
|
|
7
12
|
* Ensure KaTeX styles are loaded in the document.
|
|
8
13
|
* This is called automatically by MathTex on first use.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"katexStyles.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/katexStyles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"katexStyles.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/katexStyles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAK9D;AA4BD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAGxC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAiClD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `registerFont` — register a custom font in the browser (CE `register_font`).
|
|
3
|
+
*
|
|
4
|
+
* CE's `register_font(path)` registers a font file with the system so Pango can
|
|
5
|
+
* use it when rasterizing text. The browser analog is the CSS Font Loading API:
|
|
6
|
+
* build a `FontFace` and add it to `document.fonts`. The browser then loads the
|
|
7
|
+
* font lazily the first time text uses the family, so adding the face is enough
|
|
8
|
+
* to make the family available — no eager `load()` call is required.
|
|
9
|
+
*
|
|
10
|
+
* The function is guarded for environments without the API (Node, test workers,
|
|
11
|
+
* server-side rendering): it returns `false` and does nothing when `document`,
|
|
12
|
+
* `document.fonts`, or `FontFace` is unavailable, so it is safe to call anywhere.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* A font source accepted by `registerFont`.
|
|
16
|
+
*
|
|
17
|
+
* - A `string` is a CSS source. A bare URL or path is wrapped as `url("…")`;
|
|
18
|
+
* a value that already starts with `url(` or `local(` is used verbatim.
|
|
19
|
+
* - A `BufferSource` (an `ArrayBuffer` or typed-array view) is font binary data,
|
|
20
|
+
* passed straight to the `FontFace` constructor.
|
|
21
|
+
*/
|
|
22
|
+
export type FontSource = string | BufferSource;
|
|
23
|
+
/**
|
|
24
|
+
* Register a custom font so text mobjects can use it by family name.
|
|
25
|
+
*
|
|
26
|
+
* @param family - The font-family name to register the source under.
|
|
27
|
+
* @param source - A CSS source string, a URL/path, or font binary data.
|
|
28
|
+
* @returns `true` when the font was registered, `false` when the CSS Font
|
|
29
|
+
* Loading API is unavailable (for example in Node or a test worker).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* registerFont('Inter', 'https://example.com/Inter.woff2');
|
|
34
|
+
* registerFont('Inter', 'url("/fonts/Inter.woff2")'); // explicit CSS source
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function registerFont(family: string, source: FontSource): boolean;
|
|
38
|
+
//# sourceMappingURL=registerFont.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerFont.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/registerFont.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAiBxE"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-substring style runs for the canvas-raster Text mobject.
|
|
3
|
+
*
|
|
4
|
+
* Manim CE lets `Text` color or restyle sub-strings through `t2c`
|
|
5
|
+
* (text-to-color), `t2w` (text-to-weight) and `t2s` (text-to-slant) maps. This
|
|
6
|
+
* module turns the plain text plus those maps into a layout model: a list of
|
|
7
|
+
* lines, each a list of styled runs. The model is pure and testable; the Text
|
|
8
|
+
* canvas renderer draws each run with its own font and color.
|
|
9
|
+
*/
|
|
10
|
+
/** Per-substring style maps, as in Manim CE `Text`. */
|
|
11
|
+
export interface TextStyleMaps {
|
|
12
|
+
/** Map from a substring to a CSS color. Colors every occurrence. */
|
|
13
|
+
t2c?: Record<string, string>;
|
|
14
|
+
/** Map from a substring to a font weight ('bold', 'normal', 100-900). */
|
|
15
|
+
t2w?: Record<string, string | number>;
|
|
16
|
+
/** Map from a substring to a font style ('italic', 'oblique', 'normal'). */
|
|
17
|
+
t2s?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
/** One run of characters that share the same resolved style. */
|
|
20
|
+
export interface TextStyleRun {
|
|
21
|
+
/** The run text (never contains a newline). */
|
|
22
|
+
text: string;
|
|
23
|
+
/** Resolved color, or null to use the Text base color. */
|
|
24
|
+
color: string | null;
|
|
25
|
+
/** Resolved font weight, or null to use the Text base weight. */
|
|
26
|
+
fontWeight: string | number | null;
|
|
27
|
+
/** Resolved font style, or null to use the Text base style. */
|
|
28
|
+
fontStyle: string | null;
|
|
29
|
+
}
|
|
30
|
+
/** True when at least one style map has an entry. */
|
|
31
|
+
export declare function hasStyleMaps(maps: TextStyleMaps): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Split `text` into lines on '\n', then each line into styled runs.
|
|
34
|
+
* An empty line yields an empty run list.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildStyledTextLines(text: string, maps: TextStyleMaps): TextStyleRun[][];
|
|
37
|
+
/** Base font fields a run falls back to when it has no override. */
|
|
38
|
+
export interface RunFontBase {
|
|
39
|
+
fontStyle: string;
|
|
40
|
+
fontWeight: string | number;
|
|
41
|
+
/** The scaled point size, used directly as `<n>pt` in the CSS font string. */
|
|
42
|
+
sizePt: number;
|
|
43
|
+
fontFamily: string;
|
|
44
|
+
}
|
|
45
|
+
/** Build the CSS canvas font string for one run, with base fallbacks. */
|
|
46
|
+
export declare function runFontString(run: TextStyleRun, base: RunFontBase): string;
|
|
47
|
+
/** One color stop of a linear gradient: an offset in [0, 1] and its CSS color. */
|
|
48
|
+
export interface GradientStop {
|
|
49
|
+
offset: number;
|
|
50
|
+
color: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Build evenly-spaced gradient color stops from a color list.
|
|
54
|
+
*
|
|
55
|
+
* Two colors map to offsets [0, 1], three to [0, 0.5, 1], and n colors to
|
|
56
|
+
* offset i/(n-1). The color order is preserved. A single color is degenerate:
|
|
57
|
+
* it yields one stop at offset 0, which fills a solid color. An empty list
|
|
58
|
+
* yields no stops.
|
|
59
|
+
*
|
|
60
|
+
* This is pure, so the stop math is unit-testable without a real canvas.
|
|
61
|
+
*/
|
|
62
|
+
export declare function buildGradientStops(colors: string[]): GradientStop[];
|
|
63
|
+
/**
|
|
64
|
+
* True when `gradient` can drive a linear gradient fill: it exists and has at
|
|
65
|
+
* least two colors, as Manim CE requires.
|
|
66
|
+
*/
|
|
67
|
+
export declare function gradientIsActive(gradient: string[] | null | undefined): gradient is string[];
|
|
68
|
+
/** Style and layout fields the styled canvas path needs from a Text instance. */
|
|
69
|
+
export interface StyledTextParams {
|
|
70
|
+
fontSize: number;
|
|
71
|
+
fontFamily: string;
|
|
72
|
+
fontStyle: string;
|
|
73
|
+
fontWeight: string | number;
|
|
74
|
+
lineHeight: number;
|
|
75
|
+
textAlign: 'left' | 'center' | 'right';
|
|
76
|
+
color: string;
|
|
77
|
+
fillOpacity: number;
|
|
78
|
+
strokeWidth: number;
|
|
79
|
+
/**
|
|
80
|
+
* Optional linear color gradient (2+ colors). When set, runs with no explicit
|
|
81
|
+
* color (no `t2c` match) fill with a horizontal left-to-right gradient that
|
|
82
|
+
* spans the text's rendered box. Runs with an explicit `t2c` color keep that
|
|
83
|
+
* color, so the gradient composes with `t2c` rather than overriding it.
|
|
84
|
+
*/
|
|
85
|
+
gradient?: string[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Measure styled text. Each run is measured with its own font so a bolder or
|
|
89
|
+
* italic run reserves the correct width. Letter spacing is not applied in
|
|
90
|
+
* styled mode so measure and render stay consistent.
|
|
91
|
+
*/
|
|
92
|
+
export declare function measureStyledText(ctx: CanvasRenderingContext2D, styledLines: TextStyleRun[][], params: StyledTextParams): {
|
|
93
|
+
lines: string[];
|
|
94
|
+
width: number;
|
|
95
|
+
height: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Draw styled text to the canvas and return its world-space size. Each run is
|
|
99
|
+
* drawn with its own font and color; x advances by the measured width of each
|
|
100
|
+
* run, so mixed-weight and mixed-style runs stay correctly spaced.
|
|
101
|
+
*
|
|
102
|
+
* The world-size conversion matches the plain Text path exactly.
|
|
103
|
+
*/
|
|
104
|
+
export declare function renderStyledTextToCanvas(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, styledLines: TextStyleRun[][], params: StyledTextParams, worldPerPt: {
|
|
105
|
+
defaultFontSizePt: number;
|
|
106
|
+
defaultFontSizeInWorld: number;
|
|
107
|
+
}): {
|
|
108
|
+
width: number;
|
|
109
|
+
height: number;
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=textStyleRuns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textStyleRuns.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/textStyleRuns.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IACtC,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,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AAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAuCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,wBAAwB,EAC7B,WAAW,EAAE,YAAY,EAAE,EAAE,EAC7B,MAAM,EAAE,gBAAgB,GACvB;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAcpD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,wBAAwB,EAC7B,WAAW,EAAE,YAAY,EAAE,EAAE,EAC7B,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAA;CAAE,GACxE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAgEnC"}
|
|
@@ -12,6 +12,22 @@ export interface ThreeDAxesOptions {
|
|
|
12
12
|
yRange?: [number, number, number];
|
|
13
13
|
/** Z-axis range as [min, max, step]. Default: [-4, 4, 1] */
|
|
14
14
|
zRange?: [number, number, number];
|
|
15
|
+
/**
|
|
16
|
+
* Visual length of the x-axis in scene units, independent of xRange.
|
|
17
|
+
* When omitted, defaults to the x-range span (xMax - xMin), so the axis
|
|
18
|
+
* keeps a 1:1 range-to-visual mapping (unchanged default behavior).
|
|
19
|
+
*/
|
|
20
|
+
xLength?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Visual length of the y-axis in scene units, independent of yRange.
|
|
23
|
+
* When omitted, defaults to the y-range span (yMax - yMin).
|
|
24
|
+
*/
|
|
25
|
+
yLength?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Visual length of the z-axis in scene units, independent of zRange.
|
|
28
|
+
* When omitted, defaults to the z-range span (zMax - zMin).
|
|
29
|
+
*/
|
|
30
|
+
zLength?: number;
|
|
15
31
|
/** Default color for all axes. Default: '#ffffff' */
|
|
16
32
|
axisColor?: string;
|
|
17
33
|
/** Color for x-axis (overrides axisColor). Default: same as axisColor */
|
|
@@ -85,6 +101,12 @@ export declare class ThreeDAxes extends Group {
|
|
|
85
101
|
private _xRange;
|
|
86
102
|
private _yRange;
|
|
87
103
|
private _zRange;
|
|
104
|
+
private _xLength;
|
|
105
|
+
private _yLength;
|
|
106
|
+
private _zLength;
|
|
107
|
+
private _xScale;
|
|
108
|
+
private _yScale;
|
|
109
|
+
private _zScale;
|
|
88
110
|
private _showTicks;
|
|
89
111
|
private _tickLength;
|
|
90
112
|
private _ticks;
|
|
@@ -99,6 +121,12 @@ export declare class ThreeDAxes extends Group {
|
|
|
99
121
|
private _labelOptions;
|
|
100
122
|
constructor(options?: ThreeDAxesOptions);
|
|
101
123
|
private _initRanges;
|
|
124
|
+
/**
|
|
125
|
+
* Resolve each axis visual length and its range-to-visual scale factor.
|
|
126
|
+
* When a length option is omitted, it defaults to the range span, which
|
|
127
|
+
* gives scale 1 and keeps the historical 1:1 mapping unchanged.
|
|
128
|
+
*/
|
|
129
|
+
private _initLengths;
|
|
102
130
|
private _initTickConfig;
|
|
103
131
|
private _initLabelConfig;
|
|
104
132
|
private _resolveAxisColors;
|
|
@@ -147,7 +175,9 @@ export declare class ThreeDAxes extends Group {
|
|
|
147
175
|
private _buildLabel;
|
|
148
176
|
/**
|
|
149
177
|
* Convert graph coordinates to visual point coordinates (scene space).
|
|
150
|
-
*
|
|
178
|
+
* Each graph coordinate is multiplied by its axis scale (length / span)
|
|
179
|
+
* before the axes' position offset is applied. With default lengths the
|
|
180
|
+
* scale is 1, so graph coordinates map directly to visual positions.
|
|
151
181
|
*/
|
|
152
182
|
coordsToPoint(x: number, y: number, z: number): Vector3Tuple;
|
|
153
183
|
/**
|
|
@@ -187,15 +217,18 @@ export declare class ThreeDAxes extends Group {
|
|
|
187
217
|
*/
|
|
188
218
|
getZRange(): [number, number, number];
|
|
189
219
|
/**
|
|
190
|
-
* Get the visual X length
|
|
220
|
+
* Get the visual X length in scene units. Equals the configured xLength,
|
|
221
|
+
* or the x-range span when xLength was omitted.
|
|
191
222
|
*/
|
|
192
223
|
getXLength(): number;
|
|
193
224
|
/**
|
|
194
|
-
* Get the visual Y length
|
|
225
|
+
* Get the visual Y length in scene units. Equals the configured yLength,
|
|
226
|
+
* or the y-range span when yLength was omitted.
|
|
195
227
|
*/
|
|
196
228
|
getYLength(): number;
|
|
197
229
|
/**
|
|
198
|
-
* Get the visual Z length
|
|
230
|
+
* Get the visual Z length in scene units. Equals the configured zLength,
|
|
231
|
+
* or the z-range span when zLength was omitted.
|
|
199
232
|
*/
|
|
200
233
|
getZLength(): number;
|
|
201
234
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreeDAxes.d.ts","sourceRoot":"","sources":["../../../src/mobjects/three-d/ThreeDAxes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAA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EAAE,MAAM,EAAE,MAAM,CAAC;IAIrC;;OAEG;IACH,SAAS,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIrC;;OAEG;IACH,SAAS,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIrC;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,SAAS,IAAI,YAAY;IAIzB;;OAEG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAIvB;;OAEG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAIvB;;OAEG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAIvB;;;;;;;;;;;;;;OAcG;IACH,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,GAAE,MAAa,GAAG,IAAI;IA8CxE;;OAEG;IACH,SAAS,IAAI,OAAO,GAAG,IAAI;IAI3B;;OAEG;IACH,SAAS,IAAI,OAAO,GAAG,IAAI;IAI3B;;OAEG;IACH,SAAS,IAAI,OAAO,GAAG,IAAI;IAI3B;;;;;;;;;;;OAWG;IACH,aAAa,CACX,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,EACzB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,EACzB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GACxB,KAAK;IAUR,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,qBAAqB;IAU7B;;OAEG;IACM,IAAI,IAAI,UAAU;CAmB5B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Vector3Tuple } from '../../core/MobjectTypes';
|
|
2
|
+
import { VMobject } from '../../core/VMobject';
|
|
3
|
+
/**
|
|
4
|
+
* The gradient start and end points, used by the 3D camera to shade a VMobject.
|
|
5
|
+
* Port of CE `get_3d_vmob_gradient_start_and_end_points`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function get3dVmobGradientStartAndEndPoints(vmob: VMobject): [Vector3Tuple, Vector3Tuple];
|
|
8
|
+
/** Index of the start corner (always 0). Port of CE `get_3d_vmob_start_corner_index`. */
|
|
9
|
+
export declare function get3dVmobStartCornerIndex(_vmob: VMobject): number;
|
|
10
|
+
/** Index of the end corner. Port of CE `get_3d_vmob_end_corner_index`. */
|
|
11
|
+
export declare function get3dVmobEndCornerIndex(vmob: VMobject): number;
|
|
12
|
+
/** The start corner point. Port of CE `get_3d_vmob_start_corner`. */
|
|
13
|
+
export declare function get3dVmobStartCorner(vmob: VMobject): Vector3Tuple;
|
|
14
|
+
/** The end corner point. Port of CE `get_3d_vmob_end_corner`. */
|
|
15
|
+
export declare function get3dVmobEndCorner(vmob: VMobject): Vector3Tuple;
|
|
16
|
+
/**
|
|
17
|
+
* The unit normal of the VMobject's surface at the given point index.
|
|
18
|
+
* Port of CE `get_3d_vmob_unit_normal`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function get3dVmobUnitNormal(vmob: VMobject, pointIndex: number): Vector3Tuple;
|
|
21
|
+
/** The unit normal at the start corner. Port of CE `get_3d_vmob_start_corner_unit_normal`. */
|
|
22
|
+
export declare function get3dVmobStartCornerUnitNormal(vmob: VMobject): Vector3Tuple;
|
|
23
|
+
/** The unit normal at the end corner. Port of CE `get_3d_vmob_end_corner_unit_normal`. */
|
|
24
|
+
export declare function get3dVmobEndCornerUnitNormal(vmob: VMobject): Vector3Tuple;
|
|
25
|
+
//# sourceMappingURL=threeDVmobUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threeDVmobUtils.d.ts","sourceRoot":"","sources":["../../../src/mobjects/three-d/threeDVmobUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAiBpD;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,QAAQ,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,CAE/F;AAED,yFAAyF;AACzF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAEjE;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAE9D;AAED,qEAAqE;AACrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAMjE;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAM/D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY,CAiBpF;AAED,8FAA8F;AAC9F,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAE3E;AAED,0FAA0F;AAC1F,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAEzE"}
|