manim-web 0.18.0 → 0.19.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.
@@ -1 +1 @@
1
- {"version":3,"file":"SVGMobject.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/SVGMobject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAQ3C,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAK/E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,GAAG;IAC5E,4DAA4D;IAC5D,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,SAA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AAW,IAAI,QAAQ,EAAE;IAIhB,IAAI,IAAI,UAAU;CAO5B;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,GAC7C,UAAU,CAEZ"}
@@ -8,5 +8,6 @@
8
8
  export { Brace, BraceBetweenPoints, ArcBrace, BraceLabel, BraceText, type BraceOptions, type BraceBetweenPointsOptions, type ArcBraceOptions, type BraceLabelOptions, } from './Brace';
9
9
  export { SVGMobject, svgMobject, VMobjectFromSVGPath, type SVGMobjectOptions, type VMobjectFromSVGPathOptions, type SVGMobjectFromUrlOptions, } from './SVGMobject';
10
10
  export { GradientVMobject, type GradientVMobjectOptions, type SvgGradient, type SvgGradientStop, type SvgGradientType, } from './svgGradients';
11
+ export { PatternVMobject, parsePatternDefs, resolvePatternFill, type PatternVMobjectOptions, type SvgPattern, type SvgPatternUnits, } from './svgPatterns';
11
12
  export { type SvgFetcher, type SvgFetchResponse } from './svgLoader';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
@@ -1,5 +1,14 @@
1
1
  import { VMobject } from '../../core/VMobject';
2
2
  import { SvgGradient } from './svgGradients';
3
+ import { SvgPattern } from './svgPatterns';
4
+ /**
5
+ * Report whether an SVG element is drawn directly in the document.
6
+ *
7
+ * @param el - The element to test.
8
+ * @returns false when any ancestor is a definition container (for example
9
+ * `<defs>` or `<pattern>`); true otherwise.
10
+ */
11
+ export declare function isRenderableSvgElement(el: Element): boolean;
3
12
  /**
4
13
  * Create a flat-styled VMobject from Bezier control points.
5
14
  *
@@ -30,6 +39,8 @@ export interface FilledVMobjectOptions {
30
39
  defaultFillOpacity?: number;
31
40
  /** Gradient definitions for resolving `url(#id)` fills. */
32
41
  defs: Map<string, SvgGradient>;
42
+ /** Pattern definitions for resolving `url(#id)` fills. */
43
+ patternDefs?: Map<string, SvgPattern>;
33
44
  }
