@beff/aula 0.0.0-stage → 0.1.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 +8 -2
- package/dist/animations.d.ts +634 -0
- package/dist/animations.js +1793 -0
- package/dist/braces.d.ts +84 -0
- package/dist/braces.js +253 -0
- package/dist/card.d.ts +17 -0
- package/dist/card.js +90 -0
- package/dist/colors-palette.d.ts +2242 -0
- package/dist/colors-palette.js +2241 -0
- package/dist/colors.d.ts +120 -0
- package/dist/colors.js +403 -0
- package/dist/curves.d.ts +10 -0
- package/dist/curves.js +128 -0
- package/dist/engine.d.ts +1595 -0
- package/dist/engine.js +3364 -0
- package/dist/errors.d.ts +19 -0
- package/dist/errors.js +25 -0
- package/dist/generated/aula.conditional-suspending-3-i32-to-void.wasm +0 -0
- package/dist/generated/aula.core.wasm +0 -0
- package/dist/generated/aula.core2.wasm +0 -0
- package/dist/generated/aula.core3.wasm +0 -0
- package/dist/generated/aula.core4.wasm +0 -0
- package/dist/generated/aula.core5.wasm +0 -0
- package/dist/generated/aula.core6.wasm +0 -0
- package/dist/generated/aula.core7.wasm +0 -0
- package/dist/generated/aula.core8.wasm +0 -0
- package/dist/generated/aula.d.ts +80 -0
- package/dist/generated/aula.js +54639 -0
- package/dist/generated/interfaces/aula-engine-engine.d.ts +983 -0
- package/dist/generated/interfaces/aula-engine-host.d.ts +10 -0
- package/dist/generated/interfaces/aula-engine-tts.d.ts +43 -0
- package/dist/generated/interfaces/aula-engine-types.d.ts +60 -0
- package/dist/geometry.d.ts +551 -0
- package/dist/geometry.js +1821 -0
- package/dist/graph.d.ts +117 -0
- package/dist/graph.js +526 -0
- package/dist/graphing.d.ts +597 -0
- package/dist/graphing.js +1504 -0
- package/dist/host.d.ts +19 -0
- package/dist/host.js +85 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +11 -0
- package/dist/licenses/aula-g2p-NOTICE.txt +13 -0
- package/dist/licenses/espeak-ng-COPYING.txt +674 -0
- package/dist/licenses/fonts-OFL-JetBrainsMono.txt +93 -0
- package/dist/licenses/fonts-OFL-NunitoSans.txt +93 -0
- package/dist/load.d.ts +16 -0
- package/dist/load.js +69 -0
- package/dist/logo.d.ts +30 -0
- package/dist/logo.js +186 -0
- package/dist/manim.d.ts +22 -0
- package/dist/manim.js +19 -0
- package/dist/mobjects.d.ts +127 -0
- package/dist/mobjects.js +316 -0
- package/dist/pointcloud.d.ts +144 -0
- package/dist/pointcloud.js +400 -0
- package/dist/rates.d.ts +19 -0
- package/dist/rates.js +54 -0
- package/dist/run.d.ts +82 -0
- package/dist/run.js +245 -0
- package/dist/tables.d.ts +179 -0
- package/dist/tables.js +403 -0
- package/dist/tex.d.ts +8 -0
- package/dist/tex.js +257 -0
- package/dist/text-layouts.d.ts +64 -0
- package/dist/text-layouts.js +225 -0
- package/dist/text.d.ts +35 -0
- package/dist/text.js +52 -0
- package/dist/theme.d.ts +25 -0
- package/dist/theme.js +12 -0
- package/dist/user-code.d.ts +5 -0
- package/dist/user-code.js +20 -0
- package/dist/utils.d.ts +152 -0
- package/dist/utils.js +517 -0
- package/dist/vector-field.d.ts +132 -0
- package/dist/vector-field.js +361 -0
- package/package.json +45 -3
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import { type Color, type DecimalNumberMobject, type DecimalNumberOptions, type Point, type StyleOptions, Mobject } from "./engine.ts";
|
|
2
|
+
import { type LabelConstructor } from "./braces.ts";
|
|
3
|
+
import { Arrow, type TipShape } from "./geometry.ts";
|
|
4
|
+
import { type ParsableManimColor } from "./colors.ts";
|
|
5
|
+
import type { Mobject as RawMobject } from "./generated/interfaces/aula-engine-engine.js";
|
|
6
|
+
import { type VDictMobject } from "./mobjects.ts";
|
|
7
|
+
/** The scale of a NumberLine (Manim `_ScaleBase`): the value of a position on the line and
|
|
8
|
+
* back. */
|
|
9
|
+
export interface Scale {
|
|
10
|
+
/** The value at a linear position (Manim `function`). */
|
|
11
|
+
function(value: number): number;
|
|
12
|
+
/** The linear position of a value (Manim `inverse_function`). */
|
|
13
|
+
inverseFunction(value: number): number;
|
|
14
|
+
/** True when the axis labels come from `getCustomLabels`. */
|
|
15
|
+
readonly customLabels: boolean;
|
|
16
|
+
getCustomLabels?(valRange: readonly number[], unitDecimalPlaces?: number): Mobject[];
|
|
17
|
+
}
|
|
18
|
+
/** A linear scale (Manim `LinearBase`): the value is `scaleFactor` times the position. */
|
|
19
|
+
export declare class LinearBaseScale implements Scale {
|
|
20
|
+
readonly scaleFactor: number;
|
|
21
|
+
readonly customLabels = false;
|
|
22
|
+
constructor(scaleFactor: number);
|
|
23
|
+
function(value: number): number;
|
|
24
|
+
inverseFunction(value: number): number;
|
|
25
|
+
}
|
|
26
|
+
/** Manim's `LinearBase(scaleFactor)`. */
|
|
27
|
+
export declare function LinearBase(scaleFactor?: number): LinearBaseScale;
|
|
28
|
+
/** A logarithmic scale (Manim `LogBase`): the value is `base` to the power of the position. */
|
|
29
|
+
export declare class LogBaseScale implements Scale {
|
|
30
|
+
readonly base: number;
|
|
31
|
+
readonly customLabels: boolean;
|
|
32
|
+
constructor(base: number, customLabels: boolean);
|
|
33
|
+
function(value: number): number;
|
|
34
|
+
inverseFunction(value: number): number;
|
|
35
|
+
/** A `base^{exponent}` label for each value (Manim `get_custom_labels`). */
|
|
36
|
+
getCustomLabels(valRange: readonly number[], unitDecimalPlaces?: number, baseConfig?: {
|
|
37
|
+
fontSize?: number;
|
|
38
|
+
}): Mobject[];
|
|
39
|
+
}
|
|
40
|
+
/** Manim's `LogBase(base, customLabels)`. */
|
|
41
|
+
export declare function LogBase(base?: number, customLabels?: boolean): LogBaseScale;
|
|
42
|
+
/** `[min, max]` or `[min, max, step]` (the step defaults to 1). */
|
|
43
|
+
export type Range = readonly [number, number] | readonly [number, number, number];
|
|
44
|
+
/** The options of NumberLine (Manim's keyword arguments). */
|
|
45
|
+
export interface NumberLineOptions {
|
|
46
|
+
/** `[min, max, step]`; the default is `[-7, 7, 1]`. */
|
|
47
|
+
xRange?: Range;
|
|
48
|
+
/** The length of the line. Without it, each unit is `unitSize` long. */
|
|
49
|
+
length?: number;
|
|
50
|
+
unitSize?: number;
|
|
51
|
+
includeTicks?: boolean;
|
|
52
|
+
/** Half the height of a tick. */
|
|
53
|
+
tickSize?: number;
|
|
54
|
+
numbersWithElongatedTicks?: readonly number[];
|
|
55
|
+
longerTickMultiple?: number;
|
|
56
|
+
excludeOriginTick?: boolean;
|
|
57
|
+
/** The angle of the line, in radians. */
|
|
58
|
+
rotation?: number;
|
|
59
|
+
strokeWidth?: number;
|
|
60
|
+
color?: Color;
|
|
61
|
+
includeTip?: boolean;
|
|
62
|
+
tipWidth?: number;
|
|
63
|
+
tipHeight?: number;
|
|
64
|
+
/** A number at each tick. */
|
|
65
|
+
includeNumbers?: boolean;
|
|
66
|
+
/** The size of the numbers. */
|
|
67
|
+
fontSize?: number;
|
|
68
|
+
labelDirection?: Point;
|
|
69
|
+
/** Makes the labels of `addLabels` and of the axis labels. */
|
|
70
|
+
labelConstructor?: LabelConstructor;
|
|
71
|
+
/** The scale of the values (Manim `scaling`): `m.LinearBase()` (the default) or `m.LogBase()`. */
|
|
72
|
+
scaling?: Scale;
|
|
73
|
+
/** The shape of the tip, such as `m.StealthTip` (default: a filled triangle). */
|
|
74
|
+
tipShape?: TipShape;
|
|
75
|
+
lineToNumberBuff?: number;
|
|
76
|
+
/** Manim's `decimal_number_config`: the options of the numbers. */
|
|
77
|
+
decimalNumberConfig?: DecimalNumberOptions;
|
|
78
|
+
numbersToExclude?: readonly number[];
|
|
79
|
+
/** Numbers at these values instead of at the ticks. */
|
|
80
|
+
numbersToInclude?: readonly number[];
|
|
81
|
+
}
|
|
82
|
+
/** The settings that a NumberLine keeps for its methods. */
|
|
83
|
+
interface LineSettings {
|
|
84
|
+
xRange: readonly [number, number, number];
|
|
85
|
+
tickSize: number;
|
|
86
|
+
longerTickMultiple: number;
|
|
87
|
+
numbersWithElongatedTicks: readonly number[];
|
|
88
|
+
includeTip: boolean;
|
|
89
|
+
excludeOriginTick: boolean;
|
|
90
|
+
labelDirection: Point;
|
|
91
|
+
lineToNumberBuff: number;
|
|
92
|
+
fontSize: number;
|
|
93
|
+
numberConfig: DecimalNumberOptions;
|
|
94
|
+
numbersToExclude: readonly number[];
|
|
95
|
+
numbersToInclude: readonly number[] | undefined;
|
|
96
|
+
scaling: Scale;
|
|
97
|
+
labelConstructor: LabelConstructor;
|
|
98
|
+
}
|
|
99
|
+
/** A number line: Manim's `NumberLine`. Its own path is the line; its submobjects are the
|
|
100
|
+
* tip (with `includeTip`), the ticks, the numbers and the labels of `addLabels`. As in Manim,
|
|
101
|
+
* the line stops at the base of the tip, and `getEnd()` is the tip point. */
|
|
102
|
+
export declare class NumberLineMobject extends Mobject {
|
|
103
|
+
#private;
|
|
104
|
+
constructor(handle: RawMobject, settings: LineSettings);
|
|
105
|
+
copy(): NumberLineMobject;
|
|
106
|
+
/** `[min, max, step]` (Manim `x_range`). */
|
|
107
|
+
get xRange(): readonly [number, number, number];
|
|
108
|
+
get scaling(): Scale;
|
|
109
|
+
get fontSize(): number;
|
|
110
|
+
get labelConstructor(): LabelConstructor;
|
|
111
|
+
get labelDirection(): Point;
|
|
112
|
+
get lineToNumberBuff(): number;
|
|
113
|
+
/** The point of `number` on the line (Manim `number_to_point`). */
|
|
114
|
+
numberToPoint(number: number): Point;
|
|
115
|
+
n2p(number: number): Point;
|
|
116
|
+
/** The number at `point`, projected on the line (Manim `point_to_number`). */
|
|
117
|
+
pointToNumber(point: Point): number;
|
|
118
|
+
p2n(point: Point): number;
|
|
119
|
+
/** Frame units for one unit of the line. */
|
|
120
|
+
getUnitSize(): number;
|
|
121
|
+
/** Rotates the line by `angle` about the point of 0 (Manim `rotate_about_zero`). */
|
|
122
|
+
rotateAboutZero(angle: number): this;
|
|
123
|
+
/** Rotates the line by `angle` about the point of `number` (Manim `rotate_about_number`). */
|
|
124
|
+
rotateAboutNumber(number: number, angle: number): this;
|
|
125
|
+
/** The ticks (Manim `ticks`). */
|
|
126
|
+
get ticks(): Mobject;
|
|
127
|
+
/** The numbers (Manim `numbers`); empty without numbers. */
|
|
128
|
+
get numbers(): Mobject;
|
|
129
|
+
/** The tip, or undefined without `includeTip`. */
|
|
130
|
+
get tip(): Mobject | undefined;
|
|
131
|
+
/** The labels of `addLabels`, or undefined. */
|
|
132
|
+
get labels(): Mobject | undefined;
|
|
133
|
+
/** The values of the ticks (Manim `get_tick_range`), through the scale. */
|
|
134
|
+
getTickRange(): number[];
|
|
135
|
+
/** A tick at `x`, `size` above and below the line (Manim `get_tick`). */
|
|
136
|
+
getTick(x: number, size?: number): Mobject;
|
|
137
|
+
/** Draws the ticks again (Manim `add_ticks`). */
|
|
138
|
+
addTicks(): this;
|
|
139
|
+
getTickMarks(): Mobject;
|
|
140
|
+
/** A DecimalNumber of `x`, next to its point (Manim `get_number_mobject`). */
|
|
141
|
+
getNumberMobject(x: number, opts?: DecimalNumberOptions & {
|
|
142
|
+
direction?: Point;
|
|
143
|
+
buff?: number;
|
|
144
|
+
labelConstructor?: LabelConstructor;
|
|
145
|
+
}): DecimalNumberMobject;
|
|
146
|
+
/** A number at each value, or at each tick by default (Manim `get_number_mobjects`). */
|
|
147
|
+
getNumberMobjects(...numbers: (number | (DecimalNumberOptions & {
|
|
148
|
+
direction?: Point;
|
|
149
|
+
buff?: number;
|
|
150
|
+
}))[]): Mobject;
|
|
151
|
+
/** The numbers at the ticks (Manim `get_labels`). */
|
|
152
|
+
getLabels(): Mobject;
|
|
153
|
+
/** Draws a number at each value, or at each tick by default (Manim `add_numbers`). */
|
|
154
|
+
addNumbers(xValues?: readonly number[], opts?: DecimalNumberOptions & {
|
|
155
|
+
excluding?: readonly number[];
|
|
156
|
+
labelConstructor?: LabelConstructor;
|
|
157
|
+
}): this;
|
|
158
|
+
/** Puts a label at each value (Manim `add_labels`): a string with the default MathTex is a
|
|
159
|
+
* `Tex`, as in Manim. */
|
|
160
|
+
addLabels(dictValues: Readonly<Record<number, string | number | Mobject>> | ReadonlyMap<number, string | number | Mobject>, opts?: {
|
|
161
|
+
direction?: Point;
|
|
162
|
+
buff?: number;
|
|
163
|
+
fontSize?: number;
|
|
164
|
+
labelConstructor?: LabelConstructor;
|
|
165
|
+
}): this;
|
|
166
|
+
/** A label of text, a number or a mobject, made with the label constructor. */
|
|
167
|
+
createLabelTex(label: string | number | Mobject): Mobject;
|
|
168
|
+
}
|
|
169
|
+
/** A number line as a type: what NumberLine returns. */
|
|
170
|
+
export type NumberLine = NumberLineMobject;
|
|
171
|
+
/** A number line (Manim `NumberLine`): `NumberLine({ xRange: [0, 10, 2], length: 8, includeNumbers: true })`. */
|
|
172
|
+
export declare function NumberLine(opts?: NumberLineOptions): NumberLineMobject;
|
|
173
|
+
/** The interval from 0 to 1 (Manim `UnitInterval`): ticks every 0.1, 10 units long. */
|
|
174
|
+
export declare function UnitInterval(opts?: NumberLineOptions): NumberLineMobject;
|
|
175
|
+
/** A function of x that `plot` drew (Manim `ParametricFunction` with `underlying_function`). */
|
|
176
|
+
export declare class PlotMobject extends Mobject {
|
|
177
|
+
/** The function (Manim `underlying_function`). */
|
|
178
|
+
readonly underlyingFunction: (x: number) => number;
|
|
179
|
+
/** The point of the curve at `t` (Manim `function`). */
|
|
180
|
+
readonly function: (t: number) => Point;
|
|
181
|
+
readonly tMin: number;
|
|
182
|
+
readonly tMax: number;
|
|
183
|
+
constructor(handle: RawMobject, f: (x: number) => number, point: (t: number) => Point, range: readonly [number, number]);
|
|
184
|
+
copy(): PlotMobject;
|
|
185
|
+
}
|
|
186
|
+
/** The options of CoordinateSystem (Manim's keyword arguments). */
|
|
187
|
+
export interface CoordinateSystemOptions {
|
|
188
|
+
xRange?: Range;
|
|
189
|
+
yRange?: Range;
|
|
190
|
+
xLength?: number | undefined;
|
|
191
|
+
yLength?: number | undefined;
|
|
192
|
+
}
|
|
193
|
+
/** The common part of Axes and the planes: Manim's `CoordinateSystem`. */
|
|
194
|
+
export declare abstract class CoordinateSystem extends Mobject {
|
|
195
|
+
#private;
|
|
196
|
+
readonly xRange: readonly [number, number, number];
|
|
197
|
+
readonly yRange: readonly [number, number, number];
|
|
198
|
+
readonly xLength: number | undefined;
|
|
199
|
+
readonly yLength: number | undefined;
|
|
200
|
+
/** The labels of `addCoordinates` (Manim `coordinate_labels`). */
|
|
201
|
+
coordinateLabels: Mobject | undefined;
|
|
202
|
+
constructor(handle: RawMobject, opts: CoordinateSystemOptions);
|
|
203
|
+
abstract coordsToPoint(x: number, y: number): Point;
|
|
204
|
+
abstract pointToCoords(point: Point): [number, number];
|
|
205
|
+
/** The axes as a VGroup. */
|
|
206
|
+
abstract getAxes(): Mobject;
|
|
207
|
+
/** The point of the polar coordinates (Manim `polar_to_point`). */
|
|
208
|
+
polarToPoint(radius: number, azimuth: number): Point;
|
|
209
|
+
/** The polar coordinates `[radius, azimuth]` of `point` (Manim `point_to_polar`). */
|
|
210
|
+
pointToPolar(point: Point): [number, number];
|
|
211
|
+
c2p(x: number, y: number): Point;
|
|
212
|
+
p2c(point: Point): [number, number];
|
|
213
|
+
pr2pt(radius: number, azimuth: number): Point;
|
|
214
|
+
pt2pr(point: Point): [number, number];
|
|
215
|
+
/** Axis `index`: 0 is x, 1 is y. */
|
|
216
|
+
getAxis(index: number): NumberLineMobject;
|
|
217
|
+
/** The point of the coordinates (0, 0). */
|
|
218
|
+
getOrigin(): Point;
|
|
219
|
+
getXAxis(): NumberLineMobject;
|
|
220
|
+
getYAxis(): NumberLineMobject;
|
|
221
|
+
getXUnitSize(): number;
|
|
222
|
+
getYUnitSize(): number;
|
|
223
|
+
/** A label at the right end of the x axis (Manim `get_x_axis_label`): a string is a `MathTex`. */
|
|
224
|
+
getXAxisLabel(label: string | number | Mobject, opts?: {
|
|
225
|
+
edge?: Point;
|
|
226
|
+
direction?: Point;
|
|
227
|
+
buff?: number;
|
|
228
|
+
}): Mobject;
|
|
229
|
+
/** A label at the top of the y axis (Manim `get_y_axis_label`). */
|
|
230
|
+
getYAxisLabel(label: string | number | Mobject, opts?: {
|
|
231
|
+
edge?: Point;
|
|
232
|
+
direction?: Point;
|
|
233
|
+
buff?: number;
|
|
234
|
+
}): Mobject;
|
|
235
|
+
/** Both labels, as a VGroup (Manim `get_axis_labels`). */
|
|
236
|
+
getAxisLabels(xLabel?: string | number | Mobject, yLabel?: string | number | Mobject): Mobject;
|
|
237
|
+
/** Numbers or labels on each axis (Manim `add_coordinates`): for each axis, a list of values,
|
|
238
|
+
* an object of value to label, or undefined for the ticks. */
|
|
239
|
+
addCoordinates(...axesNumbers: (readonly number[] | Readonly<Record<number, string | number | Mobject>> | undefined)[]): this;
|
|
240
|
+
/** A line from axis `index` to `point`, a DashedLine by default (Manim
|
|
241
|
+
* `get_line_from_axis_to_point`). */
|
|
242
|
+
getLineFromAxisToPoint(index: number, point: Point, opts?: {
|
|
243
|
+
lineFunc?: (start: Point, end: Point, style: StyleOptions) => Mobject;
|
|
244
|
+
lineConfig?: StyleOptions;
|
|
245
|
+
color?: Color;
|
|
246
|
+
strokeWidth?: number;
|
|
247
|
+
}): Mobject;
|
|
248
|
+
/** A line from the x axis up or down to `point` (Manim `get_vertical_line`). */
|
|
249
|
+
getVerticalLine(point: Point, opts?: Parameters<CoordinateSystem["getLineFromAxisToPoint"]>[2]): Mobject;
|
|
250
|
+
/** A line from the y axis across to `point` (Manim `get_horizontal_line`). */
|
|
251
|
+
getHorizontalLine(point: Point, opts?: Parameters<CoordinateSystem["getLineFromAxisToPoint"]>[2]): Mobject;
|
|
252
|
+
/** The horizontal and the vertical line to `point` (Manim `get_lines_to_point`). */
|
|
253
|
+
getLinesToPoint(point: Point, opts?: Parameters<CoordinateSystem["getLineFromAxisToPoint"]>[2]): Mobject;
|
|
254
|
+
/** The graph of `function` (Manim `plot`): a smooth curve through samples, 10 for each step
|
|
255
|
+
* of `xRange` (or every `xRange[2]` with a step). */
|
|
256
|
+
plot(fn: (x: number) => number, opts?: StyleOptions & {
|
|
257
|
+
xRange?: Range;
|
|
258
|
+
useVectorized?: boolean;
|
|
259
|
+
/** Colours along the graph by value: a list of colours spread over the range of the axis
|
|
260
|
+
* `colorscaleAxis`, or a list of `[color, pivot]`. */
|
|
261
|
+
colorscale?: readonly (ParsableManimColor | readonly [ParsableManimColor, number])[];
|
|
262
|
+
/** The axis of `colorscale`: 0 is x, 1 is y (the default). */
|
|
263
|
+
colorscaleAxis?: number;
|
|
264
|
+
}): PlotMobject;
|
|
265
|
+
/** The curve where `func(x, y)` is 0 (Manim `plot_implicit_curve`), by marching squares on
|
|
266
|
+
* a grid of about `maxQuads` cells. */
|
|
267
|
+
plotImplicitCurve(func: (x: number, y: number) => number, opts?: StyleOptions & {
|
|
268
|
+
minDepth?: number;
|
|
269
|
+
maxQuads?: number;
|
|
270
|
+
}): Mobject;
|
|
271
|
+
/** The curve of `function(t)` = `[x, y]` in coordinates (Manim `plot_parametric_curve`). */
|
|
272
|
+
plotParametricCurve(fn: (t: number) => readonly [number, number], opts?: StyleOptions & {
|
|
273
|
+
tRange?: Range;
|
|
274
|
+
useVectorized?: boolean;
|
|
275
|
+
}): Mobject;
|
|
276
|
+
/** The curve of `rFunc(theta)` in polar coordinates (Manim `plot_polar_graph`). */
|
|
277
|
+
plotPolarGraph(rFunc: (theta: number) => number, opts?: StyleOptions & {
|
|
278
|
+
thetaRange?: Range;
|
|
279
|
+
}): Mobject;
|
|
280
|
+
/** The point of `graph` at `x` (Manim `input_to_graph_point`). */
|
|
281
|
+
inputToGraphPoint(x: number, graph: Mobject): Point;
|
|
282
|
+
/** `[x, f(x)]` (Manim `input_to_graph_coords`). */
|
|
283
|
+
inputToGraphCoords(x: number, graph: PlotMobject): [number, number];
|
|
284
|
+
i2gc(x: number, graph: PlotMobject): [number, number];
|
|
285
|
+
i2gp(x: number, graph: Mobject): Point;
|
|
286
|
+
/** A label of `graph` (Manim `get_graph_label`): at `xVal`, or at the right end that is in
|
|
287
|
+
* the frame, in the colour of the graph. */
|
|
288
|
+
getGraphLabel(graph: Mobject, label?: string | number | Mobject, opts?: {
|
|
289
|
+
xVal?: number;
|
|
290
|
+
direction?: Point;
|
|
291
|
+
buff?: number;
|
|
292
|
+
color?: Color;
|
|
293
|
+
dot?: boolean;
|
|
294
|
+
dotConfig?: StyleOptions & {
|
|
295
|
+
radius?: number;
|
|
296
|
+
};
|
|
297
|
+
}): Mobject;
|
|
298
|
+
/** Rectangles under `graph` from `xRange` every `dx` (Manim `get_riemann_rectangles`). */
|
|
299
|
+
getRiemannRectangles(graph: PlotMobject, opts?: {
|
|
300
|
+
xRange?: Range;
|
|
301
|
+
dx?: number;
|
|
302
|
+
inputSampleType?: "left" | "right" | "center";
|
|
303
|
+
strokeWidth?: number;
|
|
304
|
+
strokeColor?: Color;
|
|
305
|
+
fillOpacity?: number;
|
|
306
|
+
color?: Color | readonly Color[];
|
|
307
|
+
showSignedArea?: boolean;
|
|
308
|
+
boundedGraph?: PlotMobject;
|
|
309
|
+
blend?: boolean;
|
|
310
|
+
widthScaleFactor?: number;
|
|
311
|
+
}): Mobject;
|
|
312
|
+
/** The area between `graph` and the x axis, or `boundedGraph` (Manim `get_area`). A list of
|
|
313
|
+
* colours fills with the first. */
|
|
314
|
+
getArea(graph: PlotMobject, opts?: StyleOptions & {
|
|
315
|
+
xRange?: readonly [number, number];
|
|
316
|
+
color?: Color | readonly Color[];
|
|
317
|
+
opacity?: number;
|
|
318
|
+
boundedGraph?: PlotMobject;
|
|
319
|
+
}): Mobject;
|
|
320
|
+
/** The angle of the tangent of `graph` at `x`, in coordinates (Manim `angle_of_tangent`). */
|
|
321
|
+
angleOfTangent(x: number, graph: PlotMobject, dx?: number): number;
|
|
322
|
+
/** The slope of the tangent of `graph` at `x` (Manim `slope_of_tangent`). */
|
|
323
|
+
slopeOfTangent(x: number, graph: PlotMobject, opts?: {
|
|
324
|
+
dx?: number;
|
|
325
|
+
}): number;
|
|
326
|
+
/** The graph of the derivative of `graph` (Manim `plot_derivative_graph`). */
|
|
327
|
+
plotDerivativeGraph(graph: PlotMobject, opts?: StyleOptions & {
|
|
328
|
+
xRange?: Range;
|
|
329
|
+
}): PlotMobject;
|
|
330
|
+
/** The graph of an antiderivative of `graph` through `yIntercept` at 0 (Manim
|
|
331
|
+
* `plot_antiderivative_graph`), with the trapezoid rule on `samples` points. */
|
|
332
|
+
plotAntiderivativeGraph(graph: PlotMobject, opts?: StyleOptions & {
|
|
333
|
+
yIntercept?: number;
|
|
334
|
+
samples?: number;
|
|
335
|
+
useVectorized?: boolean;
|
|
336
|
+
xRange?: Range;
|
|
337
|
+
}): PlotMobject;
|
|
338
|
+
/** The lines of a secant from `x` to `x + dx` (Manim `get_secant_slope_group`): `dxLine`,
|
|
339
|
+
* `dfLine`, the labels and the secant line. */
|
|
340
|
+
getSecantSlopeGroup(x: number, graph: Mobject, opts?: {
|
|
341
|
+
dx?: number;
|
|
342
|
+
dxLineColor?: Color;
|
|
343
|
+
dyLineColor?: Color;
|
|
344
|
+
dxLabel?: string | number;
|
|
345
|
+
dyLabel?: string | number;
|
|
346
|
+
includeSecantLine?: boolean;
|
|
347
|
+
secantLineColor?: Color;
|
|
348
|
+
secantLineLength?: number;
|
|
349
|
+
}): Mobject;
|
|
350
|
+
/** `numLines` vertical lines from the x axis to `graph` (Manim `get_vertical_lines_to_graph`). */
|
|
351
|
+
getVerticalLinesToGraph(graph: Mobject, opts?: Parameters<CoordinateSystem["getLineFromAxisToPoint"]>[2] & {
|
|
352
|
+
xRange?: Range;
|
|
353
|
+
numLines?: number;
|
|
354
|
+
}): Mobject;
|
|
355
|
+
/** A triangle under `xVal` on the x axis, a label and a vertical line to `graph` (Manim
|
|
356
|
+
* `get_T_label`). */
|
|
357
|
+
getTLabel(xVal: number, graph: Mobject, opts?: {
|
|
358
|
+
label?: string | number | Mobject;
|
|
359
|
+
labelColor?: Color;
|
|
360
|
+
triangleSize?: number;
|
|
361
|
+
triangleColor?: Color;
|
|
362
|
+
lineFunc?: (start: Point, end: Point, style: StyleOptions) => Mobject;
|
|
363
|
+
lineColor?: Color;
|
|
364
|
+
}): Mobject;
|
|
365
|
+
}
|
|
366
|
+
/** The options of Axes (Manim's keyword arguments). */
|
|
367
|
+
export interface AxesOptions {
|
|
368
|
+
/** The default is `[-7, 7, 1]`. */
|
|
369
|
+
xRange?: Range;
|
|
370
|
+
/** The default is `[-4, 4, 1]`. */
|
|
371
|
+
yRange?: Range;
|
|
372
|
+
/** The default is 12. */
|
|
373
|
+
xLength?: number;
|
|
374
|
+
/** The default is 6. */
|
|
375
|
+
yLength?: number;
|
|
376
|
+
/** NumberLine options for both axes. */
|
|
377
|
+
axisConfig?: NumberLineOptions;
|
|
378
|
+
xAxisConfig?: NumberLineOptions;
|
|
379
|
+
yAxisConfig?: NumberLineOptions;
|
|
380
|
+
/** A tip at the end of each axis (default true). */
|
|
381
|
+
tips?: boolean;
|
|
382
|
+
}
|
|
383
|
+
/** Two number lines: Manim's `Axes`. Its submobjects are the x axis and the y axis (after any
|
|
384
|
+
* background lines). */
|
|
385
|
+
export declare class AxesMobject extends CoordinateSystem {
|
|
386
|
+
/** The x axis (Manim `x_axis`). */
|
|
387
|
+
xAxis: NumberLineMobject;
|
|
388
|
+
/** The y axis (Manim `y_axis`). */
|
|
389
|
+
yAxis: NumberLineMobject;
|
|
390
|
+
constructor(handle: RawMobject, axes: [NumberLineMobject, NumberLineMobject], opts: CoordinateSystemOptions);
|
|
391
|
+
copy(): AxesMobject;
|
|
392
|
+
getAxes(): Mobject;
|
|
393
|
+
getXAxis(): NumberLineMobject;
|
|
394
|
+
getYAxis(): NumberLineMobject;
|
|
395
|
+
/** The point of the coordinates `(x, y)` (Manim `coords_to_point`). */
|
|
396
|
+
coordsToPoint(x: number, y: number): Point;
|
|
397
|
+
/** The coordinates of `point` (Manim `point_to_coords`). */
|
|
398
|
+
pointToCoords(point: Point): [number, number];
|
|
399
|
+
/** A polyline through the points `(x, y)` in `lineColor`, with a dot at each (Manim
|
|
400
|
+
* `plot_line_graph`): a VDict with `line_graph` and `vertex_dots`. */
|
|
401
|
+
plotLineGraph(xValues: readonly number[], yValues: readonly number[], opts?: StyleOptions & {
|
|
402
|
+
lineColor?: Color;
|
|
403
|
+
addVertexDots?: boolean;
|
|
404
|
+
vertexDotRadius?: number;
|
|
405
|
+
vertexDotStyle?: StyleOptions;
|
|
406
|
+
}): VDictMobject;
|
|
407
|
+
}
|
|
408
|
+
/** Axes as a type: what Axes returns. */
|
|
409
|
+
export type Axes = AxesMobject;
|
|
410
|
+
/** Two number lines that cross at the origin (Manim `Axes`): `Axes({ xRange: [0, 10, 1], yRange: [0, 100, 10] })`. */
|
|
411
|
+
export declare function Axes(opts?: AxesOptions): AxesMobject;
|
|
412
|
+
/** A line style: the stroke options. */
|
|
413
|
+
export interface LineStyle {
|
|
414
|
+
strokeColor?: Color;
|
|
415
|
+
strokeWidth?: number;
|
|
416
|
+
strokeOpacity?: number;
|
|
417
|
+
}
|
|
418
|
+
/** The options of NumberPlane (Manim's keyword arguments) with those of Axes. */
|
|
419
|
+
export interface NumberPlaneOptions extends AxesOptions {
|
|
420
|
+
/** True (the default): `applyFunction` makes the lines smooth after it maps them. */
|
|
421
|
+
makeSmoothAfterApplyingFunctions?: boolean;
|
|
422
|
+
backgroundLineStyle?: LineStyle;
|
|
423
|
+
fadedLineStyle?: LineStyle;
|
|
424
|
+
fadedLineRatio?: number;
|
|
425
|
+
}
|
|
426
|
+
/** A grid of lines on axes: Manim's `NumberPlane`. Its first submobjects are the faded lines
|
|
427
|
+
* and the background lines. */
|
|
428
|
+
export declare class NumberPlaneMobject extends AxesMobject {
|
|
429
|
+
/** The background lines (Manim `background_lines`). */
|
|
430
|
+
get backgroundLines(): Mobject;
|
|
431
|
+
/** The faded lines (Manim `faded_lines`). */
|
|
432
|
+
get fadedLines(): Mobject;
|
|
433
|
+
copy(): NumberPlaneMobject;
|
|
434
|
+
/** An arrow from the origin to the coordinates (Manim `get_vector`). With no coordinates, the
|
|
435
|
+
* vector of the own path, as on every Mobject. */
|
|
436
|
+
getVector(): Point;
|
|
437
|
+
getVector(coords: readonly [number, number], opts?: Parameters<typeof Arrow>[2]): Mobject;
|
|
438
|
+
/** Splits the curves of each part to at least `numInsertedCurves`, so that a function bends
|
|
439
|
+
* the lines smoothly (Manim `prepare_for_nonlinear_transform`). */
|
|
440
|
+
prepareForNonlinearTransform(numInsertedCurves?: number): this;
|
|
441
|
+
}
|
|
442
|
+
/** Manim's `NumberPlane(opts)`: the frame's grid by default, blue background lines every step. */
|
|
443
|
+
export declare function NumberPlane(opts?: NumberPlaneOptions): NumberPlaneMobject;
|
|
444
|
+
/** Manim's `ComplexPlane`: a NumberPlane whose points are complex numbers `[re, im]`. */
|
|
445
|
+
export declare class ComplexPlaneMobject extends NumberPlaneMobject {
|
|
446
|
+
/** The point of `number` (Manim `number_to_point`). */
|
|
447
|
+
numberToPoint(number: number | readonly [number, number]): Point;
|
|
448
|
+
n2p(number: number | readonly [number, number]): Point;
|
|
449
|
+
/** The complex number `[re, im]` at `point` (Manim `point_to_number`). */
|
|
450
|
+
pointToNumber(point: Point): [number, number];
|
|
451
|
+
p2n(point: Point): [number, number];
|
|
452
|
+
/** A number at each value: on the x axis for a real value, on the y axis with `i` for an
|
|
453
|
+
* imaginary one (Manim `get_coordinate_labels`). By default, at each tick. */
|
|
454
|
+
getCoordinateLabels(...numbers: (number | readonly [number, number] | DecimalNumberOptions)[]): Mobject;
|
|
455
|
+
/** Adds `getCoordinateLabels(...numbers)` (Manim `add_coordinates`). */
|
|
456
|
+
addCoordinates(...numbers: (number | readonly number[] | Readonly<Record<number, string | number | Mobject>> | DecimalNumberOptions | undefined)[]): this;
|
|
457
|
+
copy(): ComplexPlaneMobject;
|
|
458
|
+
}
|
|
459
|
+
/** Manim's `ComplexPlane(opts)`: the options of NumberPlane. */
|
|
460
|
+
export declare function ComplexPlane(opts?: NumberPlaneOptions): ComplexPlaneMobject;
|
|
461
|
+
/** The units of the azimuth labels of a PolarPlane. */
|
|
462
|
+
export type AzimuthUnits = "PI radians" | "TAU radians" | "degrees" | "gradians" | null;
|
|
463
|
+
/** The options of PolarPlane (Manim's keyword arguments). */
|
|
464
|
+
export interface PolarPlaneOptions extends Omit<AxesOptions, "xRange" | "yRange" | "xLength" | "yLength"> {
|
|
465
|
+
/** True (the default): `applyFunction` makes the lines smooth after it maps them. */
|
|
466
|
+
makeSmoothAfterApplyingFunctions?: boolean;
|
|
467
|
+
radiusMax?: number;
|
|
468
|
+
/** The width and height; by default 2 units for each unit of radius. */
|
|
469
|
+
size?: number;
|
|
470
|
+
radiusStep?: number;
|
|
471
|
+
/** The number of azimuth lines in a turn. */
|
|
472
|
+
azimuthStep?: number;
|
|
473
|
+
azimuthUnits?: AzimuthUnits;
|
|
474
|
+
azimuthCompactFraction?: boolean;
|
|
475
|
+
azimuthOffset?: number;
|
|
476
|
+
azimuthDirection?: "CCW" | "CW";
|
|
477
|
+
azimuthLabelBuff?: number;
|
|
478
|
+
azimuthLabelFontSize?: number;
|
|
479
|
+
radiusConfig?: NumberLineOptions;
|
|
480
|
+
backgroundLineStyle?: LineStyle;
|
|
481
|
+
fadedLineStyle?: LineStyle;
|
|
482
|
+
fadedLineRatio?: number;
|
|
483
|
+
}
|
|
484
|
+
/** Circles and rays on axes: Manim's `PolarPlane`. */
|
|
485
|
+
export declare class PolarPlaneMobject extends AxesMobject {
|
|
486
|
+
#private;
|
|
487
|
+
constructor(handle: RawMobject, axes: [NumberLineMobject, NumberLineMobject], opts: CoordinateSystemOptions, polar: PolarSettings);
|
|
488
|
+
copy(): PolarPlaneMobject;
|
|
489
|
+
/** An arrow from the origin to the coordinates (Manim `get_vector`). With no coordinates, the
|
|
490
|
+
* vector of the own path, as on every Mobject. */
|
|
491
|
+
getVector(): Point;
|
|
492
|
+
getVector(coords: readonly [number, number], opts?: Parameters<typeof Arrow>[2]): Mobject;
|
|
493
|
+
prepareForNonlinearTransform(numInsertedCurves?: number): this;
|
|
494
|
+
/** The label of the angle `number` (a fraction of a turn) in π or τ (Manim `get_radian_label`). */
|
|
495
|
+
getRadianLabel(number: number, opts?: {
|
|
496
|
+
fontSize?: number;
|
|
497
|
+
color?: Color;
|
|
498
|
+
}): Mobject;
|
|
499
|
+
/** The radius numbers and the azimuth labels (Manim `get_coordinate_labels`). */
|
|
500
|
+
getCoordinateLabels(rValues?: readonly number[], aValues?: readonly number[]): Mobject;
|
|
501
|
+
/** Adds `getCoordinateLabels(rValues, aValues)` (Manim `add_coordinates`). */
|
|
502
|
+
/** Adds the labels of `getCoordinateLabels(rValues, aValues)` (Manim `add_coordinates`). */
|
|
503
|
+
addCoordinates(rValues?: readonly number[], aValues?: readonly number[]): this;
|
|
504
|
+
}
|
|
505
|
+
type PolarSettings = Required<Pick<PolarPlaneOptions, "azimuthStep" | "azimuthCompactFraction" | "azimuthOffset" | "azimuthDirection" | "azimuthLabelBuff" | "azimuthLabelFontSize">> & {
|
|
506
|
+
azimuthUnits: AzimuthUnits;
|
|
507
|
+
};
|
|
508
|
+
/** Manim's `PolarPlane(opts)`: circles every `radiusStep` and `azimuthStep` rays. */
|
|
509
|
+
export declare function PolarPlane(opts?: PolarPlaneOptions): PolarPlaneMobject;
|
|
510
|
+
/** The options of BarChart (Manim's keyword arguments) with those of Axes. */
|
|
511
|
+
export interface BarChartOptions extends AxesOptions {
|
|
512
|
+
barNames?: readonly string[];
|
|
513
|
+
barColors?: readonly Color[];
|
|
514
|
+
barWidth?: number;
|
|
515
|
+
barFillOpacity?: number;
|
|
516
|
+
barStrokeWidth?: number;
|
|
517
|
+
}
|
|
518
|
+
/** Bars on axes: Manim's `BarChart`. */
|
|
519
|
+
export declare class BarChartMobject extends AxesMobject {
|
|
520
|
+
#private;
|
|
521
|
+
/** The bars (Manim `bars`). */
|
|
522
|
+
bars: Mobject;
|
|
523
|
+
/** The values of the bars (Manim `values`). */
|
|
524
|
+
values: number[];
|
|
525
|
+
barColors: readonly Color[];
|
|
526
|
+
barWidth: number;
|
|
527
|
+
barFillOpacity: number;
|
|
528
|
+
barStrokeWidth: number;
|
|
529
|
+
/** A label with the value over each bar, in the colour of the bar (Manim `get_bar_labels`). */
|
|
530
|
+
getBarLabels(opts?: {
|
|
531
|
+
color?: Color;
|
|
532
|
+
fontSize?: number;
|
|
533
|
+
buff?: number;
|
|
534
|
+
labelConstructor?: LabelConstructor;
|
|
535
|
+
}): Mobject;
|
|
536
|
+
/** Stretches the bars to new values (Manim `change_bar_values`). */
|
|
537
|
+
changeBarValues(values: readonly number[], updateColors?: boolean): this;
|
|
538
|
+
/** The bar of `value` at position `barNumber` (Manim `_create_bar`). */
|
|
539
|
+
createBar(barNumber: number, value: number): Mobject;
|
|
540
|
+
/** Makes and colours the bars. */
|
|
541
|
+
addBars(): void;
|
|
542
|
+
}
|
|
543
|
+
/** Manim's `BarChart(values, opts)`: a bar for each value, with the names under the x axis. */
|
|
544
|
+
export declare function BarChart(values: readonly number[], opts?: BarChartOptions): BarChartMobject;
|
|
545
|
+
/** A rectangle that divides into parts: Manim's `SampleSpace`. */
|
|
546
|
+
export declare class SampleSpaceMobject extends Mobject {
|
|
547
|
+
#private;
|
|
548
|
+
defaultLabelScaleVal: number;
|
|
549
|
+
/** The parts of `divideHorizontally` (Manim `horizontal_parts`). */
|
|
550
|
+
horizontalParts: Mobject | undefined;
|
|
551
|
+
/** The parts of `divideVertically` (Manim `vertical_parts`). */
|
|
552
|
+
verticalParts: Mobject | undefined;
|
|
553
|
+
/** The title of `addTitle`. */
|
|
554
|
+
title: Mobject | undefined;
|
|
555
|
+
/** The label of `addLabel`. */
|
|
556
|
+
label: string | undefined;
|
|
557
|
+
/** A `Tex` title above the space, at most as wide (Manim `add_title`). */
|
|
558
|
+
addTitle(title?: string, buff?: number): this;
|
|
559
|
+
addLabel(label: string): this;
|
|
560
|
+
/** The probabilities with the rest of 1 at the end (Manim `complete_p_list`). */
|
|
561
|
+
completePList(pList: number | readonly number[]): number[];
|
|
562
|
+
/** Parts of the space along axis `dim` (0 x, 1 y), sized by the probabilities (Manim
|
|
563
|
+
* `get_division_along_dimension`). */
|
|
564
|
+
getDivisionAlongDimension(pList: number | readonly number[], dim: number, colors: readonly Color[], vect: Point): Mobject;
|
|
565
|
+
getHorizontalDivision(pList: number | readonly number[], colors?: readonly Color[], vect?: Point): Mobject;
|
|
566
|
+
getVerticalDivision(pList: number | readonly number[], colors?: readonly Color[], vect?: Point): Mobject;
|
|
567
|
+
divideHorizontally(pList: number | readonly number[], colors?: readonly Color[], vect?: Point): this;
|
|
568
|
+
divideVertically(pList: number | readonly number[], colors?: readonly Color[], vect?: Point): this;
|
|
569
|
+
/** A brace and a label on each part (Manim `get_subdivision_braces_and_labels`). A string
|
|
570
|
+
* label is a `MathTex`. */
|
|
571
|
+
getSubdivisionBracesAndLabels(parts: Mobject, labels: readonly (string | Mobject)[], direction: Point, opts?: {
|
|
572
|
+
buff?: number;
|
|
573
|
+
minNumQuads?: number;
|
|
574
|
+
}): Mobject;
|
|
575
|
+
getSideBracesAndLabels(labels: readonly (string | Mobject)[], direction?: Point, opts?: {
|
|
576
|
+
buff?: number;
|
|
577
|
+
}): Mobject;
|
|
578
|
+
getTopBracesAndLabels(labels: readonly (string | Mobject)[], opts?: {
|
|
579
|
+
buff?: number;
|
|
580
|
+
}): Mobject;
|
|
581
|
+
getBottomBracesAndLabels(labels: readonly (string | Mobject)[], opts?: {
|
|
582
|
+
buff?: number;
|
|
583
|
+
}): Mobject;
|
|
584
|
+
/** Adds the braces and labels of the parts (Manim `add_braces_and_labels`). */
|
|
585
|
+
addBracesAndLabels(): this;
|
|
586
|
+
}
|
|
587
|
+
/** Manim's `SampleSpace(opts)`: a dark grey 3 × 3 square. */
|
|
588
|
+
export declare function SampleSpace(opts?: {
|
|
589
|
+
height?: number;
|
|
590
|
+
width?: number;
|
|
591
|
+
fillColor?: Color;
|
|
592
|
+
fillOpacity?: number;
|
|
593
|
+
strokeWidth?: number;
|
|
594
|
+
strokeColor?: Color;
|
|
595
|
+
defaultLabelScaleVal?: number;
|
|
596
|
+
}): SampleSpaceMobject;
|
|
597
|
+
export {};
|