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.
Files changed (159) hide show
  1. package/figureone.min.js +1 -1
  2. package/index.js +79167 -0
  3. package/package.json +15 -1
  4. package/types/index.d.ts +132 -0
  5. package/types/js/figure/Animation/Animation.d.ts +36 -0
  6. package/types/js/figure/Animation/AnimationBuilder.d.ts +173 -0
  7. package/types/js/figure/Animation/AnimationManager.d.ts +392 -0
  8. package/types/js/figure/Animation/AnimationStep/CustomStep.d.ts +99 -0
  9. package/types/js/figure/Animation/AnimationStep/DelayStep.d.ts +24 -0
  10. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/ColorAnimationStep.d.ts +203 -0
  11. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/OpacityAnimationStep.d.ts +220 -0
  12. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/PositionAnimationStep.d.ts +124 -0
  13. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/PulseAnimationStep.d.ts +137 -0
  14. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/PulseTransformAnimationStep.d.ts +52 -0
  15. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/RotationAnimationStep.d.ts +119 -0
  16. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/ScaleAnimationStep.d.ts +93 -0
  17. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/ScenarioAnimationStep.d.ts +204 -0
  18. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep/TransformAnimationStep.d.ts +163 -0
  19. package/types/js/figure/Animation/AnimationStep/ElementAnimationStep.d.ts +56 -0
  20. package/types/js/figure/Animation/AnimationStep/ParallelAnimationStep.d.ts +70 -0
  21. package/types/js/figure/Animation/AnimationStep/SerialAnimationStep.d.ts +84 -0
  22. package/types/js/figure/Animation/AnimationStep/TriggerStep.d.ts +106 -0
  23. package/types/js/figure/Animation/AnimationStep.d.ts +110 -0
  24. package/types/js/figure/DrawContext2D.d.ts +9 -0
  25. package/types/js/figure/DrawingObjects/DrawingObject.d.ts +45 -0
  26. package/types/js/figure/DrawingObjects/GLObject/GLObject.d.ts +146 -0
  27. package/types/js/figure/DrawingObjects/HTMLObject/HTMLObject.d.ts +29 -0
  28. package/types/js/figure/DrawingObjects/TextObject/TextObject.d.ts +94 -0
  29. package/types/js/figure/DrawingObjects/TextObject/glyphMeasures.d.ts +7 -0
  30. package/types/js/figure/DrawingObjects/VertexObject/VertexGeneric.d.ts +21 -0
  31. package/types/js/figure/DrawingObjects/VertexObject/VertexObject.d.ts +0 -0
  32. package/types/js/figure/DrawingObjects/VertexObject/VertexText.d.ts +34 -0
  33. package/types/js/figure/Element.d.ts +1212 -0
  34. package/types/js/figure/Equation/Elements/BaseAnnotationFunction.d.ts +118 -0
  35. package/types/js/figure/Equation/Elements/BaseEquationFunction.d.ts +20 -0
  36. package/types/js/figure/Equation/Elements/Bounds.d.ts +49 -0
  37. package/types/js/figure/Equation/Elements/Color.d.ts +7 -0
  38. package/types/js/figure/Equation/Elements/Container.d.ts +5 -0
  39. package/types/js/figure/Equation/Elements/Element.d.ts +95 -0
  40. package/types/js/figure/Equation/Elements/Fraction.d.ts +5 -0
  41. package/types/js/figure/Equation/Elements/Lines.d.ts +5 -0
  42. package/types/js/figure/Equation/Elements/Matrix.d.ts +5 -0
  43. package/types/js/figure/Equation/Elements/Offset.d.ts +5 -0
  44. package/types/js/figure/Equation/Elements/Scale.d.ts +5 -0
  45. package/types/js/figure/Equation/Equation.d.ts +984 -0
  46. package/types/js/figure/Equation/EquationForm.d.ts +139 -0
  47. package/types/js/figure/Equation/EquationFunctions.d.ts +3367 -0
  48. package/types/js/figure/Equation/EquationSymbols.d.ts +1646 -0
  49. package/types/js/figure/Equation/HTMLEquation.d.ts +56 -0
  50. package/types/js/figure/Equation/Symbols/AngleBracket.d.ts +6 -0
  51. package/types/js/figure/Equation/Symbols/Arrow.d.ts +17 -0
  52. package/types/js/figure/Equation/Symbols/Bar.d.ts +6 -0
  53. package/types/js/figure/Equation/Symbols/Box.d.ts +11 -0
  54. package/types/js/figure/Equation/Symbols/Brace.d.ts +6 -0
  55. package/types/js/figure/Equation/Symbols/Bracket.d.ts +8 -0
  56. package/types/js/figure/Equation/Symbols/Division.d.ts +8 -0
  57. package/types/js/figure/Equation/Symbols/Integral.d.ts +7 -0
  58. package/types/js/figure/Equation/Symbols/Line.d.ts +5 -0
  59. package/types/js/figure/Equation/Symbols/Product.d.ts +6 -0
  60. package/types/js/figure/Equation/Symbols/Radical.d.ts +9 -0
  61. package/types/js/figure/Equation/Symbols/SquareBracket.d.ts +6 -0
  62. package/types/js/figure/Equation/Symbols/Strike.d.ts +8 -0
  63. package/types/js/figure/Equation/Symbols/Sum.d.ts +6 -0
  64. package/types/js/figure/Equation/Symbols/SymbolNew.d.ts +15 -0
  65. package/types/js/figure/Equation/Symbols/Vinculum.d.ts +6 -0
  66. package/types/js/figure/Figure.d.ts +711 -0
  67. package/types/js/figure/FigureCollections/Angle.d.ts +766 -0
  68. package/types/js/figure/FigureCollections/Axis.d.ts +517 -0
  69. package/types/js/figure/FigureCollections/Axis3.d.ts +118 -0
  70. package/types/js/figure/FigureCollections/Button.d.ts +195 -0
  71. package/types/js/figure/FigureCollections/EquationLabel.d.ts +77 -0
  72. package/types/js/figure/FigureCollections/FigureCollections.d.ts +122 -0
  73. package/types/js/figure/FigureCollections/Legend.d.ts +270 -0
  74. package/types/js/figure/FigureCollections/Line.d.ts +587 -0
  75. package/types/js/figure/FigureCollections/Plot.d.ts +558 -0
  76. package/types/js/figure/FigureCollections/PolyLine.d.ts +487 -0
  77. package/types/js/figure/FigureCollections/Rectangle.d.ts +235 -0
  78. package/types/js/figure/FigureCollections/SlideNavigator.d.ts +255 -0
  79. package/types/js/figure/FigureCollections/Slider.d.ts +155 -0
  80. package/types/js/figure/FigureCollections/Text.d.ts +307 -0
  81. package/types/js/figure/FigureCollections/Toggle.d.ts +185 -0
  82. package/types/js/figure/FigureCollections/Trace.d.ts +237 -0
  83. package/types/js/figure/FigurePrimitives/FigureElementPrimitive2DText.d.ts +119 -0
  84. package/types/js/figure/FigurePrimitives/FigureElementPrimitiveGLText.d.ts +94 -0
  85. package/types/js/figure/FigurePrimitives/FigureElementPrimitiveGesture.d.ts +536 -0
  86. package/types/js/figure/FigurePrimitives/FigureElementPrimitiveMorph.d.ts +175 -0
  87. package/types/js/figure/FigurePrimitives/FigurePrimitiveTypes.d.ts +788 -0
  88. package/types/js/figure/FigurePrimitives/FigurePrimitiveTypes2D.d.ts +1324 -0
  89. package/types/js/figure/FigurePrimitives/FigurePrimitiveTypes3D.d.ts +1105 -0
  90. package/types/js/figure/FigurePrimitives/FigurePrimitives.d.ts +173 -0
  91. package/types/js/figure/FigurePrimitives/Generic.d.ts +5 -0
  92. package/types/js/figure/FigurePrimitives/Text.d.ts +17 -0
  93. package/types/js/figure/FontManager.d.ts +113 -0
  94. package/types/js/figure/Gesture.d.ts +39 -0
  95. package/types/js/figure/Recorder/Recorder.d.ts +291 -0
  96. package/types/js/figure/Recorder/parseState.d.ts +3 -0
  97. package/types/js/figure/Recorder/recorder.worker.d.ts +1 -0
  98. package/types/js/figure/Recorder/state.d.ts +7 -0
  99. package/types/js/figure/SlideNavigator.d.ts +606 -0
  100. package/types/js/figure/TimeKeeper.d.ts +174 -0
  101. package/types/js/figure/geometries/arc.d.ts +18 -0
  102. package/types/js/figure/geometries/arrow.d.ts +215 -0
  103. package/types/js/figure/geometries/buffer.d.ts +4 -0
  104. package/types/js/figure/geometries/copy/copy.d.ts +178 -0
  105. package/types/js/figure/geometries/ellipse.d.ts +17 -0
  106. package/types/js/figure/geometries/line.d.ts +13 -0
  107. package/types/js/figure/geometries/lines/corners.d.ts +7 -0
  108. package/types/js/figure/geometries/lines/dashes.d.ts +23 -0
  109. package/types/js/figure/geometries/lines/lines.d.ts +31 -0
  110. package/types/js/figure/geometries/polygon/polygon.d.ts +12 -0
  111. package/types/js/figure/geometries/rectangle.d.ts +19 -0
  112. package/types/js/figure/geometries/triangle.d.ts +27 -0
  113. package/types/js/figure/webgl/Atlas.d.ts +42 -0
  114. package/types/js/figure/webgl/shaders.d.ts +143 -0
  115. package/types/js/figure/webgl/target.d.ts +9 -0
  116. package/types/js/figure/webgl/webgl.d.ts +54 -0
  117. package/types/js/tools/FunctionMap.d.ts +69 -0
  118. package/types/js/tools/color.d.ts +11 -0
  119. package/types/js/tools/colorNames.d.ts +2 -0
  120. package/types/js/tools/d2/polygon.d.ts +60 -0
  121. package/types/js/tools/d2/triangles.d.ts +0 -0
  122. package/types/js/tools/d3/cone.d.ts +57 -0
  123. package/types/js/tools/d3/cube.d.ts +26 -0
  124. package/types/js/tools/d3/cylinder.d.ts +45 -0
  125. package/types/js/tools/d3/line3.d.ts +55 -0
  126. package/types/js/tools/d3/prism.d.ts +49 -0
  127. package/types/js/tools/d3/revolve.d.ts +87 -0
  128. package/types/js/tools/d3/sphere.d.ts +33 -0
  129. package/types/js/tools/d3/surface.d.ts +47 -0
  130. package/types/js/tools/g2.d.ts +242 -0
  131. package/types/js/tools/geometry/Bounds.d.ts +446 -0
  132. package/types/js/tools/geometry/Line.d.ts +314 -0
  133. package/types/js/tools/geometry/Path.d.ts +67 -0
  134. package/types/js/tools/geometry/Plane.d.ts +201 -0
  135. package/types/js/tools/geometry/Point.d.ts +359 -0
  136. package/types/js/tools/geometry/Rect.d.ts +115 -0
  137. package/types/js/tools/geometry/Transform.d.ts +623 -0
  138. package/types/js/tools/geometry/angle.d.ts +105 -0
  139. package/types/js/tools/geometry/common.d.ts +9 -0
  140. package/types/js/tools/geometry/coordinates.d.ts +30 -0
  141. package/types/js/tools/geometry/deceleration.d.ts +13 -0
  142. package/types/js/tools/geometry/polygon.d.ts +4 -0
  143. package/types/js/tools/geometry/quaternion.d.ts +15 -0
  144. package/types/js/tools/geometry/scene.d.ts +282 -0
  145. package/types/js/tools/geometry/tools.d.ts +8 -0
  146. package/types/js/tools/geometry/types.d.ts +2 -0
  147. package/types/js/tools/getCssColors.d.ts +1 -0
  148. package/types/js/tools/getCssVariables.d.ts +4 -0
  149. package/types/js/tools/getImageData.d.ts +1 -0
  150. package/types/js/tools/getScssColors.d.ts +2 -0
  151. package/types/js/tools/htmlGenerator.d.ts +85 -0
  152. package/types/js/tools/m2.d.ts +24 -0
  153. package/types/js/tools/m3.d.ts +71 -0
  154. package/types/js/tools/math.d.ts +112 -0
  155. package/types/js/tools/morph.d.ts +651 -0
  156. package/types/js/tools/styleSheets.d.ts +3 -0
  157. package/types/js/tools/tools.d.ts +281 -0
  158. package/types/js/tools/types.d.ts +305 -0
  159. package/figureone.worker.js +0 -1
