plotboilerplate 1.14.0 → 1.17.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 (232) hide show
  1. package/README.md +2 -0
  2. package/changelog.md +57 -0
  3. package/dist/index.esm.js +856 -694
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.esm.min.js +1 -1
  6. package/dist/index.esm.min.js.map +1 -1
  7. package/dist/plotboilerplate.browser.min.js +1 -1
  8. package/dist/plotboilerplate.browser.min.js.map +1 -1
  9. package/dist/plotboilerplate.js +858 -598
  10. package/dist/plotboilerplate.min.js +1 -1
  11. package/package.json +1 -1
  12. package/src/cjs/BezierPath.d.ts +32 -14
  13. package/src/cjs/BezierPath.js +65 -24
  14. package/src/cjs/BezierPath.js.map +1 -1
  15. package/src/cjs/Bounds.d.ts +22 -1
  16. package/src/cjs/Bounds.js +24 -1
  17. package/src/cjs/Bounds.js.map +1 -1
  18. package/src/cjs/Circle.d.ts +15 -13
  19. package/src/cjs/Circle.js +16 -34
  20. package/src/cjs/Circle.js.map +1 -1
  21. package/src/cjs/CircleSector.d.ts +17 -16
  22. package/src/cjs/CircleSector.js +12 -24
  23. package/src/cjs/CircleSector.js.map +1 -1
  24. package/src/cjs/CubicBezierCurve.d.ts +16 -15
  25. package/src/cjs/CubicBezierCurve.js +57 -94
  26. package/src/cjs/CubicBezierCurve.js.map +1 -1
  27. package/src/cjs/KeyHandler.d.ts +10 -3
  28. package/src/cjs/KeyHandler.js +28 -23
  29. package/src/cjs/KeyHandler.js.map +1 -1
  30. package/src/cjs/Line.d.ts +2 -15
  31. package/src/cjs/Line.js +6 -31
  32. package/src/cjs/Line.js.map +1 -1
  33. package/src/cjs/MouseHandler.js +43 -53
  34. package/src/cjs/MouseHandler.js.map +1 -1
  35. package/src/cjs/PBImage.d.ts +15 -13
  36. package/src/cjs/PBImage.js +11 -15
  37. package/src/cjs/PBImage.js.map +1 -1
  38. package/src/cjs/PBText.d.ts +13 -12
  39. package/src/cjs/PBText.js +8 -12
  40. package/src/cjs/PBText.js.map +1 -1
  41. package/src/cjs/PlotBoilerplate.js +3 -2
  42. package/src/cjs/PlotBoilerplate.js.map +1 -1
  43. package/src/cjs/Polygon.d.ts +44 -14
  44. package/src/cjs/Polygon.js +116 -66
  45. package/src/cjs/Polygon.js.map +1 -1
  46. package/src/cjs/Triangle.d.ts +15 -13
  47. package/src/cjs/Triangle.js +23 -64
  48. package/src/cjs/Triangle.js.map +1 -1
  49. package/src/cjs/VEllipse.d.ts +14 -9
  50. package/src/cjs/VEllipse.js +10 -18
  51. package/src/cjs/VEllipse.js.map +1 -1
  52. package/src/cjs/VEllipseSector.d.ts +15 -1
  53. package/src/cjs/VEllipseSector.js +11 -1
  54. package/src/cjs/VEllipseSector.js.map +1 -1
  55. package/src/cjs/Vector.d.ts +3 -15
  56. package/src/cjs/Vector.js +9 -49
  57. package/src/cjs/Vector.js.map +1 -1
  58. package/src/cjs/VertTuple.d.ts +15 -1
  59. package/src/cjs/VertTuple.js +14 -19
  60. package/src/cjs/VertTuple.js.map +1 -1
  61. package/src/cjs/Vertex.d.ts +47 -13
  62. package/src/cjs/Vertex.js +62 -22
  63. package/src/cjs/Vertex.js.map +1 -1
  64. package/src/cjs/VertexListeners.d.ts +12 -8
  65. package/src/cjs/VertexListeners.js +18 -25
  66. package/src/cjs/VertexListeners.js.map +1 -1
  67. package/src/cjs/draw.d.ts +41 -2
  68. package/src/cjs/draw.js +140 -3
  69. package/src/cjs/draw.js.map +1 -1
  70. package/src/cjs/drawgl.d.ts +38 -2
  71. package/src/cjs/drawgl.js +41 -2
  72. package/src/cjs/drawgl.js.map +1 -1
  73. package/src/cjs/drawutilssvg.d.ts +66 -3
  74. package/src/cjs/drawutilssvg.js +140 -15
  75. package/src/cjs/drawutilssvg.js.map +1 -1
  76. package/src/cjs/index.d.ts +0 -1
  77. package/src/cjs/index.js +0 -1
  78. package/src/cjs/index.js.map +1 -1
  79. package/src/cjs/interfaces/DrawLib.d.ts +61 -26
  80. package/src/cjs/interfaces/DrawLib.js +2 -0
  81. package/src/cjs/interfaces/DrawLib.js.map +1 -1
  82. package/src/cjs/interfaces/core.d.ts +0 -12
  83. package/src/cjs/module.d.ts +1 -3
  84. package/src/cjs/module.js +2 -5
  85. package/src/cjs/module.js.map +1 -1
  86. package/src/cjs/utils/creategui.js +16 -2
  87. package/src/cjs/utils/datastructures/Girih.d.ts +5 -0
  88. package/src/cjs/utils/datastructures/Girih.js +18 -14
  89. package/src/cjs/utils/datastructures/Girih.js.map +1 -1
  90. package/src/cjs/utils/datastructures/GirihPenroseRhombus.js +42 -25
  91. package/src/cjs/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
  92. package/src/cjs/utils/datastructures/GirihTile.js +2 -13
  93. package/src/cjs/utils/datastructures/GirihTile.js.map +1 -1
  94. package/src/cjs/utils/findInVertexArray.d.ts +19 -0
  95. package/src/cjs/utils/findInVertexArray.js +29 -0
  96. package/src/cjs/utils/findInVertexArray.js.map +1 -0
  97. package/src/cjs/utils/helpers/BezierPathInteractionHelper.d.ts +17 -1
  98. package/src/cjs/utils/helpers/BezierPathInteractionHelper.js +50 -32
  99. package/src/cjs/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
  100. package/src/cjs/utils/io/DndFileHandler.d.ts +63 -0
  101. package/src/cjs/utils/io/DndFileHandler.js +112 -0
  102. package/src/cjs/utils/io/DndFileHandler.js.map +1 -0
  103. package/src/cjs/utils/io/FileDrop.d.ts +98 -0
  104. package/src/cjs/utils/io/FileDrop.js +142 -0
  105. package/src/cjs/utils/io/FileDrop.js.map +1 -0
  106. package/src/esm/BezierPath.d.ts +32 -14
  107. package/src/esm/BezierPath.js +65 -24
  108. package/src/esm/BezierPath.js.map +1 -1
  109. package/src/esm/Bounds.d.ts +22 -1
  110. package/src/esm/Bounds.js +24 -1
  111. package/src/esm/Bounds.js.map +1 -1
  112. package/src/esm/Circle.d.ts +15 -13
  113. package/src/esm/Circle.js +16 -34
  114. package/src/esm/Circle.js.map +1 -1
  115. package/src/esm/CircleSector.d.ts +17 -16
  116. package/src/esm/CircleSector.js +12 -24
  117. package/src/esm/CircleSector.js.map +1 -1
  118. package/src/esm/CubicBezierCurve.d.ts +16 -15
  119. package/src/esm/CubicBezierCurve.js +57 -94
  120. package/src/esm/CubicBezierCurve.js.map +1 -1
  121. package/src/esm/KeyHandler.d.ts +10 -3
  122. package/src/esm/KeyHandler.js +28 -23
  123. package/src/esm/KeyHandler.js.map +1 -1
  124. package/src/esm/Line.d.ts +2 -15
  125. package/src/esm/Line.js +6 -31
  126. package/src/esm/Line.js.map +1 -1
  127. package/src/esm/MouseHandler.js +43 -53
  128. package/src/esm/MouseHandler.js.map +1 -1
  129. package/src/esm/PBImage.d.ts +15 -13
  130. package/src/esm/PBImage.js +11 -15
  131. package/src/esm/PBImage.js.map +1 -1
  132. package/src/esm/PBText.d.ts +13 -12
  133. package/src/esm/PBText.js +8 -12
  134. package/src/esm/PBText.js.map +1 -1
  135. package/src/esm/PlotBoilerplate.js +3 -2
  136. package/src/esm/PlotBoilerplate.js.map +1 -1
  137. package/src/esm/Polygon.d.ts +44 -14
  138. package/src/esm/Polygon.js +116 -66
  139. package/src/esm/Polygon.js.map +1 -1
  140. package/src/esm/Triangle.d.ts +15 -13
  141. package/src/esm/Triangle.js +23 -64
  142. package/src/esm/Triangle.js.map +1 -1
  143. package/src/esm/VEllipse.d.ts +14 -9
  144. package/src/esm/VEllipse.js +10 -18
  145. package/src/esm/VEllipse.js.map +1 -1
  146. package/src/esm/VEllipseSector.d.ts +15 -1
  147. package/src/esm/VEllipseSector.js +11 -1
  148. package/src/esm/VEllipseSector.js.map +1 -1
  149. package/src/esm/Vector.d.ts +3 -15
  150. package/src/esm/Vector.js +9 -49
  151. package/src/esm/Vector.js.map +1 -1
  152. package/src/esm/VertTuple.d.ts +15 -1
  153. package/src/esm/VertTuple.js +14 -19
  154. package/src/esm/VertTuple.js.map +1 -1
  155. package/src/esm/Vertex.d.ts +47 -13
  156. package/src/esm/Vertex.js +62 -22
  157. package/src/esm/Vertex.js.map +1 -1
  158. package/src/esm/VertexListeners.d.ts +12 -8
  159. package/src/esm/VertexListeners.js +18 -25
  160. package/src/esm/VertexListeners.js.map +1 -1
  161. package/src/esm/draw.d.ts +41 -2
  162. package/src/esm/draw.js +139 -3
  163. package/src/esm/draw.js.map +1 -1
  164. package/src/esm/drawgl.d.ts +38 -2
  165. package/src/esm/drawgl.js +41 -2
  166. package/src/esm/drawgl.js.map +1 -1
  167. package/src/esm/drawutilssvg.d.ts +66 -3
  168. package/src/esm/drawutilssvg.js +140 -15
  169. package/src/esm/drawutilssvg.js.map +1 -1
  170. package/src/esm/index.d.ts +0 -1
  171. package/src/esm/index.js +0 -1
  172. package/src/esm/index.js.map +1 -1
  173. package/src/esm/interfaces/DrawLib.d.ts +61 -26
  174. package/src/esm/interfaces/DrawLib.js +2 -0
  175. package/src/esm/interfaces/DrawLib.js.map +1 -1
  176. package/src/esm/interfaces/core.d.ts +0 -12
  177. package/src/esm/module.d.ts +1 -3
  178. package/src/esm/module.js +5 -4
  179. package/src/esm/module.js.map +1 -1
  180. package/src/esm/utils/datastructures/Girih.d.ts +5 -0
  181. package/src/esm/utils/datastructures/Girih.js +18 -14
  182. package/src/esm/utils/datastructures/Girih.js.map +1 -1
  183. package/src/esm/utils/datastructures/GirihPenroseRhombus.js +42 -25
  184. package/src/esm/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
  185. package/src/esm/utils/datastructures/GirihTile.js +2 -13
  186. package/src/esm/utils/datastructures/GirihTile.js.map +1 -1
  187. package/src/esm/utils/findInVertexArray.d.ts +19 -0
  188. package/src/esm/utils/findInVertexArray.js +25 -0
  189. package/src/esm/utils/findInVertexArray.js.map +1 -0
  190. package/src/esm/utils/helpers/BezierPathInteractionHelper.d.ts +17 -1
  191. package/src/esm/utils/helpers/BezierPathInteractionHelper.js +49 -32
  192. package/src/esm/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
  193. package/src/esm/utils/io/DndFileHandler.d.ts +63 -0
  194. package/src/esm/utils/io/DndFileHandler.js +106 -0
  195. package/src/esm/utils/io/DndFileHandler.js.map +1 -0
  196. package/src/esm/utils/io/FileDrop.d.ts +98 -0
  197. package/src/esm/utils/io/FileDrop.js +136 -0
  198. package/src/esm/utils/io/FileDrop.js.map +1 -0
  199. package/src/ts/BezierPath.ts +78 -22
  200. package/src/ts/Bounds.ts +25 -1
  201. package/src/ts/Circle.ts +187 -200
  202. package/src/ts/CircleSector.ts +141 -141
  203. package/src/ts/CubicBezierCurve.ts +738 -810
  204. package/src/ts/KeyHandler.ts +221 -212
  205. package/src/ts/Line.ts +48 -80
  206. package/src/ts/MouseHandler.ts +356 -368
  207. package/src/ts/PBImage.ts +67 -69
  208. package/src/ts/PBText.ts +16 -14
  209. package/src/ts/PlotBoilerplate.ts +4 -2
  210. package/src/ts/Polygon.ts +493 -451
  211. package/src/ts/Triangle.ts +444 -489
  212. package/src/ts/VEllipse.ts +18 -17
  213. package/src/ts/VEllipseSector.ts +20 -1
  214. package/src/ts/Vector.ts +124 -160
  215. package/src/ts/VertTuple.ts +333 -338
  216. package/src/ts/Vertex.ts +75 -21
  217. package/src/ts/VertexListeners.ts +248 -266
  218. package/src/ts/draw.ts +192 -3
  219. package/src/ts/drawgl.ts +44 -2
  220. package/src/ts/drawutilssvg.ts +181 -15
  221. package/src/ts/index.ts +0 -1
  222. package/src/ts/interfaces/DrawLib.ts +69 -26
  223. package/src/ts/interfaces/core.ts +0 -11
  224. package/src/ts/module.ts +2 -4
  225. package/src/ts/utils/datastructures/Girih.ts +204 -209
  226. package/src/ts/utils/datastructures/GirihPenroseRhombus.ts +170 -152
  227. package/src/ts/utils/datastructures/GirihTile.ts +394 -419
  228. package/src/ts/utils/findInVertexArray.ts +28 -0
  229. package/src/ts/utils/helpers/BezierPathInteractionHelper.ts +56 -34
  230. package/src/ts/utils/io/FileDrop.ts +178 -0
  231. package/src/ts/SVGBuilder.ts +0 -109
  232. package/src/ts/utils/algorithms/sh-tmp.ts~ +0 -59
