figureone 0.15.10 → 1.0.1
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 +79170 -0
- package/llms.txt +548 -0
- package/package.json +16 -1
- package/types/index.d.ts +128 -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,146 @@
|
|
|
1
|
+
import Scene from '../../../tools/geometry/scene';
|
|
2
|
+
import type { Type3DMatrix } from '../../../tools/m3';
|
|
3
|
+
import WebGLInstance from '../../webgl/webgl';
|
|
4
|
+
import type { TypeFragmentShader, TypeVertexShader } from '../../webgl/shaders';
|
|
5
|
+
import { Rect } from '../../../tools/g2';
|
|
6
|
+
import DrawingObject from '../DrawingObject';
|
|
7
|
+
import type { TypeColor } from '../../../tools/types';
|
|
8
|
+
/**
|
|
9
|
+
* `'BYTE' | 'UNSIGNED_BYTE' | 'SHORT' | 'UNSIGNED_SHORT' | 'FLOAT'`
|
|
10
|
+
* @group Shaders
|
|
11
|
+
*/
|
|
12
|
+
export type TypeGLBufferType = 'BYTE' | 'UNSIGNED_BYTE' | 'SHORT' | 'UNSIGNED_SHORT' | 'FLOAT';
|
|
13
|
+
/**
|
|
14
|
+
* `'STATIC' | 'DYNAMIC'`
|
|
15
|
+
* @group Shaders
|
|
16
|
+
*/
|
|
17
|
+
export type TypeGLBufferUsage = 'STATIC' | 'DYNAMIC';
|
|
18
|
+
/**
|
|
19
|
+
* `'FLOAT' | 'FLOAT_VECTOR' | 'INT' | 'INT_VECTOR'`
|
|
20
|
+
* @group Shaders
|
|
21
|
+
*/
|
|
22
|
+
export type TypeGLUniform = 'FLOAT' | 'FLOAT_VECTOR' | 'INT' | 'INT_VECTOR';
|
|
23
|
+
/**
|
|
24
|
+
* FigureElementPrimitive that can be used to utilize custom shaders for WebGL.
|
|
25
|
+
*
|
|
26
|
+
* @group Misc Figure Element
|
|
27
|
+
*/
|
|
28
|
+
declare class GLObject extends DrawingObject {
|
|
29
|
+
gl: WebGLRenderingContext;
|
|
30
|
+
webgl: WebGLInstance;
|
|
31
|
+
glPrimitive: number;
|
|
32
|
+
z: number;
|
|
33
|
+
texture: {
|
|
34
|
+
id: string;
|
|
35
|
+
src?: string;
|
|
36
|
+
points: Array<number>;
|
|
37
|
+
buffer?: WebGLBuffer | null;
|
|
38
|
+
repeat?: boolean;
|
|
39
|
+
mapTo: Rect;
|
|
40
|
+
mapFrom: Rect;
|
|
41
|
+
data?: HTMLImageElement | null;
|
|
42
|
+
loadColor: TypeColor;
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
} | null;
|
|
45
|
+
attributes: {
|
|
46
|
+
[attributeName: string]: {
|
|
47
|
+
buffer: WebGLBuffer | null;
|
|
48
|
+
size: number;
|
|
49
|
+
type: number;
|
|
50
|
+
normalize: boolean;
|
|
51
|
+
stride: number;
|
|
52
|
+
offset: number;
|
|
53
|
+
usage: number;
|
|
54
|
+
data: Array<number>;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
points: Array<number>;
|
|
58
|
+
uniforms: {
|
|
59
|
+
[uniformName: string]: {
|
|
60
|
+
value: Array<number>;
|
|
61
|
+
method: (location: WebGLUniformLocation, name: string) => void;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
numVertices: number;
|
|
65
|
+
state: 'loading' | 'loaded';
|
|
66
|
+
programIndex: number;
|
|
67
|
+
selectorProgramIndex: number;
|
|
68
|
+
onLoad: ((result: boolean, id: string) => void) | null | undefined;
|
|
69
|
+
vertexShader: TypeVertexShader;
|
|
70
|
+
fragmentShader: TypeFragmentShader;
|
|
71
|
+
selectorVertexShader: TypeVertexShader;
|
|
72
|
+
selectorFragmentShader: TypeFragmentShader;
|
|
73
|
+
constructor(webgl: WebGLInstance, vertexShader?: TypeVertexShader, fragmentShader?: TypeFragmentShader, selectorVertexShader?: TypeVertexShader, selectorFragShader?: TypeFragmentShader);
|
|
74
|
+
init(webgl: WebGLInstance): void;
|
|
75
|
+
initProgram(): void;
|
|
76
|
+
showShaders(): void;
|
|
77
|
+
showSelectorShaders(): void;
|
|
78
|
+
getCanvas(): HTMLCanvasElement | OffscreenCanvas;
|
|
79
|
+
setPrimitive(primitiveType: 'TRIANGLES' | 'POINTS' | 'TRIANGLE_FAN' | 'TRIANGLE_STRIP' | 'LINES' | 'LINE_LOOP' | 'LINE_STRIP' | 'FAN' | 'STRIP'): void;
|
|
80
|
+
initAttributes(): void;
|
|
81
|
+
setZ(z: number): void;
|
|
82
|
+
contextLost(): void;
|
|
83
|
+
updateTextureMap(points?: Array<number>): void;
|
|
84
|
+
/**
|
|
85
|
+
* Buffer a texture for the shape to be painted with.
|
|
86
|
+
*/
|
|
87
|
+
addTexture(location: string, mapFrom?: Rect, mapTo?: Rect, mapToBuffer?: string, points?: Array<number>, repeat?: boolean, onLoad?: null | (() => void), loadColor?: TypeColor): void;
|
|
88
|
+
updateTexture(data: HTMLImageElement): void;
|
|
89
|
+
initTexture(force?: boolean): void;
|
|
90
|
+
createTextureMap(xMinGL?: number, xMaxGL?: number, yMinGL?: number, yMaxGL?: number, xMinTex?: number, xMaxTex?: number, yMinTex?: number, yMaxTex?: number): void;
|
|
91
|
+
addVertices(vertices: Array<number>, dimension?: 2 | 3, usage?: TypeGLBufferUsage): void;
|
|
92
|
+
addVertices3(vertices: Array<number>, usage?: TypeGLBufferUsage): void;
|
|
93
|
+
addNormals(normals: Array<number>, usage?: TypeGLBufferUsage): void;
|
|
94
|
+
addColors(colors: Array<number>, normalized?: boolean, usage?: TypeGLBufferUsage): void;
|
|
95
|
+
addAttribute(name: string, size: number, data: Array<number>, typeIn?: TypeGLBufferType, normalize?: boolean, stride?: number, offset?: number, usageIn?: TypeGLBufferUsage): void;
|
|
96
|
+
fillBuffer(name: string, data: Array<number>): void;
|
|
97
|
+
executeOnLoad(result: boolean, id: string): void;
|
|
98
|
+
resetTextureBuffer(deleteTexture?: boolean): void;
|
|
99
|
+
cleanup(deleteTexture?: boolean): void;
|
|
100
|
+
resetBuffers(deleteTexture?: boolean): void;
|
|
101
|
+
updateVertices(vertices: Array<number>): void;
|
|
102
|
+
updateVertices3(vertices: Array<number>): void;
|
|
103
|
+
updateAttribute(name: string, data: Array<number>): void;
|
|
104
|
+
_getStateProperties(): never[];
|
|
105
|
+
/**
|
|
106
|
+
* Get the current value of a uniform
|
|
107
|
+
*/
|
|
108
|
+
getUniform(uniformName: string): number[];
|
|
109
|
+
/**
|
|
110
|
+
* Add a uniform.
|
|
111
|
+
*
|
|
112
|
+
* Length 16 corresponds to a 4x4 matrix and can only be
|
|
113
|
+
* `'FLOAT_VECTOR'` type.
|
|
114
|
+
*
|
|
115
|
+
* @param {string} uniformName The variable name used in the shader
|
|
116
|
+
* @param {1 | 2 | 3 | 4 | 16} length (`1`) number of values in uniform
|
|
117
|
+
* @param {'FLOAT' | 'FLOAT_VECTOR' | 'INT' | 'INT_VECTOR'} type type of
|
|
118
|
+
* value. Use '_VECTOR' suffix if using vector methods on the uniform in the
|
|
119
|
+
* shader (`'FLOAT'`).
|
|
120
|
+
* @param {number | Array<number> | null} initialValue initial value to use
|
|
121
|
+
* for uniform - if null then uniform will be all 0 (`null`)
|
|
122
|
+
*/
|
|
123
|
+
addUniform(uniformName: string, length?: 1 | 2 | 3 | 4 | 16, type?: TypeGLUniform, initialValue?: number | Array<number> | null): void;
|
|
124
|
+
uploadUniform1f(location: WebGLUniformLocation, name: string): void;
|
|
125
|
+
uploadUniform2f(location: WebGLUniformLocation, name: string): void;
|
|
126
|
+
uploadUniform3f(location: WebGLUniformLocation, name: string): void;
|
|
127
|
+
uploadUniform4f(location: WebGLUniformLocation, name: string): void;
|
|
128
|
+
uploadUniform1fv(location: WebGLUniformLocation, name: string): void;
|
|
129
|
+
uploadUniform2fv(location: WebGLUniformLocation, name: string): void;
|
|
130
|
+
uploadUniform3fv(location: WebGLUniformLocation, name: string): void;
|
|
131
|
+
uploadUniform4fv(location: WebGLUniformLocation, name: string): void;
|
|
132
|
+
uploadUniform1iv(location: WebGLUniformLocation, name: string): void;
|
|
133
|
+
uploadUniform2iv(location: WebGLUniformLocation, name: string): void;
|
|
134
|
+
uploadUniform3iv(location: WebGLUniformLocation, name: string): void;
|
|
135
|
+
uploadUniform4iv(location: WebGLUniformLocation, name: string): void;
|
|
136
|
+
uploadUniform16fv(location: WebGLUniformLocation, name: string): void;
|
|
137
|
+
uploadUniform1i(location: WebGLUniformLocation, name: string): void;
|
|
138
|
+
uploadUniform2i(location: WebGLUniformLocation, name: string): void;
|
|
139
|
+
uploadUniform3i(location: WebGLUniformLocation, name: string): void;
|
|
140
|
+
uploadUniform4i(location: WebGLUniformLocation, name: string): void;
|
|
141
|
+
updateUniform(uniformName: string, value: number | Array<number>): void;
|
|
142
|
+
drawWithTransformMatrix(scene: Scene, worldMatrix: Type3DMatrix, color: TypeColor, numDrawVertices?: number, targetTexture?: boolean): void;
|
|
143
|
+
getPointCountForAngle(drawAngle?: number): number;
|
|
144
|
+
getPointCountForLength(drawLength: number): number;
|
|
145
|
+
}
|
|
146
|
+
export default GLObject;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Point } from '../../../tools/g2';
|
|
2
|
+
import DrawingObject from '../DrawingObject';
|
|
3
|
+
import type { TypeColor } from '../../../tools/types';
|
|
4
|
+
import type { Type3DMatrix } from '../../../tools/m3';
|
|
5
|
+
import type Scene from '../../../tools/geometry/scene';
|
|
6
|
+
declare class HTMLObject extends DrawingObject {
|
|
7
|
+
border: Array<Array<Point>>;
|
|
8
|
+
id: string;
|
|
9
|
+
location: Point;
|
|
10
|
+
element: HTMLElement;
|
|
11
|
+
parentDiv: HTMLElement;
|
|
12
|
+
xAlign: 'left' | 'right' | 'center';
|
|
13
|
+
yAlign: 'top' | 'bottom' | 'middle';
|
|
14
|
+
show: boolean;
|
|
15
|
+
lastMatrix: Array<number>;
|
|
16
|
+
lastColor: Array<number>;
|
|
17
|
+
forceDraw: boolean;
|
|
18
|
+
originalElement: HTMLElement;
|
|
19
|
+
copy: () => HTMLObject;
|
|
20
|
+
constructor(parentDiv: HTMLElement, id: string, location: Point, yAlign: "top" | "bottom" | "middle" | undefined, xAlign: "left" | "right" | "center" | undefined, originalElement: HTMLElement | Array<HTMLElement>);
|
|
21
|
+
_dup(): any;
|
|
22
|
+
setBorder(): void;
|
|
23
|
+
getBoundaries(): Array<Array<Point>>;
|
|
24
|
+
glToPixelSpace(p: Point): Point;
|
|
25
|
+
change(newHtml: any, lastDrawTransformMatrix?: any): void;
|
|
26
|
+
transformHtml(transformMatrix: Type3DMatrix, opacity?: number): void;
|
|
27
|
+
drawWithTransformMatrix(scene: Scene, worldMatrix: Type3DMatrix, color: TypeColor): void;
|
|
28
|
+
}
|
|
29
|
+
export default HTMLObject;
|
|
@@ -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;
|