figureone 0.15.10 → 1.0.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/figureone.min.js +1 -1
- package/index.js +79167 -0
- package/package.json +15 -1
- package/types/index.d.ts +132 -0
- package/types/js/figure/Animation/Animation.d.ts +36 -0
- package/types/js/figure/Animation/AnimationBuilder.d.ts +173 -0
- package/types/js/figure/Animation/AnimationManager.d.ts +392 -0
- package/types/js/figure/Animation/AnimationStep/CustomStep.d.ts +99 -0
- package/types/js/figure/Animation/AnimationStep/DelayStep.d.ts +24 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/ColorAnimationStep.d.ts +203 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/OpacityAnimationStep.d.ts +220 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/PositionAnimationStep.d.ts +124 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/PulseAnimationStep.d.ts +137 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/PulseTransformAnimationStep.d.ts +52 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/RotationAnimationStep.d.ts +119 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/ScaleAnimationStep.d.ts +93 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/ScenarioAnimationStep.d.ts +204 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/TransformAnimationStep.d.ts +163 -0
- package/types/js/figure/Animation/AnimationStep/ElementAnimationStep.d.ts +56 -0
- package/types/js/figure/Animation/AnimationStep/ParallelAnimationStep.d.ts +70 -0
- package/types/js/figure/Animation/AnimationStep/SerialAnimationStep.d.ts +84 -0
- package/types/js/figure/Animation/AnimationStep/TriggerStep.d.ts +106 -0
- package/types/js/figure/Animation/AnimationStep.d.ts +110 -0
- package/types/js/figure/DrawContext2D.d.ts +9 -0
- package/types/js/figure/DrawingObjects/DrawingObject.d.ts +45 -0
- package/types/js/figure/DrawingObjects/GLObject/GLObject.d.ts +146 -0
- package/types/js/figure/DrawingObjects/HTMLObject/HTMLObject.d.ts +29 -0
- package/types/js/figure/DrawingObjects/TextObject/TextObject.d.ts +94 -0
- package/types/js/figure/DrawingObjects/TextObject/glyphMeasures.d.ts +7 -0
- package/types/js/figure/DrawingObjects/VertexObject/VertexGeneric.d.ts +21 -0
- package/types/js/figure/DrawingObjects/VertexObject/VertexObject.d.ts +0 -0
- package/types/js/figure/DrawingObjects/VertexObject/VertexText.d.ts +34 -0
- package/types/js/figure/Element.d.ts +1212 -0
- package/types/js/figure/Equation/Elements/BaseAnnotationFunction.d.ts +118 -0
- package/types/js/figure/Equation/Elements/BaseEquationFunction.d.ts +20 -0
- package/types/js/figure/Equation/Elements/Bounds.d.ts +49 -0
- package/types/js/figure/Equation/Elements/Color.d.ts +7 -0
- package/types/js/figure/Equation/Elements/Container.d.ts +5 -0
- package/types/js/figure/Equation/Elements/Element.d.ts +95 -0
- package/types/js/figure/Equation/Elements/Fraction.d.ts +5 -0
- package/types/js/figure/Equation/Elements/Lines.d.ts +5 -0
- package/types/js/figure/Equation/Elements/Matrix.d.ts +5 -0
- package/types/js/figure/Equation/Elements/Offset.d.ts +5 -0
- package/types/js/figure/Equation/Elements/Scale.d.ts +5 -0
- package/types/js/figure/Equation/Equation.d.ts +984 -0
- package/types/js/figure/Equation/EquationForm.d.ts +139 -0
- package/types/js/figure/Equation/EquationFunctions.d.ts +3367 -0
- package/types/js/figure/Equation/EquationSymbols.d.ts +1646 -0
- package/types/js/figure/Equation/HTMLEquation.d.ts +56 -0
- package/types/js/figure/Equation/Symbols/AngleBracket.d.ts +6 -0
- package/types/js/figure/Equation/Symbols/Arrow.d.ts +17 -0
- package/types/js/figure/Equation/Symbols/Bar.d.ts +6 -0
- package/types/js/figure/Equation/Symbols/Box.d.ts +11 -0
- package/types/js/figure/Equation/Symbols/Brace.d.ts +6 -0
- package/types/js/figure/Equation/Symbols/Bracket.d.ts +8 -0
- package/types/js/figure/Equation/Symbols/Division.d.ts +8 -0
- package/types/js/figure/Equation/Symbols/Integral.d.ts +7 -0
- package/types/js/figure/Equation/Symbols/Line.d.ts +5 -0
- package/types/js/figure/Equation/Symbols/Product.d.ts +6 -0
- package/types/js/figure/Equation/Symbols/Radical.d.ts +9 -0
- package/types/js/figure/Equation/Symbols/SquareBracket.d.ts +6 -0
- package/types/js/figure/Equation/Symbols/Strike.d.ts +8 -0
- package/types/js/figure/Equation/Symbols/Sum.d.ts +6 -0
- package/types/js/figure/Equation/Symbols/SymbolNew.d.ts +15 -0
- package/types/js/figure/Equation/Symbols/Vinculum.d.ts +6 -0
- package/types/js/figure/Figure.d.ts +711 -0
- package/types/js/figure/FigureCollections/Angle.d.ts +766 -0
- package/types/js/figure/FigureCollections/Axis.d.ts +517 -0
- package/types/js/figure/FigureCollections/Axis3.d.ts +118 -0
- package/types/js/figure/FigureCollections/Button.d.ts +195 -0
- package/types/js/figure/FigureCollections/EquationLabel.d.ts +77 -0
- package/types/js/figure/FigureCollections/FigureCollections.d.ts +122 -0
- package/types/js/figure/FigureCollections/Legend.d.ts +270 -0
- package/types/js/figure/FigureCollections/Line.d.ts +587 -0
- package/types/js/figure/FigureCollections/Plot.d.ts +558 -0
- package/types/js/figure/FigureCollections/PolyLine.d.ts +487 -0
- package/types/js/figure/FigureCollections/Rectangle.d.ts +235 -0
- package/types/js/figure/FigureCollections/SlideNavigator.d.ts +255 -0
- package/types/js/figure/FigureCollections/Slider.d.ts +155 -0
- package/types/js/figure/FigureCollections/Text.d.ts +307 -0
- package/types/js/figure/FigureCollections/Toggle.d.ts +185 -0
- package/types/js/figure/FigureCollections/Trace.d.ts +237 -0
- package/types/js/figure/FigurePrimitives/FigureElementPrimitive2DText.d.ts +119 -0
- package/types/js/figure/FigurePrimitives/FigureElementPrimitiveGLText.d.ts +94 -0
- package/types/js/figure/FigurePrimitives/FigureElementPrimitiveGesture.d.ts +536 -0
- package/types/js/figure/FigurePrimitives/FigureElementPrimitiveMorph.d.ts +175 -0
- package/types/js/figure/FigurePrimitives/FigurePrimitiveTypes.d.ts +788 -0
- package/types/js/figure/FigurePrimitives/FigurePrimitiveTypes2D.d.ts +1324 -0
- package/types/js/figure/FigurePrimitives/FigurePrimitiveTypes3D.d.ts +1105 -0
- package/types/js/figure/FigurePrimitives/FigurePrimitives.d.ts +173 -0
- package/types/js/figure/FigurePrimitives/Generic.d.ts +5 -0
- package/types/js/figure/FigurePrimitives/Text.d.ts +17 -0
- package/types/js/figure/FontManager.d.ts +113 -0
- package/types/js/figure/Gesture.d.ts +39 -0
- package/types/js/figure/Recorder/Recorder.d.ts +291 -0
- package/types/js/figure/Recorder/parseState.d.ts +3 -0
- package/types/js/figure/Recorder/recorder.worker.d.ts +1 -0
- package/types/js/figure/Recorder/state.d.ts +7 -0
- package/types/js/figure/SlideNavigator.d.ts +606 -0
- package/types/js/figure/TimeKeeper.d.ts +174 -0
- package/types/js/figure/geometries/arc.d.ts +18 -0
- package/types/js/figure/geometries/arrow.d.ts +215 -0
- package/types/js/figure/geometries/buffer.d.ts +4 -0
- package/types/js/figure/geometries/copy/copy.d.ts +178 -0
- package/types/js/figure/geometries/ellipse.d.ts +17 -0
- package/types/js/figure/geometries/line.d.ts +13 -0
- package/types/js/figure/geometries/lines/corners.d.ts +7 -0
- package/types/js/figure/geometries/lines/dashes.d.ts +23 -0
- package/types/js/figure/geometries/lines/lines.d.ts +31 -0
- package/types/js/figure/geometries/polygon/polygon.d.ts +12 -0
- package/types/js/figure/geometries/rectangle.d.ts +19 -0
- package/types/js/figure/geometries/triangle.d.ts +27 -0
- package/types/js/figure/webgl/Atlas.d.ts +42 -0
- package/types/js/figure/webgl/shaders.d.ts +143 -0
- package/types/js/figure/webgl/target.d.ts +9 -0
- package/types/js/figure/webgl/webgl.d.ts +54 -0
- package/types/js/tools/FunctionMap.d.ts +69 -0
- package/types/js/tools/color.d.ts +11 -0
- package/types/js/tools/colorNames.d.ts +2 -0
- package/types/js/tools/d2/polygon.d.ts +60 -0
- package/types/js/tools/d2/triangles.d.ts +0 -0
- package/types/js/tools/d3/cone.d.ts +57 -0
- package/types/js/tools/d3/cube.d.ts +26 -0
- package/types/js/tools/d3/cylinder.d.ts +45 -0
- package/types/js/tools/d3/line3.d.ts +55 -0
- package/types/js/tools/d3/prism.d.ts +49 -0
- package/types/js/tools/d3/revolve.d.ts +87 -0
- package/types/js/tools/d3/sphere.d.ts +33 -0
- package/types/js/tools/d3/surface.d.ts +47 -0
- package/types/js/tools/g2.d.ts +242 -0
- package/types/js/tools/geometry/Bounds.d.ts +446 -0
- package/types/js/tools/geometry/Line.d.ts +314 -0
- package/types/js/tools/geometry/Path.d.ts +67 -0
- package/types/js/tools/geometry/Plane.d.ts +201 -0
- package/types/js/tools/geometry/Point.d.ts +359 -0
- package/types/js/tools/geometry/Rect.d.ts +115 -0
- package/types/js/tools/geometry/Transform.d.ts +623 -0
- package/types/js/tools/geometry/angle.d.ts +105 -0
- package/types/js/tools/geometry/common.d.ts +9 -0
- package/types/js/tools/geometry/coordinates.d.ts +30 -0
- package/types/js/tools/geometry/deceleration.d.ts +13 -0
- package/types/js/tools/geometry/polygon.d.ts +4 -0
- package/types/js/tools/geometry/quaternion.d.ts +15 -0
- package/types/js/tools/geometry/scene.d.ts +282 -0
- package/types/js/tools/geometry/tools.d.ts +8 -0
- package/types/js/tools/geometry/types.d.ts +2 -0
- package/types/js/tools/getCssColors.d.ts +1 -0
- package/types/js/tools/getCssVariables.d.ts +4 -0
- package/types/js/tools/getImageData.d.ts +1 -0
- package/types/js/tools/getScssColors.d.ts +2 -0
- package/types/js/tools/htmlGenerator.d.ts +85 -0
- package/types/js/tools/m2.d.ts +24 -0
- package/types/js/tools/m3.d.ts +71 -0
- package/types/js/tools/math.d.ts +112 -0
- package/types/js/tools/morph.d.ts +651 -0
- package/types/js/tools/styleSheets.d.ts +3 -0
- package/types/js/tools/tools.d.ts +281 -0
- package/types/js/tools/types.d.ts +305 -0
- package/figureone.worker.js +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "figureone",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Draw, animate and interact with shapes, text, plots and equations in Javascript. Create interactive slide shows, and interactive videos.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
7
|
+
"unpkg": "figureone.min.js",
|
|
8
|
+
"jsdelivr": "figureone.min.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./types/index.d.ts",
|
|
12
|
+
"default": "./index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"figureone.min.js",
|
|
18
|
+
"types/"
|
|
19
|
+
],
|
|
6
20
|
"repository": {
|
|
7
21
|
"type": "git",
|
|
8
22
|
"url": "git+https://github.com/airladon/figureone.git"
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as g2 from './js/tools/g2';
|
|
2
|
+
import * as math from './js/tools/math';
|
|
3
|
+
import * as m2 from './js/tools/m2';
|
|
4
|
+
import * as m3 from './js/tools/m3';
|
|
5
|
+
import * as morph from './js/tools/morph';
|
|
6
|
+
import Figure from './js/figure/Figure';
|
|
7
|
+
import TimeKeeper from './js/figure/TimeKeeper';
|
|
8
|
+
import { Recorder } from './js/figure/Recorder/Recorder';
|
|
9
|
+
import { FunctionMap, GlobalFunctionMap } from './js/tools/FunctionMap';
|
|
10
|
+
import * as color from './js/tools/color';
|
|
11
|
+
import * as html from './js/tools/htmlGenerator';
|
|
12
|
+
import * as misc from './js/tools/tools';
|
|
13
|
+
import * as css from './js/tools/styleSheets';
|
|
14
|
+
import * as lines from './js/figure/geometries/lines/lines';
|
|
15
|
+
import { FigureElement, FigureElementPrimitive, FigureElementCollection } from './js/figure/Element';
|
|
16
|
+
import Scene from './js/tools/geometry/scene';
|
|
17
|
+
import DrawContext2D from './js/figure/DrawContext2D';
|
|
18
|
+
import WebGLInstance from './js/figure/webgl/webgl';
|
|
19
|
+
import DrawingObject from './js/figure/DrawingObjects/DrawingObject';
|
|
20
|
+
import VertexGeneric from './js/figure/DrawingObjects/VertexObject/VertexGeneric';
|
|
21
|
+
import { FigureFont } from './js/figure/DrawingObjects/TextObject/TextObject';
|
|
22
|
+
import HTMLObject from './js/figure/DrawingObjects/HTMLObject/HTMLObject';
|
|
23
|
+
import HTMLEquation from './js/figure/Equation/HTMLEquation';
|
|
24
|
+
import CollectionsAngle from './js/figure/FigureCollections/Angle';
|
|
25
|
+
import CollectionsLine from './js/figure/FigureCollections/Line';
|
|
26
|
+
import CollectionsPolyline from './js/figure/FigureCollections/PolyLine';
|
|
27
|
+
import EquationLabel from './js/figure/FigureCollections/EquationLabel';
|
|
28
|
+
import { Equation } from './js/figure/Equation/Equation';
|
|
29
|
+
import EquationForm from './js/figure/Equation/EquationForm';
|
|
30
|
+
import SlideNavigator from './js/figure/SlideNavigator';
|
|
31
|
+
import type { TypeRotationDirection, TypeParsablePoint } from './js/tools/g2';
|
|
32
|
+
import type { COL_Line, OBJ_LineLabel, TypeLabelledLine } from './js/figure/FigureCollections/Line';
|
|
33
|
+
import type { TypeLabelLocation, TypeLabelSubLocation, TypeLabelOrientation } from './js/figure/FigureCollections/EquationLabel';
|
|
34
|
+
import type { COL_Angle, TypeAngleLabelOptions, TypeLabelledAngle } from './js/figure/FigureCollections/Angle';
|
|
35
|
+
import type { OBJ_Figure } from './js/figure/Figure';
|
|
36
|
+
import type { COL_Polyline, OBJ_PolylinePad } from './js/figure/FigureCollections/PolyLine';
|
|
37
|
+
import * as anim from './js/figure/Animation/Animation';
|
|
38
|
+
export type { TypeRotationDirection, TypeLabelLocation, TypeLabelSubLocation, TypeLabelOrientation, COL_Line, COL_Angle, OBJ_Figure, OBJ_LineLabel, TypeAngleLabelOptions, COL_Polyline, OBJ_PolylinePad, TypeParsablePoint, TypeLabelledAngle, TypeLabelledLine, };
|
|
39
|
+
/**
|
|
40
|
+
* FigureOne entry point
|
|
41
|
+
* @module Fig
|
|
42
|
+
* @global
|
|
43
|
+
* @property {class} {@link Figure} - Figure Class
|
|
44
|
+
*/
|
|
45
|
+
declare const Fig: {
|
|
46
|
+
tools: {
|
|
47
|
+
math: typeof math;
|
|
48
|
+
g2: typeof g2;
|
|
49
|
+
m3: typeof m3;
|
|
50
|
+
color: typeof color;
|
|
51
|
+
css: typeof css;
|
|
52
|
+
html: typeof html;
|
|
53
|
+
misc: typeof misc;
|
|
54
|
+
lines: typeof lines;
|
|
55
|
+
m2: typeof m2;
|
|
56
|
+
morph: typeof morph;
|
|
57
|
+
};
|
|
58
|
+
Figure: typeof Figure;
|
|
59
|
+
Recorder: typeof Recorder;
|
|
60
|
+
FunctionMap: typeof FunctionMap;
|
|
61
|
+
GlobalFunctionMap: typeof GlobalFunctionMap;
|
|
62
|
+
SlideNavigator: typeof SlideNavigator;
|
|
63
|
+
FigureElement: typeof FigureElement;
|
|
64
|
+
FigureElementCollection: typeof FigureElementCollection;
|
|
65
|
+
FigureElementPrimitive: typeof FigureElementPrimitive;
|
|
66
|
+
DrawContext2D: typeof DrawContext2D;
|
|
67
|
+
WebGLInstance: typeof WebGLInstance;
|
|
68
|
+
DrawingObject: typeof DrawingObject;
|
|
69
|
+
VertexGeneric: typeof VertexGeneric;
|
|
70
|
+
FigureFont: typeof FigureFont;
|
|
71
|
+
HTMLObject: typeof HTMLObject;
|
|
72
|
+
CollectionsAngle: typeof CollectionsAngle;
|
|
73
|
+
CollectionsLine: typeof CollectionsLine;
|
|
74
|
+
CollectionsPolyline: typeof CollectionsPolyline;
|
|
75
|
+
EquationLabel: typeof EquationLabel;
|
|
76
|
+
EquationForm: typeof EquationForm;
|
|
77
|
+
Equation: typeof Equation;
|
|
78
|
+
HTMLEquation: typeof HTMLEquation;
|
|
79
|
+
Animation: typeof anim;
|
|
80
|
+
Scene: typeof Scene;
|
|
81
|
+
Point: typeof g2.Point;
|
|
82
|
+
Plane: typeof g2.Plane;
|
|
83
|
+
Line: typeof g2.Line;
|
|
84
|
+
Rect: typeof g2.Rect;
|
|
85
|
+
Transform: typeof g2.Transform;
|
|
86
|
+
parsePoint: typeof g2.getPoint;
|
|
87
|
+
LineBounds: typeof g2.LineBounds;
|
|
88
|
+
RectBounds: typeof g2.RectBounds;
|
|
89
|
+
RangeBounds: typeof g2.RangeBounds;
|
|
90
|
+
minAngleDiff: typeof g2.minAngleDiff;
|
|
91
|
+
getTriangleCenter: typeof g2.getTriangleCenter;
|
|
92
|
+
polarToRect: typeof g2.polarToRect;
|
|
93
|
+
rectToPolar: typeof g2.rectToPolar;
|
|
94
|
+
threePointAngle: typeof g2.threePointAngle;
|
|
95
|
+
threePointAngleMin: typeof g2.threePointAngleMin;
|
|
96
|
+
clipAngle: typeof g2.clipAngle;
|
|
97
|
+
getPoint: typeof g2.getPoint;
|
|
98
|
+
getPoints: typeof g2.getPoints;
|
|
99
|
+
getScale: typeof g2.getScale;
|
|
100
|
+
getLine: typeof g2.getLine;
|
|
101
|
+
getRect: typeof g2.getRect;
|
|
102
|
+
getPlane: typeof g2.getPlane;
|
|
103
|
+
getTransform: typeof g2.getTransform;
|
|
104
|
+
surfaceGrid: typeof g2.surfaceGrid;
|
|
105
|
+
cube: typeof g2.cube;
|
|
106
|
+
sphere: typeof g2.sphere;
|
|
107
|
+
polygon: typeof g2.polygon;
|
|
108
|
+
revolve: typeof g2.revolve;
|
|
109
|
+
surface: typeof g2.surface;
|
|
110
|
+
cone: typeof g2.cone;
|
|
111
|
+
cylinder: typeof g2.cylinder;
|
|
112
|
+
line3: typeof g2.line3;
|
|
113
|
+
getMaxTimeFromVelocity: typeof g2.getMaxTimeFromVelocity;
|
|
114
|
+
toNumbers: typeof g2.toNumbers;
|
|
115
|
+
pointsToNumbers: typeof g2.pointsToNumbers;
|
|
116
|
+
joinObjects: typeof misc.joinObjects;
|
|
117
|
+
m3: typeof m3;
|
|
118
|
+
morph: typeof morph;
|
|
119
|
+
misc: typeof misc;
|
|
120
|
+
round: typeof math.round;
|
|
121
|
+
roundNum: (value: number, precision?: number) => number;
|
|
122
|
+
range: typeof math.range;
|
|
123
|
+
randSign: typeof math.randSign;
|
|
124
|
+
randBool: typeof math.randBool;
|
|
125
|
+
randInt: typeof math.randInt;
|
|
126
|
+
rand: typeof math.rand;
|
|
127
|
+
randElement: typeof math.randElement;
|
|
128
|
+
randElements: typeof math.randElements;
|
|
129
|
+
removeRandElement: typeof math.removeRandElement;
|
|
130
|
+
TimeKeeper: typeof TimeKeeper;
|
|
131
|
+
};
|
|
132
|
+
export default Fig;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { OBJ_PositionAnimationStep } from './AnimationStep/ElementAnimationStep/PositionAnimationStep';
|
|
2
|
+
import PositionAnimationStep from './AnimationStep/ElementAnimationStep/PositionAnimationStep';
|
|
3
|
+
import type { OBJ_ScenarioAnimationStep, OBJ_ScenariosAnimationStep } from './AnimationStep/ElementAnimationStep/ScenarioAnimationStep';
|
|
4
|
+
import ScenarioAnimationStep from './AnimationStep/ElementAnimationStep/ScenarioAnimationStep';
|
|
5
|
+
import type { OBJ_ColorAnimationStep } from './AnimationStep/ElementAnimationStep/ColorAnimationStep';
|
|
6
|
+
import { ColorAnimationStep, DimAnimationStep, UndimAnimationStep, dim, undim } from './AnimationStep/ElementAnimationStep/ColorAnimationStep';
|
|
7
|
+
import type { OBJ_OpacityAnimationStep } from './AnimationStep/ElementAnimationStep/OpacityAnimationStep';
|
|
8
|
+
import { OpacityAnimationStep, DissolveInAnimationStep, dissolveIn, DissolveOutAnimationStep, dissolveOut } from './AnimationStep/ElementAnimationStep/OpacityAnimationStep';
|
|
9
|
+
import type { OBJ_TransformAnimationStep } from './AnimationStep/ElementAnimationStep/TransformAnimationStep';
|
|
10
|
+
import TransformAnimationStep from './AnimationStep/ElementAnimationStep/TransformAnimationStep';
|
|
11
|
+
import type { OBJ_PulseTransformAnimationStep } from './AnimationStep/ElementAnimationStep/PulseTransformAnimationStep';
|
|
12
|
+
import PulseTransformAnimationStep from './AnimationStep/ElementAnimationStep/PulseTransformAnimationStep';
|
|
13
|
+
import type { OBJ_RotationAnimationStep } from './AnimationStep/ElementAnimationStep/RotationAnimationStep';
|
|
14
|
+
import RotationAnimationStep from './AnimationStep/ElementAnimationStep/RotationAnimationStep';
|
|
15
|
+
import type { OBJ_ScaleAnimationStep } from './AnimationStep/ElementAnimationStep/ScaleAnimationStep';
|
|
16
|
+
import ScaleAnimationStep from './AnimationStep/ElementAnimationStep/ScaleAnimationStep';
|
|
17
|
+
import type { OBJ_PulseAnimationStep } from './AnimationStep/ElementAnimationStep/PulseAnimationStep';
|
|
18
|
+
import PulseAnimationStep from './AnimationStep/ElementAnimationStep/PulseAnimationStep';
|
|
19
|
+
import type { OBJ_TriggerAnimationStep } from './AnimationStep/TriggerStep';
|
|
20
|
+
import { TriggerAnimationStep, trigger } from './AnimationStep/TriggerStep';
|
|
21
|
+
import type { OBJ_CustomAnimationStep } from './AnimationStep/CustomStep';
|
|
22
|
+
import { CustomAnimationStep, custom } from './AnimationStep/CustomStep';
|
|
23
|
+
import type { OBJ_ElementAnimationStep } from './AnimationStep/ElementAnimationStep';
|
|
24
|
+
import type { OBJ_ParallelAnimationStep } from './AnimationStep/ParallelAnimationStep';
|
|
25
|
+
import { ParallelAnimationStep, inParallel } from './AnimationStep/ParallelAnimationStep';
|
|
26
|
+
import type { OBJ_SerialAnimationStep } from './AnimationStep/SerialAnimationStep';
|
|
27
|
+
import { SerialAnimationStep, inSerial } from './AnimationStep/SerialAnimationStep';
|
|
28
|
+
import { DelayAnimationStep, delay } from './AnimationStep/DelayStep';
|
|
29
|
+
import type { OBJ_AnimationStep } from './AnimationStep';
|
|
30
|
+
import AnimationStep from './AnimationStep';
|
|
31
|
+
import type { TypeAnimationManagerInputOptions } from './AnimationManager';
|
|
32
|
+
import AnimationManager from './AnimationManager';
|
|
33
|
+
import type { OBJ_AnimationBuilder } from './AnimationBuilder';
|
|
34
|
+
import AnimationBuilder from './AnimationBuilder';
|
|
35
|
+
export type { OBJ_PositionAnimationStep, OBJ_AnimationBuilder, OBJ_ParallelAnimationStep, OBJ_SerialAnimationStep, OBJ_TransformAnimationStep, OBJ_AnimationStep, OBJ_TriggerAnimationStep, OBJ_ColorAnimationStep, OBJ_CustomAnimationStep, TypeAnimationManagerInputOptions, OBJ_RotationAnimationStep, OBJ_ScaleAnimationStep, OBJ_PulseAnimationStep, OBJ_OpacityAnimationStep, OBJ_ScenarioAnimationStep, OBJ_PulseTransformAnimationStep, OBJ_ElementAnimationStep, OBJ_ScenariosAnimationStep, };
|
|
36
|
+
export { PositionAnimationStep, AnimationBuilder, ParallelAnimationStep, SerialAnimationStep, TransformAnimationStep, AnimationStep, DelayAnimationStep, TriggerAnimationStep, inParallel, inSerial, trigger, delay, ColorAnimationStep, DissolveInAnimationStep, dissolveIn, DissolveOutAnimationStep, dissolveOut, CustomAnimationStep, custom, AnimationManager, RotationAnimationStep, ScaleAnimationStep, PulseAnimationStep, OpacityAnimationStep, DimAnimationStep, dim, UndimAnimationStep, undim, ScenarioAnimationStep, PulseTransformAnimationStep, };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { FigureElement } from '../Element';
|
|
2
|
+
import type { OBJ_Scenario } from '../Element';
|
|
3
|
+
import type { OBJ_SerialAnimationStep } from './AnimationStep/SerialAnimationStep';
|
|
4
|
+
import type { OBJ_PositionAnimationStep, OBJ_ParallelAnimationStep, OBJ_AnimationStep, OBJ_TriggerAnimationStep, OBJ_ColorAnimationStep, OBJ_CustomAnimationStep, OBJ_TransformAnimationStep, OBJ_RotationAnimationStep, OBJ_ScaleAnimationStep, OBJ_PulseAnimationStep, OBJ_OpacityAnimationStep, OBJ_PulseTransformAnimationStep, AnimationStep, OBJ_ScenarioAnimationStep, OBJ_ElementAnimationStep, OBJ_ScenariosAnimationStep } from './Animation';
|
|
5
|
+
import type { TypeParsablePoint, TypeParsableTransform } from '../../tools/g2';
|
|
6
|
+
import * as animation from './Animation';
|
|
7
|
+
import type { TypeColor } from '../../tools/types';
|
|
8
|
+
/**
|
|
9
|
+
* Animation builder options object
|
|
10
|
+
* @extends OBJ_SerialAnimationStep
|
|
11
|
+
* @property {FigureElement} [element]
|
|
12
|
+
* @interface
|
|
13
|
+
* @group Misc Animation
|
|
14
|
+
*/
|
|
15
|
+
export type OBJ_AnimationBuilder = {
|
|
16
|
+
element?: FigureElement;
|
|
17
|
+
customSteps?: Array<{
|
|
18
|
+
step: (options: Record<string, any>) => AnimationStep;
|
|
19
|
+
name: string;
|
|
20
|
+
}>;
|
|
21
|
+
} & OBJ_SerialAnimationStep;
|
|
22
|
+
/**
|
|
23
|
+
* Animation Builder
|
|
24
|
+
*
|
|
25
|
+
* Convenient way to build animation steps in serial. Each step returns the
|
|
26
|
+
* same builder object, and so chaining in a fluent like API can be achieved.
|
|
27
|
+
*
|
|
28
|
+
* @extends SerialAnimationStep
|
|
29
|
+
* @see <a href="#animationmanagernew">AnimationManager.new</a>
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* p.animations.new()
|
|
33
|
+
* .delay(1)
|
|
34
|
+
* .position({ target: [1, 0], duration: 2 })
|
|
35
|
+
* .delay(1)
|
|
36
|
+
* .rotation({ target: Math.PI, duration: 2 })
|
|
37
|
+
* .start();
|
|
38
|
+
* @group Animation
|
|
39
|
+
*/
|
|
40
|
+
export default class AnimationBuilder extends animation.SerialAnimationStep {
|
|
41
|
+
/**
|
|
42
|
+
* @hideconstructor
|
|
43
|
+
*/
|
|
44
|
+
constructor(elementOrOptions?: FigureElement | OBJ_AnimationBuilder, ...options: Array<OBJ_AnimationBuilder>);
|
|
45
|
+
fnExec(idOrFn: string | Function | null, ...args: any): any;
|
|
46
|
+
_getStateProperties(): string[];
|
|
47
|
+
_getStateName(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Add a custom animation step that uses this element by default
|
|
50
|
+
* @param {string | ((number) => void) | OBJ_CustomAnimationStep} callbackOrOptions
|
|
51
|
+
* @return {AnimationBuilder}
|
|
52
|
+
*/
|
|
53
|
+
custom(callbackOrOptions: string | ((percent: number) => void) | OBJ_CustomAnimationStep): this;
|
|
54
|
+
/**
|
|
55
|
+
* Add a rotation animation step that uses this element by default
|
|
56
|
+
* @param {OBJ_RotationAnimationStep | number} targetOrOptions
|
|
57
|
+
* @return {AnimationBuilder}
|
|
58
|
+
*/
|
|
59
|
+
rotation(targetOrOptions: OBJ_RotationAnimationStep | number, ry?: number | null, rz?: number): this;
|
|
60
|
+
/**
|
|
61
|
+
* Add a position animation step that uses this element by default
|
|
62
|
+
* @param {TypeParsablePoint | OBJ_PositionAnimationStep | number} targetOrOptionsOrX
|
|
63
|
+
* @param {number} y define if `targetOrOptionsOrX` is x (number)
|
|
64
|
+
* @return {AnimationBuilder}
|
|
65
|
+
*/
|
|
66
|
+
position(targetOrOptionsOrX: TypeParsablePoint | OBJ_PositionAnimationStep | number, y?: number, z?: number): this;
|
|
67
|
+
/**
|
|
68
|
+
* Add a translation animation step that uses this element by default
|
|
69
|
+
* @param {TypeParsablePoint | OBJ_PositionAnimationStep | number} targetOrOptionsOrX
|
|
70
|
+
* @param {number} y define if `targetOrOptionsOrX` is x (number)
|
|
71
|
+
* @return {AnimationBuilder}
|
|
72
|
+
*/
|
|
73
|
+
translation(targetOrOptionsOrX: TypeParsablePoint | OBJ_PositionAnimationStep | number, y?: number, z?: number): this;
|
|
74
|
+
/**
|
|
75
|
+
* Add a scale animation step that uses this element by default
|
|
76
|
+
* @param {TypeParsablePoint | OBJ_ScaleAnimationStep | number} targetOrOptionsOrX
|
|
77
|
+
* when a number is used, it will apply to both x and y if y is null
|
|
78
|
+
* @param {number | null} y use a number to define the y scale, or use null
|
|
79
|
+
* to use the `x` value (`null`)
|
|
80
|
+
* @return {AnimationBuilder}
|
|
81
|
+
*/
|
|
82
|
+
scale(targetOrOptionsOrX: TypeParsablePoint | OBJ_ScaleAnimationStep | number, y?: null | number, z?: number): this;
|
|
83
|
+
/**
|
|
84
|
+
* Add a transform animation step that uses this element by default
|
|
85
|
+
* @param {OBJ_TransformAnimationStep | TypeParsableTransform} transformOrOptions
|
|
86
|
+
* @return {AnimationBuilder}
|
|
87
|
+
*/
|
|
88
|
+
transform(transformOrOptions: OBJ_TransformAnimationStep | TypeParsableTransform): this;
|
|
89
|
+
pulseTransforms(...options: Array<OBJ_PulseTransformAnimationStep>): this;
|
|
90
|
+
/**
|
|
91
|
+
* Add a scenario animation step that uses this element by default
|
|
92
|
+
* @param {OBJ_ScenarioAnimationStep | OBJ_Scenario | string} scenarioOrOptions
|
|
93
|
+
* @return {AnimationBuilder}
|
|
94
|
+
*/
|
|
95
|
+
scenario(scenarioOrOptions: string | OBJ_Scenario | OBJ_ScenarioAnimationStep): this;
|
|
96
|
+
/**
|
|
97
|
+
* Add a scenarios animation step that uses this element by default
|
|
98
|
+
* @param {string | OBJ_ScenariosAnimationStep} scenarioNameOrOptions
|
|
99
|
+
* @return {AnimationBuilder}
|
|
100
|
+
*/
|
|
101
|
+
scenarios(scenarioOrOptions: string | OBJ_ScenariosAnimationStep): this;
|
|
102
|
+
/**
|
|
103
|
+
* Add a color animation step that uses this element by default
|
|
104
|
+
* @param {OBJ_ColorAnimationStep | TypeColor} colorOrOptions
|
|
105
|
+
* @return {AnimationBuilder}
|
|
106
|
+
*/
|
|
107
|
+
color(colorOrOptions: OBJ_ColorAnimationStep | TypeColor): this;
|
|
108
|
+
/**
|
|
109
|
+
* Add an opacity animation step that uses this element by default
|
|
110
|
+
* @param {OBJ_OpacityAnimationStep | number} opacityOrOptions
|
|
111
|
+
* @return {AnimationBuilder}
|
|
112
|
+
*/
|
|
113
|
+
opacity(opacityOrOptions: OBJ_OpacityAnimationStep | number): this;
|
|
114
|
+
/**
|
|
115
|
+
* Add an dissolve out animation step that uses this element by default
|
|
116
|
+
* @param {number | OBJ_ElementAnimationStep} durationOrOptions
|
|
117
|
+
* @return {AnimationBuilder}
|
|
118
|
+
*/
|
|
119
|
+
dissolveOut(durationOrOptions?: number | OBJ_ElementAnimationStep): this;
|
|
120
|
+
/**
|
|
121
|
+
* Add an dissolve in animation step that uses this element by default
|
|
122
|
+
* @param {number | OBJ_ElementAnimationStep} durationOrOptions
|
|
123
|
+
* @return {AnimationBuilder}
|
|
124
|
+
*/
|
|
125
|
+
dissolveIn(durationOrOptions?: number | OBJ_ElementAnimationStep): this;
|
|
126
|
+
addStep(animName: string, ...params: Array<any>): this;
|
|
127
|
+
/**
|
|
128
|
+
* Add an dim animation step that uses this element by default
|
|
129
|
+
* @param {OBJ_ElementAnimationStep | number} durationOrOptions
|
|
130
|
+
* @return {AnimationBuilder}
|
|
131
|
+
*/
|
|
132
|
+
dim(durationOrOptions?: number | OBJ_ElementAnimationStep): this;
|
|
133
|
+
/**
|
|
134
|
+
* Add an undim animation step that uses this element by default
|
|
135
|
+
* @param {OBJ_ElementAnimationStep | number} durationOrOptions
|
|
136
|
+
* @return {AnimationBuilder}
|
|
137
|
+
*/
|
|
138
|
+
undim(durationOrOptions?: number | OBJ_ElementAnimationStep): this;
|
|
139
|
+
/**
|
|
140
|
+
* Add a delay animation step
|
|
141
|
+
* @param {OBJ_AnimationStep | number} delayOrOptions
|
|
142
|
+
* @return {AnimationBuilder}
|
|
143
|
+
*/
|
|
144
|
+
delay(delayOrOptions?: number | OBJ_AnimationStep): this;
|
|
145
|
+
/**
|
|
146
|
+
* Add a trigger animation step
|
|
147
|
+
* @param {OBJ_TriggerAnimationStep | function(): void | string} callbackOrOptions
|
|
148
|
+
* callback can be a function or an id to a function map
|
|
149
|
+
* @return {AnimationBuilder}
|
|
150
|
+
*/
|
|
151
|
+
trigger(callbackOrOptions: (() => void) | string | OBJ_TriggerAnimationStep): this;
|
|
152
|
+
/**
|
|
153
|
+
* Add a parallel animation step
|
|
154
|
+
* @param {Array<AnimationStep | null> | OBJ_ParallelAnimationStep} stepsOrOptions
|
|
155
|
+
* @return {AnimationBuilder}
|
|
156
|
+
*/
|
|
157
|
+
inParallel(stepsOrOptions?: Array<animation.AnimationStep | null> | OBJ_ParallelAnimationStep, ...options: Array<OBJ_ParallelAnimationStep>): this;
|
|
158
|
+
/**
|
|
159
|
+
* Add a serial animation step
|
|
160
|
+
* @param {Array<AnimationStep | null> | OBJ_SerialAnimationStep} stepsOrOptions
|
|
161
|
+
* @return {AnimationBuilder}
|
|
162
|
+
*/
|
|
163
|
+
inSerial(stepsOrOptions?: Array<animation.AnimationStep> | OBJ_SerialAnimationStep, ...options: Array<OBJ_SerialAnimationStep>): this;
|
|
164
|
+
/**
|
|
165
|
+
* Add a pulse animation step
|
|
166
|
+
* @param {OBJ_PulseAnimationStep | number} scaleOrOptions pulse scale
|
|
167
|
+
* (number) or pulse animation step options
|
|
168
|
+
* @return {PulseAnimationStep}
|
|
169
|
+
*/
|
|
170
|
+
pulse(scaleOrOptions: OBJ_PulseAnimationStep | number): this;
|
|
171
|
+
reset(): void;
|
|
172
|
+
_dup(): animation.AnimationBuilder;
|
|
173
|
+
}
|