@@ -15,8 +15,11 @@
15
15
  * @modified 2021-11-12 Added `text()` params fontSize, fontFamily, rotation, textAlign.
16
16
  * @modified 2021-11-16 Added `text()` params fontWeight and fontStyle.
17
17
  * @modified 2021-11-19 Added the `color` param to the `label(...)` function.
18
+ * @modified 2022-02-03 Added the `lineWidth` param to the `crosshair` function.
19
+ * @modified 2022-02-03 Added the `cross(...)` function.
18
20
  **/
19
21
 
22
+ import { Bounds } from "../Bounds";
20
23
  import { Polygon } from "../Polygon";
21
24
  import { Vertex } from "../Vertex";
22
25
  import { SVGPathParams, UID, XYCoords } from "./core";
@@ -121,7 +124,7 @@ export interface DrawLib<R> {
121
124
  * @param {number=1} lineWidth? - [optional] The line's width.
122
125
  * @return {void}
123
126
  * @instance
124
- * @memberof drawutils
127
+ * @memberof DrawLib
125
128
  **/
126
129
  line: (zA: Vertex, zB: Vertex, color: string, lineWidth?: number) => R;
127
130
 
@@ -135,7 +138,7 @@ export interface DrawLib<R> {
135
138
  * @param {number=} lineWidth - (optional) The line width to use; default is 1.
136
139
  * @return {void}
137
140
  * @instance
138
- * @memberof drawutils
141
+ * @memberof DrawLib
139
142
  **/
140
143
  arrow: (zA: Vertex, zB: Vertex, color: string, lineWidth?: number) => R;
141
144
 
@@ -150,10 +153,33 @@ export interface DrawLib<R> {
150
153
  * @param {Vertex} size - The x/y-size to draw the image with.
151
154
  * @return {void}
152
155
  * @instance
153
- * @memberof drawutils
156
+ * @memberof DrawLib
154
157
  **/
155
158
  image: (image: HTMLImageElement, position: Vertex, size: Vertex) => R;
156
159
 
160
+ /**
161
+ * Draw an image at the given position with the given size.<br>
162
+ * <br>
163
+ * Note: SVG images may have resizing issues at the moment.Draw a line and an arrow at the end (zB) of the given line with the specified (CSS-) color.
164
+ *
165
+ * @method texturedPoly
166
+ * @param {Image} textureImage - The image object to draw.
167
+ * @param {Bounds} textureSize - The texture size to use; these are the original bounds to map the polygon vertices to.
168
+ * @param {Polygon} polygon - The polygon to use as clip path.
169
+ * @param {Vertex} polygonPosition - The polygon's position (relative), measured at the bounding box's center.
170
+ * @param {number} rotation - The rotation to use for the polygon (and for the texture).
171
+ * @return {void}
172
+ * @instance
173
+ * @memberof DrawLib
174
+ **/
175
+ texturedPoly: (
176
+ textureImage: HTMLImageElement,
177
+ textureSize: Bounds,
178
+ polygon: Polygon,
179
+ polygonPosition: Vertex,
180
+ rotation: number
181
+ ) => R;
182
+
157
183
  /**
158
184
  * Draw the given (cubic) bézier curve.
159
185
  *
@@ -166,7 +192,7 @@ export interface DrawLib<R> {
166
192
  * @param {number} lineWidth - (optional) The line width to use.
167
193
  * @return {void}
168
194
  * @instance
169
- * @memberof drawutils
195
+ * @memberof DrawLib
170
196
  */
171
197
  cubicBezier: (
172
198
  startPoint: Vertex,
@@ -190,7 +216,7 @@ export interface DrawLib<R> {
190
216
  * @param {number=1} lineWidth - (optional) The line width to use.
191
217
  * @return {void}
192
218
  * @instance
193
- * @memberof drawutils
219
+ * @memberof DrawLib
194
220
  */
195
221
  cubicBezierPath: (path: Array<Vertex>, color: string, lineWidth?: number) => R;
196
222
 
@@ -204,7 +230,7 @@ export interface DrawLib<R> {
204
230
  * @param {Vertex} endPoint - The end point of the handle.
205
231
  * @return {void}
206
232
  * @instance
207
- * @memberof drawutils
233
+ * @memberof DrawLib
208
234
  */
209
235
  handle: (startPoint: Vertex, endPoint: Vertex) => R;
210
236
 
@@ -216,7 +242,7 @@ export interface DrawLib<R> {
216
242
  * @param {Vertex} endPoint - The end point to draw the handle at.
217
243
  * @return {void}
218
244
  * @instance
219
- * @memberof drawutils
245
+ * @memberof DrawLib
220
246
  */
221
247
  handleLine: (startPoint: Vertex, endPoint: Vertex) => R;
222
248
 
@@ -228,7 +254,7 @@ export interface DrawLib<R> {
228
254
  * @param {string} color - The CSS color to draw the dot with.
229
255
  * @return {void}
230
256
  * @instance
231
- * @memberof drawutils
257
+ * @memberof DrawLib
232
258
  */
233
259
  dot: (p: Vertex, color: string) => R;
234
260
 
@@ -240,7 +266,7 @@ export interface DrawLib<R> {
240
266
  * @param {string} color - The CSS color to draw the point with.
241
267
  * @return {void}
242
268
  * @instance
243
- * @memberof drawutils
269
+ * @memberof DrawLib
244
270
  */
245
271
  point: (p: Vertex, color: string) => R;
246
272
 
@@ -256,7 +282,7 @@ export interface DrawLib<R> {
256
282
  * @param {number=} lineWidth - (optional) The line width to use; default is 1.
257
283
  * @return {void}
258
284
  * @instance
259
- * @memberof drawutils
285
+ * @memberof DrawLib
260
286
  */
261
287
  circle: (center: Vertex, radius: number, color: string, lineWidth?: number) => R;
262
288
 
@@ -272,7 +298,7 @@ export interface DrawLib<R> {
272
298
  * @param {number=} lineWidth - (optional) The line width to use; default is 1.
273
299
  * @return {void}
274
300
  * @instance
275
- * @memberof drawutils
301
+ * @memberof DrawLib
276
302
  */
277
303
  circleArc: (center: Vertex, radius: number, startAngle: number, endAngle: number, color: string, lineWidth?: number) => R;
278
304
 
@@ -288,7 +314,7 @@ export interface DrawLib<R> {
288
314
  * @param {number=} rotation - (optional, default=0) The rotation of the ellipse.
289
315
  * @return {void}
290
316
  * @instance
291
- * @memberof drawutils
317
+ * @memberof DrawLib
292
318
  */
293
319
  ellipse: (center: Vertex, radiusX: number, radiusY: number, color: string, lineWidth?: number, rotation?: number) => R;
294
320
 
@@ -304,7 +330,7 @@ export interface DrawLib<R> {
304
330
  * @param {number=} lineWidth - (optional) The line width to use; default is 1.
305
331
  * @return {void}
306
332
  * @instance
307
- * @memberof drawutils
333
+ * @memberof DrawLib
308
334
  */
309
335
  square: (center: XYCoords, size: number, color: string, lineWidth?: number) => R;
310
336
 
@@ -319,7 +345,7 @@ export interface DrawLib<R> {
319
345
  * @param {number=} lineWidth - (optional) The line width to use; default is 1.
320
346
  * @return {void}
321
347
  * @instance
322
- * @memberof drawutils
348
+ * @memberof DrawLib
323
349
  */
324
350
  rect: (upperLeft: XYCoords, width: number, height: number, color: string, lineWidth?: number) => R;
325
351
 
@@ -335,7 +361,7 @@ export interface DrawLib<R> {
335
361
  * @param {string} color - The CSS color to draw the grid with.
336
362
  * @return {void}
337
363
  * @instance
338
- * @memberof drawutils
364
+ * @memberof DrawLib
339
365
  */
340
366
  grid: (center: Vertex, width: number, height: number, sizeX: number, sizeY: number, color: string) => R;
341
367
 
@@ -353,7 +379,7 @@ export interface DrawLib<R> {
353
379
  * @param {string} color - The CSS color to draw the raster with.
354
380
  * @return {void}
355
381
  * @instance
356
- * @memberof drawutils
382
+ * @memberof DrawLib
357
383
  */
358
384
  raster: (center: Vertex, width: number, height: number, sizeX: number, sizeY: number, color: string) => R;
359
385
 
@@ -370,7 +396,7 @@ export interface DrawLib<R> {
370
396
  * @param {string} color - The CSS color to draw the diamond with.
371
397
  * @return {void}
372
398
  * @instance
373
- * @memberof drawutils
399
+ * @memberof DrawLib
374
400
  */
375
401
  diamondHandle: (center: Vertex, size: number, color: string) => R;
376
402
 
@@ -387,7 +413,7 @@ export interface DrawLib<R> {
387
413
  * @param {string} color - The CSS color to draw the square with.
388
414
  * @return {void}
389
415
  * @instance
390
- * @memberof drawutils
416
+ * @memberof DrawLib
391
417
  */
392
418
  squareHandle: (center: Vertex, size: number, color: string) => R;
393
419
 
@@ -404,7 +430,7 @@ export interface DrawLib<R> {
404
430
  * @param {string} color - The CSS color to draw the circle with.
405
431
  * @return {void}
406
432
  * @instance
407
- * @memberof drawutils
433
+ * @memberof DrawLib
408
434
  */
409
435
  circleHandle: (center: Vertex, size: number, color: string) => R;
410
436
 
@@ -417,11 +443,28 @@ export interface DrawLib<R> {
417
443
  * @param {XYCoords} center - The center of the crosshair.
418
444
  * @param {number} radius - The radius of the crosshair.
419
445
  * @param {string} color - The CSS color to draw the crosshair with.
446
+ * @param {number=0.5} lineWidth - (optional, default=0.5) The line width to use.
447
+ * @return {void}
448
+ * @instance
449
+ * @memberof DrawLib
450
+ */
451
+ crosshair: (center: XYCoords, radius: number, color: string, lineWidth?: number) => R;
452
+
453
+ /**
454
+ * Draw a cross with diagonal axes with given radius, color and lineWidth at the given position.<br>
455
+ * <br>
456
+ * Note that the x's radius will not be affected by scaling.
457
+ *
458
+ * @method crosshair
459
+ * @param {XYCoords} center - The center of the crosshair.
460
+ * @param {number} radius - The radius of the crosshair.
461
+ * @param {string} color - The CSS color to draw the crosshair with.
462
+ * @param {number=1} lineWidth - (optional, default=1.0) The line width to use.
420
463
  * @return {void}
421
464
  * @instance
422
- * @memberof drawutils
465
+ * @memberof DrawLib
423
466
  */
424
- crosshair: (center: XYCoords, radius: number, color: string) => R;
467
+ cross: (center: XYCoords, radius: number, color: string, lineWidth?: number) => R;
425
468
 
426
469
  /**
427
470
  * Draw a polygon.
@@ -431,7 +474,7 @@ export interface DrawLib<R> {
431
474
  * @param {string} color - The CSS color to draw the polygon with.
432
475
  * @return {void}
433
476
  * @instance
434
- * @memberof drawutils
477
+ * @memberof DrawLib
435
478
  */
436
479
  polygon: (polygon: Polygon, color: string, lineWidth?: number) => R;
437
480
 
@@ -445,7 +488,7 @@ export interface DrawLib<R> {
445
488
  * @param {number=} lineWidth - (optional) The line width to use; default is 1.
446
489
  * @return {void}
447
490
  * @instance
448
- * @memberof drawutils
491
+ * @memberof DrawLib
449
492
  */
450
493
  polyline: (vertices: Array<Vertex>, isOpen: boolean, color: string, lineWidth?: number) => R;
451
494
 
@@ -466,7 +509,7 @@ export interface DrawLib<R> {
466
509
  * @param {string=} options.textAlign - The text align to use. According to the specifiactions (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign) valid values are `"left" || "right" || "center" || "start" || "end"`.
467
510
  * @return {void}
468
511
  * @instance
469
- * @memberof drawutils
512
+ * @memberof DrawLib
470
513
  */
471
514
  text: (text: string, x: number, y: number, options?: FontOptions) => R;
472
515
 
@@ -481,7 +524,7 @@ export interface DrawLib<R> {
481
524
  * @param {string="black"} color - The color to use (default is black).
482
525
  * @return {void}
483
526
  * @instance
484
- * @memberof drawutils
527
+ * @memberof DrawLib
485
528
  */
486
529
  label: (text: string, x: number, y: number, rotation?: number, color?: string) => R;
487
530
 
@@ -494,7 +537,7 @@ export interface DrawLib<R> {
494
537
  * @param {number=1} lineWidth - (optional) the line width to use (default is 1).
495
538
  * @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.
496
539
  * @instance
497
- * @memberof drawutils
540
+ * @memberof DrawLib
498
541
  * @return {R} An instance representing the drawn path.
499
542
  */
500
543
  path: (pathData: SVGPathParams, color?: string, lineWidth?: number, options?: { inplace?: boolean }) => R;
@@ -211,17 +211,6 @@ export interface SVGSerializable {
211
211
  * Required to generate proper CSS classes and other class related IDs.
212
212
  **/
213
213
  readonly className: string;
214
-
215
- /**
216
- * Convert this vertex to SVG code.
217
- *
218
- * @method toSVGString
219
- * @param {object=} options - An optional set of options, like 'className'.
220
- * @return {string} A string representing the SVG code for this vertex.
221
- * @instance
222
- * @memberof Vertex
223
- **/
224
- toSVGString: (options: { className?: string }) => string;
225
214
  }
226
215
 
227
216
  /**
package/src/ts/module.ts CHANGED
@@ -11,7 +11,7 @@ import { Circle } from "./Circle";
11
11
  import { CircleSector } from "./CircleSector";
12
12
  import { CubicBezierCurve } from "./CubicBezierCurve";
13
13
  import { drawutils } from "./draw";
14
- import { drawutilsgl } from "./drawgl";
14
+ // import { drawutilsgl } from "./drawgl";
15
15
  import { geomutils } from "./geomutils";
16
16
  import { Grid } from "./Grid";
17
17
  import { KeyHandler } from "./KeyHandler";
@@ -20,7 +20,6 @@ import { MouseHandler } from "./MouseHandler";
20
20
  import { PBImage } from "./PBImage";
21
21
  import { PlotBoilerplate } from "./PlotBoilerplate";
22
22
  import { Polygon } from "./Polygon";
23
- import { SVGBuilder } from "./SVGBuilder";
24
23
  import { Triangle } from "./Triangle";
25
24
  import { UIDGenerator } from "./UIDGenerator";
26
25
  import { Vector } from "./Vector";
@@ -39,7 +38,7 @@ export {
39
38
  CircleSector,
40
39
  CubicBezierCurve,
41
40
  drawutils,
42
- drawutilsgl,
41
+ // drawutilsgl,
43
42
  geomutils,
44
43
  Grid,
45
44
  // ...interf,
@@ -49,7 +48,6 @@ export {
49
48
  PBImage,
50
49
  PlotBoilerplate,
51
50
  Polygon,
52
- SVGBuilder,
53
51
  Triangle,
54
52
  UIDGenerator,
55
53
  Vector,