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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { OBJ_Font, TypeColor, OBJ_GlyphModifiers } from '../../../tools/types';
|
|
2
|
+
import type { OBJ_AtlasMap } from '../../webgl/Atlas';
|
|
3
|
+
declare class FigureFont {
|
|
4
|
+
family: string;
|
|
5
|
+
weight: 'normal' | 'bold' | 'lighter' | 'bolder' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
6
|
+
style: 'normal' | 'italic';
|
|
7
|
+
src: HTMLImageElement | string;
|
|
8
|
+
id: string;
|
|
9
|
+
map: OBJ_AtlasMap;
|
|
10
|
+
glyphs: string | 'greek' | 'math' | 'mathExt' | 'common' | 'latin' | 'all' | 'numbers' | 'mathlatin' | Array<string>;
|
|
11
|
+
atlasSize: null | number;
|
|
12
|
+
loadColor: TypeColor;
|
|
13
|
+
size: number;
|
|
14
|
+
underline: false | {
|
|
15
|
+
width: number;
|
|
16
|
+
descent: number;
|
|
17
|
+
color?: TypeColor;
|
|
18
|
+
};
|
|
19
|
+
color: TypeColor;
|
|
20
|
+
outline: false | {
|
|
21
|
+
width: number;
|
|
22
|
+
fill: boolean;
|
|
23
|
+
color?: TypeColor;
|
|
24
|
+
};
|
|
25
|
+
opacity: number;
|
|
26
|
+
descent: number;
|
|
27
|
+
midDescent: number;
|
|
28
|
+
maxDescent: number;
|
|
29
|
+
midAscent: number;
|
|
30
|
+
maxAscent: number;
|
|
31
|
+
modifiers: OBJ_GlyphModifiers;
|
|
32
|
+
mods: Record<string, any>;
|
|
33
|
+
testString: string;
|
|
34
|
+
timeout: number;
|
|
35
|
+
maxCount: number;
|
|
36
|
+
atlasColor: boolean;
|
|
37
|
+
letterSpacing: number;
|
|
38
|
+
render: 'gl' | '2d' | 'html';
|
|
39
|
+
constructor(optionsIn?: OBJ_Font | FigureFont);
|
|
40
|
+
_state(): Record<string, any>;
|
|
41
|
+
getFamily(): string;
|
|
42
|
+
getFontID(isAtlas?: boolean): string;
|
|
43
|
+
getTextureID(): string;
|
|
44
|
+
getGlyphs(): string;
|
|
45
|
+
getGlyphsID(): any;
|
|
46
|
+
getTestStringID(): string;
|
|
47
|
+
getTestStringGlyphs(): string;
|
|
48
|
+
draw2D(ctx: CanvasRenderingContext2D, colorIn: TypeColor | null | number, text: string, locationX: number, locationY: number, scalingFactor?: number): void;
|
|
49
|
+
definition(): {
|
|
50
|
+
family: string;
|
|
51
|
+
style: "normal" | "italic";
|
|
52
|
+
size: number;
|
|
53
|
+
outline: false | {
|
|
54
|
+
width: number;
|
|
55
|
+
fill: boolean;
|
|
56
|
+
color?: TypeColor;
|
|
57
|
+
};
|
|
58
|
+
weight: "bold" | "normal" | "100" | "lighter" | "bolder" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
|
|
59
|
+
color: number[];
|
|
60
|
+
opacity: number;
|
|
61
|
+
descent: number;
|
|
62
|
+
midDescent: number;
|
|
63
|
+
maxDescent: number;
|
|
64
|
+
midAscent: number;
|
|
65
|
+
maxAscent: number;
|
|
66
|
+
src: string | HTMLImageElement;
|
|
67
|
+
map: OBJ_AtlasMap;
|
|
68
|
+
loadColor: TypeColor;
|
|
69
|
+
glyphs: string | string[];
|
|
70
|
+
testString: string;
|
|
71
|
+
timeout: number;
|
|
72
|
+
maxCount: number;
|
|
73
|
+
modifiers: OBJ_GlyphModifiers;
|
|
74
|
+
underline: false | {
|
|
75
|
+
width: number;
|
|
76
|
+
descent: number;
|
|
77
|
+
color?: TypeColor;
|
|
78
|
+
};
|
|
79
|
+
atlasColor: boolean;
|
|
80
|
+
atlasSize: number | null;
|
|
81
|
+
render: "html" | "gl" | "2d";
|
|
82
|
+
letterSpacing: number;
|
|
83
|
+
};
|
|
84
|
+
measureText(text: string, aWidth?: number): {
|
|
85
|
+
ascent: number;
|
|
86
|
+
descent: number;
|
|
87
|
+
};
|
|
88
|
+
setFontInContext(ctx: CanvasRenderingContext2D, scalingFactor?: number): void;
|
|
89
|
+
setColorInContext(ctx: CanvasRenderingContext2D, color: TypeColor | null): void;
|
|
90
|
+
setStrokeColorInContext(ctx: CanvasRenderingContext2D, color: TypeColor | null): void;
|
|
91
|
+
_dup(): FigureFont;
|
|
92
|
+
}
|
|
93
|
+
export { // eslint-disable-next-line import/prefer-default-export
|
|
94
|
+
FigureFont, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare function glyphMeasures(family: string, style: string, a: number, // max ascent
|
|
2
|
+
ma: number, // mid ascent
|
|
3
|
+
d: number, // max descent
|
|
4
|
+
md: number, // mid descent
|
|
5
|
+
d0: number, // min descent
|
|
6
|
+
modifiers: Record<string, any>): any;
|
|
7
|
+
export default glyphMeasures;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Point, Rect } from '../../../tools/g2';
|
|
2
|
+
import WebGLInstance from '../../webgl/webgl';
|
|
3
|
+
import GLObject from '../GLObject/GLObject';
|
|
4
|
+
import type { CPY_Step } from '../../geometries/copy/copy';
|
|
5
|
+
declare class VertexGeneric extends GLObject {
|
|
6
|
+
width: number;
|
|
7
|
+
close: boolean;
|
|
8
|
+
copy: Array<CPY_Step>;
|
|
9
|
+
vertices: Array<Point>;
|
|
10
|
+
texOptions: {
|
|
11
|
+
location: string;
|
|
12
|
+
mapFrom: Rect;
|
|
13
|
+
mapTo: Rect;
|
|
14
|
+
repeat: boolean;
|
|
15
|
+
};
|
|
16
|
+
constructor(webgl: WebGLInstance, textureLocation?: string, textureVertexSpace?: Rect, textureCoords?: Rect, textureRepeat?: boolean);
|
|
17
|
+
getPointCountForAngle(drawAngle?: number): number;
|
|
18
|
+
getPointCountForLength(drawLength: number): number;
|
|
19
|
+
change(options: any): void;
|
|
20
|
+
}
|
|
21
|
+
export default VertexGeneric;
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Point } from '../../../tools/g2';
|
|
2
|
+
import WebGLInstance from '../../webgl/webgl';
|
|
3
|
+
import VertexGeneric from './VertexGeneric';
|
|
4
|
+
type TypeVertexInputTextOptions = {
|
|
5
|
+
text: string | null | undefined;
|
|
6
|
+
size: number | string | null | undefined;
|
|
7
|
+
family: string | null | undefined;
|
|
8
|
+
weight: number | null | undefined;
|
|
9
|
+
style: 'normal' | 'italic' | null | undefined;
|
|
10
|
+
xAlign: 'left' | 'center' | 'right' | null | undefined;
|
|
11
|
+
yAlign: 'top' | 'bottom' | 'middle' | 'baseline' | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
declare class VertexText extends VertexGeneric {
|
|
14
|
+
ctx: any;
|
|
15
|
+
figureToPixelSpaceScale: Point;
|
|
16
|
+
figureToGLSpaceTransformMatrix: Array<number>;
|
|
17
|
+
text: string;
|
|
18
|
+
size: number | string;
|
|
19
|
+
family: string;
|
|
20
|
+
weight: number;
|
|
21
|
+
style: 'normal' | 'italic';
|
|
22
|
+
xAlign: 'left' | 'center' | 'right';
|
|
23
|
+
yAlign: 'top' | 'bottom' | 'middle' | 'baseline';
|
|
24
|
+
canvas: HTMLCanvasElement;
|
|
25
|
+
ascent: number;
|
|
26
|
+
descent: number;
|
|
27
|
+
height: number;
|
|
28
|
+
width: number;
|
|
29
|
+
constructor(webgl: WebGLInstance, textOptions: TypeVertexInputTextOptions);
|
|
30
|
+
resizeText(pixelToVertexSpaceScale?: Point): void;
|
|
31
|
+
calcAscentDescent(): void;
|
|
32
|
+
drawTextIntoBuffer(pixelToVertexSpaceScale?: Point): void;
|
|
33
|
+
}
|
|
34
|
+
export default VertexText;
|