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