manim-web 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/Animation.d.ts +16 -1
- package/dist/animation/Animation.d.ts.map +1 -1
- package/dist/animation/MasterTimeline.d.ts +70 -0
- package/dist/animation/MasterTimeline.d.ts.map +1 -0
- package/dist/animation/Timeline.d.ts +1 -1
- package/dist/animation/Timeline.d.ts.map +1 -1
- package/dist/animation/fading/FadeIn.d.ts.map +1 -1
- package/dist/animation/movement/Shift.d.ts +2 -3
- package/dist/animation/movement/Shift.d.ts.map +1 -1
- package/dist/animation/transform/ApplyTransforms.d.ts +91 -0
- package/dist/animation/transform/ApplyTransforms.d.ts.map +1 -0
- package/dist/animation/transform/FadeTransforms.d.ts +76 -0
- package/dist/animation/transform/FadeTransforms.d.ts.map +1 -0
- package/dist/animation/transform/MovementTransforms.d.ts +131 -0
- package/dist/animation/transform/MovementTransforms.d.ts.map +1 -0
- package/dist/animation/transform/SpecialTransforms.d.ts +158 -0
- package/dist/animation/transform/SpecialTransforms.d.ts.map +1 -0
- package/dist/animation/transform/TransformExtensions.d.ts +11 -430
- package/dist/animation/transform/TransformExtensions.d.ts.map +1 -1
- package/dist/animation/transform/index.d.ts +4 -1
- package/dist/animation/transform/index.d.ts.map +1 -1
- package/dist/core/Group.d.ts +4 -1
- package/dist/core/Group.d.ts.map +1 -1
- package/dist/core/InteractiveScene.d.ts.map +1 -1
- package/dist/core/LinearTransformationScene.d.ts +152 -0
- package/dist/core/LinearTransformationScene.d.ts.map +1 -0
- package/dist/core/Mobject.d.ts +26 -389
- package/dist/core/Mobject.d.ts.map +1 -1
- package/dist/core/MobjectPositioning.d.ts +32 -0
- package/dist/core/MobjectPositioning.d.ts.map +1 -0
- package/dist/core/MobjectState.d.ts +40 -0
- package/dist/core/MobjectState.d.ts.map +1 -0
- package/dist/core/MobjectTypes.d.ts +51 -0
- package/dist/core/MobjectTypes.d.ts.map +1 -0
- package/dist/core/MovingCameraScene.d.ts +77 -0
- package/dist/core/MovingCameraScene.d.ts.map +1 -0
- package/dist/core/Renderer.d.ts +5 -0
- package/dist/core/Renderer.d.ts.map +1 -1
- package/dist/core/Scene.d.ts +88 -1
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/core/SceneExtensions.d.ts +7 -637
- package/dist/core/SceneExtensions.d.ts.map +1 -1
- package/dist/core/StateManager.d.ts.map +1 -1
- package/dist/core/ThreeDScene.d.ts +199 -0
- package/dist/core/ThreeDScene.d.ts.map +1 -0
- package/dist/core/VMobject.d.ts +48 -200
- package/dist/core/VMobject.d.ts.map +1 -1
- package/dist/core/VMobjectCurves.d.ts +25 -0
- package/dist/core/VMobjectCurves.d.ts.map +1 -0
- package/dist/core/VMobjectGeometry.d.ts +84 -0
- package/dist/core/VMobjectGeometry.d.ts.map +1 -0
- package/dist/core/VMobjectRendering.d.ts +138 -0
- package/dist/core/VMobjectRendering.d.ts.map +1 -0
- package/dist/core/VectorScene.d.ts +106 -0
- package/dist/core/VectorScene.d.ts.map +1 -0
- package/dist/core/ZoomedScene.d.ts +151 -0
- package/dist/core/ZoomedScene.d.ts.map +1 -0
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/export/GifExporter.d.ts +4 -3
- package/dist/export/GifExporter.d.ts.map +1 -1
- package/dist/export/VideoExporter.d.ts +3 -3
- package/dist/export/VideoExporter.d.ts.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13671 -12768
- package/dist/integrations/react.js +500 -461
- package/dist/integrations/vue.js +370 -331
- package/dist/interaction/Clickable.d.ts.map +1 -1
- package/dist/interaction/Draggable.d.ts.map +1 -1
- package/dist/interaction/Hoverable.d.ts.map +1 -1
- package/dist/interaction/SelectionManager.d.ts.map +1 -1
- package/dist/mobjects/geometry/AnnularSector.d.ts +107 -0
- package/dist/mobjects/geometry/AnnularSector.d.ts.map +1 -0
- package/dist/mobjects/geometry/Annulus.d.ts +89 -0
- package/dist/mobjects/geometry/Annulus.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcPolygon.d.ts +74 -0
- package/dist/mobjects/geometry/ArcPolygon.d.ts.map +1 -0
- package/dist/mobjects/geometry/ArcShapes.d.ts +11 -657
- package/dist/mobjects/geometry/ArcShapes.d.ts.map +1 -1
- package/dist/mobjects/geometry/BooleanOperations.d.ts.map +1 -1
- package/dist/mobjects/geometry/CurvedArrow.d.ts +95 -0
- package/dist/mobjects/geometry/CurvedArrow.d.ts.map +1 -0
- package/dist/mobjects/geometry/CurvedDoubleArrow.d.ts +60 -0
- package/dist/mobjects/geometry/CurvedDoubleArrow.d.ts.map +1 -0
- package/dist/mobjects/geometry/Ellipse.d.ts +98 -0
- package/dist/mobjects/geometry/Ellipse.d.ts.map +1 -0
- package/dist/mobjects/geometry/Rectangle.d.ts +3 -3
- package/dist/mobjects/geometry/Rectangle.d.ts.map +1 -1
- package/dist/mobjects/geometry/Sector.d.ts +99 -0
- package/dist/mobjects/geometry/Sector.d.ts.map +1 -0
- package/dist/mobjects/geometry/ShapeMatchers.d.ts +5 -1
- package/dist/mobjects/geometry/ShapeMatchers.d.ts.map +1 -1
- package/dist/mobjects/geometry/TangentialArc.d.ts +58 -0
- package/dist/mobjects/geometry/TangentialArc.d.ts.map +1 -0
- package/dist/mobjects/geometry/index.d.ts +10 -3
- package/dist/mobjects/geometry/index.d.ts.map +1 -1
- package/dist/mobjects/graph/DiGraph.d.ts +26 -0
- package/dist/mobjects/graph/DiGraph.d.ts.map +1 -0
- package/dist/mobjects/graph/GenericGraph.d.ts +184 -0
- package/dist/mobjects/graph/GenericGraph.d.ts.map +1 -0
- package/dist/mobjects/graph/Graph.d.ts +10 -0
- package/dist/mobjects/graph/Graph.d.ts.map +1 -0
- package/dist/mobjects/graph/graphFactories.d.ts +49 -0
- package/dist/mobjects/graph/graphFactories.d.ts.map +1 -0
- package/dist/mobjects/graph/graphTypes.d.ts +110 -0
- package/dist/mobjects/graph/graphTypes.d.ts.map +1 -0
- package/dist/mobjects/graph/index.d.ts +6 -417
- package/dist/mobjects/graph/index.d.ts.map +1 -1
- package/dist/mobjects/graph/layoutAlgorithms.d.ts +11 -0
- package/dist/mobjects/graph/layoutAlgorithms.d.ts.map +1 -0
- package/dist/mobjects/graphing/FunctionGraph.d.ts.map +1 -1
- package/dist/mobjects/graphing/ParametricFunction.d.ts +1 -1
- package/dist/mobjects/graphing/ParametricFunction.d.ts.map +1 -1
- package/dist/mobjects/image/index.d.ts +2 -1
- package/dist/mobjects/image/index.d.ts.map +1 -1
- package/dist/mobjects/point/Mobject1D.d.ts +129 -0
- package/dist/mobjects/point/Mobject1D.d.ts.map +1 -0
- package/dist/mobjects/point/Mobject2D.d.ts +170 -0
- package/dist/mobjects/point/Mobject2D.d.ts.map +1 -0
- package/dist/mobjects/point/PGroup.d.ts +111 -0
- package/dist/mobjects/point/PGroup.d.ts.map +1 -0
- package/dist/mobjects/point/PMobject.d.ts +152 -0
- package/dist/mobjects/point/PMobject.d.ts.map +1 -0
- package/dist/mobjects/point/PointCloudDot.d.ts +98 -0
- package/dist/mobjects/point/PointCloudDot.d.ts.map +1 -0
- package/dist/mobjects/point/PointMobject.d.ts +62 -0
- package/dist/mobjects/point/PointMobject.d.ts.map +1 -0
- package/dist/mobjects/point/index.d.ts +7 -701
- package/dist/mobjects/point/index.d.ts.map +1 -1
- package/dist/mobjects/svg/Brace.d.ts.map +1 -1
- package/dist/mobjects/text/Code.d.ts +2 -39
- package/dist/mobjects/text/Code.d.ts.map +1 -1
- package/dist/mobjects/text/CodeHighlighting.d.ts +50 -0
- package/dist/mobjects/text/CodeHighlighting.d.ts.map +1 -0
- package/dist/mobjects/text/CodeLanguageData.d.ts +25 -0
- package/dist/mobjects/text/CodeLanguageData.d.ts.map +1 -0
- package/dist/mobjects/text/DecimalNumber.d.ts.map +1 -1
- package/dist/mobjects/text/MathTex.d.ts +1 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -1
- package/dist/mobjects/text/MathTexSVG.d.ts +2 -0
- package/dist/mobjects/text/MathTexSVG.d.ts.map +1 -1
- package/dist/mobjects/text/Text.d.ts.map +1 -1
- package/dist/mobjects/text/Variable.d.ts.map +1 -1
- package/dist/mobjects/text/katex-styles.d.ts.map +1 -1
- package/dist/mobjects/three-d/Arrow3D.d.ts.map +1 -1
- package/dist/player/Player.d.ts +85 -0
- package/dist/player/Player.d.ts.map +1 -0
- package/dist/player/PlayerController.d.ts +22 -0
- package/dist/player/PlayerController.d.ts.map +1 -0
- package/dist/player/PlayerUI.d.ts +70 -0
- package/dist/player/PlayerUI.d.ts.map +1 -0
- package/dist/player/index.d.ts +4 -0
- package/dist/player/index.d.ts.map +1 -0
- package/dist/rate-functions/index.d.ts +144 -1
- package/dist/rate-functions/index.d.ts.map +1 -1
- package/dist/utils/hungarian.d.ts.map +1 -1
- package/dist/utils/skeletonize.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Mobject, Vector3Tuple } from '../../core/Mobject';
|
|
2
|
-
import { Dot } from '../geometry/Dot';
|
|
3
1
|
/**
|
|
4
2
|
* Graph mobjects for network visualization in manimweb
|
|
5
3
|
*
|
|
@@ -7,419 +5,10 @@ import { Dot } from '../geometry/Dot';
|
|
|
7
5
|
* and edges. Supports both undirected (Graph) and directed (DiGraph) graphs
|
|
8
6
|
* with various layout algorithms.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
* Edge definition as a tuple of [source, target]
|
|
17
|
-
*/
|
|
18
|
-
export type EdgeTuple = [VertexId, VertexId];
|
|
19
|
-
/**
|
|
20
|
-
* Layout algorithm types
|
|
21
|
-
*/
|
|
22
|
-
export type LayoutType = 'spring' | 'circular' | 'shell' | 'tree' | 'random' | 'grid' | 'kamada_kawai' | 'spectral' | 'bipartite' | 'custom';
|
|
23
|
-
/**
|
|
24
|
-
* Options for vertex styling
|
|
25
|
-
*/
|
|
26
|
-
export interface VertexStyleOptions {
|
|
27
|
-
/** Radius of the vertex dot. Default: 0.15 */
|
|
28
|
-
radius?: number;
|
|
29
|
-
/** Fill color of the vertex. Default: WHITE */
|
|
30
|
-
color?: string;
|
|
31
|
-
/** Fill opacity. Default: 1 */
|
|
32
|
-
fillOpacity?: number;
|
|
33
|
-
/** Stroke color for the vertex border. Default: same as color */
|
|
34
|
-
strokeColor?: string;
|
|
35
|
-
/** Stroke width. Default: 2 */
|
|
36
|
-
strokeWidth?: number;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Options for edge styling
|
|
40
|
-
*/
|
|
41
|
-
export interface EdgeStyleOptions {
|
|
42
|
-
/** Color of the edge. Default: BLUE */
|
|
43
|
-
color?: string;
|
|
44
|
-
/** Stroke width of the edge. Default: 4 */
|
|
45
|
-
strokeWidth?: number;
|
|
46
|
-
/** For directed graphs, tip length. Default: 0.2 */
|
|
47
|
-
tipLength?: number;
|
|
48
|
-
/** For directed graphs, tip width. Default: 0.12 */
|
|
49
|
-
tipWidth?: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Configuration for a single vertex
|
|
53
|
-
*/
|
|
54
|
-
export interface VertexConfig {
|
|
55
|
-
/** Position of the vertex (if using custom layout) */
|
|
56
|
-
position?: Vector3Tuple;
|
|
57
|
-
/** Custom styling for this vertex */
|
|
58
|
-
style?: VertexStyleOptions;
|
|
59
|
-
/** Label text to display next to the vertex */
|
|
60
|
-
label?: string;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Configuration for a single edge
|
|
64
|
-
*/
|
|
65
|
-
export interface EdgeConfig {
|
|
66
|
-
/** Custom styling for this edge */
|
|
67
|
-
style?: EdgeStyleOptions;
|
|
68
|
-
/** Label text to display on the edge */
|
|
69
|
-
label?: string;
|
|
70
|
-
/** Weight of the edge (used by some layout algorithms) */
|
|
71
|
-
weight?: number;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Layout configuration options
|
|
75
|
-
*/
|
|
76
|
-
export interface LayoutConfig {
|
|
77
|
-
/** Type of layout algorithm */
|
|
78
|
-
type: LayoutType;
|
|
79
|
-
/** Scale factor for the layout. Default: 2 */
|
|
80
|
-
scale?: number;
|
|
81
|
-
/** Center point of the layout. Default: [0, 0, 0] */
|
|
82
|
-
center?: Vector3Tuple;
|
|
83
|
-
/** Number of iterations for force-directed layouts. Default: 50 */
|
|
84
|
-
iterations?: number;
|
|
85
|
-
/** For tree layout: root vertex */
|
|
86
|
-
root?: VertexId;
|
|
87
|
-
/** For bipartite layout: partition sets */
|
|
88
|
-
partition?: [VertexId[], VertexId[]];
|
|
89
|
-
/** Custom positions map for custom layout */
|
|
90
|
-
positions?: Map<VertexId, Vector3Tuple>;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Options for creating a graph
|
|
94
|
-
*/
|
|
95
|
-
export interface GenericGraphOptions {
|
|
96
|
-
/** List of vertex identifiers */
|
|
97
|
-
vertices?: VertexId[];
|
|
98
|
-
/** List of edges as [source, target] tuples */
|
|
99
|
-
edges?: EdgeTuple[];
|
|
100
|
-
/** Layout configuration */
|
|
101
|
-
layout?: LayoutType | LayoutConfig;
|
|
102
|
-
/** Default vertex styling */
|
|
103
|
-
vertexStyle?: VertexStyleOptions;
|
|
104
|
-
/** Default edge styling */
|
|
105
|
-
edgeStyle?: EdgeStyleOptions;
|
|
106
|
-
/** Per-vertex configuration */
|
|
107
|
-
vertexConfig?: Map<VertexId, VertexConfig> | Record<string, VertexConfig>;
|
|
108
|
-
/** Per-edge configuration (key is "source-target") */
|
|
109
|
-
edgeConfig?: Map<string, EdgeConfig> | Record<string, EdgeConfig>;
|
|
110
|
-
/** Whether to show vertex labels. Default: false */
|
|
111
|
-
showLabels?: boolean;
|
|
112
|
-
/** Label font size. Default: 24 */
|
|
113
|
-
labelFontSize?: number;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* GenericGraph - Base class for graph visualization
|
|
117
|
-
*
|
|
118
|
-
* Provides the foundation for both directed and undirected graphs.
|
|
119
|
-
* Manages vertices and edges as Mobject children for animation support.
|
|
120
|
-
*/
|
|
121
|
-
export declare class GenericGraph extends Mobject {
|
|
122
|
-
/** List of vertex identifiers */
|
|
123
|
-
protected _vertices: VertexId[];
|
|
124
|
-
/** List of edges as [source, target] tuples */
|
|
125
|
-
protected _edges: EdgeTuple[];
|
|
126
|
-
/** Map of vertex id to position */
|
|
127
|
-
protected _positions: Map<VertexId, Vector3Tuple>;
|
|
128
|
-
/** Map of vertex id to Dot mobject */
|
|
129
|
-
protected _vertexMobjects: Map<VertexId, Dot>;
|
|
130
|
-
/** Map of edge key to Line/Arrow mobject */
|
|
131
|
-
protected _edgeMobjects: Map<string, Mobject>;
|
|
132
|
-
/** Layout configuration */
|
|
133
|
-
protected _layoutConfig: LayoutConfig;
|
|
134
|
-
/** Default vertex style */
|
|
135
|
-
protected _vertexStyle: VertexStyleOptions;
|
|
136
|
-
/** Default edge style */
|
|
137
|
-
protected _edgeStyle: EdgeStyleOptions;
|
|
138
|
-
/** Per-vertex configuration */
|
|
139
|
-
protected _vertexConfig: Map<VertexId, VertexConfig>;
|
|
140
|
-
/** Per-edge configuration */
|
|
141
|
-
protected _edgeConfig: Map<string, EdgeConfig>;
|
|
142
|
-
/** Whether this is a directed graph */
|
|
143
|
-
protected _directed: boolean;
|
|
144
|
-
/** Three.js group for this graph */
|
|
145
|
-
protected _group: THREE.Group | null;
|
|
146
|
-
constructor(options?: GenericGraphOptions);
|
|
147
|
-
/**
|
|
148
|
-
* Get edge key from vertex pair
|
|
149
|
-
*/
|
|
150
|
-
protected _getEdgeKey(source: VertexId, target: VertexId): string;
|
|
151
|
-
/**
|
|
152
|
-
* Compute vertex positions using the layout algorithm
|
|
153
|
-
*/
|
|
154
|
-
protected _computeLayout(): void;
|
|
155
|
-
/**
|
|
156
|
-
* Create vertex and edge mobjects
|
|
157
|
-
*/
|
|
158
|
-
protected _createMobjects(): void;
|
|
159
|
-
/**
|
|
160
|
-
* Create a single vertex mobject
|
|
161
|
-
*/
|
|
162
|
-
protected _createVertexMobject(v: VertexId): void;
|
|
163
|
-
/**
|
|
164
|
-
* Create a single edge mobject
|
|
165
|
-
*/
|
|
166
|
-
protected _createEdgeMobject(source: VertexId, target: VertexId): void;
|
|
167
|
-
/**
|
|
168
|
-
* Shorten an edge to not overlap with vertex circles
|
|
169
|
-
*/
|
|
170
|
-
protected _shortenEdge(start: Vector3Tuple, end: Vector3Tuple, radius: number): [Vector3Tuple, Vector3Tuple];
|
|
171
|
-
/**
|
|
172
|
-
* Add a vertex to the graph
|
|
173
|
-
* @param v - Vertex identifier
|
|
174
|
-
* @param config - Optional vertex configuration
|
|
175
|
-
* @returns this for chaining
|
|
176
|
-
*/
|
|
177
|
-
addVertex(v: VertexId, config?: VertexConfig): this;
|
|
178
|
-
/**
|
|
179
|
-
* Add multiple vertices to the graph
|
|
180
|
-
* @param vertices - Array of vertex identifiers
|
|
181
|
-
* @returns this for chaining
|
|
182
|
-
*/
|
|
183
|
-
addVertices(...vertices: VertexId[]): this;
|
|
184
|
-
/**
|
|
185
|
-
* Remove a vertex from the graph
|
|
186
|
-
* @param v - Vertex identifier
|
|
187
|
-
* @returns this for chaining
|
|
188
|
-
*/
|
|
189
|
-
removeVertex(v: VertexId): this;
|
|
190
|
-
/**
|
|
191
|
-
* Get all vertex identifiers
|
|
192
|
-
*/
|
|
193
|
-
getVertices(): VertexId[];
|
|
194
|
-
/**
|
|
195
|
-
* Get the number of vertices
|
|
196
|
-
*/
|
|
197
|
-
get numVertices(): number;
|
|
198
|
-
/**
|
|
199
|
-
* Check if the graph contains a vertex
|
|
200
|
-
*/
|
|
201
|
-
hasVertex(v: VertexId): boolean;
|
|
202
|
-
/**
|
|
203
|
-
* Get the Dot mobject for a vertex
|
|
204
|
-
*/
|
|
205
|
-
getVertexMobject(v: VertexId): Dot | undefined;
|
|
206
|
-
/**
|
|
207
|
-
* Get the position of a vertex
|
|
208
|
-
*/
|
|
209
|
-
getVertexPosition(v: VertexId): Vector3Tuple | undefined;
|
|
210
|
-
/**
|
|
211
|
-
* Set the position of a vertex
|
|
212
|
-
*/
|
|
213
|
-
setVertexPosition(v: VertexId, position: Vector3Tuple): this;
|
|
214
|
-
/**
|
|
215
|
-
* Get neighbors of a vertex (adjacent vertices)
|
|
216
|
-
*/
|
|
217
|
-
getNeighbors(v: VertexId): VertexId[];
|
|
218
|
-
/**
|
|
219
|
-
* Get the degree of a vertex (number of edges)
|
|
220
|
-
*/
|
|
221
|
-
getDegree(v: VertexId): number;
|
|
222
|
-
/**
|
|
223
|
-
* Add an edge to the graph
|
|
224
|
-
* @param source - Source vertex
|
|
225
|
-
* @param target - Target vertex
|
|
226
|
-
* @param config - Optional edge configuration
|
|
227
|
-
* @returns this for chaining
|
|
228
|
-
*/
|
|
229
|
-
addEdge(source: VertexId, target: VertexId, config?: EdgeConfig): this;
|
|
230
|
-
/**
|
|
231
|
-
* Add multiple edges to the graph
|
|
232
|
-
* @param edges - Array of [source, target] tuples
|
|
233
|
-
* @returns this for chaining
|
|
234
|
-
*/
|
|
235
|
-
addEdges(...edges: EdgeTuple[]): this;
|
|
236
|
-
/**
|
|
237
|
-
* Remove an edge from the graph
|
|
238
|
-
* @param source - Source vertex
|
|
239
|
-
* @param target - Target vertex
|
|
240
|
-
* @returns this for chaining
|
|
241
|
-
*/
|
|
242
|
-
removeEdge(source: VertexId, target: VertexId): this;
|
|
243
|
-
/**
|
|
244
|
-
* Get all edges
|
|
245
|
-
*/
|
|
246
|
-
getEdges(): EdgeTuple[];
|
|
247
|
-
/**
|
|
248
|
-
* Get the number of edges
|
|
249
|
-
*/
|
|
250
|
-
get numEdges(): number;
|
|
251
|
-
/**
|
|
252
|
-
* Check if the graph contains an edge
|
|
253
|
-
*/
|
|
254
|
-
hasEdge(source: VertexId, target: VertexId): boolean;
|
|
255
|
-
/**
|
|
256
|
-
* Get the Line/Arrow mobject for an edge
|
|
257
|
-
*/
|
|
258
|
-
getEdgeMobject(source: VertexId, target: VertexId): Mobject | undefined;
|
|
259
|
-
/**
|
|
260
|
-
* Change the layout algorithm
|
|
261
|
-
* @param layout - Layout type or configuration
|
|
262
|
-
* @returns this for chaining
|
|
263
|
-
*/
|
|
264
|
-
setLayout(layout: LayoutType | LayoutConfig): this;
|
|
265
|
-
/**
|
|
266
|
-
* Get all vertex positions
|
|
267
|
-
*/
|
|
268
|
-
getPositions(): Map<VertexId, Vector3Tuple>;
|
|
269
|
-
/**
|
|
270
|
-
* Set the color of a specific vertex
|
|
271
|
-
*/
|
|
272
|
-
setVertexColor(v: VertexId, color: string): this;
|
|
273
|
-
/**
|
|
274
|
-
* Set the color of a specific edge
|
|
275
|
-
*/
|
|
276
|
-
setEdgeColor(source: VertexId, target: VertexId, color: string): this;
|
|
277
|
-
/**
|
|
278
|
-
* Highlight a path (sequence of vertices)
|
|
279
|
-
*/
|
|
280
|
-
highlightPath(path: VertexId[], vertexColor?: string, edgeColor?: string): this;
|
|
281
|
-
/**
|
|
282
|
-
* Reset all colors to default
|
|
283
|
-
*/
|
|
284
|
-
resetColors(): this;
|
|
285
|
-
/**
|
|
286
|
-
* Create the Three.js backing object
|
|
287
|
-
*/
|
|
288
|
-
protected _createThreeObject(): THREE.Object3D;
|
|
289
|
-
/**
|
|
290
|
-
* Create a copy of this graph
|
|
291
|
-
*/
|
|
292
|
-
protected _createCopy(): GenericGraph;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Graph - Undirected graph visualization
|
|
296
|
-
*
|
|
297
|
-
* Creates a graph with vertices connected by undirected edges (Lines).
|
|
298
|
-
*
|
|
299
|
-
* @example
|
|
300
|
-
* ```typescript
|
|
301
|
-
* // Create a simple triangle graph
|
|
302
|
-
* const graph = new Graph({
|
|
303
|
-
* vertices: ['A', 'B', 'C'],
|
|
304
|
-
* edges: [['A', 'B'], ['B', 'C'], ['C', 'A']],
|
|
305
|
-
* layout: 'circular'
|
|
306
|
-
* });
|
|
307
|
-
*
|
|
308
|
-
* // Create a graph with custom styling
|
|
309
|
-
* const styledGraph = new Graph({
|
|
310
|
-
* vertices: [1, 2, 3, 4],
|
|
311
|
-
* edges: [[1, 2], [2, 3], [3, 4], [4, 1]],
|
|
312
|
-
* layout: 'spring',
|
|
313
|
-
* vertexStyle: { color: '#FF0000', radius: 0.2 },
|
|
314
|
-
* edgeStyle: { color: '#00FF00', strokeWidth: 3 }
|
|
315
|
-
* });
|
|
316
|
-
* ```
|
|
317
|
-
*/
|
|
318
|
-
export declare class Graph extends GenericGraph {
|
|
319
|
-
constructor(options?: GenericGraphOptions);
|
|
320
|
-
/**
|
|
321
|
-
* Create a copy of this graph
|
|
322
|
-
*/
|
|
323
|
-
protected _createCopy(): Graph;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Options for creating a directed graph
|
|
327
|
-
*/
|
|
328
|
-
export interface DiGraphOptions extends GenericGraphOptions {
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* DiGraph - Directed graph visualization
|
|
332
|
-
*
|
|
333
|
-
* Creates a graph with vertices connected by directed edges (Arrows).
|
|
334
|
-
*
|
|
335
|
-
* @example
|
|
336
|
-
* ```typescript
|
|
337
|
-
* // Create a directed graph
|
|
338
|
-
* const digraph = new DiGraph({
|
|
339
|
-
* vertices: ['A', 'B', 'C'],
|
|
340
|
-
* edges: [['A', 'B'], ['B', 'C'], ['C', 'A']],
|
|
341
|
-
* layout: 'circular'
|
|
342
|
-
* });
|
|
343
|
-
*
|
|
344
|
-
* // Tree structure with directed edges
|
|
345
|
-
* const tree = new DiGraph({
|
|
346
|
-
* vertices: ['root', 'left', 'right', 'leafL', 'leafR'],
|
|
347
|
-
* edges: [
|
|
348
|
-
* ['root', 'left'],
|
|
349
|
-
* ['root', 'right'],
|
|
350
|
-
* ['left', 'leafL'],
|
|
351
|
-
* ['right', 'leafR']
|
|
352
|
-
* ],
|
|
353
|
-
* layout: { type: 'tree', root: 'root' }
|
|
354
|
-
* });
|
|
355
|
-
* ```
|
|
356
|
-
*/
|
|
357
|
-
export declare class DiGraph extends GenericGraph {
|
|
358
|
-
constructor(options?: DiGraphOptions);
|
|
359
|
-
/**
|
|
360
|
-
* Get out-neighbors (vertices this vertex points to)
|
|
361
|
-
*/
|
|
362
|
-
getOutNeighbors(v: VertexId): VertexId[];
|
|
363
|
-
/**
|
|
364
|
-
* Get in-neighbors (vertices that point to this vertex)
|
|
365
|
-
*/
|
|
366
|
-
getInNeighbors(v: VertexId): VertexId[];
|
|
367
|
-
/**
|
|
368
|
-
* Get out-degree (number of outgoing edges)
|
|
369
|
-
*/
|
|
370
|
-
getOutDegree(v: VertexId): number;
|
|
371
|
-
/**
|
|
372
|
-
* Get in-degree (number of incoming edges)
|
|
373
|
-
*/
|
|
374
|
-
getInDegree(v: VertexId): number;
|
|
375
|
-
/**
|
|
376
|
-
* Create a copy of this digraph
|
|
377
|
-
*/
|
|
378
|
-
protected _createCopy(): DiGraph;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Create a complete graph (all vertices connected)
|
|
382
|
-
* @param n - Number of vertices
|
|
383
|
-
* @returns A complete Graph with n vertices
|
|
384
|
-
*/
|
|
385
|
-
export declare function completeGraph(n: number, options?: Partial<GenericGraphOptions>): Graph;
|
|
386
|
-
/**
|
|
387
|
-
* Create a cycle graph (vertices in a ring)
|
|
388
|
-
* @param n - Number of vertices
|
|
389
|
-
* @returns A cycle Graph with n vertices
|
|
390
|
-
*/
|
|
391
|
-
export declare function cycleGraph(n: number, options?: Partial<GenericGraphOptions>): Graph;
|
|
392
|
-
/**
|
|
393
|
-
* Create a path graph (linear chain)
|
|
394
|
-
* @param n - Number of vertices
|
|
395
|
-
* @returns A path Graph with n vertices
|
|
396
|
-
*/
|
|
397
|
-
export declare function pathGraph(n: number, options?: Partial<GenericGraphOptions>): Graph;
|
|
398
|
-
/**
|
|
399
|
-
* Create a star graph (one central vertex connected to all others)
|
|
400
|
-
* @param n - Number of outer vertices (total vertices = n + 1)
|
|
401
|
-
* @returns A star Graph
|
|
402
|
-
*/
|
|
403
|
-
export declare function starGraph(n: number, options?: Partial<GenericGraphOptions>): Graph;
|
|
404
|
-
/**
|
|
405
|
-
* Create a binary tree
|
|
406
|
-
* @param depth - Depth of the tree
|
|
407
|
-
* @returns A binary tree DiGraph
|
|
408
|
-
*/
|
|
409
|
-
export declare function binaryTree(depth: number, options?: Partial<GenericGraphOptions>): DiGraph;
|
|
410
|
-
/**
|
|
411
|
-
* Create a grid graph
|
|
412
|
-
* @param rows - Number of rows
|
|
413
|
-
* @param cols - Number of columns
|
|
414
|
-
* @returns A grid Graph
|
|
415
|
-
*/
|
|
416
|
-
export declare function gridGraph(rows: number, cols: number, options?: Partial<GenericGraphOptions>): Graph;
|
|
417
|
-
/**
|
|
418
|
-
* Create a bipartite graph
|
|
419
|
-
* @param n1 - Number of vertices in first partition
|
|
420
|
-
* @param n2 - Number of vertices in second partition
|
|
421
|
-
* @param edges - Edges between partitions (optional, complete if not provided)
|
|
422
|
-
* @returns A bipartite Graph
|
|
423
|
-
*/
|
|
424
|
-
export declare function bipartiteGraph(n1: number, n2: number, edges?: EdgeTuple[], options?: Partial<GenericGraphOptions>): Graph;
|
|
8
|
+
export type { VertexId, EdgeTuple, LayoutType, VertexStyleOptions, EdgeStyleOptions, VertexConfig, EdgeConfig, LayoutConfig, GenericGraphOptions, DiGraphOptions, } from './graphTypes';
|
|
9
|
+
export { computeLayout, computeCircularLayout } from './layoutAlgorithms';
|
|
10
|
+
export { GenericGraph } from './GenericGraph';
|
|
11
|
+
export { Graph } from './Graph';
|
|
12
|
+
export { DiGraph } from './DiGraph';
|
|
13
|
+
export { completeGraph, cycleGraph, pathGraph, starGraph, binaryTree, gridGraph, bipartiteGraph, } from './graphFactories';
|
|
425
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graph/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graph/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,GACf,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import { VertexId, EdgeTuple, LayoutConfig, VertexConfig } from './graphTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Compute vertex positions using the specified layout algorithm
|
|
5
|
+
*/
|
|
6
|
+
export declare function computeLayout(vertices: VertexId[], edges: EdgeTuple[], config: LayoutConfig, vertexConfig?: Map<VertexId, VertexConfig>): Map<VertexId, Vector3Tuple>;
|
|
7
|
+
/**
|
|
8
|
+
* Circular layout: vertices equally spaced on a circle
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeCircularLayout(vertices: VertexId[], positions: Map<VertexId, Vector3Tuple>, scale: number, center: Vector3Tuple): void;
|
|
11
|
+
//# sourceMappingURL=layoutAlgorithms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layoutAlgorithms.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graph/layoutAlgorithms.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/E;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,QAAQ,EAAE,EACpB,KAAK,EAAE,SAAS,EAAE,EAClB,MAAM,EAAE,YAAY,EACpB,YAAY,CAAC,EAAE,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,GACzC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAmD7B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,QAAQ,EAAE,EACpB,SAAS,EAAE,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,EACtC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,GACnB,IAAI,CAUN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionGraph.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graphing/FunctionGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5B,yEAAyE;IACzE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;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are class ParametricFunction extends VMobject {
|
|
|
69
69
|
* @param t - The parameter value
|
|
70
70
|
* @returns The 3D point on the curve
|
|
71
71
|
*/
|
|
72
|
-
getPointFromT(t: number): Vector3Tuple;
|
|
72
|
+
getPointFromT(t: number): Vector3Tuple | null;
|
|
73
73
|
/**
|
|
74
74
|
* Get the parametric function
|
|
75
75
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParametricFunction.d.ts","sourceRoot":"","sources":["../../../src/mobjects/graphing/ParametricFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,yEAAyE;IACzE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjE,qDAAqD;IACrD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,oFAAoF;IACpF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,OAAO,CAAC,KAAK,CAA6D;IAC1E,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,KAAK,CAAc;IAC3B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H,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAkB7C;;OAEG;IACH,WAAW,IAAI,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIzE;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAMnF;;OAEG;IACH,SAAS,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IAI7B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAMzC;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAMvC;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI;IAMhC;;OAEG;IACH,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAMpC;;OAEG;cACgB,WAAW,IAAI,kBAAkB;CAWrD;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -84,6 +84,7 @@ export declare class ImageMobject extends Mobject {
|
|
|
84
84
|
protected _naturalHeight: number;
|
|
85
85
|
private _loadPromise;
|
|
86
86
|
private _loadResolve;
|
|
87
|
+
private _loadReject;
|
|
87
88
|
constructor(options: ImageMobjectOptions);
|
|
88
89
|
/**
|
|
89
90
|
* Load texture from a 2D grayscale pixel array
|
|
@@ -205,7 +206,7 @@ export declare class ImageMobject extends Mobject {
|
|
|
205
206
|
/**
|
|
206
207
|
* Override getBoundingBox to use calculated dimensions
|
|
207
208
|
*/
|
|
208
|
-
|
|
209
|
+
getBoundingBox(): {
|
|
209
210
|
width: number;
|
|
210
211
|
height: number;
|
|
211
212
|
depth: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/image/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kHAAkH;IAClH,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACvB,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uHAAuH;IACvH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,YAAa,SAAQ,OAAO;IACvC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IAC7C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,S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,MAAM,CAAA;KAAE;IAOnD;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACM,cAAc,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAS3E;;OAEG;cACgB,WAAW,IAAI,YAAY;IAc9C;;OAEG;IACM,OAAO,IAAI,IAAI;CAQzB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { Vector3Tuple } from '../../core/Mobject';
|
|
2
|
+
import { PMobject } from './PMobject';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating a Mobject1D
|
|
5
|
+
*/
|
|
6
|
+
export interface Mobject1DOptions {
|
|
7
|
+
/** Start point [x, y, z]. Default: [-1, 0, 0] */
|
|
8
|
+
start?: Vector3Tuple;
|
|
9
|
+
/** End point [x, y, z]. Default: [1, 0, 0] */
|
|
10
|
+
end?: Vector3Tuple;
|
|
11
|
+
/** Number of points along the line. Default: 20 */
|
|
12
|
+
numPoints?: number;
|
|
13
|
+
/** Alternative to numPoints: density (points per unit length). Overrides numPoints if provided. */
|
|
14
|
+
density?: number;
|
|
15
|
+
/** Color as CSS color string. Default: white (#FFFFFF) */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** Opacity from 0 to 1. Default: 1 */
|
|
18
|
+
opacity?: number;
|
|
19
|
+
/** Size of each point in pixels. Default: 6 */
|
|
20
|
+
pointSize?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Mobject1D - 1D point distribution along a line
|
|
24
|
+
*
|
|
25
|
+
* Points are distributed along a line segment between start and end.
|
|
26
|
+
* You can specify either a fixed number of points or a density
|
|
27
|
+
* (points per unit length).
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // Create a line of 10 points from origin to (2, 0, 0)
|
|
32
|
+
* const line = new Mobject1D({
|
|
33
|
+
* start: [0, 0, 0],
|
|
34
|
+
* end: [2, 0, 0],
|
|
35
|
+
* numPoints: 10,
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // Create a line with density of 5 points per unit
|
|
39
|
+
* const denseLine = new Mobject1D({
|
|
40
|
+
* start: [-1, -1, 0],
|
|
41
|
+
* end: [1, 1, 0],
|
|
42
|
+
* density: 5,
|
|
43
|
+
* color: '#00ff00',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare class Mobject1D extends PMobject {
|
|
48
|
+
protected _start: Vector3Tuple;
|
|
49
|
+
protected _end: Vector3Tuple;
|
|
50
|
+
protected _numPointsConfig: number;
|
|
51
|
+
protected _density?: number;
|
|
52
|
+
constructor(options?: Mobject1DOptions);
|
|
53
|
+
/**
|
|
54
|
+
* Calculate the length of the line segment
|
|
55
|
+
*/
|
|
56
|
+
getLength(): number;
|
|
57
|
+
/**
|
|
58
|
+
* Get the actual number of points based on config or density
|
|
59
|
+
*/
|
|
60
|
+
protected _getActualNumPoints(): number;
|
|
61
|
+
/**
|
|
62
|
+
* Generate points along the line
|
|
63
|
+
*/
|
|
64
|
+
protected _generatePoints(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Get the start point
|
|
67
|
+
*/
|
|
68
|
+
getStart(): Vector3Tuple;
|
|
69
|
+
/**
|
|
70
|
+
* Get the end point
|
|
71
|
+
*/
|
|
72
|
+
getEnd(): Vector3Tuple;
|
|
73
|
+
/**
|
|
74
|
+
* Set the start point and regenerate
|
|
75
|
+
* @param start - New start point [x, y, z]
|
|
76
|
+
* @returns this for chaining
|
|
77
|
+
*/
|
|
78
|
+
setStart(start: Vector3Tuple): this;
|
|
79
|
+
/**
|
|
80
|
+
* Set the end point and regenerate
|
|
81
|
+
* @param end - New end point [x, y, z]
|
|
82
|
+
* @returns this for chaining
|
|
83
|
+
*/
|
|
84
|
+
setEnd(end: Vector3Tuple): this;
|
|
85
|
+
/**
|
|
86
|
+
* Set both endpoints and regenerate
|
|
87
|
+
* @param start - New start point [x, y, z]
|
|
88
|
+
* @param end - New end point [x, y, z]
|
|
89
|
+
* @returns this for chaining
|
|
90
|
+
*/
|
|
91
|
+
setEndpoints(start: Vector3Tuple, end: Vector3Tuple): this;
|
|
92
|
+
/**
|
|
93
|
+
* Set the number of points and regenerate (clears density)
|
|
94
|
+
* @param count - Number of points
|
|
95
|
+
* @returns this for chaining
|
|
96
|
+
*/
|
|
97
|
+
setNumPoints(count: number): this;
|
|
98
|
+
/**
|
|
99
|
+
* Set the density and regenerate (overrides numPoints)
|
|
100
|
+
* @param density - Points per unit length
|
|
101
|
+
* @returns this for chaining
|
|
102
|
+
*/
|
|
103
|
+
setDensity(density: number): this;
|
|
104
|
+
/**
|
|
105
|
+
* Get the center of the line segment
|
|
106
|
+
*/
|
|
107
|
+
getCenter(): Vector3Tuple;
|
|
108
|
+
/**
|
|
109
|
+
* Move the line to center at a new position
|
|
110
|
+
* @param point - Target center position [x, y, z]
|
|
111
|
+
*/
|
|
112
|
+
moveTo(point: Vector3Tuple): this;
|
|
113
|
+
/**
|
|
114
|
+
* Shift the line by a delta
|
|
115
|
+
* @param delta - Translation vector [x, y, z]
|
|
116
|
+
* @returns this for chaining
|
|
117
|
+
*/
|
|
118
|
+
shift(delta: Vector3Tuple): this;
|
|
119
|
+
/**
|
|
120
|
+
* Regenerate the points
|
|
121
|
+
* @returns this for chaining
|
|
122
|
+
*/
|
|
123
|
+
regenerate(): this;
|
|
124
|
+
/**
|
|
125
|
+
* Create a copy of this Mobject1D
|
|
126
|
+
*/
|
|
127
|
+
protected _createCopy(): Mobject1D;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=Mobject1D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mobject1D.d.ts","sourceRoot":"","sources":["../../../src/mobjects/point/Mobject1D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBA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