@@ -0,0 +1,139 @@
1
+ import { Point, Transform } from '../../tools/g2';
2
+ import type { TypeColor } from '../../tools/types';
3
+ import { FigureElementPrimitive, FigureElementCollection } from '../Element';
4
+ import { Elements } from './Elements/Element';
5
+ /**
6
+ * Horizontal Alignment
7
+ *
8
+ * `TypeHAlign = 'left' | 'right' | 'center' | number`
9
+ *
10
+ * Where `number` is a percentage of the width from the left. So
11
+ * `0` would be equivalent to `'left'`, 0.5 equivalent to
12
+ * `'center'` and 1 equivalent to `'right'`.
13
+ * @group Misc Shapes
14
+ */
15
+ export type TypeHAlign = 'left' | 'right' | 'center' | number;
16
+ /**
17
+ * Vertical Alignment
18
+ *
19
+ * `TypeHAlign = 'left' | 'right' | 'center' | 'baseline' | number`
20
+ *
21
+ * Where `number` is a percentage of the width from the left. So
22
+ * `0` would be equivalent to `'left'`, 0.5 equivalent to
23
+ * `'center'` and 1 equivalent to `'right'`.
24
+ * @group Misc Shapes
25
+ */
26
+ export type TypeVAlign = 'top' | 'bottom' | 'middle' | 'baseline' | number;
27
+ export type TypeEquationForm = {
28
+ collection: FigureElementCollection;
29
+ arrange: (scale: number, xAlign: TypeHAlign | null, yAlign: TypeVAlign | null, fixTo: FigureElementPrimitive | FigureElementCollection | Point) => void;
30
+ dissolveElements: (elements: Array<FigureElementPrimitive | FigureElementCollection>, dissolve: boolean, delay: number, time: number, callback: ((cancelled?: boolean) => void) | null) => void;
31
+ getElementsToShowAndHide: () => void;
32
+ showHide: (showTime: number, hideTime: number, callback: ((arg?: any) => void) | null) => void;
33
+ hideShow: (showTime: number, hideTime: number, callback: ((arg?: any) => void) | null) => void;
34
+ animatePositionsTo: (delay: number, callback: ((arg?: any) => void) | null) => void;
35
+ description: string | null;
36
+ modifiers: Record<string, any>;
37
+ type: string;
38
+ onShow: string | (() => void);
39
+ elementMods: {
40
+ [key: string]: {
41
+ element: FigureElementPrimitive | FigureElementCollection;
42
+ mods: Record<string, any>;
43
+ };
44
+ };
45
+ time: number | null;
46
+ } & Elements;
47
+ export type TypeCollectionMethods = {
48
+ getAllElements: () => Array<FigureElementPrimitive | FigureElementCollection>;
49
+ hideAll: () => void;
50
+ show: () => void;
51
+ showOnly: (elements: Array<FigureElementPrimitive | FigureElementCollection>) => void;
52
+ stop(cancelled?: boolean, forceSetToEndOfPlan?: boolean): void;
53
+ getElementTransforms: () => {
54
+ [key: string]: Transform;
55
+ };
56
+ getElementColors: (includeHidden: boolean) => {
57
+ [key: string]: TypeColor;
58
+ };
59
+ setElementTransforms: (transforms: {
60
+ [key: string]: Transform;
61
+ }) => void;
62
+ setElementColors: (colors: {
63
+ [key: string]: TypeColor;
64
+ }) => void;
65
+ animateToTransforms(elementTransforms: Record<string, any>, time?: number, delay?: number, rotDirection?: number, callback?: string | ((arg?: any) => void) | null, name?: string, easeFunction?: string | ((n: number) => number)): number;
66
+ animateToColors(elementColors: Record<string, any>, time?: number, delay?: number, callback?: string | ((arg?: any) => void) | null, name?: string, easeFunction?: string | ((n: number) => number)): number;
67
+ };
68
+ export type TypeElements = {
69
+ [key: string]: FigureElementCollection | FigureElementPrimitive;
70
+ };
71
+ export type TypeElementTranslationOptions = {
72
+ [key: string]: {
73
+ element: FigureElementPrimitive | FigureElementCollection;
74
+ direction?: 'up' | 'down';
75
+ style: 'curved' | 'linear';
76
+ mag: number;
77
+ };
78
+ };
79
+ export default class EquationForm extends Elements {
80
+ elements: {
81
+ [key: string]: FigureElementCollection | FigureElementPrimitive;
82
+ };
83
+ collectionMethods: TypeCollectionMethods;
84
+ name: string;
85
+ elementMods: {
86
+ [key: string]: {
87
+ element: FigureElementPrimitive | FigureElementCollection;
88
+ mods: Record<string, any>;
89
+ };
90
+ };
91
+ arranged: {
92
+ scale: number;
93
+ xAlign: TypeHAlign | null;
94
+ yAlign: TypeVAlign | null;
95
+ fixTo: FigureElementPrimitive | FigureElementCollection | Point;
96
+ };
97
+ description: string | null;
98
+ modifiers: Record<string, any>;
99
+ onTransition: null | string | (() => void);
100
+ onShow: null | string | (() => void);
101
+ duration: number | null | undefined;
102
+ translation: TypeElementTranslationOptions;
103
+ positionsSet: boolean;
104
+ layout: 'always' | 'lazy' | 'init';
105
+ ignoreColor: boolean;
106
+ fromForm: {
107
+ [key: string]: {
108
+ onTransition?: string | (() => void);
109
+ onShow?: string | (() => void);
110
+ duration?: number;
111
+ translation?: TypeElementTranslationOptions;
112
+ elementMods: {
113
+ [key: string]: {
114
+ element: FigureElementPrimitive | FigureElementCollection;
115
+ mods: Record<string, any>;
116
+ };
117
+ };
118
+ };
119
+ };
120
+ constructor(elements: TypeElements, collectionMethods: TypeCollectionMethods);
121
+ cleanup(): void;
122
+ getNamedElements(): Record<string, any>;
123
+ rearrange(): void;
124
+ setPositions(noArrange?: boolean): void;
125
+ _dup(elements?: TypeElements, collectionMethods?: TypeCollectionMethods): EquationForm;
126
+ arrange(scale?: number, xAlign?: TypeHAlign | null, yAlign?: TypeVAlign | null, fixTo?: FigureElementPrimitive | FigureElementCollection | Point): void;
127
+ lazyArrange(scale?: number, xAlign?: TypeHAlign | null, yAlign?: TypeVAlign | null, fixTo?: FigureElementPrimitive | FigureElementCollection | Point): void;
128
+ dissolveElements(elements: Array<FigureElementPrimitive | FigureElementCollection>, dissolve?: 'in' | 'out', delay?: number, time?: number, callback?: (string | ((cancelled: boolean) => void)) | null): void;
129
+ getElementsToShowAndHide(): {
130
+ show: (FigureElementCollection | FigureElementPrimitive)[];
131
+ hide: (FigureElementCollection | FigureElementPrimitive)[];
132
+ };
133
+ render(): void;
134
+ showHide(showTime?: number, hideTime?: number, callback?: ((arg?: any) => void) | null, animationStop?: boolean): void;
135
+ hideShow(showTime?: number, hideTime?: number, callback?: ((arg?: any) => void) | null, animationStop?: boolean): void;
136
+ allHideShow(delay?: number, hideTime?: number, blankTime?: number, showTime?: number, callback?: ((cancelled: boolean) => void) | null): void;
137
+ applyElementMods(fromWhere?: null | string): void;
138
+ animatePositionsTo(delay: number, dissolveOutTime: number, moveTime: number | null, dissolveInTime: number, callback?: (string | ((arg?: any) => void)) | null, fromWhere?: string | null | undefined, dissolveInBeforeMove?: boolean): number;
139
+ }