34
45
  /**
35
46
  * Build a VMobject for a fill-bearing SVG shape, applying a gradient fill when
@@ -1 +1 @@
1
- {"version":3,"file":"svgFill.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgFill.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACpC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,GACnB,QAAQ,CAUV;AAED,4DAA4D;AAC5D,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACrC,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2DAA2D;IAC3D,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,GAAG,QAAQ,CAqB3E"}
1
+ {"version":3,"file":"svgFill.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svg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jects/svg/svgImage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAcxC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,EAAE,CAwBlE"}
1
+ {"version":3,"file":"svgImage.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgImage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAexC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,EAAE,CAyBlE"}
@@ -0,0 +1,90 @@
1
+ import { VMobject } from '../../core/VMobject';
2
+ /**
3
+ * SVG `<pattern>` fill support for SVGMobject (best-manim enhancement).
4
+ *
5
+ * Parses `<pattern>` definitions into a plain data model, resolves
6
+ * `fill="url(#id)"` references, rasterizes the pattern tile to a canvas, and
7
+ * builds a {@link PatternVMobject} whose fill exposes a repeating
8
+ * {@link THREE.CanvasTexture} (`wrapS`/`wrapT` = `RepeatWrapping`).
9
+ *
10
+ * This mirrors the gradient design ({@link ./svgGradients}): the shape stays a
11
+ * VMobject with a flat-fill approximation so the single-fill render path is
12
+ * unchanged, and the repeating texture is exposed additively on the mobject for
13
+ * texture-aware consumers. The tile raster reuses the same `THREE.CanvasTexture`
14
+ * mechanism as {@link ImageMobject}.
15
+ *
16
+ * Scope: the tile may hold simple shapes (`rect`, `circle`, `ellipse`,
17
+ * `polygon`, `path`) and `<image>` elements. Unsupported or empty tiles fall
18
+ * back to a solid approximation or no fill rather than throwing.
19
+ */
20
+ import * as THREE from 'three';
21
+ /** SVG coordinate system for a pattern's tile box or its content. */
22
+ export type SvgPatternUnits = 'userSpaceOnUse' | 'objectBoundingBox';
23
+ /** Parsed SVG `<pattern>` definition. */
24
+ export interface SvgPattern {
25
+ /** The pattern `id` used by `url(#id)` references. */
26
+ id: string;
27
+ /** Coordinate system of `width`/`height` (default `objectBoundingBox`). */
28
+ patternUnits: SvgPatternUnits;
29
+ /** Coordinate system of the tile content (default `userSpaceOnUse`). */
30
+ patternContentUnits: SvgPatternUnits;
31
+ /** Tile width in the `patternUnits` system. */
32
+ width: number;
33
+ /** Tile height in the `patternUnits` system. */
34
+ height: number;
35
+ /** Drawable child elements of the tile, in document order. */
36
+ content: Element[];
37
+ }
38
+ /**
39
+ * Collect every `<pattern>` definition in an SVG, keyed by its `id`.
40
+ *
41
+ * A pattern without an `id` or without drawable content children is skipped,
42
+ * mirroring how a stop-less gradient is skipped.
43
+ *
44
+ * @param svg - The parsed `<svg>` root element.
45
+ * @returns A map from pattern id to its parsed definition.
46
+ */
47
+ export declare function parsePatternDefs(svg: Element): Map<string, SvgPattern>;
48
+ /**
49
+ * Resolve a `fill="url(#id)"` reference to its pattern definition.
50
+ *
51
+ * @param fillAttr - The raw fill attribute value.
52
+ * @param defs - Pattern definitions from {@link parsePatternDefs}.
53
+ * @returns The matching pattern, or undefined when the fill is not a pattern
54
+ * reference or the id is unknown.
55
+ */
56
+ export declare function resolvePatternFill(fillAttr: string | null | undefined, defs: Map<string, SvgPattern>): SvgPattern | undefined;
57
+ /** Options for {@link PatternVMobject}. */
58
+ export interface PatternVMobjectOptions {
59
+ /** The resolved pattern applied as this object's fill. */
60
+ pattern: SvgPattern;
61
+ /** Bezier control points in 3D. */
62
+ points3D: [number, number, number][];
63
+ /** Stroke color (default WHITE). */
64
+ strokeColor?: string;
65
+ /** Stroke width (default DEFAULT_STROKE_WIDTH). */
66
+ strokeWidth?: number;
67
+ /** Fill opacity when the pattern renders a fill (default 0.5). */
68
+ fillOpacity?: number;
69
+ }
70
+ /**
71
+ * A VMobject whose fill comes from an SVG `<pattern>`.
72
+ *
73
+ * The flat `fillColor` is the first solid color in the tile, so the shape still
74
+ * renders in the single-fill pipeline. {@link patternTexture} holds the
75
+ * repeating tile texture (`RepeatWrapping`, repeat count derived from the shape
76
+ * size over the tile size) for texture-aware consumers, and {@link pattern}
77
+ * keeps the parsed definition. When the tile has no drawable content the texture
78
+ * is null and the fill falls back to the solid color or to no fill.
79
+ */
80
+ export declare class PatternVMobject extends VMobject {
81
+ /** The parsed pattern definition applied as fill. */
82
+ readonly pattern: SvgPattern;
83
+ /** The repeating tile texture, or null when the tile is not renderable. */
84
+ readonly patternTexture: THREE.CanvasTexture | null;
85
+ constructor(options: PatternVMobjectOptions);
86
+ /** Set the texture repeat from the shape span over the tile size. */
87
+ private _applyRepeatFromPoints;
88
+ copy(): PatternVMobject;
89
+ }
90
+ //# sourceMappingURL=svgPatterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgPatterns.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgPatterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAK/C,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAErE,yCAAyC;AACzC,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,YAAY,EAAE,eAAe,CAAC;IAC9B,wEAAwE;IACxE,mBAAmB,EAAE,eAAe,CAAC;IACrC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB;AAiBD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAiBtE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAC5B,UAAU,GAAG,SAAS,CAKxB;AA2LD,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,0DAA0D;IAC1D,OAAO,EAAE,UAAU,CAAC;IACpB,mCAAmC;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACrC,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;gBAExC,OAAO,EAAE,sBAAsB;IAqB3C,qEAAqE;IACrE,OAAO,CAAC,sBAAsB;IAkBrB,IAAI,IAAI,eAAe;CAWjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"svgText.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AASD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,EAAE,CA2BpF"}
1
+ {"version":3,"file":"svgText.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AASD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,EAAE,CA4BpF"}
@@ -81,6 +81,8 @@ export declare class Table extends VGroup {
81
81
  protected _verticalLines: VGroup;
82
82
  /** Background rectangles for highlighting */
83
83
  protected _backgroundRectangles: Map<string, Rectangle>;
84
+ /** Background rectangles added behind every entry via addBackgroundToEntries */
85
+ protected _entryBackgrounds: Rectangle[];
84
86
  /** Cell dimensions for each row and column */
85
87
  protected _rowHeights: number[];
86
88
  protected _colWidths: number[];
@@ -126,11 +128,30 @@ export declare class Table extends VGroup {
126
128
  * @returns VGroup containing all entries in the column
127
129
  */
128
130
  getColumn(col: number): VGroup;
131
+ /**
132
+ * Get all rows as a VGroup of VGroups (0-indexed, data only).
133
+ * Each child VGroup holds the entries of one row.
134
+ * @returns VGroup of row VGroups
135
+ */
136
+ getRows(): VGroup;
137
+ /**
138
+ * Get all columns as a VGroup of VGroups (0-indexed, data only).
139
+ * Each child VGroup holds the entries of one column.
140
+ * @returns VGroup of column VGroups
141
+ */
142
+ getColumns(): VGroup;
129
143
  /**
130
144
  * Get all data entries as a VGroup
131
145
  * @returns VGroup containing all data entries
132
146
  */
133
147
  getEntries(): VGroup;
148
+ /**
149
+ * Get all data entries, excluding row and column labels, as a VGroup.
150
+ * Equivalent to {@link getEntries}; provided to match ManimCE's
151
+ * get_entries_without_labels naming.
152
+ * @returns VGroup containing all data entries
153
+ */
154
+ getEntriesWithoutLabels(): VGroup;
134
155
  /**
135
156
  * Get row labels as a VGroup
136
157
  */
@@ -139,6 +160,11 @@ export declare class Table extends VGroup {
139
160
  * Get column labels as a VGroup
140
161
  */
141
162
  getColLabels(): VGroup;
163
+ /**
164
+ * Get all labels (column labels followed by row labels) as a VGroup.
165
+ * @returns VGroup containing every label mobject
166
+ */
167
+ getLabels(): VGroup;
142
168
  /**
143
169
  * Get all horizontal lines
144
170
  */
@@ -147,6 +173,16 @@ export declare class Table extends VGroup {
147
173
  * Get all vertical lines
148
174
  */
149
175
  getVerticalLines(): VGroup;
176
+ /**
177
+ * Build a highlight rectangle sized and positioned to cover a cell, WITHOUT
178
+ * adding it to the table. Use {@link addHighlight} to also insert it.
179
+ * @param row - Row index (0-based)
180
+ * @param col - Column index (0-based)
181
+ * @param color - Highlight color. Default: YELLOW
182
+ * @param opacity - Fill opacity. Default: 0.3
183
+ * @returns The created Rectangle
184
+ */
185
+ getHighlightedCell(row: number, col: number, color?: string, opacity?: number): Rectangle;
150
186
  /**
151
187
  * Add a highlight rectangle behind a cell
152
188
  * @param row - Row index (0-based)
@@ -156,6 +192,23 @@ export declare class Table extends VGroup {
156
192
  * @returns The created Rectangle for further customization
157
193
  */
158
194
  addHighlight(row: number, col: number, color?: string, opacity?: number): Rectangle;
195
+ /**
196
+ * Alias for {@link addHighlight}, matching ManimCE's add_highlighted_cell.
197
+ * @param row - Row index (0-based)
198
+ * @param col - Column index (0-based)
199
+ * @param color - Highlight color. Default: YELLOW
200
+ * @param opacity - Fill opacity. Default: 0.3
201
+ * @returns The created Rectangle for further customization
202
+ */
203
+ addHighlightedCell(row: number, col: number, color?: string, opacity?: number): Rectangle;
204
+ /**
205
+ * Add a filled background rectangle behind every data entry.
206
+ * Repeated calls replace the previous backgrounds.
207
+ * @param color - Background color. Default: BLACK
208
+ * @param opacity - Fill opacity. Default: 1
209
+ * @returns this
210
+ */
211
+ addBackgroundToEntries(color?: string, opacity?: number): this;
159
212
  /**
160
213
  * Remove a highlight from a cell
161
214
  * @param row - Row index (0-based)
@@ -174,136 +227,20 @@ export declare class Table extends VGroup {
174
227
  * Set the color of grid lines
175
228
  */
176
229
  setLineColor(color: string): this;
230
+ /**
231
+ * Set the color of each data row. Colors are matched to rows in order.
232
+ * Rows beyond the number of colors are left unchanged.
233
+ * @param colors - One color per row
234
+ * @returns this
235
+ */
236
+ setRowColors(...colors: string[]): this;
237
+ /**
238
+ * Set the color of each data column. Colors are matched to columns in order.
239
+ * Columns beyond the number of colors are left unchanged.
240
+ * @param colors - One color per column
241
+ * @returns this
242
+ */
243
+ setColumnColors(...colors: string[]): this;
177
244
  copy(): Table;
178
245
  }
179
- /**
180
- * Options for creating a MathTable
181
- */
182
- export interface MathTableOptions extends Omit<TableOptions, 'data' | 'rowLabels' | 'colLabels'> {
183
- /** 2D array of LaTeX strings */
184
- data: string[][];
185
- /** Row labels as LaTeX strings */
186
- rowLabels?: string[];
187
- /** Column labels as LaTeX strings */
188
- colLabels?: string[];
189
- /** Font size for MathTex entries. Default: 36 */
190
- fontSize?: number;
191
- /** Color for all entries. Default: WHITE */
192
- color?: string;
193
- }
194
- /**
195
- * MathTable - A table where all entries are LaTeX-rendered MathTex
196
- *
197
- * Convenience class for creating tables of mathematical expressions.
198
- *
199
- * @example
200
- * ```typescript
201
- * const table = new MathTable({
202
- * data: [
203
- * ['x', 'x^2', 'x^3'],
204
- * ['1', '1', '1'],
205
- * ['2', '4', '8'],
206
- * ['3', '9', '27'],
207
- * ],
208
- * colLabels: ['x', 'x^2', 'x^3'],
209
- * });
210
- * ```
211
- */
212
- export declare class MathTable extends Table {
213
- constructor(options: MathTableOptions);
214
- }
215
- /**
216
- * Options for creating a MobjectTable
217
- */
218
- export type MobjectTableOptions = TableOptions;
219
- /**
220
- * MobjectTable - A table that can contain any type of mobject
221
- *
222
- * This is essentially an alias for Table, but with a more descriptive name
223
- * when you explicitly want to mix different mobject types.
224
- *
225
- * @example
226
- * ```typescript
227
- * const circle = new Circle();
228
- * const square = new Square();
229
- * const text = new Text({ text: 'Hello' });
230
- *
231
- * const table = new MobjectTable({
232
- * data: [[circle, square, text]]
233
- * });
234
- * ```
235
- */
236
- export declare class MobjectTable extends Table {
237
- constructor(options: MobjectTableOptions);
238
- }
239
- /**
240
- * Options for creating an IntegerTable
241
- */
242
- export interface IntegerTableOptions extends Omit<TableOptions, 'data' | 'rowLabels' | 'colLabels'> {
243
- /** 2D array of integers */
244
- data: number[][];
245
- /** Row labels as integers */
246
- rowLabels?: number[];
247
- /** Column labels as integers */
248
- colLabels?: number[];
249
- /** Font size. Default: 36 */
250
- fontSize?: number;
251
- /** Color for all entries. Default: WHITE */
252
- color?: string;
253
- }
254
- /**
255
- * IntegerTable - A table of integers
256
- *
257
- * Creates a table displaying integer values using DecimalNumber with 0 decimal places.
258
- *
259
- * @example
260
- * ```typescript
261
- * const table = new IntegerTable({
262
- * data: [
263
- * [1, 2, 3],
264
- * [4, 5, 6],
265
- * [7, 8, 9],
266
- * ]
267
- * });
268
- * ```
269
- */
270
- export declare class IntegerTable extends Table {
271
- constructor(options: IntegerTableOptions);
272
- }
273
- /**
274
- * Options for creating a DecimalTable
275
- */
276
- export interface DecimalTableOptions extends Omit<TableOptions, 'data' | 'rowLabels' | 'colLabels'> {
277
- /** 2D array of decimal numbers */
278
- data: number[][];
279
- /** Row labels as decimal numbers */
280
- rowLabels?: number[];
281
- /** Column labels as decimal numbers */
282
- colLabels?: number[];
283
- /** Number of decimal places. Default: 2 */
284
- numDecimalPlaces?: number;
285
- /** Font size. Default: 36 */
286
- fontSize?: number;
287
- /** Color for all entries. Default: WHITE */
288
- color?: string;
289
- }
290
- /**
291
- * DecimalTable - A table of decimal numbers
292
- *
293
- * Creates a table displaying decimal values with configurable precision.
294
- *
295
- * @example
296
- * ```typescript
297
- * const table = new DecimalTable({
298
- * data: [
299
- * [1.234, 2.567, 3.891],
300
- * [4.123, 5.456, 6.789],
301
- * ],
302
- * numDecimalPlaces: 2
303
- * });
304
- * ```
305
- */
306
- export declare class DecimalTable extends Table {
307
- constructor(options: DecimalTableOptions);
308
- }
309
246
  //# sourceMappingURL=Table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/mobjects/table/Table.ts"],"names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EG;IACH,UAAU,IAAI,MAAM;IAIpB;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAWjC;;;;;OAKG;IACH,YAAY,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAUvC;;;;;OAKG;IACH,eAAe,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAYjC,IAAI,IAAI,KAAK;CAmBvB"}
@@ -0,0 +1,132 @@
1
+ import { Table, TableOptions } from './Table';
2
+ /**
3
+ * Options for creating a MathTable
4
+ */
5
+ export interface MathTableOptions extends Omit<TableOptions, 'data' | 'rowLabels' | 'colLabels'> {
6
+ /** 2D array of LaTeX strings */
7
+ data: string[][];
8
+ /** Row labels as LaTeX strings */
9
+ rowLabels?: string[];
10
+ /** Column labels as LaTeX strings */
11
+ colLabels?: string[];
12
+ /** Font size for MathTex entries. Default: 36 */
13
+ fontSize?: number;
14
+ /** Color for all entries. Default: WHITE */
15
+ color?: string;
16
+ }
17
+ /**
18
+ * MathTable - A table where all entries are LaTeX-rendered MathTex
19
+ *
20
+ * Convenience class for creating tables of mathematical expressions.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const table = new MathTable({
25
+ * data: [
26
+ * ['x', 'x^2', 'x^3'],
27
+ * ['1', '1', '1'],
28
+ * ['2', '4', '8'],
29
+ * ['3', '9', '27'],
30
+ * ],
31
+ * colLabels: ['x', 'x^2', 'x^3'],
32
+ * });
33
+ * ```
34
+ */
35
+ export declare class MathTable extends Table {
36
+ constructor(options: MathTableOptions);
37
+ }
38
+ /**
39
+ * Options for creating a MobjectTable
40
+ */
41
+ export type MobjectTableOptions = TableOptions;
42
+ /**
43
+ * MobjectTable - A table that can contain any type of mobject
44
+ *
45
+ * This is essentially an alias for Table, but with a more descriptive name
46
+ * when you explicitly want to mix different mobject types.
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * const circle = new Circle();
51
+ * const square = new Square();
52
+ * const text = new Text({ text: 'Hello' });
53
+ *
54
+ * const table = new MobjectTable({
55
+ * data: [[circle, square, text]]
56
+ * });
57
+ * ```
58
+ */
59
+ export declare class MobjectTable extends Table {
60
+ constructor(options: MobjectTableOptions);
61
+ }
62
+ /**
63
+ * Options for creating an IntegerTable
64
+ */
65
+ export interface IntegerTableOptions extends Omit<TableOptions, 'data' | 'rowLabels' | 'colLabels'> {
66
+ /** 2D array of integers */
67
+ data: number[][];
68
+ /** Row labels as integers */
69
+ rowLabels?: number[];
70
+ /** Column labels as integers */
71
+ colLabels?: number[];
72
+ /** Font size. Default: 36 */
73
+ fontSize?: number;
74
+ /** Color for all entries. Default: WHITE */
75
+ color?: string;
76
+ }
77
+ /**
78
+ * IntegerTable - A table of integers
79
+ *
80
+ * Creates a table displaying integer values using DecimalNumber with 0 decimal places.
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * const table = new IntegerTable({
85
+ * data: [
86
+ * [1, 2, 3],
87
+ * [4, 5, 6],
88
+ * [7, 8, 9],
89
+ * ]
90
+ * });
91
+ * ```
92
+ */
93
+ export declare class IntegerTable extends Table {
94
+ constructor(options: IntegerTableOptions);
95
+ }
96
+ /**
97
+ * Options for creating a DecimalTable
98
+ */
99
+ export interface DecimalTableOptions extends Omit<TableOptions, 'data' | 'rowLabels' | 'colLabels'> {
100
+ /** 2D array of decimal numbers */
101
+ data: number[][];
102
+ /** Row labels as decimal numbers */
103
+ rowLabels?: number[];
104
+ /** Column labels as decimal numbers */
105
+ colLabels?: number[];
106
+ /** Number of decimal places. Default: 2 */
107
+ numDecimalPlaces?: number;
108
+ /** Font size. Default: 36 */
109
+ fontSize?: number;
110
+ /** Color for all entries. Default: WHITE */
111
+ color?: string;
112
+ }
113
+ /**
114
+ * DecimalTable - A table of decimal numbers
115
+ *
116
+ * Creates a table displaying decimal values with configurable precision.
117
+ *
118
+ * @example
119
+ * ```typescript
120
+ * const table = new DecimalTable({
121
+ * data: [
122
+ * [1.234, 2.567, 3.891],
123
+ * [4.123, 5.456, 6.789],
124
+ * ],
125
+ * numDecimalPlaces: 2
126
+ * });
127
+ * ```
128
+ */
129
+ export declare class DecimalTable extends Table {
130
+ constructor(options: DecimalTableOptions);
131
+ }
132
+ //# sourceMappingURL=TableVariants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableVariants.d.ts","sourceRoot":"","sources":["../../../src/mobjects/table/TableVariants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW,GAAG,WAAW,CAAC;IAC9F,gCAAgC;IAChC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,OAAO,EAAE,gBAAgB;CAqBtC;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,mBAAmB;CAGzC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,YAAY,EACZ,MAAM,GAAG,WAAW,GAAG,WAAW,CACnC;IACC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,mBAAmB;CA6CzC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,YAAY,EACZ,MAAM,GAAG,WAAW,GAAG,WAAW,CACnC;IACC,kCAAkC;IAClC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;IACjB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,mBAAmB;CAqDzC"}
@@ -4,5 +4,6 @@
4
4
  * This module provides table layout capabilities for displaying data in grids,
5
5
  * supporting various entry types including text, math, and arbitrary mobjects.
6
6
  */
7
- export { Table, MathTable, MobjectTable, IntegerTable, DecimalTable, type TableOptions, type MathTableOptions, type MobjectTableOptions, type IntegerTableOptions, type DecimalTableOptions, } from './Table';
7
+ export { Table, type TableOptions } from './Table';
8
+ export { MathTable, MobjectTable, IntegerTable, DecimalTable, type MathTableOptions, type MobjectTableOptions, type IntegerTableOptions, type DecimalTableOptions, } from './TableVariants';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/table/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/table/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAGnD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC"}