plotboilerplate 1.20.1 → 1.21.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/README.md +17 -1
- package/dist/index.esm.js +2065 -1397
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/plotboilerplate.browser.min.js +1 -1
- package/dist/plotboilerplate.browser.min.js.map +1 -1
- package/dist/plotboilerplate.js +1265 -584
- package/dist/plotboilerplate.min.js +1 -1
- package/package.json +2 -1
- package/src/cjs/BezierPath.d.ts +27 -49
- package/src/cjs/BezierPath.js +69 -237
- package/src/cjs/BezierPath.js.map +1 -1
- package/src/cjs/Bounds.d.ts +14 -1
- package/src/cjs/Bounds.js +21 -1
- package/src/cjs/Bounds.js.map +1 -1
- package/src/cjs/CubicBezierCurve.d.ts +70 -1
- package/src/cjs/CubicBezierCurve.js +130 -12
- package/src/cjs/CubicBezierCurve.js.map +1 -1
- package/src/cjs/Line.d.ts +2 -1
- package/src/cjs/Line.js +1 -0
- package/src/cjs/Line.js.map +1 -1
- package/src/cjs/PBText.d.ts +2 -1
- package/src/cjs/PBText.js +10 -9
- package/src/cjs/PBText.js.map +1 -1
- package/src/cjs/PlotBoilerplate.d.ts +10 -13
- package/src/cjs/PlotBoilerplate.js +136 -47
- package/src/cjs/PlotBoilerplate.js.map +1 -1
- package/src/cjs/Polygon.d.ts +35 -1
- package/src/cjs/Polygon.js +87 -1
- package/src/cjs/Polygon.js.map +1 -1
- package/src/cjs/Triangle.js +1 -0
- package/src/cjs/Triangle.js.map +1 -1
- package/src/cjs/VEllipse.js +1 -1
- package/src/cjs/VEllipse.js.map +1 -1
- package/src/cjs/Vector.d.ts +4 -4
- package/src/cjs/Vector.js +2 -2
- package/src/cjs/Vector.js.map +1 -1
- package/src/cjs/VertTuple.d.ts +2 -1
- package/src/cjs/VertTuple.js +4 -3
- package/src/cjs/VertTuple.js.map +1 -1
- package/src/cjs/Vertex.d.ts +14 -3
- package/src/cjs/Vertex.js +18 -3
- package/src/cjs/Vertex.js.map +1 -1
- package/src/cjs/draw.d.ts +159 -79
- package/src/cjs/draw.js +311 -139
- package/src/cjs/draw.js.map +1 -1
- package/src/cjs/drawgl.d.ts +93 -55
- package/src/cjs/drawgl.js +90 -34
- package/src/cjs/drawgl.js.map +1 -1
- package/src/cjs/drawutilssvg.d.ts +233 -58
- package/src/cjs/drawutilssvg.js +384 -95
- package/src/cjs/drawutilssvg.js.map +1 -1
- package/src/cjs/interfaces/DrawLib.d.ts +161 -82
- package/src/cjs/interfaces/DrawLib.js +7 -0
- package/src/cjs/interfaces/DrawLib.js.map +1 -1
- package/src/cjs/interfaces/core.d.ts +46 -32
- package/src/cjs/interfaces/core.js +2 -0
- package/src/cjs/interfaces/core.js.map +1 -1
- package/src/cjs/utils/creategui.js +16 -10
- package/src/cjs/utils/datastructures/Color.d.ts +3 -1
- package/src/cjs/utils/datastructures/Color.js +12 -1
- package/src/cjs/utils/datastructures/Color.js.map +1 -1
- package/src/cjs/utils/detectDarkMode.d.ts +10 -0
- package/src/cjs/utils/detectDarkMode.js +32 -0
- package/src/cjs/utils/detectDarkMode.js.map +1 -0
- package/src/cjs/utils/module.js +4 -2
- package/src/esm/BezierPath.d.ts +27 -49
- package/src/esm/BezierPath.js +69 -237
- package/src/esm/BezierPath.js.map +1 -1
- package/src/esm/Bounds.d.ts +14 -1
- package/src/esm/Bounds.js +19 -1
- package/src/esm/Bounds.js.map +1 -1
- package/src/esm/CubicBezierCurve.d.ts +70 -1
- package/src/esm/CubicBezierCurve.js +130 -12
- package/src/esm/CubicBezierCurve.js.map +1 -1
- package/src/esm/Line.d.ts +2 -1
- package/src/esm/Line.js +1 -0
- package/src/esm/Line.js.map +1 -1
- package/src/esm/PBText.d.ts +2 -1
- package/src/esm/PBText.js +10 -9
- package/src/esm/PBText.js.map +1 -1
- package/src/esm/PlotBoilerplate.d.ts +10 -13
- package/src/esm/PlotBoilerplate.js +136 -48
- package/src/esm/PlotBoilerplate.js.map +1 -1
- package/src/esm/Polygon.d.ts +35 -1
- package/src/esm/Polygon.js +85 -1
- package/src/esm/Polygon.js.map +1 -1
- package/src/esm/Triangle.js +1 -0
- package/src/esm/Triangle.js.map +1 -1
- package/src/esm/VEllipse.js +1 -1
- package/src/esm/VEllipse.js.map +1 -1
- package/src/esm/Vector.d.ts +4 -4
- package/src/esm/Vector.js +2 -2
- package/src/esm/Vector.js.map +1 -1
- package/src/esm/VertTuple.d.ts +2 -1
- package/src/esm/VertTuple.js +4 -3
- package/src/esm/VertTuple.js.map +1 -1
- package/src/esm/Vertex.d.ts +14 -3
- package/src/esm/Vertex.js +18 -3
- package/src/esm/Vertex.js.map +1 -1
- package/src/esm/draw.d.ts +159 -79
- package/src/esm/draw.js +307 -137
- package/src/esm/draw.js.map +1 -1
- package/src/esm/drawgl.d.ts +93 -55
- package/src/esm/drawgl.js +90 -34
- package/src/esm/drawgl.js.map +1 -1
- package/src/esm/drawutilssvg.d.ts +233 -58
- package/src/esm/drawutilssvg.js +379 -95
- package/src/esm/drawutilssvg.js.map +1 -1
- package/src/esm/interfaces/DrawLib.d.ts +161 -82
- package/src/esm/interfaces/DrawLib.js +7 -0
- package/src/esm/interfaces/DrawLib.js.map +1 -1
- package/src/esm/interfaces/core.d.ts +46 -32
- package/src/esm/interfaces/core.js +2 -0
- package/src/esm/interfaces/core.js.map +1 -1
- package/src/esm/utils/datastructures/Color.d.ts +3 -1
- package/src/esm/utils/datastructures/Color.js +12 -1
- package/src/esm/utils/datastructures/Color.js.map +1 -1
- package/src/esm/utils/detectDarkMode.d.ts +10 -0
- package/src/esm/utils/detectDarkMode.js +28 -0
- package/src/esm/utils/detectDarkMode.js.map +1 -0
- package/src/ts/BezierPath.ts +74 -244
- package/src/ts/Bounds.ts +25 -1
- package/src/ts/CubicBezierCurve.ts +139 -12
- package/src/ts/Line.ts +2 -1
- package/src/ts/PBText.ts +10 -9
- package/src/ts/PlotBoilerplate.ts +130 -50
- package/src/ts/Polygon.ts +91 -1
- package/src/ts/Triangle.ts +2 -1
- package/src/ts/VEllipse.ts +2 -2
- package/src/ts/Vector.ts +4 -4
- package/src/ts/VertTuple.ts +4 -3
- package/src/ts/Vertex.ts +20 -4
- package/src/ts/draw.ts +316 -119
- package/src/ts/drawgl.ts +141 -78
- package/src/ts/drawutilssvg.ts +562 -133
- package/src/ts/interfaces/DrawLib.ts +223 -86
- package/src/ts/interfaces/core.ts +47 -32
- package/src/ts/utils/datastructures/Color.ts +13 -1
- package/src/ts/utils/detectDarkMode.ts +30 -0
package/src/cjs/draw.d.ts
CHANGED
|
@@ -47,11 +47,20 @@
|
|
|
47
47
|
* @modified 2022-08-23 Fixed a type issue in the `polyline` function.
|
|
48
48
|
* @modified 2022-08-23 Fixed a type issue in the `setConfiguration` function.
|
|
49
49
|
* @modified 2022-08-23 Fixed a type issue in the `path` function.
|
|
50
|
-
* @
|
|
50
|
+
* @modified 2023-02-10 The methods `setCurrentClassName` and `setCurrentId` also accept `null` now.
|
|
51
|
+
* @modified 2023-09-29 Removed unused method stub for texturedPoly helper function (cleanup).
|
|
52
|
+
* @modified 2023-09-29 Downgrading all `Vertex` param type to the more generic `XYCoords` type in these render functions: line, arrow, texturedPoly, cubicBezier, cubicBezierPath, handle, handleLine, dot, point, circle, circleArc, ellipse, grid, raster.
|
|
53
|
+
* @modified 2023-09-29 Added the `headLength` parameter to the 'DrawLib.arrow()` function.
|
|
54
|
+
* @modified 2023-09-29 Added the `arrowHead(...)` function to the 'DrawLib.arrow()` interface.
|
|
55
|
+
* @modified 2023-09-29 Added the `cubicBezierArrow(...)` function to the 'DrawLib.arrow()` interface.
|
|
56
|
+
* @modified 2023-09-29 Added the `lineDashes` attribute.
|
|
57
|
+
* @modified 2023-09-30 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
|
|
58
|
+
* @modified 2023-10-07 Adding the optional `arrowHeadBasePositionBuffer` param to the arrowHead(...) method.
|
|
59
|
+
* @version 1.13.0
|
|
51
60
|
**/
|
|
52
61
|
import { Polygon } from "./Polygon";
|
|
53
62
|
import { Vertex } from "./Vertex";
|
|
54
|
-
import { DrawLib, SVGPathParams, XYCoords, UID, DrawLibConfiguration, FontStyle, FontWeight } from "./interfaces";
|
|
63
|
+
import { DrawLib, SVGPathParams, XYCoords, UID, DrawLibConfiguration, FontStyle, FontWeight, StrokeOptions } from "./interfaces";
|
|
55
64
|
import { Bounds } from "./Bounds";
|
|
56
65
|
/**
|
|
57
66
|
* @classdesc A wrapper class for basic drawing operations.
|
|
@@ -99,6 +108,13 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
99
108
|
* @param {boolean} fillShaped - Indicates if the constructed drawutils should fill all drawn shapes (if possible).
|
|
100
109
|
**/
|
|
101
110
|
constructor(context: CanvasRenderingContext2D, fillShapes: boolean);
|
|
111
|
+
/**
|
|
112
|
+
* A private helper method to apply stroke options to the current
|
|
113
|
+
* context.
|
|
114
|
+
* @param {StrokeOptions=} strokeOptions -
|
|
115
|
+
*/
|
|
116
|
+
private applyStrokeOpts;
|
|
117
|
+
_fillOrDraw(color: string): void;
|
|
102
118
|
/**
|
|
103
119
|
* Called before each draw cycle.
|
|
104
120
|
* @param {UID=} uid - (optional) A UID identifying the currently drawn element(s).
|
|
@@ -129,44 +145,84 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
129
145
|
*
|
|
130
146
|
* @name setCurrentId
|
|
131
147
|
* @method
|
|
132
|
-
* @param {UID} uid - A UID identifying the currently drawn element(s).
|
|
148
|
+
* @param {UID|null} uid - A UID identifying the currently drawn element(s).
|
|
133
149
|
**/
|
|
134
|
-
setCurrentId(uid: UID |
|
|
150
|
+
setCurrentId(uid: UID | null): void;
|
|
135
151
|
/**
|
|
136
152
|
* This method shouled be called each time the currently drawn `Drawable` changes.
|
|
137
153
|
* Determine the class name for further usage here.
|
|
138
154
|
*
|
|
139
155
|
* @name setCurrentClassName
|
|
140
156
|
* @method
|
|
141
|
-
* @param {string} className - A class name for further custom use cases.
|
|
157
|
+
* @param {string|null} className - A class name for further custom use cases.
|
|
142
158
|
**/
|
|
143
|
-
setCurrentClassName(className: string |
|
|
159
|
+
setCurrentClassName(className: string | null): void;
|
|
144
160
|
/**
|
|
145
161
|
* Draw the line between the given two points with the specified (CSS-) color.
|
|
146
162
|
*
|
|
147
163
|
* @method line
|
|
148
|
-
* @param {
|
|
149
|
-
* @param {
|
|
164
|
+
* @param {XYCoords} zA - The start point of the line.
|
|
165
|
+
* @param {XYCoords} zB - The end point of the line.
|
|
150
166
|
* @param {string} color - Any valid CSS color string.
|
|
151
167
|
* @param {number} lineWidth? - [optional] The line's width.
|
|
168
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
169
|
+
*
|
|
152
170
|
* @return {void}
|
|
153
171
|
* @instance
|
|
154
172
|
* @memberof drawutils
|
|
155
173
|
**/
|
|
156
|
-
line(zA:
|
|
174
|
+
line(zA: XYCoords, zB: XYCoords, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
157
175
|
/**
|
|
158
176
|
* Draw a line and an arrow at the end (zB) of the given line with the specified (CSS-) color.
|
|
159
177
|
*
|
|
160
178
|
* @method arrow
|
|
161
|
-
* @param {
|
|
162
|
-
* @param {
|
|
179
|
+
* @param {XYCoords} zA - The start point of the arrow-line.
|
|
180
|
+
* @param {XYCoords} zB - The end point of the arrow-line.
|
|
163
181
|
* @param {string} color - Any valid CSS color string.
|
|
164
182
|
* @param {number=} lineWidth - (optional) The line width to use; default is 1.
|
|
183
|
+
* @param {headLength=8} headLength - (optional) The length of the arrow head (default is 8 units).
|
|
184
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
185
|
+
*
|
|
165
186
|
* @return {void}
|
|
166
187
|
* @instance
|
|
167
188
|
* @memberof drawutils
|
|
168
189
|
**/
|
|
169
|
-
arrow(zA:
|
|
190
|
+
arrow(zA: XYCoords, zB: XYCoords, color: string, lineWidth?: number, headLength?: number, strokeOptions?: StrokeOptions): void;
|
|
191
|
+
/**
|
|
192
|
+
* Draw a cubic Bézier curve and and an arrow at the end (endControlPoint) of the given line width the specified (CSS-) color and arrow size.
|
|
193
|
+
*
|
|
194
|
+
* @method cubicBezierArrow
|
|
195
|
+
* @param {XYCoords} startPoint - The start point of the cubic Bézier curve
|
|
196
|
+
* @param {XYCoords} endPoint - The end point the cubic Bézier curve.
|
|
197
|
+
* @param {XYCoords} startControlPoint - The start control point the cubic Bézier curve.
|
|
198
|
+
* @param {XYCoords} endControlPoint - The end control point the cubic Bézier curve.
|
|
199
|
+
* @param {string} color - The CSS color to draw the curve with.
|
|
200
|
+
* @param {number} lineWidth - (optional) The line width to use.
|
|
201
|
+
* @param {headLength=8} headLength - (optional) The length of the arrow head (default is 8 units).
|
|
202
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
203
|
+
*
|
|
204
|
+
* @return {void}
|
|
205
|
+
* @instance
|
|
206
|
+
* @memberof DrawLib
|
|
207
|
+
*/
|
|
208
|
+
cubicBezierArrow(startPoint: XYCoords, endPoint: XYCoords, startControlPoint: XYCoords, endControlPoint: XYCoords, color: string, lineWidth?: number, headLength?: number, strokeOptions?: StrokeOptions): void;
|
|
209
|
+
/**
|
|
210
|
+
* Draw just an arrow head a the end of an imaginary line (zB) of the given line width the specified (CSS-) color and size.
|
|
211
|
+
*
|
|
212
|
+
* @method arrow
|
|
213
|
+
* @param {XYCoords} zA - The start point of the arrow-line.
|
|
214
|
+
* @param {XYCoords} zB - The end point of the arrow-line.
|
|
215
|
+
* @param {string} color - Any valid CSS color string.
|
|
216
|
+
* @param {number=1} lineWidth - (optional) The line width to use; default is 1.
|
|
217
|
+
* @param {number=8} headLength - (optional) The length of the arrow head (default is 8 pixels).
|
|
218
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
219
|
+
* @param {XYCoords=} arrowHeadBasePositionBuffer - (optional) If not null, then this position will contain the arrow head's start point (after execution). Some sort of OUT variable.
|
|
220
|
+
*
|
|
221
|
+
* @return {void}
|
|
222
|
+
* @instance
|
|
223
|
+
* @memberof DrawLib
|
|
224
|
+
**/
|
|
225
|
+
arrowHead(zA: XYCoords, zB: XYCoords, color: string, lineWidth?: number, headLength?: number, strokeOptions?: StrokeOptions, arrowHeadBasePositionBuffer?: XYCoords): void;
|
|
170
226
|
/**
|
|
171
227
|
* Draw an image at the given position with the given size.<br>
|
|
172
228
|
* <br>
|
|
@@ -174,14 +230,14 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
174
230
|
*
|
|
175
231
|
* @method image
|
|
176
232
|
* @param {Image} image - The image object to draw.
|
|
177
|
-
* @param {
|
|
178
|
-
* @param {
|
|
233
|
+
* @param {XYCoords} position - The position to draw the the upper left corner at.
|
|
234
|
+
* @param {XYCoords} size - The x/y-size to draw the image with.
|
|
179
235
|
* @param {number=0.0} alpha - (optional, default=0.0) The transparency (1.0=opaque, 0.0=transparent).
|
|
180
236
|
* @return {void}
|
|
181
237
|
* @instance
|
|
182
238
|
* @memberof drawutils
|
|
183
239
|
**/
|
|
184
|
-
image(image: HTMLImageElement, position:
|
|
240
|
+
image(image: HTMLImageElement, position: XYCoords, size: XYCoords, alpha?: number): void;
|
|
185
241
|
/**
|
|
186
242
|
* Draw an image at the given position with the given size.<br>
|
|
187
243
|
* <br>
|
|
@@ -191,15 +247,14 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
191
247
|
* @param {Image} textureImage - The image object to draw.
|
|
192
248
|
* @param {Bounds} textureSize - The texture size to use; these are the original bounds to map the polygon vertices to.
|
|
193
249
|
* @param {Polygon} polygon - The polygon to use as clip path.
|
|
194
|
-
* @param {
|
|
250
|
+
* @param {XYCoords} polygonPosition - The polygon's position (relative), measured at the bounding box's center.
|
|
195
251
|
* @param {number} rotation - The rotation to use for the polygon (and for the texture).
|
|
196
252
|
* @param {XYCoords={x:0,y:0}} rotationCenter - (optional) The rotational center; default is center of bounding box.
|
|
197
253
|
* @return {void}
|
|
198
254
|
* @instance
|
|
199
255
|
* @memberof drawutils
|
|
200
256
|
**/
|
|
201
|
-
texturedPoly(textureImage: HTMLImageElement, textureSize: Bounds, polygon: Polygon, polygonPosition:
|
|
202
|
-
_texturedPoly(textureImage: HTMLImageElement, textureSize: Bounds, polygon: Polygon, polygonPosition: Vertex, rotation: number, rotationCenter?: XYCoords): void;
|
|
257
|
+
texturedPoly(textureImage: HTMLImageElement, textureSize: Bounds, polygon: Polygon, polygonPosition: XYCoords, rotation: number): void;
|
|
203
258
|
/**
|
|
204
259
|
* Draw a rectangle.
|
|
205
260
|
*
|
|
@@ -208,38 +263,46 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
208
263
|
* @param {number} height - The height of the rectangle.
|
|
209
264
|
* @param {string} color - The color to use.
|
|
210
265
|
* @param {number=1} lineWidth - (optional) The line with to use (default is 1).
|
|
266
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
267
|
+
*
|
|
268
|
+
* @return {void}
|
|
269
|
+
* @instance
|
|
270
|
+
* @memberof drawutils
|
|
211
271
|
**/
|
|
212
|
-
rect(position: XYCoords, width: number, height: number, color: string, lineWidth?: number): void;
|
|
213
|
-
_fillOrDraw(color: string): void;
|
|
272
|
+
rect(position: XYCoords, width: number, height: number, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
214
273
|
/**
|
|
215
274
|
* Draw the given (cubic) bézier curve.
|
|
216
275
|
*
|
|
217
276
|
* @method cubicBezier
|
|
218
|
-
* @param {
|
|
219
|
-
* @param {
|
|
220
|
-
* @param {
|
|
221
|
-
* @param {
|
|
277
|
+
* @param {XYCoords} startPoint - The start point of the cubic Bézier curve
|
|
278
|
+
* @param {XYCoords} endPoint - The end point the cubic Bézier curve.
|
|
279
|
+
* @param {XYCoords} startControlPoint - The start control point the cubic Bézier curve.
|
|
280
|
+
* @param {XYCoords} endControlPoint - The end control point the cubic Bézier curve.
|
|
222
281
|
* @param {string} color - The CSS color to draw the curve with.
|
|
223
282
|
* @param {number} lineWidth - (optional) The line width to use.
|
|
283
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
284
|
+
*
|
|
224
285
|
* @return {void}
|
|
225
286
|
* @instance
|
|
226
287
|
* @memberof drawutils
|
|
227
288
|
*/
|
|
228
|
-
cubicBezier(startPoint:
|
|
289
|
+
cubicBezier(startPoint: XYCoords, endPoint: XYCoords, startControlPoint: XYCoords, endControlPoint: XYCoords, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
229
290
|
/**
|
|
230
291
|
* Draw the given (quadratic) bézier curve.
|
|
231
292
|
*
|
|
232
293
|
* @method quadraticBezier
|
|
233
|
-
* @param {
|
|
234
|
-
* @param {
|
|
235
|
-
* @param {
|
|
294
|
+
* @param {XYCoords} startPoint - The start point of the cubic Bézier curve
|
|
295
|
+
* @param {XYCoords} controlPoint - The control point the cubic Bézier curve.
|
|
296
|
+
* @param {XYCoords} endPoint - The end control point the cubic Bézier curve.
|
|
236
297
|
* @param {string} color - The CSS color to draw the curve with.
|
|
237
298
|
* @param {number|string} lineWidth - (optional) The line width to use.
|
|
299
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
300
|
+
*
|
|
238
301
|
* @return {void}
|
|
239
302
|
* @instance
|
|
240
303
|
* @memberof drawutils
|
|
241
304
|
*/
|
|
242
|
-
quadraticBezier(startPoint:
|
|
305
|
+
quadraticBezier(startPoint: XYCoords, controlPoint: XYCoords, endPoint: XYCoords, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
243
306
|
/**
|
|
244
307
|
* Draw the given (cubic) Bézier path.
|
|
245
308
|
*
|
|
@@ -248,108 +311,117 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
248
311
|
* <pre> [ point1, point1_startControl, point2_endControl, point2, point2_startControl, point3_endControl, point3, ... pointN_endControl, pointN ]</pre>
|
|
249
312
|
*
|
|
250
313
|
* @method cubicBezierPath
|
|
251
|
-
* @param {
|
|
314
|
+
* @param {XYCoords[]} path - The cubic bezier path as described above.
|
|
252
315
|
* @param {string} color - The CSS colot to draw the path with.
|
|
253
316
|
* @param {number=1} lineWidth - (optional) The line width to use.
|
|
317
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
318
|
+
*
|
|
254
319
|
* @return {void}
|
|
255
320
|
* @instance
|
|
256
321
|
* @memberof drawutils
|
|
257
322
|
*/
|
|
258
|
-
cubicBezierPath(path: Array<
|
|
323
|
+
cubicBezierPath(path: Array<XYCoords>, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
259
324
|
/**
|
|
260
325
|
* Draw the given handle and handle point (used to draw interactive Bézier curves).
|
|
261
326
|
*
|
|
262
327
|
* The colors for this are fixed and cannot be specified.
|
|
263
328
|
*
|
|
264
329
|
* @method handle
|
|
265
|
-
* @param {
|
|
266
|
-
* @param {
|
|
330
|
+
* @param {XYCoords} startPoint - The start of the handle.
|
|
331
|
+
* @param {XYCoords} endPoint - The end point of the handle.
|
|
267
332
|
* @return {void}
|
|
268
333
|
* @instance
|
|
269
334
|
* @memberof drawutils
|
|
270
335
|
*/
|
|
271
|
-
handle(startPoint:
|
|
336
|
+
handle(startPoint: XYCoords, endPoint: XYCoords): void;
|
|
272
337
|
/**
|
|
273
338
|
* Draw a handle line (with a light grey).
|
|
274
339
|
*
|
|
275
340
|
* @method handleLine
|
|
276
|
-
* @param {
|
|
277
|
-
* @param {
|
|
341
|
+
* @param {XYCoords} startPoint - The start point to draw the handle at.
|
|
342
|
+
* @param {XYCoords} endPoint - The end point to draw the handle at.
|
|
278
343
|
* @return {void}
|
|
279
344
|
* @instance
|
|
280
345
|
* @memberof drawutils
|
|
281
346
|
*/
|
|
282
|
-
handleLine(startPoint:
|
|
347
|
+
handleLine(startPoint: XYCoords, endPoint: XYCoords): void;
|
|
283
348
|
/**
|
|
284
349
|
* Draw a 1x1 dot with the specified (CSS-) color.
|
|
285
350
|
*
|
|
286
351
|
* @method dot
|
|
287
|
-
* @param {
|
|
352
|
+
* @param {XYCoords} p - The position to draw the dot at.
|
|
288
353
|
* @param {string} color - The CSS color to draw the dot with.
|
|
289
354
|
* @return {void}
|
|
290
355
|
* @instance
|
|
291
356
|
* @memberof drawutils
|
|
292
357
|
*/
|
|
293
|
-
dot(p:
|
|
358
|
+
dot(p: XYCoords, color: string): void;
|
|
294
359
|
/**
|
|
295
360
|
* Draw the given point with the specified (CSS-) color and radius 3.
|
|
296
361
|
*
|
|
297
362
|
* @method point
|
|
298
|
-
* @param {
|
|
363
|
+
* @param {XYCoords} p - The position to draw the point at.
|
|
299
364
|
* @param {string} color - The CSS color to draw the point with.
|
|
300
365
|
* @return {void}
|
|
301
366
|
* @instance
|
|
302
367
|
* @memberof drawutils
|
|
303
368
|
*/
|
|
304
|
-
point(p:
|
|
369
|
+
point(p: XYCoords, color: string): void;
|
|
305
370
|
/**
|
|
306
371
|
* Draw a circle with the specified (CSS-) color and radius.<br>
|
|
307
372
|
* <br>
|
|
308
373
|
* Note that if the x- and y- scales are different the result will be an ellipse rather than a circle.
|
|
309
374
|
*
|
|
310
375
|
* @method circle
|
|
311
|
-
* @param {
|
|
376
|
+
* @param {XYCoords} center - The center of the circle.
|
|
312
377
|
* @param {number} radius - The radius of the circle.
|
|
313
378
|
* @param {string} color - The CSS color to draw the circle with.
|
|
314
379
|
* @param {number} lineWidth - The line width (optional, default=1).
|
|
380
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
381
|
+
*
|
|
382
|
+
* @return {void}
|
|
383
|
+
* @instance
|
|
384
|
+
* @memberof drawutils
|
|
385
|
+
*/
|
|
386
|
+
circle(center: XYCoords, radius: number, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
387
|
+
/**
|
|
388
|
+
* Draw a circular arc (section of a circle) with the given CSS color.
|
|
389
|
+
*
|
|
390
|
+
* @method circleArc
|
|
391
|
+
* @param {XYCoords} center - The center of the circle.
|
|
392
|
+
* @param {number} radius - The radius of the circle.
|
|
393
|
+
* @param {number} startAngle - The angle to start at.
|
|
394
|
+
* @param {number} endAngle - The angle to end at.
|
|
395
|
+
* @param {string=#000000} color - The CSS color to draw the circle with.
|
|
396
|
+
* @param {number=1} lineWidth - The line width to use
|
|
397
|
+
* @param {boolean=false} options.asSegment - If `true` then no beginPath and no draw will be applied (as part of larger path).
|
|
398
|
+
* @param {number=} options.dashOffset - (optional) `See StrokeOptions`.
|
|
399
|
+
* @param {number=[]} options.dashArray - (optional) `See StrokeOptions`.
|
|
400
|
+
*
|
|
315
401
|
* @return {void}
|
|
316
402
|
* @instance
|
|
317
403
|
* @memberof drawutils
|
|
318
404
|
*/
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Draw a circular arc (section of a circle) with the given CSS color.
|
|
322
|
-
*
|
|
323
|
-
* @method circleArc
|
|
324
|
-
* @param {Vertex} center - The center of the circle.
|
|
325
|
-
* @param {number} radius - The radius of the circle.
|
|
326
|
-
* @param {number} startAngle - The angle to start at.
|
|
327
|
-
* @param {number} endAngle - The angle to end at.
|
|
328
|
-
* @param {string=#000000} color - The CSS color to draw the circle with.
|
|
329
|
-
* @param {number=1} lineWidth - The line width to use
|
|
330
|
-
// * @param {boolean=false} options.asSegment - If `true` then no beginPath and no draw will be applied (as part of larger path).
|
|
331
|
-
* @return {void}
|
|
332
|
-
* @instance
|
|
333
|
-
* @memberof drawutils
|
|
334
|
-
*/
|
|
335
|
-
circleArc(center: Vertex, radius: number, startAngle: number, endAngle: number, color?: string, lineWidth?: number, options?: {
|
|
405
|
+
circleArc(center: XYCoords, radius: number, startAngle: number, endAngle: number, color?: string, lineWidth?: number, options?: {
|
|
336
406
|
asSegment?: boolean;
|
|
337
|
-
}): void;
|
|
407
|
+
} & StrokeOptions): void;
|
|
338
408
|
/**
|
|
339
409
|
* Draw an ellipse with the specified (CSS-) color and thw two radii.
|
|
340
410
|
*
|
|
341
411
|
* @method ellipse
|
|
342
|
-
* @param {
|
|
412
|
+
* @param {XYCoords} center - The center of the ellipse.
|
|
343
413
|
* @param {number} radiusX - The radius of the ellipse.
|
|
344
414
|
* @param {number} radiusY - The radius of the ellipse.
|
|
345
415
|
* @param {string} color - The CSS color to draw the ellipse with.
|
|
346
416
|
* @param {number} lineWidth=1 - An optional line width param (default is 1).
|
|
347
417
|
* @param {number=} rotation - (optional, default=0) The rotation of the ellipse.
|
|
418
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
419
|
+
*
|
|
348
420
|
* @return {void}
|
|
349
421
|
* @instance
|
|
350
422
|
* @memberof drawutils
|
|
351
423
|
*/
|
|
352
|
-
ellipse(center:
|
|
424
|
+
ellipse(center: XYCoords, radiusX: number, radiusY: number, color: string, lineWidth?: number, rotation?: number, strokeOptions?: StrokeOptions): void;
|
|
353
425
|
/**
|
|
354
426
|
* Draw square at the given center, size and with the specified (CSS-) color.<br>
|
|
355
427
|
* <br>
|
|
@@ -360,16 +432,18 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
360
432
|
* @param {number} size - The size of the square.
|
|
361
433
|
* @param {string} color - The CSS color to draw the square with.
|
|
362
434
|
* @param {number} lineWidth - The line with to use (optional, default is 1).
|
|
435
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
436
|
+
*
|
|
363
437
|
* @return {void}
|
|
364
438
|
* @instance
|
|
365
439
|
* @memberof drawutils
|
|
366
440
|
*/
|
|
367
|
-
square(center: XYCoords, size: number, color: string, lineWidth?: number): void;
|
|
441
|
+
square(center: XYCoords, size: number, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
368
442
|
/**
|
|
369
443
|
* Draw a grid of horizontal and vertical lines with the given (CSS-) color.
|
|
370
444
|
*
|
|
371
445
|
* @method grid
|
|
372
|
-
* @param {
|
|
446
|
+
* @param {XYCoords} center - The center of the grid.
|
|
373
447
|
* @param {number} width - The total width of the grid (width/2 each to the left and to the right).
|
|
374
448
|
* @param {number} height - The total height of the grid (height/2 each to the top and to the bottom).
|
|
375
449
|
* @param {number} sizeX - The horizontal grid size.
|
|
@@ -379,14 +453,14 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
379
453
|
* @instance
|
|
380
454
|
* @memberof drawutils
|
|
381
455
|
*/
|
|
382
|
-
grid(center:
|
|
456
|
+
grid(center: XYCoords, width: number, height: number, sizeX: number, sizeY: number, color: string): void;
|
|
383
457
|
/**
|
|
384
458
|
* Draw a raster of crosshairs in the given grid.<br>
|
|
385
459
|
*
|
|
386
460
|
* This works analogue to the grid() function
|
|
387
461
|
*
|
|
388
462
|
* @method raster
|
|
389
|
-
* @param {
|
|
463
|
+
* @param {XYCoords} center - The center of the raster.
|
|
390
464
|
* @param {number} width - The total width of the raster (width/2 each to the left and to the right).
|
|
391
465
|
* @param {number} height - The total height of the raster (height/2 each to the top and to the bottom).
|
|
392
466
|
* @param {number} sizeX - The horizontal raster size.
|
|
@@ -396,7 +470,7 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
396
470
|
* @instance
|
|
397
471
|
* @memberof drawutils
|
|
398
472
|
*/
|
|
399
|
-
raster(center:
|
|
473
|
+
raster(center: XYCoords, width: number, height: number, sizeX: number, sizeY: number, color: string): void;
|
|
400
474
|
/**
|
|
401
475
|
* Draw a diamond handle (square rotated by 45°) with the given CSS color.
|
|
402
476
|
*
|
|
@@ -405,14 +479,14 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
405
479
|
* as even shaped diamonds.
|
|
406
480
|
*
|
|
407
481
|
* @method diamondHandle
|
|
408
|
-
* @param {
|
|
409
|
-
* @param {
|
|
482
|
+
* @param {XYCoords} center - The center of the diamond.
|
|
483
|
+
* @param {number} size - The x/y-size of the diamond.
|
|
410
484
|
* @param {string} color - The CSS color to draw the diamond with.
|
|
411
485
|
* @return {void}
|
|
412
486
|
* @instance
|
|
413
487
|
* @memberof drawutils
|
|
414
488
|
*/
|
|
415
|
-
diamondHandle(center:
|
|
489
|
+
diamondHandle(center: XYCoords, size: number, color: string): void;
|
|
416
490
|
/**
|
|
417
491
|
* Draw a square handle with the given CSS color.<br>
|
|
418
492
|
* <br>
|
|
@@ -421,14 +495,14 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
421
495
|
* as even shaped squares.
|
|
422
496
|
*
|
|
423
497
|
* @method squareHandle
|
|
424
|
-
* @param {
|
|
425
|
-
* @param {
|
|
498
|
+
* @param {XYCoords} center - The center of the square.
|
|
499
|
+
* @param {number} size - The x/y-size of the square.
|
|
426
500
|
* @param {string} color - The CSS color to draw the square with.
|
|
427
501
|
* @return {void}
|
|
428
502
|
* @instance
|
|
429
503
|
* @memberof drawutils
|
|
430
504
|
*/
|
|
431
|
-
squareHandle(center:
|
|
505
|
+
squareHandle(center: XYCoords, size: number, color: string): void;
|
|
432
506
|
/**
|
|
433
507
|
* Draw a circle handle with the given CSS color.<br>
|
|
434
508
|
* <br>
|
|
@@ -437,14 +511,14 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
437
511
|
* as even shaped circles.
|
|
438
512
|
*
|
|
439
513
|
* @method circleHandle
|
|
440
|
-
* @param {
|
|
514
|
+
* @param {XYCoords} center - The center of the circle.
|
|
441
515
|
* @param {number} radius - The radius of the circle.
|
|
442
516
|
* @param {string} color - The CSS color to draw the circle with.
|
|
443
517
|
* @return {void}
|
|
444
518
|
* @instance
|
|
445
519
|
* @memberof drawutils
|
|
446
520
|
*/
|
|
447
|
-
circleHandle(center:
|
|
521
|
+
circleHandle(center: XYCoords, radius: number, color: string): void;
|
|
448
522
|
/**
|
|
449
523
|
* Draw a crosshair with given radius and color at the given position.<br>
|
|
450
524
|
* <br>
|
|
@@ -482,24 +556,28 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
482
556
|
* @param {Polygon} polygon - The polygon to draw.
|
|
483
557
|
* @param {string} color - The CSS color to draw the polygon with.
|
|
484
558
|
* @param {string} lineWidth - The line width to use.
|
|
559
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
560
|
+
*
|
|
485
561
|
* @return {void}
|
|
486
562
|
* @instance
|
|
487
563
|
* @memberof drawutils
|
|
488
564
|
*/
|
|
489
|
-
polygon(polygon: Polygon, color: string, lineWidth?: number): void;
|
|
565
|
+
polygon(polygon: Polygon, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
490
566
|
/**
|
|
491
567
|
* Draw a polygon line (alternative function to the polygon).
|
|
492
568
|
*
|
|
493
569
|
* @method polyline
|
|
494
|
-
* @param {
|
|
570
|
+
* @param {XYCoords[]} vertices - The polygon vertices to draw.
|
|
495
571
|
* @param {boolan} isOpen - If true the polyline will not be closed at its end.
|
|
496
572
|
* @param {string} color - The CSS color to draw the polygon with.
|
|
497
573
|
* @param {number} lineWidth - The line width (default is 1.0);
|
|
574
|
+
* @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
|
|
575
|
+
*
|
|
498
576
|
* @return {void}
|
|
499
577
|
* @instance
|
|
500
578
|
* @memberof drawutils
|
|
501
579
|
*/
|
|
502
|
-
polyline(vertices: Array<
|
|
580
|
+
polyline(vertices: Array<XYCoords>, isOpen: boolean, color: string, lineWidth?: number, strokeOptions?: StrokeOptions): void;
|
|
503
581
|
/**
|
|
504
582
|
* Draw a text at the given relative position.
|
|
505
583
|
*
|
|
@@ -554,13 +632,15 @@ export declare class drawutils implements DrawLib<void> {
|
|
|
554
632
|
* @param {string=null} color - (optional) The color to draw this path with (default is null).
|
|
555
633
|
* @param {number=1} lineWidth - (optional) the line width to use (default is 1).
|
|
556
634
|
* @param {boolean=false} options.inplace - (optional) If set to true then path transforamtions (scale and translate) will be done in-place in the array. This can boost the performance.
|
|
635
|
+
* @param {number=} options.dashOffset - (optional) `See StrokeOptions`.
|
|
636
|
+
* @param {number=[]} options.dashArray - (optional) `See StrokeOptions`.
|
|
557
637
|
* @instance
|
|
558
638
|
* @memberof drawutils
|
|
559
639
|
* @return {R} An instance representing the drawn path.
|
|
560
640
|
*/
|
|
561
641
|
path(pathData: SVGPathParams, color?: string, lineWidth?: number, options?: {
|
|
562
642
|
inplace?: boolean;
|
|
563
|
-
}): void;
|
|
643
|
+
} & StrokeOptions): void;
|
|
564
644
|
/**
|
|
565
645
|
* Due to gl compatibility there is a generic 'clear' function required
|
|
566
646
|
* to avoid accessing the context object itself directly.
|