plotboilerplate 1.28.0 → 1.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1022) hide show
  1. package/package.json +1 -1
  2. package/src/_cjs/BezierPath.d.ts +0 -610
  3. package/src/_cjs/BezierPath.js +0 -1127
  4. package/src/_cjs/BezierPath.js.map +0 -1
  5. package/src/_cjs/Bounds.d.ts +0 -252
  6. package/src/_cjs/Bounds.js +0 -320
  7. package/src/_cjs/Bounds.js.map +0 -1
  8. package/src/_cjs/Circle.d.ts +0 -214
  9. package/src/_cjs/Circle.js +0 -339
  10. package/src/_cjs/Circle.js.map +0 -1
  11. package/src/_cjs/CircleSector.d.ts +0 -211
  12. package/src/_cjs/CircleSector.js +0 -364
  13. package/src/_cjs/CircleSector.js.map +0 -1
  14. package/src/_cjs/CubicBezierCurve.d.ts +0 -656
  15. package/src/_cjs/CubicBezierCurve.js +0 -1062
  16. package/src/_cjs/CubicBezierCurve.js.map +0 -1
  17. package/src/_cjs/Grid.d.ts +0 -83
  18. package/src/_cjs/Grid.js +0 -90
  19. package/src/_cjs/Grid.js.map +0 -1
  20. package/src/_cjs/KeyHandler.d.ts +0 -177
  21. package/src/_cjs/KeyHandler.js +0 -435
  22. package/src/_cjs/KeyHandler.js.map +0 -1
  23. package/src/_cjs/Line.d.ts +0 -134
  24. package/src/_cjs/Line.js +0 -220
  25. package/src/_cjs/Line.js.map +0 -1
  26. package/src/_cjs/MouseHandler.d.ts +0 -283
  27. package/src/_cjs/MouseHandler.js +0 -423
  28. package/src/_cjs/MouseHandler.js.map +0 -1
  29. package/src/_cjs/PBImage.d.ts +0 -81
  30. package/src/_cjs/PBImage.js +0 -61
  31. package/src/_cjs/PBImage.js.map +0 -1
  32. package/src/_cjs/PBText.d.ts +0 -118
  33. package/src/_cjs/PBText.js +0 -63
  34. package/src/_cjs/PBText.js.map +0 -1
  35. package/src/_cjs/PlotBoilerplate.d.ts +0 -899
  36. package/src/_cjs/PlotBoilerplate.js +0 -2348
  37. package/src/_cjs/PlotBoilerplate.js.map +0 -1
  38. package/src/_cjs/Polygon.d.ts +0 -520
  39. package/src/_cjs/Polygon.js +0 -933
  40. package/src/_cjs/Polygon.js.map +0 -1
  41. package/src/_cjs/SVGBuilder.d.ts +0 -47
  42. package/src/_cjs/SVGBuilder.js +0 -100
  43. package/src/_cjs/SVGBuilder.js.map +0 -1
  44. package/src/_cjs/Triangle.d.ts +0 -392
  45. package/src/_cjs/Triangle.js +0 -497
  46. package/src/_cjs/Triangle.js.map +0 -1
  47. package/src/_cjs/UIDGenerator.d.ts +0 -12
  48. package/src/_cjs/UIDGenerator.js +0 -21
  49. package/src/_cjs/UIDGenerator.js.map +0 -1
  50. package/src/_cjs/VEllipse.d.ts +0 -319
  51. package/src/_cjs/VEllipse.js +0 -578
  52. package/src/_cjs/VEllipse.js.map +0 -1
  53. package/src/_cjs/VEllipseSector.d.ts +0 -230
  54. package/src/_cjs/VEllipseSector.js +0 -428
  55. package/src/_cjs/VEllipseSector.js.map +0 -1
  56. package/src/_cjs/Vector.d.ts +0 -126
  57. package/src/_cjs/Vector.js +0 -199
  58. package/src/_cjs/Vector.js.map +0 -1
  59. package/src/_cjs/VertTuple.d.ts +0 -284
  60. package/src/_cjs/VertTuple.js +0 -348
  61. package/src/_cjs/VertTuple.js.map +0 -1
  62. package/src/_cjs/Vertex.d.ts +0 -498
  63. package/src/_cjs/Vertex.js +0 -703
  64. package/src/_cjs/Vertex.js.map +0 -1
  65. package/src/_cjs/VertexAttr.d.ts +0 -72
  66. package/src/_cjs/VertexAttr.js +0 -59
  67. package/src/_cjs/VertexAttr.js.map +0 -1
  68. package/src/_cjs/VertexListeners.d.ts +0 -208
  69. package/src/_cjs/VertexListeners.js +0 -267
  70. package/src/_cjs/VertexListeners.js.map +0 -1
  71. package/src/_cjs/draw.d.ts +0 -657
  72. package/src/_cjs/draw.js +0 -1164
  73. package/src/_cjs/draw.js.map +0 -1
  74. package/src/_cjs/drawgl.d.ts +0 -544
  75. package/src/_cjs/drawgl.js +0 -794
  76. package/src/_cjs/drawgl.js.map +0 -1
  77. package/src/_cjs/drawutilssvg.d.ts +0 -954
  78. package/src/_cjs/drawutilssvg.js +0 -1713
  79. package/src/_cjs/drawutilssvg.js.map +0 -1
  80. package/src/_cjs/entry-glsupport.js +0 -28
  81. package/src/_cjs/entry.js +0 -29
  82. package/src/_cjs/geomutils.d.ts +0 -77
  83. package/src/_cjs/geomutils.js +0 -126
  84. package/src/_cjs/geomutils.js.map +0 -1
  85. package/src/_cjs/index.d.ts +0 -102
  86. package/src/_cjs/index.js +0 -128
  87. package/src/_cjs/index.js.map +0 -1
  88. package/src/_cjs/interfaces/DrawLib.d.ts +0 -582
  89. package/src/_cjs/interfaces/DrawLib.js +0 -32
  90. package/src/_cjs/interfaces/DrawLib.js.map +0 -1
  91. package/src/_cjs/interfaces/additionals.d.ts +0 -95
  92. package/src/_cjs/interfaces/additionals.js +0 -3
  93. package/src/_cjs/interfaces/additionals.js.map +0 -1
  94. package/src/_cjs/interfaces/core.d.ts +0 -286
  95. package/src/_cjs/interfaces/core.js +0 -30
  96. package/src/_cjs/interfaces/core.js.map +0 -1
  97. package/src/_cjs/interfaces/externals.d.ts +0 -56
  98. package/src/_cjs/interfaces/externals.js +0 -8
  99. package/src/_cjs/interfaces/externals.js.map +0 -1
  100. package/src/_cjs/interfaces/index.d.ts +0 -4
  101. package/src/_cjs/interfaces/index.js +0 -21
  102. package/src/_cjs/interfaces/index.js.map +0 -1
  103. package/src/_cjs/module.d.ts +0 -26
  104. package/src/_cjs/module.js +0 -60
  105. package/src/_cjs/module.js.map +0 -1
  106. package/src/_cjs/utils/InitializationObserver.d.ts +0 -18
  107. package/src/_cjs/utils/InitializationObserver.js +0 -63
  108. package/src/_cjs/utils/InitializationObserver.js.map +0 -1
  109. package/src/_cjs/utils/LissajousFigure.d.ts +0 -34
  110. package/src/_cjs/utils/LissajousFigure.js +0 -100
  111. package/src/_cjs/utils/LissajousFigure.js.map +0 -1
  112. package/src/_cjs/utils/NGons.d.ts +0 -13
  113. package/src/_cjs/utils/NGons.js +0 -36
  114. package/src/_cjs/utils/NGons.js.map +0 -1
  115. package/src/_cjs/utils/Params.d.ts +0 -17
  116. package/src/_cjs/utils/Params.js +0 -53
  117. package/src/_cjs/utils/Params.js.map +0 -1
  118. package/src/_cjs/utils/PerlinNoise.d.ts +0 -19
  119. package/src/_cjs/utils/PerlinNoise.js +0 -352
  120. package/src/_cjs/utils/PerlinNoise.js.map +0 -1
  121. package/src/_cjs/utils/SVGPathUtils.d.ts +0 -22
  122. package/src/_cjs/utils/SVGPathUtils.js +0 -45
  123. package/src/_cjs/utils/SVGPathUtils.js.map +0 -1
  124. package/src/_cjs/utils/WebColors.d.ts +0 -35
  125. package/src/_cjs/utils/WebColors.js +0 -58
  126. package/src/_cjs/utils/WebColors.js.map +0 -1
  127. package/src/_cjs/utils/WebColorsContrast.d.ts +0 -6
  128. package/src/_cjs/utils/WebColorsContrast.js +0 -12
  129. package/src/_cjs/utils/WebColorsContrast.js.map +0 -1
  130. package/src/_cjs/utils/WebColorsMalachite.d.ts +0 -12
  131. package/src/_cjs/utils/WebColorsMalachite.js +0 -28
  132. package/src/_cjs/utils/WebColorsMalachite.js.map +0 -1
  133. package/src/_cjs/utils/_gup.js_ +0 -13
  134. package/src/_cjs/utils/algorithms/CatmullRomPath.d.ts +0 -60
  135. package/src/_cjs/utils/algorithms/CatmullRomPath.js +0 -108
  136. package/src/_cjs/utils/algorithms/CatmullRomPath.js.map +0 -1
  137. package/src/_cjs/utils/algorithms/CircleIntersections.d.ts +0 -170
  138. package/src/_cjs/utils/algorithms/CircleIntersections.js +0 -310
  139. package/src/_cjs/utils/algorithms/CircleIntersections.js.map +0 -1
  140. package/src/_cjs/utils/algorithms/ContourLineDetection.d.ts +0 -150
  141. package/src/_cjs/utils/algorithms/ContourLineDetection.js +0 -367
  142. package/src/_cjs/utils/algorithms/ContourLineDetection.js.map +0 -1
  143. package/src/_cjs/utils/algorithms/CubicSplinePath.d.ts +0 -63
  144. package/src/_cjs/utils/algorithms/CubicSplinePath.js +0 -175
  145. package/src/_cjs/utils/algorithms/CubicSplinePath.js.map +0 -1
  146. package/src/_cjs/utils/algorithms/HobbyPath.d.ts +0 -81
  147. package/src/_cjs/utils/algorithms/HobbyPath.js +0 -278
  148. package/src/_cjs/utils/algorithms/HobbyPath.js.map +0 -1
  149. package/src/_cjs/utils/algorithms/Metaballs.d.ts +0 -30
  150. package/src/_cjs/utils/algorithms/Metaballs.js +0 -114
  151. package/src/_cjs/utils/algorithms/Metaballs.js.map +0 -1
  152. package/src/_cjs/utils/algorithms/PolygonInset.d.ts +0 -184
  153. package/src/_cjs/utils/algorithms/PolygonInset.js +0 -431
  154. package/src/_cjs/utils/algorithms/PolygonInset.js.map +0 -1
  155. package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
  156. package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.js +0 -269
  157. package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
  158. package/src/_cjs/utils/algorithms/arrayFill.d.ts +0 -8
  159. package/src/_cjs/utils/algorithms/arrayFill.js +0 -18
  160. package/src/_cjs/utils/algorithms/arrayFill.js.map +0 -1
  161. package/src/_cjs/utils/algorithms/arrayResize.d.ts +0 -8
  162. package/src/_cjs/utils/algorithms/arrayResize.js +0 -24
  163. package/src/_cjs/utils/algorithms/arrayResize.js.map +0 -1
  164. package/src/_cjs/utils/algorithms/arrayShuffle.d.ts +0 -8
  165. package/src/_cjs/utils/algorithms/arrayShuffle.js +0 -15
  166. package/src/_cjs/utils/algorithms/arrayShuffle.js.map +0 -1
  167. package/src/_cjs/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
  168. package/src/_cjs/utils/algorithms/clearDuplicateVertices.js +0 -51
  169. package/src/_cjs/utils/algorithms/clearDuplicateVertices.js.map +0 -1
  170. package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
  171. package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.js +0 -61
  172. package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
  173. package/src/_cjs/utils/algorithms/convexHull.d.ts +0 -23
  174. package/src/_cjs/utils/algorithms/convexHull.js +0 -71
  175. package/src/_cjs/utils/algorithms/convexHull.js.map +0 -1
  176. package/src/_cjs/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
  177. package/src/_cjs/utils/algorithms/convexPolygonIncircle.js +0 -145
  178. package/src/_cjs/utils/algorithms/convexPolygonIncircle.js.map +0 -1
  179. package/src/_cjs/utils/algorithms/delaunay.d.ts +0 -30
  180. package/src/_cjs/utils/algorithms/delaunay.js +0 -158
  181. package/src/_cjs/utils/algorithms/delaunay.js.map +0 -1
  182. package/src/_cjs/utils/algorithms/delaunay2voronoi.d.ts +0 -25
  183. package/src/_cjs/utils/algorithms/delaunay2voronoi.js +0 -104
  184. package/src/_cjs/utils/algorithms/delaunay2voronoi.js.map +0 -1
  185. package/src/_cjs/utils/algorithms/detectPaths.d.ts +0 -21
  186. package/src/_cjs/utils/algorithms/detectPaths.js +0 -169
  187. package/src/_cjs/utils/algorithms/detectPaths.js.map +0 -1
  188. package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
  189. package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.js +0 -51
  190. package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
  191. package/src/_cjs/utils/algorithms/getContrastColor.d.ts +0 -13
  192. package/src/_cjs/utils/algorithms/getContrastColor.js +0 -26
  193. package/src/_cjs/utils/algorithms/getContrastColor.js.map +0 -1
  194. package/src/_cjs/utils/algorithms/matrixFill.d.ts +0 -10
  195. package/src/_cjs/utils/algorithms/matrixFill.js +0 -21
  196. package/src/_cjs/utils/algorithms/matrixFill.js.map +0 -1
  197. package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
  198. package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.js +0 -270
  199. package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
  200. package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
  201. package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.js +0 -102
  202. package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
  203. package/src/_cjs/utils/algorithms/sutherlandHodgman.d.ts +0 -16
  204. package/src/_cjs/utils/algorithms/sutherlandHodgman.js +0 -76
  205. package/src/_cjs/utils/algorithms/sutherlandHodgman.js.map +0 -1
  206. package/src/_cjs/utils/cloneVertexArray.d.ts +0 -13
  207. package/src/_cjs/utils/cloneVertexArray.js +0 -23
  208. package/src/_cjs/utils/cloneVertexArray.js.map +0 -1
  209. package/src/_cjs/utils/createRandomizedPolygon.d.ts +0 -14
  210. package/src/_cjs/utils/createRandomizedPolygon.js +0 -32
  211. package/src/_cjs/utils/createRandomizedPolygon.js.map +0 -1
  212. package/src/_cjs/utils/creategui.js +0 -434
  213. package/src/_cjs/utils/dat.gui.arrowbounce.polyfill.js +0 -128
  214. package/src/_cjs/utils/dat.gui.title.polyfill.js +0 -35
  215. package/src/_cjs/utils/datastructures/CircularIntervalSet.d.ts +0 -83
  216. package/src/_cjs/utils/datastructures/CircularIntervalSet.js +0 -163
  217. package/src/_cjs/utils/datastructures/CircularIntervalSet.js.map +0 -1
  218. package/src/_cjs/utils/datastructures/Color.d.ts +0 -391
  219. package/src/_cjs/utils/datastructures/Color.js +0 -1084
  220. package/src/_cjs/utils/datastructures/Color.js.map +0 -1
  221. package/src/_cjs/utils/datastructures/ColorGradient.d.ts +0 -81
  222. package/src/_cjs/utils/datastructures/ColorGradient.js +0 -176
  223. package/src/_cjs/utils/datastructures/ColorGradient.js.map +0 -1
  224. package/src/_cjs/utils/datastructures/DataGrid2d.d.ts +0 -53
  225. package/src/_cjs/utils/datastructures/DataGrid2d.js +0 -20
  226. package/src/_cjs/utils/datastructures/DataGrid2d.js.map +0 -1
  227. package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
  228. package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.js +0 -155
  229. package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
  230. package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
  231. package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.js +0 -84
  232. package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
  233. package/src/_cjs/utils/datastructures/GenericPath.d.ts +0 -86
  234. package/src/_cjs/utils/datastructures/GenericPath.js +0 -122
  235. package/src/_cjs/utils/datastructures/GenericPath.js.map +0 -1
  236. package/src/_cjs/utils/datastructures/GeometryMesh.d.ts +0 -49
  237. package/src/_cjs/utils/datastructures/GeometryMesh.js +0 -58
  238. package/src/_cjs/utils/datastructures/GeometryMesh.js.map +0 -1
  239. package/src/_cjs/utils/datastructures/Girih.d.ts +0 -181
  240. package/src/_cjs/utils/datastructures/Girih.js +0 -266
  241. package/src/_cjs/utils/datastructures/Girih.js.map +0 -1
  242. package/src/_cjs/utils/datastructures/GirihBowtie.d.ts +0 -37
  243. package/src/_cjs/utils/datastructures/GirihBowtie.js +0 -152
  244. package/src/_cjs/utils/datastructures/GirihBowtie.js.map +0 -1
  245. package/src/_cjs/utils/datastructures/GirihDecagon.d.ts +0 -52
  246. package/src/_cjs/utils/datastructures/GirihDecagon.js +0 -132
  247. package/src/_cjs/utils/datastructures/GirihDecagon.js.map +0 -1
  248. package/src/_cjs/utils/datastructures/GirihHexagon.d.ts +0 -39
  249. package/src/_cjs/utils/datastructures/GirihHexagon.js +0 -200
  250. package/src/_cjs/utils/datastructures/GirihHexagon.js.map +0 -1
  251. package/src/_cjs/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
  252. package/src/_cjs/utils/datastructures/GirihPenroseRhombus.js +0 -189
  253. package/src/_cjs/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
  254. package/src/_cjs/utils/datastructures/GirihPentagon.d.ts +0 -37
  255. package/src/_cjs/utils/datastructures/GirihPentagon.js +0 -109
  256. package/src/_cjs/utils/datastructures/GirihPentagon.js.map +0 -1
  257. package/src/_cjs/utils/datastructures/GirihRhombus.d.ts +0 -38
  258. package/src/_cjs/utils/datastructures/GirihRhombus.js +0 -155
  259. package/src/_cjs/utils/datastructures/GirihRhombus.js.map +0 -1
  260. package/src/_cjs/utils/datastructures/GirihTile.d.ts +0 -283
  261. package/src/_cjs/utils/datastructures/GirihTile.js +0 -308
  262. package/src/_cjs/utils/datastructures/GirihTile.js.map +0 -1
  263. package/src/_cjs/utils/datastructures/Matrix4x4.d.ts +0 -244
  264. package/src/_cjs/utils/datastructures/Matrix4x4.js +0 -262
  265. package/src/_cjs/utils/datastructures/Matrix4x4.js.map +0 -1
  266. package/src/_cjs/utils/datastructures/VoronoiCell.d.ts +0 -122
  267. package/src/_cjs/utils/datastructures/VoronoiCell.js +0 -183
  268. package/src/_cjs/utils/datastructures/VoronoiCell.js.map +0 -1
  269. package/src/_cjs/utils/datastructures/interfaces.d.ts +0 -13
  270. package/src/_cjs/utils/datastructures/interfaces.js +0 -10
  271. package/src/_cjs/utils/datastructures/interfaces.js.map +0 -1
  272. package/src/_cjs/utils/detectDarkMode.d.ts +0 -10
  273. package/src/_cjs/utils/detectDarkMode.js +0 -41
  274. package/src/_cjs/utils/detectDarkMode.js.map +0 -1
  275. package/src/_cjs/utils/dom/components/ColorGradientPicker.d.ts +0 -246
  276. package/src/_cjs/utils/dom/components/ColorGradientPicker.js +0 -667
  277. package/src/_cjs/utils/dom/components/ColorGradientPicker.js.map +0 -1
  278. package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.d.ts +0 -129
  279. package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.js +0 -520
  280. package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.js.map +0 -1
  281. package/src/_cjs/utils/dom/components/ColorGradientSelector.d.ts +0 -118
  282. package/src/_cjs/utils/dom/components/ColorGradientSelector.js +0 -327
  283. package/src/_cjs/utils/dom/components/ColorGradientSelector.js.map +0 -1
  284. package/src/_cjs/utils/dom/components/Test.d.ts +0 -7
  285. package/src/_cjs/utils/dom/components/Test.js +0 -30
  286. package/src/_cjs/utils/dom/components/Test.js.map +0 -1
  287. package/src/_cjs/utils/dom/getAvailableContainerSpace.d.ts +0 -2
  288. package/src/_cjs/utils/dom/getAvailableContainerSpace.js +0 -29
  289. package/src/_cjs/utils/dom/getAvailableContainerSpace.js.map +0 -1
  290. package/src/_cjs/utils/dom/getFProp.d.ts +0 -5
  291. package/src/_cjs/utils/dom/getFProp.js +0 -12
  292. package/src/_cjs/utils/dom/getFProp.js.map +0 -1
  293. package/src/_cjs/utils/dom/guiSizeToggler.d.ts +0 -18
  294. package/src/_cjs/utils/dom/guiSizeToggler.js +0 -44
  295. package/src/_cjs/utils/dom/guiSizeToggler.js.map +0 -1
  296. package/src/_cjs/utils/findInVertexArray.d.ts +0 -19
  297. package/src/_cjs/utils/findInVertexArray.js +0 -29
  298. package/src/_cjs/utils/findInVertexArray.js.map +0 -1
  299. package/src/_cjs/utils/getFProp.d.ts +0 -5
  300. package/src/_cjs/utils/getFProp.js +0 -12
  301. package/src/_cjs/utils/getFProp.js.map +0 -1
  302. package/src/_cjs/utils/gup.d.ts +0 -14
  303. package/src/_cjs/utils/gup.js +0 -31
  304. package/src/_cjs/utils/gup.js.map +0 -1
  305. package/src/_cjs/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
  306. package/src/_cjs/utils/helpers/BezierPathInteractionHelper.js +0 -655
  307. package/src/_cjs/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
  308. package/src/_cjs/utils/helpers/CircleHelper.d.ts +0 -73
  309. package/src/_cjs/utils/helpers/CircleHelper.js +0 -93
  310. package/src/_cjs/utils/helpers/CircleHelper.js.map +0 -1
  311. package/src/_cjs/utils/helpers/CircleSectorHelper.d.ts +0 -90
  312. package/src/_cjs/utils/helpers/CircleSectorHelper.js +0 -114
  313. package/src/_cjs/utils/helpers/CircleSectorHelper.js.map +0 -1
  314. package/src/_cjs/utils/helpers/TriangleHelper.d.ts +0 -57
  315. package/src/_cjs/utils/helpers/TriangleHelper.js +0 -83
  316. package/src/_cjs/utils/helpers/TriangleHelper.js.map +0 -1
  317. package/src/_cjs/utils/helpers/VEllipseHelper.d.ts +0 -32
  318. package/src/_cjs/utils/helpers/VEllipseHelper.js +0 -88
  319. package/src/_cjs/utils/helpers/VEllipseHelper.js.map +0 -1
  320. package/src/_cjs/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
  321. package/src/_cjs/utils/helpers/VEllipseSectorHelper.js +0 -135
  322. package/src/_cjs/utils/helpers/VEllipseSectorHelper.js.map +0 -1
  323. package/src/_cjs/utils/io/DndFileHandler.d.ts +0 -63
  324. package/src/_cjs/utils/io/DndFileHandler.js +0 -112
  325. package/src/_cjs/utils/io/DndFileHandler.js.map +0 -1
  326. package/src/_cjs/utils/io/FileDrop.d.ts +0 -110
  327. package/src/_cjs/utils/io/FileDrop.js +0 -177
  328. package/src/_cjs/utils/io/FileDrop.js.map +0 -1
  329. package/src/_cjs/utils/lil.gui.arrowbounce.polyfill.js +0 -133
  330. package/src/_cjs/utils/lil.gui.title.polyfill.js +0 -32
  331. package/src/_cjs/utils/module.js +0 -18
  332. package/src/_cjs/utils/parsers/LinearColorGradientParser.d.ts +0 -78
  333. package/src/_cjs/utils/parsers/LinearColorGradientParser.js +0 -224
  334. package/src/_cjs/utils/parsers/LinearColorGradientParser.js.map +0 -1
  335. package/src/_cjs/utils/parsers/OBJParser.d.ts +0 -24
  336. package/src/_cjs/utils/parsers/OBJParser.js +0 -77
  337. package/src/_cjs/utils/parsers/OBJParser.js.map +0 -1
  338. package/src/_cjs/utils/parsers/STLParser.d.ts +0 -61
  339. package/src/_cjs/utils/parsers/STLParser.js +0 -182
  340. package/src/_cjs/utils/parsers/STLParser.js.map +0 -1
  341. package/src/_cjs/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
  342. package/src/_cjs/utils/parsers/svg/parseSVGPathData.js +0 -486
  343. package/src/_cjs/utils/parsers/svg/parseSVGPathData.js.map +0 -1
  344. package/src/_cjs/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
  345. package/src/_cjs/utils/parsers/svg/splitSVGPathData.js +0 -53
  346. package/src/_cjs/utils/parsers/svg/splitSVGPathData.js.map +0 -1
  347. package/src/_cjs/utils/parsers/svg/types.d.ts +0 -63
  348. package/src/_cjs/utils/parsers/svg/types.js +0 -17
  349. package/src/_cjs/utils/parsers/svg/types.js.map +0 -1
  350. package/src/_cjs/utils/ts-runner.js +0 -146
  351. package/src/_cjs/utils/tsAsyncScriptLoader.js +0 -74
  352. package/src/_esm/BezierPath.d.ts +0 -610
  353. package/src/_esm/BezierPath.js +0 -1124
  354. package/src/_esm/BezierPath.js.map +0 -1
  355. package/src/_esm/Bounds.d.ts +0 -252
  356. package/src/_esm/Bounds.js +0 -317
  357. package/src/_esm/Bounds.js.map +0 -1
  358. package/src/_esm/Circle.d.ts +0 -214
  359. package/src/_esm/Circle.js +0 -335
  360. package/src/_esm/Circle.js.map +0 -1
  361. package/src/_esm/CircleSector.d.ts +0 -211
  362. package/src/_esm/CircleSector.js +0 -359
  363. package/src/_esm/CircleSector.js.map +0 -1
  364. package/src/_esm/CubicBezierCurve.d.ts +0 -656
  365. package/src/_esm/CubicBezierCurve.js +0 -1057
  366. package/src/_esm/CubicBezierCurve.js.map +0 -1
  367. package/src/_esm/Grid.d.ts +0 -83
  368. package/src/_esm/Grid.js +0 -89
  369. package/src/_esm/Grid.js.map +0 -1
  370. package/src/_esm/KeyHandler.d.ts +0 -177
  371. package/src/_esm/KeyHandler.js +0 -434
  372. package/src/_esm/KeyHandler.js.map +0 -1
  373. package/src/_esm/Line.d.ts +0 -134
  374. package/src/_esm/Line.js +0 -200
  375. package/src/_esm/Line.js.map +0 -1
  376. package/src/_esm/MouseHandler.d.ts +0 -283
  377. package/src/_esm/MouseHandler.js +0 -397
  378. package/src/_esm/MouseHandler.js.map +0 -1
  379. package/src/_esm/PBImage.d.ts +0 -81
  380. package/src/_esm/PBImage.js +0 -60
  381. package/src/_esm/PBImage.js.map +0 -1
  382. package/src/_esm/PBText.d.ts +0 -118
  383. package/src/_esm/PBText.js +0 -62
  384. package/src/_esm/PBText.js.map +0 -1
  385. package/src/_esm/PlotBoilerplate.d.ts +0 -899
  386. package/src/_esm/PlotBoilerplate.js +0 -2347
  387. package/src/_esm/PlotBoilerplate.js.map +0 -1
  388. package/src/_esm/Polygon.d.ts +0 -520
  389. package/src/_esm/Polygon.js +0 -924
  390. package/src/_esm/Polygon.js.map +0 -1
  391. package/src/_esm/SVGBuilder.d.ts +0 -47
  392. package/src/_esm/SVGBuilder.js +0 -95
  393. package/src/_esm/SVGBuilder.js.map +0 -1
  394. package/src/_esm/Triangle.d.ts +0 -392
  395. package/src/_esm/Triangle.js +0 -493
  396. package/src/_esm/Triangle.js.map +0 -1
  397. package/src/_esm/UIDGenerator.d.ts +0 -12
  398. package/src/_esm/UIDGenerator.js +0 -18
  399. package/src/_esm/UIDGenerator.js.map +0 -1
  400. package/src/_esm/VEllipse.d.ts +0 -319
  401. package/src/_esm/VEllipse.js +0 -574
  402. package/src/_esm/VEllipse.js.map +0 -1
  403. package/src/_esm/VEllipseSector.d.ts +0 -230
  404. package/src/_esm/VEllipseSector.js +0 -422
  405. package/src/_esm/VEllipseSector.js.map +0 -1
  406. package/src/_esm/Vector.d.ts +0 -126
  407. package/src/_esm/Vector.js +0 -181
  408. package/src/_esm/Vector.js.map +0 -1
  409. package/src/_esm/VertTuple.d.ts +0 -284
  410. package/src/_esm/VertTuple.js +0 -347
  411. package/src/_esm/VertTuple.js.map +0 -1
  412. package/src/_esm/Vertex.d.ts +0 -498
  413. package/src/_esm/Vertex.js +0 -702
  414. package/src/_esm/Vertex.js.map +0 -1
  415. package/src/_esm/VertexAttr.d.ts +0 -72
  416. package/src/_esm/VertexAttr.js +0 -58
  417. package/src/_esm/VertexAttr.js.map +0 -1
  418. package/src/_esm/VertexListeners.d.ts +0 -209
  419. package/src/_esm/VertexListeners.js +0 -270
  420. package/src/_esm/VertexListeners.js.map +0 -1
  421. package/src/_esm/draw.d.ts +0 -657
  422. package/src/_esm/draw.js +0 -1159
  423. package/src/_esm/draw.js.map +0 -1
  424. package/src/_esm/drawgl.d.ts +0 -544
  425. package/src/_esm/drawgl.js +0 -812
  426. package/src/_esm/drawgl.js.map +0 -1
  427. package/src/_esm/drawutilssvg.d.ts +0 -954
  428. package/src/_esm/drawutilssvg.js +0 -1705
  429. package/src/_esm/drawutilssvg.js.map +0 -1
  430. package/src/_esm/entry-glsupport.js +0 -28
  431. package/src/_esm/entry.js +0 -29
  432. package/src/_esm/geomutils.d.ts +0 -77
  433. package/src/_esm/geomutils.js +0 -126
  434. package/src/_esm/geomutils.js.map +0 -1
  435. package/src/_esm/index.d.ts +0 -102
  436. package/src/_esm/index.js +0 -128
  437. package/src/_esm/index.js.map +0 -1
  438. package/src/_esm/interfaces/DrawLib.d.ts +0 -582
  439. package/src/_esm/interfaces/DrawLib.js +0 -32
  440. package/src/_esm/interfaces/DrawLib.js.map +0 -1
  441. package/src/_esm/interfaces/additionals.d.ts +0 -95
  442. package/src/_esm/interfaces/additionals.js +0 -3
  443. package/src/_esm/interfaces/additionals.js.map +0 -1
  444. package/src/_esm/interfaces/core.d.ts +0 -286
  445. package/src/_esm/interfaces/core.js +0 -30
  446. package/src/_esm/interfaces/core.js.map +0 -1
  447. package/src/_esm/interfaces/externals.d.ts +0 -56
  448. package/src/_esm/interfaces/externals.js +0 -8
  449. package/src/_esm/interfaces/externals.js.map +0 -1
  450. package/src/_esm/interfaces/index.d.ts +0 -4
  451. package/src/_esm/interfaces/index.js +0 -21
  452. package/src/_esm/interfaces/index.js.map +0 -1
  453. package/src/_esm/module.d.ts +0 -26
  454. package/src/_esm/module.js +0 -60
  455. package/src/_esm/module.js.map +0 -1
  456. package/src/_esm/src/ts/BezierPath.d.ts +0 -610
  457. package/src/_esm/src/ts/BezierPath.js +0 -1120
  458. package/src/_esm/src/ts/BezierPath.js.map +0 -1
  459. package/src/_esm/src/ts/Bounds.d.ts +0 -252
  460. package/src/_esm/src/ts/Bounds.js +0 -313
  461. package/src/_esm/src/ts/Bounds.js.map +0 -1
  462. package/src/_esm/src/ts/Circle.d.ts +0 -214
  463. package/src/_esm/src/ts/Circle.js +0 -331
  464. package/src/_esm/src/ts/Circle.js.map +0 -1
  465. package/src/_esm/src/ts/CircleSector.d.ts +0 -211
  466. package/src/_esm/src/ts/CircleSector.js +0 -355
  467. package/src/_esm/src/ts/CircleSector.js.map +0 -1
  468. package/src/_esm/src/ts/CubicBezierCurve.d.ts +0 -656
  469. package/src/_esm/src/ts/CubicBezierCurve.js +0 -1053
  470. package/src/_esm/src/ts/CubicBezierCurve.js.map +0 -1
  471. package/src/_esm/src/ts/Grid.d.ts +0 -83
  472. package/src/_esm/src/ts/Grid.js +0 -85
  473. package/src/_esm/src/ts/Grid.js.map +0 -1
  474. package/src/_esm/src/ts/KeyHandler.d.ts +0 -177
  475. package/src/_esm/src/ts/KeyHandler.js +0 -430
  476. package/src/_esm/src/ts/KeyHandler.js.map +0 -1
  477. package/src/_esm/src/ts/Line.d.ts +0 -134
  478. package/src/_esm/src/ts/Line.js +0 -196
  479. package/src/_esm/src/ts/Line.js.map +0 -1
  480. package/src/_esm/src/ts/MouseHandler.d.ts +0 -283
  481. package/src/_esm/src/ts/MouseHandler.js +0 -391
  482. package/src/_esm/src/ts/MouseHandler.js.map +0 -1
  483. package/src/_esm/src/ts/PBImage.d.ts +0 -81
  484. package/src/_esm/src/ts/PBImage.js +0 -56
  485. package/src/_esm/src/ts/PBImage.js.map +0 -1
  486. package/src/_esm/src/ts/PBText.d.ts +0 -118
  487. package/src/_esm/src/ts/PBText.js +0 -58
  488. package/src/_esm/src/ts/PBText.js.map +0 -1
  489. package/src/_esm/src/ts/PlotBoilerplate.d.ts +0 -899
  490. package/src/_esm/src/ts/PlotBoilerplate.js +0 -2340
  491. package/src/_esm/src/ts/PlotBoilerplate.js.map +0 -1
  492. package/src/_esm/src/ts/Polygon.d.ts +0 -520
  493. package/src/_esm/src/ts/Polygon.js +0 -920
  494. package/src/_esm/src/ts/Polygon.js.map +0 -1
  495. package/src/_esm/src/ts/Triangle.d.ts +0 -392
  496. package/src/_esm/src/ts/Triangle.js +0 -489
  497. package/src/_esm/src/ts/Triangle.js.map +0 -1
  498. package/src/_esm/src/ts/UIDGenerator.d.ts +0 -12
  499. package/src/_esm/src/ts/UIDGenerator.js +0 -14
  500. package/src/_esm/src/ts/UIDGenerator.js.map +0 -1
  501. package/src/_esm/src/ts/VEllipse.d.ts +0 -319
  502. package/src/_esm/src/ts/VEllipse.js +0 -570
  503. package/src/_esm/src/ts/VEllipse.js.map +0 -1
  504. package/src/_esm/src/ts/VEllipseSector.d.ts +0 -230
  505. package/src/_esm/src/ts/VEllipseSector.js +0 -418
  506. package/src/_esm/src/ts/VEllipseSector.js.map +0 -1
  507. package/src/_esm/src/ts/Vector.d.ts +0 -126
  508. package/src/_esm/src/ts/Vector.js +0 -177
  509. package/src/_esm/src/ts/Vector.js.map +0 -1
  510. package/src/_esm/src/ts/VertTuple.d.ts +0 -284
  511. package/src/_esm/src/ts/VertTuple.js +0 -343
  512. package/src/_esm/src/ts/VertTuple.js.map +0 -1
  513. package/src/_esm/src/ts/Vertex.d.ts +0 -498
  514. package/src/_esm/src/ts/Vertex.js +0 -698
  515. package/src/_esm/src/ts/Vertex.js.map +0 -1
  516. package/src/_esm/src/ts/VertexAttr.d.ts +0 -72
  517. package/src/_esm/src/ts/VertexAttr.js +0 -54
  518. package/src/_esm/src/ts/VertexAttr.js.map +0 -1
  519. package/src/_esm/src/ts/VertexListeners.d.ts +0 -209
  520. package/src/_esm/src/ts/VertexListeners.js +0 -266
  521. package/src/_esm/src/ts/VertexListeners.js.map +0 -1
  522. package/src/_esm/src/ts/draw.d.ts +0 -657
  523. package/src/_esm/src/ts/draw.js +0 -1155
  524. package/src/_esm/src/ts/draw.js.map +0 -1
  525. package/src/_esm/src/ts/drawgl.d.ts +0 -544
  526. package/src/_esm/src/ts/drawgl.js +0 -808
  527. package/src/_esm/src/ts/drawgl.js.map +0 -1
  528. package/src/_esm/src/ts/drawutilssvg.d.ts +0 -954
  529. package/src/_esm/src/ts/drawutilssvg.js +0 -1701
  530. package/src/_esm/src/ts/drawutilssvg.js.map +0 -1
  531. package/src/_esm/src/ts/geomutils.d.ts +0 -77
  532. package/src/_esm/src/ts/geomutils.js +0 -123
  533. package/src/_esm/src/ts/geomutils.js.map +0 -1
  534. package/src/_esm/src/ts/index.d.ts +0 -102
  535. package/src/_esm/src/ts/index.js +0 -112
  536. package/src/_esm/src/ts/index.js.map +0 -1
  537. package/src/_esm/src/ts/interfaces/DrawLib.d.ts +0 -582
  538. package/src/_esm/src/ts/interfaces/DrawLib.js +0 -31
  539. package/src/_esm/src/ts/interfaces/DrawLib.js.map +0 -1
  540. package/src/_esm/src/ts/interfaces/additionals.d.ts +0 -95
  541. package/src/_esm/src/ts/interfaces/additionals.js +0 -2
  542. package/src/_esm/src/ts/interfaces/additionals.js.map +0 -1
  543. package/src/_esm/src/ts/interfaces/core.d.ts +0 -286
  544. package/src/_esm/src/ts/interfaces/core.js +0 -29
  545. package/src/_esm/src/ts/interfaces/core.js.map +0 -1
  546. package/src/_esm/src/ts/interfaces/externals.d.ts +0 -56
  547. package/src/_esm/src/ts/interfaces/externals.js +0 -7
  548. package/src/_esm/src/ts/interfaces/externals.js.map +0 -1
  549. package/src/_esm/src/ts/interfaces/index.d.ts +0 -4
  550. package/src/_esm/src/ts/interfaces/index.js +0 -5
  551. package/src/_esm/src/ts/interfaces/index.js.map +0 -1
  552. package/src/_esm/src/ts/module.d.ts +0 -26
  553. package/src/_esm/src/ts/module.js +0 -38
  554. package/src/_esm/src/ts/module.js.map +0 -1
  555. package/src/_esm/src/ts/utils/InitializationObserver.d.ts +0 -18
  556. package/src/_esm/src/ts/utils/InitializationObserver.js +0 -57
  557. package/src/_esm/src/ts/utils/InitializationObserver.js.map +0 -1
  558. package/src/_esm/src/ts/utils/LissajousFigure.d.ts +0 -34
  559. package/src/_esm/src/ts/utils/LissajousFigure.js +0 -95
  560. package/src/_esm/src/ts/utils/LissajousFigure.js.map +0 -1
  561. package/src/_esm/src/ts/utils/NGons.d.ts +0 -13
  562. package/src/_esm/src/ts/utils/NGons.js +0 -33
  563. package/src/_esm/src/ts/utils/NGons.js.map +0 -1
  564. package/src/_esm/src/ts/utils/Params.d.ts +0 -17
  565. package/src/_esm/src/ts/utils/Params.js +0 -48
  566. package/src/_esm/src/ts/utils/Params.js.map +0 -1
  567. package/src/_esm/src/ts/utils/PerlinNoise.d.ts +0 -19
  568. package/src/_esm/src/ts/utils/PerlinNoise.js +0 -346
  569. package/src/_esm/src/ts/utils/PerlinNoise.js.map +0 -1
  570. package/src/_esm/src/ts/utils/SVGPathUtils.d.ts +0 -22
  571. package/src/_esm/src/ts/utils/SVGPathUtils.js +0 -42
  572. package/src/_esm/src/ts/utils/SVGPathUtils.js.map +0 -1
  573. package/src/_esm/src/ts/utils/WebColors.d.ts +0 -35
  574. package/src/_esm/src/ts/utils/WebColors.js +0 -54
  575. package/src/_esm/src/ts/utils/WebColors.js.map +0 -1
  576. package/src/_esm/src/ts/utils/WebColorsContrast.d.ts +0 -6
  577. package/src/_esm/src/ts/utils/WebColorsContrast.js +0 -9
  578. package/src/_esm/src/ts/utils/WebColorsContrast.js.map +0 -1
  579. package/src/_esm/src/ts/utils/WebColorsMalachite.d.ts +0 -12
  580. package/src/_esm/src/ts/utils/WebColorsMalachite.js +0 -25
  581. package/src/_esm/src/ts/utils/WebColorsMalachite.js.map +0 -1
  582. package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.d.ts +0 -60
  583. package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.js +0 -103
  584. package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.js.map +0 -1
  585. package/src/_esm/src/ts/utils/algorithms/CircleIntersections.d.ts +0 -170
  586. package/src/_esm/src/ts/utils/algorithms/CircleIntersections.js +0 -303
  587. package/src/_esm/src/ts/utils/algorithms/CircleIntersections.js.map +0 -1
  588. package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.d.ts +0 -150
  589. package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.js +0 -362
  590. package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.js.map +0 -1
  591. package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.d.ts +0 -63
  592. package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.js +0 -170
  593. package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.js.map +0 -1
  594. package/src/_esm/src/ts/utils/algorithms/HobbyPath.d.ts +0 -81
  595. package/src/_esm/src/ts/utils/algorithms/HobbyPath.js +0 -273
  596. package/src/_esm/src/ts/utils/algorithms/HobbyPath.js.map +0 -1
  597. package/src/_esm/src/ts/utils/algorithms/Metaballs.d.ts +0 -30
  598. package/src/_esm/src/ts/utils/algorithms/Metaballs.js +0 -109
  599. package/src/_esm/src/ts/utils/algorithms/Metaballs.js.map +0 -1
  600. package/src/_esm/src/ts/utils/algorithms/PolygonInset.d.ts +0 -184
  601. package/src/_esm/src/ts/utils/algorithms/PolygonInset.js +0 -424
  602. package/src/_esm/src/ts/utils/algorithms/PolygonInset.js.map +0 -1
  603. package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
  604. package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.js +0 -262
  605. package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
  606. package/src/_esm/src/ts/utils/algorithms/arrayFill.d.ts +0 -8
  607. package/src/_esm/src/ts/utils/algorithms/arrayFill.js +0 -14
  608. package/src/_esm/src/ts/utils/algorithms/arrayFill.js.map +0 -1
  609. package/src/_esm/src/ts/utils/algorithms/arrayResize.d.ts +0 -8
  610. package/src/_esm/src/ts/utils/algorithms/arrayResize.js +0 -20
  611. package/src/_esm/src/ts/utils/algorithms/arrayResize.js.map +0 -1
  612. package/src/_esm/src/ts/utils/algorithms/arrayShuffle.d.ts +0 -8
  613. package/src/_esm/src/ts/utils/algorithms/arrayShuffle.js +0 -11
  614. package/src/_esm/src/ts/utils/algorithms/arrayShuffle.js.map +0 -1
  615. package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
  616. package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.js +0 -47
  617. package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.js.map +0 -1
  618. package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
  619. package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.js +0 -57
  620. package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
  621. package/src/_esm/src/ts/utils/algorithms/convexHull.d.ts +0 -23
  622. package/src/_esm/src/ts/utils/algorithms/convexHull.js +0 -67
  623. package/src/_esm/src/ts/utils/algorithms/convexHull.js.map +0 -1
  624. package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
  625. package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.js +0 -141
  626. package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.js.map +0 -1
  627. package/src/_esm/src/ts/utils/algorithms/delaunay.d.ts +0 -30
  628. package/src/_esm/src/ts/utils/algorithms/delaunay.js +0 -153
  629. package/src/_esm/src/ts/utils/algorithms/delaunay.js.map +0 -1
  630. package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.d.ts +0 -25
  631. package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.js +0 -99
  632. package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.js.map +0 -1
  633. package/src/_esm/src/ts/utils/algorithms/detectPaths.d.ts +0 -21
  634. package/src/_esm/src/ts/utils/algorithms/detectPaths.js +0 -165
  635. package/src/_esm/src/ts/utils/algorithms/detectPaths.js.map +0 -1
  636. package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
  637. package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.js +0 -47
  638. package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
  639. package/src/_esm/src/ts/utils/algorithms/getContrastColor.d.ts +0 -13
  640. package/src/_esm/src/ts/utils/algorithms/getContrastColor.js +0 -22
  641. package/src/_esm/src/ts/utils/algorithms/getContrastColor.js.map +0 -1
  642. package/src/_esm/src/ts/utils/algorithms/matrixFill.d.ts +0 -10
  643. package/src/_esm/src/ts/utils/algorithms/matrixFill.js +0 -17
  644. package/src/_esm/src/ts/utils/algorithms/matrixFill.js.map +0 -1
  645. package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
  646. package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.js +0 -266
  647. package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
  648. package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
  649. package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.js +0 -99
  650. package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
  651. package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.d.ts +0 -16
  652. package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.js +0 -72
  653. package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.js.map +0 -1
  654. package/src/_esm/src/ts/utils/cloneVertexArray.d.ts +0 -13
  655. package/src/_esm/src/ts/utils/cloneVertexArray.js +0 -19
  656. package/src/_esm/src/ts/utils/cloneVertexArray.js.map +0 -1
  657. package/src/_esm/src/ts/utils/createRandomizedPolygon.d.ts +0 -14
  658. package/src/_esm/src/ts/utils/createRandomizedPolygon.js +0 -28
  659. package/src/_esm/src/ts/utils/createRandomizedPolygon.js.map +0 -1
  660. package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.d.ts +0 -83
  661. package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.js +0 -158
  662. package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.js.map +0 -1
  663. package/src/_esm/src/ts/utils/datastructures/Color.d.ts +0 -391
  664. package/src/_esm/src/ts/utils/datastructures/Color.js +0 -1063
  665. package/src/_esm/src/ts/utils/datastructures/Color.js.map +0 -1
  666. package/src/_esm/src/ts/utils/datastructures/ColorGradient.d.ts +0 -81
  667. package/src/_esm/src/ts/utils/datastructures/ColorGradient.js +0 -171
  668. package/src/_esm/src/ts/utils/datastructures/ColorGradient.js.map +0 -1
  669. package/src/_esm/src/ts/utils/datastructures/DataGrid2d.d.ts +0 -53
  670. package/src/_esm/src/ts/utils/datastructures/DataGrid2d.js +0 -19
  671. package/src/_esm/src/ts/utils/datastructures/DataGrid2d.js.map +0 -1
  672. package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
  673. package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.js +0 -150
  674. package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
  675. package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
  676. package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.js +0 -79
  677. package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
  678. package/src/_esm/src/ts/utils/datastructures/GenericPath.d.ts +0 -86
  679. package/src/_esm/src/ts/utils/datastructures/GenericPath.js +0 -117
  680. package/src/_esm/src/ts/utils/datastructures/GenericPath.js.map +0 -1
  681. package/src/_esm/src/ts/utils/datastructures/GeometryMesh.d.ts +0 -49
  682. package/src/_esm/src/ts/utils/datastructures/GeometryMesh.js +0 -53
  683. package/src/_esm/src/ts/utils/datastructures/GeometryMesh.js.map +0 -1
  684. package/src/_esm/src/ts/utils/datastructures/Girih.d.ts +0 -181
  685. package/src/_esm/src/ts/utils/datastructures/Girih.js +0 -261
  686. package/src/_esm/src/ts/utils/datastructures/Girih.js.map +0 -1
  687. package/src/_esm/src/ts/utils/datastructures/GirihBowtie.d.ts +0 -37
  688. package/src/_esm/src/ts/utils/datastructures/GirihBowtie.js +0 -130
  689. package/src/_esm/src/ts/utils/datastructures/GirihBowtie.js.map +0 -1
  690. package/src/_esm/src/ts/utils/datastructures/GirihDecagon.d.ts +0 -52
  691. package/src/_esm/src/ts/utils/datastructures/GirihDecagon.js +0 -110
  692. package/src/_esm/src/ts/utils/datastructures/GirihDecagon.js.map +0 -1
  693. package/src/_esm/src/ts/utils/datastructures/GirihHexagon.d.ts +0 -39
  694. package/src/_esm/src/ts/utils/datastructures/GirihHexagon.js +0 -178
  695. package/src/_esm/src/ts/utils/datastructures/GirihHexagon.js.map +0 -1
  696. package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
  697. package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.js +0 -167
  698. package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
  699. package/src/_esm/src/ts/utils/datastructures/GirihPentagon.d.ts +0 -37
  700. package/src/_esm/src/ts/utils/datastructures/GirihPentagon.js +0 -87
  701. package/src/_esm/src/ts/utils/datastructures/GirihPentagon.js.map +0 -1
  702. package/src/_esm/src/ts/utils/datastructures/GirihRhombus.d.ts +0 -38
  703. package/src/_esm/src/ts/utils/datastructures/GirihRhombus.js +0 -133
  704. package/src/_esm/src/ts/utils/datastructures/GirihRhombus.js.map +0 -1
  705. package/src/_esm/src/ts/utils/datastructures/GirihTile.d.ts +0 -283
  706. package/src/_esm/src/ts/utils/datastructures/GirihTile.js +0 -286
  707. package/src/_esm/src/ts/utils/datastructures/GirihTile.js.map +0 -1
  708. package/src/_esm/src/ts/utils/datastructures/Matrix4x4.d.ts +0 -244
  709. package/src/_esm/src/ts/utils/datastructures/Matrix4x4.js +0 -246
  710. package/src/_esm/src/ts/utils/datastructures/Matrix4x4.js.map +0 -1
  711. package/src/_esm/src/ts/utils/datastructures/VoronoiCell.d.ts +0 -122
  712. package/src/_esm/src/ts/utils/datastructures/VoronoiCell.js +0 -178
  713. package/src/_esm/src/ts/utils/datastructures/VoronoiCell.js.map +0 -1
  714. package/src/_esm/src/ts/utils/datastructures/interfaces.d.ts +0 -13
  715. package/src/_esm/src/ts/utils/datastructures/interfaces.js +0 -9
  716. package/src/_esm/src/ts/utils/datastructures/interfaces.js.map +0 -1
  717. package/src/_esm/src/ts/utils/detectDarkMode.d.ts +0 -10
  718. package/src/_esm/src/ts/utils/detectDarkMode.js +0 -37
  719. package/src/_esm/src/ts/utils/detectDarkMode.js.map +0 -1
  720. package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.d.ts +0 -246
  721. package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.js +0 -743
  722. package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.js.map +0 -1
  723. package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.d.ts +0 -118
  724. package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.js +0 -339
  725. package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.js.map +0 -1
  726. package/src/_esm/src/ts/utils/dom/components/Test.d.ts +0 -7
  727. package/src/_esm/src/ts/utils/dom/components/Test.js +0 -26
  728. package/src/_esm/src/ts/utils/dom/components/Test.js.map +0 -1
  729. package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.d.ts +0 -2
  730. package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.js +0 -25
  731. package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.js.map +0 -1
  732. package/src/_esm/src/ts/utils/dom/getFProp.d.ts +0 -5
  733. package/src/_esm/src/ts/utils/dom/getFProp.js +0 -8
  734. package/src/_esm/src/ts/utils/dom/getFProp.js.map +0 -1
  735. package/src/_esm/src/ts/utils/dom/guiSizeToggler.d.ts +0 -18
  736. package/src/_esm/src/ts/utils/dom/guiSizeToggler.js +0 -40
  737. package/src/_esm/src/ts/utils/dom/guiSizeToggler.js.map +0 -1
  738. package/src/_esm/src/ts/utils/findInVertexArray.d.ts +0 -19
  739. package/src/_esm/src/ts/utils/findInVertexArray.js +0 -25
  740. package/src/_esm/src/ts/utils/findInVertexArray.js.map +0 -1
  741. package/src/_esm/src/ts/utils/gup.d.ts +0 -14
  742. package/src/_esm/src/ts/utils/gup.js +0 -27
  743. package/src/_esm/src/ts/utils/gup.js.map +0 -1
  744. package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
  745. package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.js +0 -648
  746. package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
  747. package/src/_esm/src/ts/utils/helpers/CircleHelper.d.ts +0 -73
  748. package/src/_esm/src/ts/utils/helpers/CircleHelper.js +0 -88
  749. package/src/_esm/src/ts/utils/helpers/CircleHelper.js.map +0 -1
  750. package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.d.ts +0 -90
  751. package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.js +0 -109
  752. package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.js.map +0 -1
  753. package/src/_esm/src/ts/utils/helpers/TriangleHelper.d.ts +0 -57
  754. package/src/_esm/src/ts/utils/helpers/TriangleHelper.js +0 -78
  755. package/src/_esm/src/ts/utils/helpers/TriangleHelper.js.map +0 -1
  756. package/src/_esm/src/ts/utils/helpers/VEllipseHelper.d.ts +0 -32
  757. package/src/_esm/src/ts/utils/helpers/VEllipseHelper.js +0 -83
  758. package/src/_esm/src/ts/utils/helpers/VEllipseHelper.js.map +0 -1
  759. package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
  760. package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.js +0 -130
  761. package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.js.map +0 -1
  762. package/src/_esm/src/ts/utils/io/FileDrop.d.ts +0 -110
  763. package/src/_esm/src/ts/utils/io/FileDrop.js +0 -171
  764. package/src/_esm/src/ts/utils/io/FileDrop.js.map +0 -1
  765. package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.d.ts +0 -78
  766. package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.js +0 -217
  767. package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.js.map +0 -1
  768. package/src/_esm/src/ts/utils/parsers/OBJParser.d.ts +0 -24
  769. package/src/_esm/src/ts/utils/parsers/OBJParser.js +0 -72
  770. package/src/_esm/src/ts/utils/parsers/OBJParser.js.map +0 -1
  771. package/src/_esm/src/ts/utils/parsers/STLParser.d.ts +0 -61
  772. package/src/_esm/src/ts/utils/parsers/STLParser.js +0 -175
  773. package/src/_esm/src/ts/utils/parsers/STLParser.js.map +0 -1
  774. package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
  775. package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.js +0 -482
  776. package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.js.map +0 -1
  777. package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
  778. package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.js +0 -49
  779. package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.js.map +0 -1
  780. package/src/_esm/src/ts/utils/parsers/svg/types.d.ts +0 -63
  781. package/src/_esm/src/ts/utils/parsers/svg/types.js +0 -16
  782. package/src/_esm/src/ts/utils/parsers/svg/types.js.map +0 -1
  783. package/src/_esm/utils/InitializationObserver.d.ts +0 -18
  784. package/src/_esm/utils/InitializationObserver.js +0 -61
  785. package/src/_esm/utils/InitializationObserver.js.map +0 -1
  786. package/src/_esm/utils/LissajousFigure.d.ts +0 -34
  787. package/src/_esm/utils/LissajousFigure.js +0 -99
  788. package/src/_esm/utils/LissajousFigure.js.map +0 -1
  789. package/src/_esm/utils/NGons.d.ts +0 -13
  790. package/src/_esm/utils/NGons.js +0 -36
  791. package/src/_esm/utils/NGons.js.map +0 -1
  792. package/src/_esm/utils/Params.d.ts +0 -17
  793. package/src/_esm/utils/Params.js +0 -52
  794. package/src/_esm/utils/Params.js.map +0 -1
  795. package/src/_esm/utils/PerlinNoise.d.ts +0 -19
  796. package/src/_esm/utils/PerlinNoise.js +0 -350
  797. package/src/_esm/utils/PerlinNoise.js.map +0 -1
  798. package/src/_esm/utils/SVGPathUtils.d.ts +0 -22
  799. package/src/_esm/utils/SVGPathUtils.js +0 -45
  800. package/src/_esm/utils/SVGPathUtils.js.map +0 -1
  801. package/src/_esm/utils/WebColors.d.ts +0 -35
  802. package/src/_esm/utils/WebColors.js +0 -58
  803. package/src/_esm/utils/WebColors.js.map +0 -1
  804. package/src/_esm/utils/WebColorsContrast.d.ts +0 -6
  805. package/src/_esm/utils/WebColorsContrast.js +0 -12
  806. package/src/_esm/utils/WebColorsContrast.js.map +0 -1
  807. package/src/_esm/utils/WebColorsMalachite.d.ts +0 -12
  808. package/src/_esm/utils/WebColorsMalachite.js +0 -28
  809. package/src/_esm/utils/WebColorsMalachite.js.map +0 -1
  810. package/src/_esm/utils/algorithms/CatmullRomPath.d.ts +0 -60
  811. package/src/_esm/utils/algorithms/CatmullRomPath.js +0 -107
  812. package/src/_esm/utils/algorithms/CatmullRomPath.js.map +0 -1
  813. package/src/_esm/utils/algorithms/CircleIntersections.d.ts +0 -170
  814. package/src/_esm/utils/algorithms/CircleIntersections.js +0 -307
  815. package/src/_esm/utils/algorithms/CircleIntersections.js.map +0 -1
  816. package/src/_esm/utils/algorithms/ContourLineDetection.d.ts +0 -150
  817. package/src/_esm/utils/algorithms/ContourLineDetection.js +0 -366
  818. package/src/_esm/utils/algorithms/ContourLineDetection.js.map +0 -1
  819. package/src/_esm/utils/algorithms/CubicSplinePath.d.ts +0 -63
  820. package/src/_esm/utils/algorithms/CubicSplinePath.js +0 -174
  821. package/src/_esm/utils/algorithms/CubicSplinePath.js.map +0 -1
  822. package/src/_esm/utils/algorithms/HobbyPath.d.ts +0 -81
  823. package/src/_esm/utils/algorithms/HobbyPath.js +0 -277
  824. package/src/_esm/utils/algorithms/HobbyPath.js.map +0 -1
  825. package/src/_esm/utils/algorithms/Metaballs.d.ts +0 -30
  826. package/src/_esm/utils/algorithms/Metaballs.js +0 -113
  827. package/src/_esm/utils/algorithms/Metaballs.js.map +0 -1
  828. package/src/_esm/utils/algorithms/PolygonInset.d.ts +0 -184
  829. package/src/_esm/utils/algorithms/PolygonInset.js +0 -428
  830. package/src/_esm/utils/algorithms/PolygonInset.js.map +0 -1
  831. package/src/_esm/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
  832. package/src/_esm/utils/algorithms/PolygonTesselationOutlines.js +0 -267
  833. package/src/_esm/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
  834. package/src/_esm/utils/algorithms/arrayFill.d.ts +0 -8
  835. package/src/_esm/utils/algorithms/arrayFill.js +0 -18
  836. package/src/_esm/utils/algorithms/arrayFill.js.map +0 -1
  837. package/src/_esm/utils/algorithms/arrayResize.d.ts +0 -8
  838. package/src/_esm/utils/algorithms/arrayResize.js +0 -24
  839. package/src/_esm/utils/algorithms/arrayResize.js.map +0 -1
  840. package/src/_esm/utils/algorithms/arrayShuffle.d.ts +0 -8
  841. package/src/_esm/utils/algorithms/arrayShuffle.js +0 -15
  842. package/src/_esm/utils/algorithms/arrayShuffle.js.map +0 -1
  843. package/src/_esm/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
  844. package/src/_esm/utils/algorithms/clearDuplicateVertices.js +0 -51
  845. package/src/_esm/utils/algorithms/clearDuplicateVertices.js.map +0 -1
  846. package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
  847. package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.js +0 -61
  848. package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
  849. package/src/_esm/utils/algorithms/convexHull.d.ts +0 -23
  850. package/src/_esm/utils/algorithms/convexHull.js +0 -71
  851. package/src/_esm/utils/algorithms/convexHull.js.map +0 -1
  852. package/src/_esm/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
  853. package/src/_esm/utils/algorithms/convexPolygonIncircle.js +0 -145
  854. package/src/_esm/utils/algorithms/convexPolygonIncircle.js.map +0 -1
  855. package/src/_esm/utils/algorithms/createRandomizedPolygon.d.ts +0 -14
  856. package/src/_esm/utils/algorithms/createRandomizedPolygon.js +0 -28
  857. package/src/_esm/utils/algorithms/createRandomizedPolygon.js.map +0 -1
  858. package/src/_esm/utils/algorithms/delaunay.d.ts +0 -30
  859. package/src/_esm/utils/algorithms/delaunay.js +0 -157
  860. package/src/_esm/utils/algorithms/delaunay.js.map +0 -1
  861. package/src/_esm/utils/algorithms/delaunay2voronoi.d.ts +0 -25
  862. package/src/_esm/utils/algorithms/delaunay2voronoi.js +0 -103
  863. package/src/_esm/utils/algorithms/delaunay2voronoi.js.map +0 -1
  864. package/src/_esm/utils/algorithms/detectPaths.d.ts +0 -21
  865. package/src/_esm/utils/algorithms/detectPaths.js +0 -169
  866. package/src/_esm/utils/algorithms/detectPaths.js.map +0 -1
  867. package/src/_esm/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
  868. package/src/_esm/utils/algorithms/findPolygonSelfIntersections.js +0 -51
  869. package/src/_esm/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
  870. package/src/_esm/utils/algorithms/getContrastColor.d.ts +0 -13
  871. package/src/_esm/utils/algorithms/getContrastColor.js +0 -26
  872. package/src/_esm/utils/algorithms/getContrastColor.js.map +0 -1
  873. package/src/_esm/utils/algorithms/matrixFill.d.ts +0 -10
  874. package/src/_esm/utils/algorithms/matrixFill.js +0 -21
  875. package/src/_esm/utils/algorithms/matrixFill.js.map +0 -1
  876. package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
  877. package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.js +0 -270
  878. package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
  879. package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
  880. package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.js +0 -102
  881. package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
  882. package/src/_esm/utils/algorithms/sutherlandHodgman.d.ts +0 -16
  883. package/src/_esm/utils/algorithms/sutherlandHodgman.js +0 -76
  884. package/src/_esm/utils/algorithms/sutherlandHodgman.js.map +0 -1
  885. package/src/_esm/utils/cloneVertexArray.d.ts +0 -13
  886. package/src/_esm/utils/cloneVertexArray.js +0 -23
  887. package/src/_esm/utils/cloneVertexArray.js.map +0 -1
  888. package/src/_esm/utils/createRandomizedPolygon.d.ts +0 -14
  889. package/src/_esm/utils/createRandomizedPolygon.js +0 -32
  890. package/src/_esm/utils/createRandomizedPolygon.js.map +0 -1
  891. package/src/_esm/utils/datastructures/CircularIntervalSet.d.ts +0 -83
  892. package/src/_esm/utils/datastructures/CircularIntervalSet.js +0 -162
  893. package/src/_esm/utils/datastructures/CircularIntervalSet.js.map +0 -1
  894. package/src/_esm/utils/datastructures/Color.d.ts +0 -391
  895. package/src/_esm/utils/datastructures/Color.js +0 -1067
  896. package/src/_esm/utils/datastructures/Color.js.map +0 -1
  897. package/src/_esm/utils/datastructures/ColorGradient.d.ts +0 -81
  898. package/src/_esm/utils/datastructures/ColorGradient.js +0 -175
  899. package/src/_esm/utils/datastructures/ColorGradient.js.map +0 -1
  900. package/src/_esm/utils/datastructures/DataGrid2d.d.ts +0 -53
  901. package/src/_esm/utils/datastructures/DataGrid2d.js +0 -20
  902. package/src/_esm/utils/datastructures/DataGrid2d.js.map +0 -1
  903. package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
  904. package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.js +0 -154
  905. package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
  906. package/src/_esm/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
  907. package/src/_esm/utils/datastructures/DataGrid2dListAdapter.js +0 -83
  908. package/src/_esm/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
  909. package/src/_esm/utils/datastructures/GenericPath.d.ts +0 -86
  910. package/src/_esm/utils/datastructures/GenericPath.js +0 -121
  911. package/src/_esm/utils/datastructures/GenericPath.js.map +0 -1
  912. package/src/_esm/utils/datastructures/GeometryMesh.d.ts +0 -49
  913. package/src/_esm/utils/datastructures/GeometryMesh.js +0 -57
  914. package/src/_esm/utils/datastructures/GeometryMesh.js.map +0 -1
  915. package/src/_esm/utils/datastructures/Girih.d.ts +0 -181
  916. package/src/_esm/utils/datastructures/Girih.js +0 -265
  917. package/src/_esm/utils/datastructures/Girih.js.map +0 -1
  918. package/src/_esm/utils/datastructures/GirihBowtie.d.ts +0 -37
  919. package/src/_esm/utils/datastructures/GirihBowtie.js +0 -134
  920. package/src/_esm/utils/datastructures/GirihBowtie.js.map +0 -1
  921. package/src/_esm/utils/datastructures/GirihDecagon.d.ts +0 -52
  922. package/src/_esm/utils/datastructures/GirihDecagon.js +0 -114
  923. package/src/_esm/utils/datastructures/GirihDecagon.js.map +0 -1
  924. package/src/_esm/utils/datastructures/GirihHexagon.d.ts +0 -39
  925. package/src/_esm/utils/datastructures/GirihHexagon.js +0 -182
  926. package/src/_esm/utils/datastructures/GirihHexagon.js.map +0 -1
  927. package/src/_esm/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
  928. package/src/_esm/utils/datastructures/GirihPenroseRhombus.js +0 -171
  929. package/src/_esm/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
  930. package/src/_esm/utils/datastructures/GirihPentagon.d.ts +0 -37
  931. package/src/_esm/utils/datastructures/GirihPentagon.js +0 -91
  932. package/src/_esm/utils/datastructures/GirihPentagon.js.map +0 -1
  933. package/src/_esm/utils/datastructures/GirihRhombus.d.ts +0 -38
  934. package/src/_esm/utils/datastructures/GirihRhombus.js +0 -137
  935. package/src/_esm/utils/datastructures/GirihRhombus.js.map +0 -1
  936. package/src/_esm/utils/datastructures/GirihTile.d.ts +0 -283
  937. package/src/_esm/utils/datastructures/GirihTile.js +0 -290
  938. package/src/_esm/utils/datastructures/GirihTile.js.map +0 -1
  939. package/src/_esm/utils/datastructures/Matrix4x4.d.ts +0 -244
  940. package/src/_esm/utils/datastructures/Matrix4x4.js +0 -250
  941. package/src/_esm/utils/datastructures/Matrix4x4.js.map +0 -1
  942. package/src/_esm/utils/datastructures/VoronoiCell.d.ts +0 -122
  943. package/src/_esm/utils/datastructures/VoronoiCell.js +0 -182
  944. package/src/_esm/utils/datastructures/VoronoiCell.js.map +0 -1
  945. package/src/_esm/utils/datastructures/interfaces.d.ts +0 -13
  946. package/src/_esm/utils/datastructures/interfaces.js +0 -10
  947. package/src/_esm/utils/datastructures/interfaces.js.map +0 -1
  948. package/src/_esm/utils/detectDarkMode.d.ts +0 -10
  949. package/src/_esm/utils/detectDarkMode.js +0 -41
  950. package/src/_esm/utils/detectDarkMode.js.map +0 -1
  951. package/src/_esm/utils/dom/components/ColorGradientPicker.d.ts +0 -246
  952. package/src/_esm/utils/dom/components/ColorGradientPicker.js +0 -780
  953. package/src/_esm/utils/dom/components/ColorGradientPicker.js.map +0 -1
  954. package/src/_esm/utils/dom/components/ColorGradientPickerJSX.d.ts +0 -129
  955. package/src/_esm/utils/dom/components/ColorGradientPickerJSX.js +0 -582
  956. package/src/_esm/utils/dom/components/ColorGradientPickerJSX.js.map +0 -1
  957. package/src/_esm/utils/dom/components/ColorGradientSelector.d.ts +0 -118
  958. package/src/_esm/utils/dom/components/ColorGradientSelector.js +0 -376
  959. package/src/_esm/utils/dom/components/ColorGradientSelector.js.map +0 -1
  960. package/src/_esm/utils/dom/components/Test.d.ts +0 -7
  961. package/src/_esm/utils/dom/components/Test.js +0 -63
  962. package/src/_esm/utils/dom/components/Test.js.map +0 -1
  963. package/src/_esm/utils/dom/getAvailableContainerSpace.d.ts +0 -2
  964. package/src/_esm/utils/dom/getAvailableContainerSpace.js +0 -29
  965. package/src/_esm/utils/dom/getAvailableContainerSpace.js.map +0 -1
  966. package/src/_esm/utils/dom/getFProp.d.ts +0 -5
  967. package/src/_esm/utils/dom/getFProp.js +0 -12
  968. package/src/_esm/utils/dom/getFProp.js.map +0 -1
  969. package/src/_esm/utils/dom/guiSizeToggler.d.ts +0 -18
  970. package/src/_esm/utils/dom/guiSizeToggler.js +0 -44
  971. package/src/_esm/utils/dom/guiSizeToggler.js.map +0 -1
  972. package/src/_esm/utils/findInVertexArray.d.ts +0 -19
  973. package/src/_esm/utils/findInVertexArray.js +0 -29
  974. package/src/_esm/utils/findInVertexArray.js.map +0 -1
  975. package/src/_esm/utils/getFProp.d.ts +0 -5
  976. package/src/_esm/utils/getFProp.js +0 -8
  977. package/src/_esm/utils/getFProp.js.map +0 -1
  978. package/src/_esm/utils/gup.d.ts +0 -14
  979. package/src/_esm/utils/gup.js +0 -31
  980. package/src/_esm/utils/gup.js.map +0 -1
  981. package/src/_esm/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
  982. package/src/_esm/utils/helpers/BezierPathInteractionHelper.js +0 -655
  983. package/src/_esm/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
  984. package/src/_esm/utils/helpers/CircleHelper.d.ts +0 -73
  985. package/src/_esm/utils/helpers/CircleHelper.js +0 -92
  986. package/src/_esm/utils/helpers/CircleHelper.js.map +0 -1
  987. package/src/_esm/utils/helpers/CircleSectorHelper.d.ts +0 -90
  988. package/src/_esm/utils/helpers/CircleSectorHelper.js +0 -113
  989. package/src/_esm/utils/helpers/CircleSectorHelper.js.map +0 -1
  990. package/src/_esm/utils/helpers/TriangleHelper.d.ts +0 -57
  991. package/src/_esm/utils/helpers/TriangleHelper.js +0 -82
  992. package/src/_esm/utils/helpers/TriangleHelper.js.map +0 -1
  993. package/src/_esm/utils/helpers/VEllipseHelper.d.ts +0 -32
  994. package/src/_esm/utils/helpers/VEllipseHelper.js +0 -87
  995. package/src/_esm/utils/helpers/VEllipseHelper.js.map +0 -1
  996. package/src/_esm/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
  997. package/src/_esm/utils/helpers/VEllipseSectorHelper.js +0 -134
  998. package/src/_esm/utils/helpers/VEllipseSectorHelper.js.map +0 -1
  999. package/src/_esm/utils/io/DndFileHandler.d.ts +0 -63
  1000. package/src/_esm/utils/io/DndFileHandler.js +0 -106
  1001. package/src/_esm/utils/io/DndFileHandler.js.map +0 -1
  1002. package/src/_esm/utils/io/FileDrop.d.ts +0 -110
  1003. package/src/_esm/utils/io/FileDrop.js +0 -175
  1004. package/src/_esm/utils/io/FileDrop.js.map +0 -1
  1005. package/src/_esm/utils/parsers/LinearColorGradientParser.d.ts +0 -78
  1006. package/src/_esm/utils/parsers/LinearColorGradientParser.js +0 -223
  1007. package/src/_esm/utils/parsers/LinearColorGradientParser.js.map +0 -1
  1008. package/src/_esm/utils/parsers/OBJParser.d.ts +0 -25
  1009. package/src/_esm/utils/parsers/OBJParser.js +0 -78
  1010. package/src/_esm/utils/parsers/OBJParser.js.map +0 -1
  1011. package/src/_esm/utils/parsers/STLParser.d.ts +0 -61
  1012. package/src/_esm/utils/parsers/STLParser.js +0 -179
  1013. package/src/_esm/utils/parsers/STLParser.js.map +0 -1
  1014. package/src/_esm/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
  1015. package/src/_esm/utils/parsers/svg/parseSVGPathData.js +0 -486
  1016. package/src/_esm/utils/parsers/svg/parseSVGPathData.js.map +0 -1
  1017. package/src/_esm/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
  1018. package/src/_esm/utils/parsers/svg/splitSVGPathData.js +0 -53
  1019. package/src/_esm/utils/parsers/svg/splitSVGPathData.js.map +0 -1
  1020. package/src/_esm/utils/parsers/svg/types.d.ts +0 -63
  1021. package/src/_esm/utils/parsers/svg/types.js +0 -17
  1022. package/src/_esm/utils/parsers/svg/types.js.map +0 -1
@@ -1,1705 +0,0 @@
1
- "use strict";
2
- /**
3
- * Draws elements into an SVG node.
4
- *
5
- * Note that this library uses buffers and draw cycles. To draw onto an SVG canvas, do this:
6
- * const drawLib = new drawutilssvg( svgNode, ... );
7
- * const fillLib = drawLib.copyInstance(true);
8
- * // Begin draw cycle
9
- * drawLib.beginDrawCycle(time);
10
- * // ... draw or fill your stuff ...
11
- * drawLib.endDrawCycle(time); // Here the elements become visible
12
- *
13
- * @author Ikaros Kappler
14
- * @date 2021-01-03
15
- * @modified 2021-01-24 Fixed the `fillShapes` attribute in the copyInstance function.
16
- * @modified 2021-01-26 Changed the `isPrimary` (default true) attribute to `isSecondary` (default false).
17
- * @modified 2021-02-03 Added the static `createSvg` function.
18
- * @modified 2021-02-03 Fixed the currentId='background' bug on the clear() function.
19
- * @modified 2021-02-03 Fixed CSSProperty `stroke-width` (was line-width before, which is wrong).
20
- * @modified 2021-02-03 Added the static `HEAD_XML` attribute.
21
- * @modified 2021-02-19 Added the static helper function `transformPathData(...)` for svg path transformations (scale and translate).
22
- * @modified 2021-02-22 Added the static helper function `copyPathData(...)`.
23
- * @modified 2021-02-22 Added the `path` drawing function to draw SVG path data.
24
- * @modified 2021-03-01 Fixed a bug in the `clear` function (curClassName was not cleared).
25
- * @modified 2021-03-29 Fixed a bug in the `text` function (second y param was wrong, used x here).
26
- * @modified 2021-03-29 Moved this file from `src/ts/utils/helpers/` to `src/ts/`.
27
- * @modified 2021-03-31 Added 'ellipseSector' the the class names.
28
- * @modified 2021-03-31 Implemented buffering using a buffer <g> node and the beginDrawCycle and endDrawCycle methods.
29
- * @modified 2021-05-31 Added the `setConfiguration` function from `DrawLib`.
30
- * @modified 2021-11-15 Adding more parameters tot the `text()` function: fontSize, textAlign, fontFamily, lineHeight.
31
- * @modified 2021-11-19 Fixing the `label(text,x,y)` position.
32
- * @modified 2021-11-19 Added the `color` param to the `label(...)` function.
33
- * @modified 2022-02-03 Added the `lineWidth` param to the `crosshair` function.
34
- * @modified 2022-02-03 Added the `cross(...)` function.
35
- * @modified 2022-03-26 Added the private `nodeDefs` and `bufferedNodeDefs` attributes.
36
- * @modified 2022-03-26 Added the `texturedPoly` function to draw textures polygons.
37
- * @modified 2022-07-26 Adding `alpha` to the `image(...)` function.
38
- * @modified 2022-11-10 Tweaking some type issues.
39
- * @modified 2023-02-04 Fixed a typo in the CSS classname for cubic Bézier paths: cubicBezier (was cubierBezier).
40
- * @modified 2023-02-10 The methods `setCurrentClassName` and `setCurrentId` also accept `null` now.
41
- * @modified 2023-09-29 Added initialization checks for null parameters.
42
- * @modified 2023-09-29 Added a missing implementation to the `drawurilssvg.do(XYCoords,string)` function. Didn't draw anything.
43
- * @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.
44
- * @modified 2023-09-29 Added the `headLength` parameter to the 'DrawLib.arrow()` function.
45
- * @modified 2023-09-29 Added the `arrowHead(...)` function to the 'DrawLib.arrow()` interface.
46
- * @modified 2023-09-29 Added the `cubicBezierArrow(...)` function to the 'DrawLib.arrow()` interface.
47
- * @modified 2023-10-04 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
48
- * @modified 2024-01-30 Fixing an issue with immutable style sets; changes to the global draw config did not reflect here (do now).
49
- * @modified 2024-03-10 Fixing some types for Typescript 5 compatibility.
50
- * @modified 2024-07-24 Caching custom style defs in a private buffer variable.
51
- * @modified 2025-11-14 Fixing a bug in the CSS `mix-blend-mode` property handling (caused a runtime error).
52
- * @modified 2026-01-04 Adding `lineJoin` attribute to the methods' `StrokeOptions` param.
53
- * @modified 2026-01-04 Fixing missing `strokeOptions` param in the `drawutilssvg.polygon` method.
54
- * @modified 2026-03-18 Adding `isOpen` parameter to `cubicBezierPath` draw method.
55
- * @version 1.7.0
56
- **/
57
- Object.defineProperty(exports, "__esModule", { value: true });
58
- exports.drawutilssvg = void 0;
59
- const CircleSector_1 = require("./CircleSector");
60
- const CubicBezierCurve_1 = require("./CubicBezierCurve");
61
- const Vertex_1 = require("./Vertex");
62
- const UIDGenerator_1 = require("./UIDGenerator");
63
- const Vector_1 = require("./Vector");
64
- const RAD_TO_DEG = 180 / Math.PI;
65
- /**
66
- * @classdesc A helper class for basic SVG drawing operations. This class should
67
- * be compatible to the default 'draw' class.
68
- *
69
- * @requires CubicBzierCurvce
70
- * @requires Polygon
71
- * @requires Vertex
72
- * @requires XYCoords
73
- */
74
- class drawutilssvg {
75
- /**
76
- * Passed from primary to secondary instance.
77
- */
78
- //private nodeStyle: SVGStyleElement;
79
- /**
80
- * The constructor.
81
- *
82
- * @constructor
83
- * @name drawutilssvg
84
- * @param {SVGElement} svgNode - The SVG node to use.
85
- * @param {XYCoords} offset - The draw offset to use.
86
- * @param {XYCoords} scale - The scale factors to use.
87
- * @param {XYDimension} canvasSize - The initial canvas size (use setSize to change).
88
- * @param {boolean} fillShapes - Indicates if the constructed drawutils should fill all drawn shapes (if possible).
89
- * @param {DrawConfig} drawConfig - The default draw config to use for CSS fallback styles.
90
- * @param {boolean=} isSecondary - (optional) Indicates if this is the primary or secondary instance. Only primary instances manage child nodes.
91
- * @param {SVGGElement=} gNode - (optional) Primary and seconday instances share the same &lt;g> node.
92
- **/
93
- constructor(svgNode, offset, scale, canvasSize, fillShapes, drawConfig, isSecondary, gNode, bufferGNode, nodeDefs, bufferNodeDefs, nodeStyle) {
94
- this.svgNode = svgNode;
95
- this.offset = new Vertex_1.Vertex(0, 0).set(offset);
96
- this.scale = new Vertex_1.Vertex(1, 1).set(scale);
97
- this.fillShapes = fillShapes;
98
- this.isSecondary = Boolean(isSecondary);
99
- this.drawConfig = drawConfig;
100
- this.drawlibConfiguration = {};
101
- this.cache = new Map();
102
- this.setSize(canvasSize);
103
- if (isSecondary) {
104
- if (!gNode || !bufferGNode || !nodeDefs || !bufferNodeDefs) {
105
- throw "Cannot create secondary svg draw lib with undefinde gNode|bufferGNode|nodeDefs|bufferNodeDefs.";
106
- }
107
- this.gNode = gNode;
108
- this.bufferGNode = bufferGNode;
109
- this.nodeDefs = nodeDefs;
110
- this.bufferedNodeDefs = bufferNodeDefs;
111
- if (nodeStyle) {
112
- this.nodeStyle = nodeStyle;
113
- }
114
- }
115
- else {
116
- this.addStyleDefs(drawConfig);
117
- this.addDefsNode();
118
- this.gNode = this.createSVGNode("g");
119
- this.bufferGNode = this.createSVGNode("g");
120
- this.svgNode.appendChild(this.gNode);
121
- }
122
- }
123
- /**
124
- * Adds a default style defintion based on the passed DrawConfig.
125
- * Twaek the draw config to change default colors or line thicknesses.
126
- *
127
- * @param {DrawConfig} drawConfig
128
- */
129
- addStyleDefs(drawConfig) {
130
- this.nodeStyle = this.createSVGNode("style");
131
- this.svgNode.appendChild(this.nodeStyle);
132
- this.rebuildStyleDefs(drawConfig);
133
- }
134
- /**
135
- * This method is required to re-define the global style defs. It is needed
136
- * if any value in the DrawConfig changed in the meantime.
137
- * @param drawConfig
138
- */
139
- rebuildStyleDefs(drawConfig) {
140
- // Which default styles to add? -> All from the DrawConfig.
141
- // Compare with DrawConfig interface
142
- const keys = {
143
- "bezier": "CubicBezierCurve",
144
- //"bezierPath": "BezierPath", // TODO: is this correct?
145
- "polygon": "Polygon",
146
- "triangle": "Triangle",
147
- "ellipse": "Ellipse",
148
- "ellipseSector": "EllipseSector",
149
- "circle": "Circle",
150
- "circleSector": "CircleSector",
151
- "vertex": "Vertex",
152
- "line": "Line",
153
- "vector": "Vector",
154
- "image": "Image",
155
- "text": "Text"
156
- };
157
- // Question: why isn't this working if the svgNode is created dynamically? (nodeStyle.sheet is null)
158
- const rules = [];
159
- // console.log("drawConfig", drawConfig);
160
- for (var k in keys) {
161
- const className = keys[k];
162
- const drawSettings = drawConfig[k];
163
- if (drawSettings) {
164
- rules.push(`.${className} { fill : none; stroke: ${drawSettings.color}; stroke-width: ${drawSettings.lineWidth}px }`);
165
- }
166
- else {
167
- console.warn(`Warning: your draw config is missing the key '${k}' which is required.`);
168
- }
169
- }
170
- if (this.customStyleDefs) {
171
- rules.push("\n/* Custom styles */\n");
172
- this.customStyleDefs.forEach((value, key) => {
173
- rules.push(key + " { " + value + " }");
174
- });
175
- // this.nodeStyle.innerHTML += "\n/* Custom styles */\n" + rules.join("\n");
176
- }
177
- this.nodeStyle.innerHTML = rules.join("\n");
178
- }
179
- /**
180
- * Adds the internal <defs> node.
181
- */
182
- addDefsNode() {
183
- this.nodeDefs = this.createSVGNode("defs");
184
- // this.svgNode.appendChild(this.nodeDefs);
185
- this.bufferedNodeDefs = this.createSVGNode("defs");
186
- this.svgNode.appendChild(this.nodeDefs);
187
- }
188
- /**
189
- * This is a simple way to include custom CSS class mappings to the style defs of the generated SVG.
190
- *
191
- * The mapping should be of the form
192
- * [style-class] -> [style-def-string]
193
- *
194
- * Example:
195
- * "rect.red" -> "fill: #ff0000; border: 1px solid red"
196
- *
197
- * @param {Map<string,string>} defs
198
- */
199
- addCustomStyleDefs(defs) {
200
- this.customStyleDefs = defs;
201
- }
202
- /**
203
- * Retieve an old (cached) element.
204
- * Only if both – key and nodeName – match, the element will be returned (null otherwise).
205
- *
206
- * @method findElement
207
- * @private
208
- * @memberof drawutilssvg
209
- * @instance
210
- * @param {UID} key - The key of the desired element (used when re-drawing).
211
- * @param {string} nodeName - The expected node name.
212
- */
213
- findElement(key, nodeName) {
214
- if (!key) {
215
- return null;
216
- }
217
- var node = this.cache.get(key);
218
- if (node && node.nodeName.toUpperCase() === nodeName.toUpperCase()) {
219
- this.cache.delete(key);
220
- return node;
221
- }
222
- return null;
223
- }
224
- /**
225
- * Create a new DOM node &lt;svg&gt; in the SVG namespace.
226
- *
227
- * @method createSVGNode
228
- * @private
229
- * @memberof drawutilssvg
230
- * @instance
231
- * @param {string} nodeName - The node name (tag-name).
232
- * @return {SVGElement} A new element in the SVG namespace with the given node name.
233
- */
234
- createSVGNode(nodeName) {
235
- return document.createElementNS("http://www.w3.org/2000/svg", nodeName);
236
- }
237
- /**
238
- * Make a new SVG node (or recycle an old one) with the given node name (circle, path, line, rect, ...).
239
- *
240
- * This function is used in draw cycles to re-use old DOM nodes (in hope to boost performance).
241
- *
242
- * @method makeNode
243
- * @private
244
- * @instance
245
- * @memberof drawutilssvg
246
- * @param {string} nodeName - The node name.
247
- * @return {SVGElement} The new node, which is not yet added to any document.
248
- */
249
- makeNode(nodeName) {
250
- // Try to find node in current DOM cache.
251
- // Unique node keys are strictly necessary.
252
- // Try to recycle an old element from cache.
253
- var node = this.findElement(this.curId, nodeName);
254
- if (!node) {
255
- // If no such old elements exists (key not found, tag name not matching),
256
- // then create a new one.
257
- node = this.createSVGNode(nodeName);
258
- }
259
- if (this.drawlibConfiguration.blendMode) {
260
- const blendMode = node.style["mix-blend-mode"];
261
- if (typeof blendMode === "function") {
262
- blendMode(this.drawlibConfiguration.blendMode);
263
- }
264
- else {
265
- node.style["mix-blend-mode"] = this.drawlibConfiguration.blendMode;
266
- }
267
- }
268
- // if (this.lineDashEnabled && this.lineDash && this.lineDash.length > 0 && drawutilssvg.nodeSupportsLineDash(nodeName)) {
269
- // node.setAttribute("stroke-dasharray", this.lineDash.join(" "));
270
- // }
271
- return node;
272
- }
273
- /**
274
- * This is the final helper function for drawing and filling stuff and binding new
275
- * nodes to the SVG document.
276
- * It is not intended to be used from the outside.
277
- *
278
- * When in draw mode it draws the current shape.
279
- * When in fill mode it fills the current shape.
280
- *
281
- * This function is usually only called internally.
282
- *
283
- * @method _bindFillDraw
284
- * @private
285
- * @instance
286
- * @memberof drawutilssvg
287
- * @param {SVGElement} node - The node to draw/fill and bind.
288
- * @param {string} className - The class name(s) to use.
289
- * @param {string} color - A stroke/fill color to use.
290
- * @param {number=1} lineWidth - (optional) A line width to use for drawing (default is 1).
291
- * @return {SVGElement} The node itself (for chaining).
292
- */
293
- _bindFillDraw(node, className, color, lineWidth, strokeOptions) {
294
- this._configureNode(node, className, this.fillShapes, color, lineWidth, strokeOptions);
295
- return this._bindNode(node, undefined);
296
- }
297
- /**
298
- * Bind this given node to a parent. If no parent is passed then the global
299
- * node buffer will be used.
300
- *
301
- * @method _bindNode
302
- * @private
303
- * @instance
304
- * @memberof drawutilssvg
305
- * @param {SVGElement} node - The SVG node to bind.
306
- * @param {SVGElement=} bindingParent - (optional) You may pass node other than the glober buffer node.
307
- * @returns {SVGElement} The passed node itself.
308
- */
309
- _bindNode(node, bindingParent) {
310
- if (!node.parentNode) {
311
- // Attach to DOM only if not already attached
312
- (bindingParent !== null && bindingParent !== void 0 ? bindingParent : this.bufferGNode).appendChild(node);
313
- }
314
- return node;
315
- }
316
- /**
317
- * Add custom CSS class names and the globally defined CSS classname to the
318
- * given node.
319
- *
320
- * @method addCSSClasses
321
- * @private
322
- * @instance
323
- * @memberof drawutilssvg
324
- * @param {SVGElement} node - The SVG node to bind.
325
- * @param {string} className - The additional custom classname to add.
326
- * @returns {void}
327
- */
328
- _addCSSClasses(node, className) {
329
- if (this.curClassName) {
330
- node.setAttribute("class", `${className} ${this.curClassName}`);
331
- }
332
- else {
333
- node.setAttribute("class", className);
334
- }
335
- }
336
- _configureNode(node, className, fillMode, color, lineWidth, strokeOptions) {
337
- this._addCSSClasses(node, className);
338
- node.setAttribute("fill", fillMode && color ? color : "none");
339
- node.setAttribute("stroke", fillMode ? "none" : color || "none");
340
- node.setAttribute("stroke-width", `${lineWidth || 1}`);
341
- if (this.curId) {
342
- node.setAttribute("id", `${this.curId}`); // Maybe React-style 'key' would be better?
343
- }
344
- this.applyStrokeOpts(node, strokeOptions);
345
- return node;
346
- }
347
- /**
348
- * Sets the size and view box of the document. Call this if canvas size changes.
349
- *
350
- * @method setSize
351
- * @instance
352
- * @memberof drawutilssvg
353
- * @param {XYDimension} canvasSize - The new canvas size.
354
- */
355
- setSize(canvasSize) {
356
- this.canvasSize = canvasSize;
357
- this.svgNode.setAttribute("viewBox", `0 0 ${this.canvasSize.width} ${this.canvasSize.height}`);
358
- this.svgNode.setAttribute("width", `${this.canvasSize.width}`);
359
- this.svgNode.setAttribute("height", `${this.canvasSize.height}`);
360
- }
361
- /**
362
- * Creates a 'shallow' (non deep) copy of this instance. This implies
363
- * that under the hood the same gl context and gl program will be used.
364
- */
365
- copyInstance(fillShapes) {
366
- var copy = new drawutilssvg(this.svgNode, this.offset, this.scale, this.canvasSize, fillShapes, this.drawConfig, // null as any as DrawConfig, // no DrawConfig – this will work as long as `isSecondary===true`
367
- true, // isSecondary
368
- this.gNode, this.bufferGNode, this.nodeDefs, this.bufferedNodeDefs, this.nodeStyle);
369
- return copy;
370
- }
371
- /**
372
- * Set the current drawlib configuration.
373
- *
374
- * @name setConfiguration
375
- * @method
376
- * @param {DrawLibConfiguration} configuration - The new configuration settings to use for the next render methods.
377
- */
378
- setConfiguration(configuration) {
379
- this.drawlibConfiguration = configuration;
380
- }
381
- /**
382
- * This method shouled be called each time the currently drawn `Drawable` changes.
383
- * It is used by some libraries for identifying elemente on re-renders.
384
- *
385
- * @name setCurrentId
386
- * @method
387
- * @param {UID|null} uid - A UID identifying the currently drawn element(s).
388
- * @instance
389
- * @memberof drawutilssvg
390
- **/
391
- setCurrentId(uid) {
392
- this.curId = uid;
393
- }
394
- /**
395
- * This method shouled be called each time the currently drawn `Drawable` changes.
396
- * Determine the class name for further usage here.
397
- *
398
- * @name setCurrentClassName
399
- * @method
400
- * @param {string|null} className - A class name for further custom use cases.
401
- * @instance
402
- * @memberof drawutilssvg
403
- **/
404
- setCurrentClassName(className) {
405
- this.curClassName = className;
406
- }
407
- /**
408
- * Called before each draw cycle.
409
- * This is required for compatibility with other draw classes in the library.
410
- *
411
- * @name beginDrawCycle
412
- * @method
413
- * @param {UID=} uid - (optional) A UID identifying the currently drawn element(s).
414
- * @instance
415
- * @memberof drawutilssvg
416
- **/
417
- beginDrawCycle(renderTime) {
418
- // Clear non-recycable elements from last draw cycle.
419
- this.cache.clear();
420
- // Clearing an SVG is equivalent to removing all its child elements.
421
- for (var i = 0; i < this.bufferGNode.childNodes.length; i++) {
422
- // Hide all nodes here. Don't throw them away.
423
- // We can probably re-use them in the next draw cycle.
424
- var child = this.bufferGNode.childNodes[i];
425
- this.cache.set(child.getAttribute("id"), child);
426
- }
427
- this.removeAllChildNodes();
428
- }
429
- /**
430
- * Called after each draw cycle.
431
- *
432
- * This is required for compatibility with other draw classes in the library (like drawgl).
433
- *
434
- * @name endDrawCycle
435
- * @method
436
- * @param {number} renderTime
437
- * @instance
438
- **/
439
- endDrawCycle(renderTime) {
440
- this.rebuildStyleDefs(this.drawConfig);
441
- if (!this.isSecondary) {
442
- // All elements are drawn into the buffer; they are NOT yet visible, not did the browser perform any
443
- // layout updates.
444
- // Replace the old <g>-node with the buffer node.
445
- // https://stackoverflow.com/questions/27442464/how-to-update-a-svg-image-without-seeing-a-blinking
446
- this.svgNode.replaceChild(this.bufferedNodeDefs, this.nodeDefs);
447
- this.svgNode.replaceChild(this.bufferGNode, this.gNode);
448
- }
449
- const tmpGNode = this.gNode;
450
- this.gNode = this.bufferGNode;
451
- this.bufferGNode = tmpGNode;
452
- const tmpDefsNode = this.nodeDefs;
453
- this.nodeDefs = this.bufferedNodeDefs;
454
- this.bufferedNodeDefs = tmpDefsNode;
455
- }
456
- /**
457
- * A private helper method to apply stroke options to the current
458
- * context.
459
- * @param {StrokeOptions=} strokeOptions -
460
- */
461
- applyStrokeOpts(node, strokeOptions) {
462
- // Set line dash options?
463
- if (strokeOptions &&
464
- strokeOptions.dashArray &&
465
- strokeOptions.dashArray.length > 0 &&
466
- drawutilssvg.nodeSupportsLineDash(node.tagName)) {
467
- node.setAttribute("stroke-dasharray", strokeOptions.dashArray
468
- .map((dashArayElem) => {
469
- return dashArayElem * this.scale.x;
470
- })
471
- .join(" "));
472
- if (strokeOptions.dashOffset) {
473
- node.setAttribute("stroke-dashoffset", `${strokeOptions.dashOffset * this.scale.x}`);
474
- }
475
- }
476
- // Set line join option?
477
- if (strokeOptions && strokeOptions.lineJoin && drawutilssvg.nodeSupportsLineJoin(node.tagName)) {
478
- node.setAttribute("stroke-linejoin", strokeOptions.lineJoin);
479
- }
480
- }
481
- _x(x) {
482
- return this.offset.x + this.scale.x * x;
483
- }
484
- _y(y) {
485
- return this.offset.y + this.scale.y * y;
486
- }
487
- /**
488
- * Draw the line between the given two points with the specified (CSS-) color.
489
- *
490
- * @method line
491
- * @param {XYCoords} zA - The start point of the line.
492
- * @param {XYCoords} zB - The end point of the line.
493
- * @param {string} color - Any valid CSS color string.
494
- * @param {number=1} lineWidth? - [optional] The line's width.
495
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
496
- *
497
- * @return {void}
498
- * @instance
499
- * @memberof drawutilssvg
500
- **/
501
- line(zA, zB, color, lineWidth, strokeOptions) {
502
- // const line: SVGElement = this.makeNode("line");
503
- // this.applyStrokeOpts(line, strokeOptions);
504
- // line.setAttribute("x1", `${this._x(zA.x)}`);
505
- // line.setAttribute("y1", `${this._y(zA.y)}`);
506
- // line.setAttribute("x2", `${this._x(zB.x)}`);
507
- // line.setAttribute("y2", `${this._y(zB.y)}`);
508
- const line = this.makeLineNode(zA, zB, color, lineWidth, strokeOptions);
509
- return this._bindFillDraw(line, "line", color, lineWidth || 1, strokeOptions);
510
- }
511
- /**
512
- * Draw a line and an arrow at the end (zB) of the given line with the specified (CSS-) color.
513
- *
514
- * @method arrow
515
- * @param {XYCoords} zA - The start point of the arrow-line.
516
- * @param {XYCoords} zB - The end point of the arrow-line.
517
- * @param {string} color - Any valid CSS color string.
518
- * @param {number=} lineWidth - (optional) The line width to use; default is 1.
519
- * @param {headLength=8} headLength - (optional) The length of the arrow head (default is 8 units).
520
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
521
- *
522
- * @return {void}
523
- * @instance
524
- * @memberof drawutilssvg
525
- **/
526
- arrow(zA, zB, color, lineWidth, headLength = 8, strokeOptions) {
527
- const group = this.makeNode("g");
528
- const arrowHeadBasePosition = { x: 0, y: 0 };
529
- // Just create the child nodes, don't bind them to the root node.
530
- const arrowHead = this.makeArrowHeadNode(zA, zB, color, lineWidth, headLength, undefined, arrowHeadBasePosition);
531
- const line = this.makeLineNode(zA, arrowHeadBasePosition, color, lineWidth, strokeOptions);
532
- group.appendChild(line);
533
- group.appendChild(arrowHead);
534
- this._addCSSClasses(group, "linear-arrow");
535
- this._bindNode(group, undefined);
536
- return group;
537
- }
538
- /**
539
- * 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.
540
- *
541
- * @method cubicBezierArrow
542
- * @param {XYCoords} startPoint - The start point of the cubic Bézier curve
543
- * @param {XYCoords} endPoint - The end point the cubic Bézier curve.
544
- * @param {XYCoords} startControlPoint - The start control point the cubic Bézier curve.
545
- * @param {XYCoords} endControlPoint - The end control point the cubic Bézier curve.
546
- * @param {string} color - The CSS color to draw the curve with.
547
- * @param {number} lineWidth - (optional) The line width to use.
548
- * @param {headLength=8} headLength - (optional) The length of the arrow head (default is 8 units).
549
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
550
- *
551
- * @return {void}
552
- * @instance
553
- * @memberof DrawLib
554
- */
555
- cubicBezierArrow(startPoint, endPoint, startControlPoint, endControlPoint, color, lineWidth, headLength = 8, strokeOptions) {
556
- const group = this.makeNode("g");
557
- // Just create the child nodes, don't bind them to the root node.
558
- const arrowHeadBasePosition = new Vertex_1.Vertex(0, 0);
559
- const arrowHead = this.makeArrowHeadNode(endControlPoint, endPoint, color, lineWidth, headLength, undefined, arrowHeadBasePosition);
560
- const diff = arrowHeadBasePosition.difference(endPoint);
561
- const bezier = this.makeCubicBezierNode(startPoint, { x: endPoint.x - diff.x, y: endPoint.y - diff.y }, startControlPoint, { x: endControlPoint.x - diff.x, y: endControlPoint.y - diff.y }, color, lineWidth, strokeOptions);
562
- group.appendChild(bezier);
563
- group.appendChild(arrowHead);
564
- this._addCSSClasses(group, "cubicbezier-arrow");
565
- this._bindNode(group, undefined);
566
- return group;
567
- }
568
- /**
569
- * Draw just an arrow head a the end of an imaginary line (zB) of the given line width the specified (CSS-) color and size.
570
- *
571
- * @method arrow
572
- * @param {XYCoords} zA - The start point of the arrow-line.
573
- * @param {XYCoords} zB - The end point of the arrow-line.
574
- * @param {string} color - Any valid CSS color string.
575
- * @param {number=1} lineWidth - (optional) The line width to use; default is 1.
576
- * @param {number=8} headLength - (optional) The length of the arrow head (default is 8 pixels).
577
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
578
- *
579
- * @return {void}
580
- * @instance
581
- * @memberof DrawLib
582
- **/
583
- arrowHead(zA, zB, color, lineWidth, headLength = 8, strokeOptions) {
584
- const node = this.makeArrowHeadNode(zA, zB, color, lineWidth, headLength, strokeOptions);
585
- return this._bindFillDraw(node, "arrowhead", color, lineWidth || 1, strokeOptions);
586
- }
587
- /**
588
- * Draw an image at the given position with the given size.<br>
589
- * <br>
590
- * 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.
591
- *
592
- * @method image
593
- * @param {Image} image - The image object to draw.
594
- * @param {XYCoords} position - The position to draw the the upper left corner at.
595
- * @param {XYCoords} size - The x/y-size to draw the image with.
596
- * @param {number=0.0} alpha - (optional, default=0.0) The transparency (1.0=opaque, 0.0=transparent).
597
- * @return {void}
598
- * @instance
599
- * @memberof drawutilssvg
600
- **/
601
- image(image, position, size, alpha = 1.0) {
602
- const node = this.makeNode("image");
603
- // We need to re-adjust the image if it was not yet fully loaded before.
604
- const setImageSize = (image) => {
605
- if (image.naturalWidth) {
606
- const ratioX = size.x / image.naturalWidth;
607
- const ratioY = size.y / image.naturalHeight;
608
- node.setAttribute("width", `${image.naturalWidth * this.scale.x}`);
609
- node.setAttribute("height", `${image.naturalHeight * this.scale.y}`);
610
- node.setAttribute("display", null); // Dislay when loaded
611
- // if (alpha) {
612
- node.setAttribute("opacity", `${alpha}`);
613
- // }
614
- node.setAttribute("transform", `translate(${this._x(position.x)} ${this._y(position.y)}) scale(${ratioX} ${ratioY})`);
615
- }
616
- };
617
- image.addEventListener("load", event => {
618
- setImageSize(image);
619
- });
620
- // Safari has a transform-origin bug.
621
- // Use x=0, y=0 and translate/scale instead (see above)
622
- node.setAttribute("x", `${0}`);
623
- node.setAttribute("y", `${0}`);
624
- node.setAttribute("display", "none"); // Hide before loaded
625
- setImageSize(image);
626
- node.setAttribute("href", image.src);
627
- return this._bindFillDraw(node, "image", null, null);
628
- }
629
- /**
630
- * Draw an image at the given position with the given size.<br>
631
- * <br>
632
- * 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.
633
- *
634
- * @method texturedPoly
635
- * @param {Image} textureImage - The image object to draw.
636
- * @param {Bounds} textureSize - The texture size to use; these are the original bounds to map the polygon vertices to.
637
- * @param {Polygon} polygon - The polygon to use as clip path.
638
- * @param {XYCoords} polygonPosition - The polygon's position (relative), measured at the bounding box's center.
639
- * @param {number} rotation - The rotation to use for the polygon (and for the texture).
640
- * @return {void}
641
- * @instance
642
- * @memberof drawutilssvg
643
- **/
644
- texturedPoly(textureImage, textureSize, polygon, polygonPosition, rotation) {
645
- // const basePolygonBounds: Bounds = polygon.getBounds();
646
- const rotatedScalingOrigin = new Vertex_1.Vertex(textureSize.min).clone().rotate(rotation, polygonPosition);
647
- // const rotationCenter = polygonPosition.clone().add(rotatedScalingOrigin.difference(textureSize.min).inv());
648
- // Create something like this
649
- // ...
650
- // <defs>
651
- // <clipPath id="shape">
652
- // <path fill="none" d="..."/>
653
- // </clipPath>
654
- // </defs>
655
- // ...
656
- // <g clip-path="url(#shape)">
657
- // <g transform="scale(...)">
658
- // <image width="643" height="643" transform="rotate(...)" xlink:href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/222579/beagle400.jpg" >
659
- // </g>
660
- // </g>
661
- // </image>
662
- // ...
663
- const clipPathNode = this.makeNode("clipPath");
664
- const clipPathId = `clippath_${UIDGenerator_1.UIDGenerator.next()}`; // TODO: use a better UUID generator here?
665
- clipPathNode.setAttribute("id", clipPathId);
666
- const gNode = this.makeNode("g");
667
- const imageNode = this.makeNode("image");
668
- imageNode.setAttribute("x", `${this._x(rotatedScalingOrigin.x)}`);
669
- imageNode.setAttribute("y", `${this._y(rotatedScalingOrigin.y)}`);
670
- imageNode.setAttribute("width", `${textureSize.width}`);
671
- imageNode.setAttribute("height", `${textureSize.height}`);
672
- imageNode.setAttribute("href", textureImage.src);
673
- // imageNode.setAttribute("opacity", "0.5");
674
- // SVG rotations in degrees
675
- imageNode.setAttribute("transform", `rotate(${rotation * RAD_TO_DEG}, ${this._x(rotatedScalingOrigin.x)}, ${this._y(rotatedScalingOrigin.y)})`);
676
- const pathNode = this.makeNode("path");
677
- const pathData = [];
678
- if (polygon.vertices.length > 0) {
679
- const self = this;
680
- pathData.push("M", `${this._x(polygon.vertices[0].x)}`, `${this._y(polygon.vertices[0].y)}`);
681
- for (var i = 1; i < polygon.vertices.length; i++) {
682
- pathData.push("L", `${this._x(polygon.vertices[i].x)}`, `${this._y(polygon.vertices[i].y)}`);
683
- }
684
- }
685
- pathNode.setAttribute("d", pathData.join(" "));
686
- clipPathNode.appendChild(pathNode);
687
- this.bufferedNodeDefs.appendChild(clipPathNode);
688
- gNode.appendChild(imageNode);
689
- gNode.setAttribute("transform-origin", `${this._x(rotatedScalingOrigin.x)} ${this._y(rotatedScalingOrigin.y)}`);
690
- gNode.setAttribute("transform", `scale(${this.scale.x}, ${this.scale.y})`);
691
- const clipNode = this.makeNode("g");
692
- clipNode.appendChild(gNode);
693
- clipNode.setAttribute("clip-path", `url(#${clipPathId})`);
694
- // TODO: check if the image class is correct here or if we should use a 'clippedImage' class here
695
- this._bindFillDraw(clipNode, "image", null, null); // No color, no lineWidth
696
- return clipNode;
697
- }
698
- /**
699
- * Draw the given (cubic) bézier curve.
700
- *
701
- * @method cubicBezier
702
- * @param {XYCoords} startPoint - The start point of the cubic Bézier curve
703
- * @param {XYCoords} endPoint - The end point the cubic Bézier curve.
704
- * @param {XYCoords} startControlPoint - The start control point the cubic Bézier curve.
705
- * @param {XYCoords} endControlPoint - The end control point the cubic Bézier curve.
706
- * @param {string} color - The CSS color to draw the curve with.
707
- * @param {number} lineWidth - (optional) The line width to use.
708
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
709
- *
710
- * @return {void}
711
- * @instance
712
- * @memberof drawutilssvg
713
- */
714
- cubicBezier(startPoint, endPoint, startControlPoint, endControlPoint, color, lineWidth, strokeOptions) {
715
- const node = this.makeCubicBezierNode(startPoint, endPoint, startControlPoint, endControlPoint, color, lineWidth, strokeOptions);
716
- return this._bindNode(node, undefined);
717
- }
718
- /**
719
- * Draw the given (cubic) Bézier path.
720
- *
721
- * The given path must be an array with n*3+1 vertices, where n is the number of
722
- * curves in the path:
723
- * <pre> [ point1, point1_startControl, point2_endControl, point2, point2_startControl, point3_endControl, point3, ... pointN_endControl, pointN ]</pre>
724
- *
725
- * @method cubicBezierPath
726
- * @param {XYCoords[]} path - The cubic bezier path as described above.
727
- * @param {string} color - The CSS colot to draw the path with.
728
- * @param {number=1} lineWidth - (optional) The line width to use.
729
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
730
- * @param {boolean} isOpen - (optional) Set to tur if the path should not be closed.
731
- * @return {void}
732
- * @instance
733
- * @memberof drawutilssvg
734
- */
735
- cubicBezierPath(path, color, lineWidth, strokeOptions, isOpen) {
736
- const node = this.makeNode("path");
737
- this.applyStrokeOpts(node, strokeOptions);
738
- if (!path || path.length == 0) {
739
- return node;
740
- }
741
- // Draw curve
742
- const d = ["M", this._x(path[0].x), this._y(path[0].y)];
743
- // Draw curve path
744
- var endPoint;
745
- var startControlPoint;
746
- var endControlPoint;
747
- for (var i = 1; i < path.length; i += 3) {
748
- startControlPoint = path[i];
749
- endControlPoint = path[i + 1];
750
- endPoint = path[i + 2];
751
- d.push("C", this._x(startControlPoint.x), this._y(startControlPoint.y), this._x(endControlPoint.x), this._y(endControlPoint.y), this._x(endPoint.x), this._y(endPoint.y));
752
- }
753
- if (!isOpen) {
754
- d.push("Z");
755
- }
756
- node.setAttribute("d", d.join(" "));
757
- return this._bindFillDraw(node, "cubicBezierPath", color, lineWidth || 1);
758
- }
759
- /**
760
- * Draw the given handle and handle point (used to draw interactive Bézier curves).
761
- *
762
- * The colors for this are fixed and cannot be specified.
763
- *
764
- * @method handle
765
- * @param {Vertex} startPoint - The start of the handle.
766
- * @param {Vertex} endPoint - The end point of the handle.
767
- * @return {void}
768
- * @instance
769
- * @memberof drawutilssvg
770
- */
771
- handle(startPoint, endPoint) {
772
- // TODO: redefine methods like these into an abstract class?
773
- this.point(startPoint, "rgb(0,32,192)");
774
- this.square(endPoint, 5, "rgba(0,128,192,0.5)");
775
- }
776
- /**
777
- * Draw a handle line (with a light grey).
778
- *
779
- * @method handleLine
780
- * @param {XYCoords} startPoint - The start point to draw the handle at.
781
- * @param {XYCoords} endPoint - The end point to draw the handle at.
782
- * @return {void}
783
- * @instance
784
- * @memberof drawutilssvg
785
- */
786
- handleLine(startPoint, endPoint) {
787
- this.line(startPoint, endPoint, "rgb(128,128,128,0.5)");
788
- }
789
- /**
790
- * Draw a 1x1 dot with the specified (CSS-) color.
791
- *
792
- * @method dot
793
- * @param {XYCoords} p - The position to draw the dot at.
794
- * @param {string} color - The CSS color to draw the dot with.
795
- * @return {void}
796
- * @instance
797
- * @memberof drawutilssvg
798
- */
799
- dot(p, color) {
800
- const node = this.makeNode("line");
801
- node.setAttribute("x1", `${this._x(p.x)}`);
802
- node.setAttribute("y1", `${this._y(p.y)}`);
803
- node.setAttribute("x2", `${this._x(p.x)}`);
804
- node.setAttribute("y2", `${this._y(p.y)}`);
805
- return this._bindFillDraw(node, "dot", color, 1);
806
- }
807
- /**
808
- * Draw the given point with the specified (CSS-) color and radius 3.
809
- *
810
- * @method point
811
- * @param {XYCoords} p - The position to draw the point at.
812
- * @param {string} color - The CSS color to draw the point with.
813
- * @return {void}
814
- * @instance
815
- * @memberof drawutilssvg
816
- */
817
- point(p, color) {
818
- var radius = 3;
819
- const node = this.makeNode("circle");
820
- node.setAttribute("cx", `${this._x(p.x)}`);
821
- node.setAttribute("cy", `${this._y(p.y)}`);
822
- node.setAttribute("r", `${radius}`);
823
- return this._bindFillDraw(node, "point", color, 1);
824
- }
825
- /**
826
- * Draw a circle with the specified (CSS-) color and radius.<br>
827
- * <br>
828
- * Note that if the x- and y- scales are different the result will be an ellipse rather than a circle.
829
- *
830
- * @method circle
831
- * @param {XYCoords} center - The center of the circle.
832
- * @param {number} radius - The radius of the circle.
833
- * @param {string} color - The CSS color to draw the circle with.
834
- * @param {number=} lineWidth - (optional) The line width to use; default is 1.
835
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
836
- *
837
- * @return {void}
838
- * @instance
839
- * @memberof drawutilssvg
840
- */
841
- circle(center, radius, color, lineWidth, strokeOptions) {
842
- // Todo: draw ellipse when scalex!=scaley
843
- const node = this.makeNode("circle");
844
- this.applyStrokeOpts(node, strokeOptions);
845
- node.setAttribute("cx", `${this._x(center.x)}`);
846
- node.setAttribute("cy", `${this._y(center.y)}`);
847
- node.setAttribute("r", `${radius * this.scale.x}`); // y?
848
- return this._bindFillDraw(node, "circle", color, lineWidth || 1);
849
- }
850
- /**
851
- * Draw a circular arc (section of a circle) with the given CSS color.
852
- *
853
- * @method circleArc
854
- * @param {XYCoords} center - The center of the circle.
855
- * @param {number} radius - The radius of the circle.
856
- * @param {number} startAngle - The angle to start at.
857
- * @param {number} endAngle - The angle to end at.
858
- * @param {string} color - The CSS color to draw the circle with.
859
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
860
- *
861
- * @return {void}
862
- * @instance
863
- * @memberof drawutilssvg
864
- */
865
- circleArc(center, radius, startAngle, endAngle, color, lineWidth, strokeOptions) {
866
- const node = this.makeNode("path");
867
- this.applyStrokeOpts(node, strokeOptions);
868
- const arcData = CircleSector_1.CircleSector.circleSectorUtils.describeSVGArc(this._x(center.x), this._y(center.y), radius * this.scale.x, // y?
869
- startAngle, endAngle);
870
- node.setAttribute("d", arcData.join(" "));
871
- return this._bindFillDraw(node, "circleArc", color, lineWidth || 1);
872
- }
873
- /**
874
- * Draw an ellipse with the specified (CSS-) color and thw two radii.
875
- *
876
- * @method ellipse
877
- * @param {XYCoords} center - The center of the ellipse.
878
- * @param {number} radiusX - The radius of the ellipse.
879
- * @param {number} radiusY - The radius of the ellipse.
880
- * @param {string} color - The CSS color to draw the ellipse with.
881
- * @param {number=} lineWidth - (optional) The line width to use; default is 1.
882
- * @param {number=} rotation - (optional, default=0) The rotation of the ellipse.
883
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
884
- *
885
- * @return {void}
886
- * @instance
887
- * @memberof drawutilssvg
888
- */
889
- ellipse(center, radiusX, radiusY, color, lineWidth, rotation, strokeOptions) {
890
- if (typeof rotation === "undefined") {
891
- rotation = 0.0;
892
- }
893
- const node = this.makeNode("ellipse");
894
- this.applyStrokeOpts(node, strokeOptions);
895
- node.setAttribute("cx", `${this._x(center.x)}`);
896
- node.setAttribute("cy", `${this._y(center.y)}`);
897
- node.setAttribute("rx", `${radiusX * this.scale.x}`);
898
- node.setAttribute("ry", `${radiusY * this.scale.y}`);
899
- // node.setAttribute( 'style', `transform: rotate(${rotation} ${center.x} ${center.y})` );
900
- node.setAttribute("transform", `rotate(${(rotation * 180) / Math.PI} ${this._x(center.x)} ${this._y(center.y)})`);
901
- return this._bindFillDraw(node, "ellipse", color, lineWidth || 1);
902
- }
903
- /**
904
- * Draw square at the given center, size and with the specified (CSS-) color.<br>
905
- * <br>
906
- * Note that if the x-scale and the y-scale are different the result will be a rectangle rather than a square.
907
- *
908
- * @method square
909
- * @param {XYCoords} center - The center of the square.
910
- * @param {number} size - The size of the square.
911
- * @param {string} color - The CSS color to draw the square with.
912
- * @param {number=} lineWidth - (optional) The line width to use; default is 1.
913
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
914
- *
915
- * @return {SVGElement}
916
- * @instance
917
- * @memberof drawutilssvg
918
- */
919
- square(center, size, color, lineWidth, strokeOptions) {
920
- const node = this.makeNode("rectangle");
921
- this.applyStrokeOpts(node, strokeOptions);
922
- node.setAttribute("x", `${this._x(center.x - size / 2.0)}`);
923
- node.setAttribute("y", `${this._y(center.y - size / 2.0)}`);
924
- node.setAttribute("width", `${size * this.scale.x}`);
925
- node.setAttribute("height", `${size * this.scale.y}`);
926
- return this._bindFillDraw(node, "square", color, lineWidth || 1);
927
- }
928
- /**
929
- * Draw a rectangle.
930
- *
931
- * @param {XYCoords} position - The upper left corner of the rectangle.
932
- * @param {number} width - The width of the rectangle.
933
- * @param {number} height - The height of the rectangle.
934
- * @param {string} color - The color to use.
935
- * @param {number=1} lineWidth - (optional) The line with to use (default is 1).
936
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
937
- *
938
- * @return {SVGElement}
939
- * @instance
940
- * @memberof drawutilssvg
941
- **/
942
- rect(position, width, height, color, lineWidth, strokeOptions) {
943
- const node = this.makeNode("rect");
944
- this.applyStrokeOpts(node, strokeOptions);
945
- node.setAttribute("x", `${this._x(position.x)}`);
946
- node.setAttribute("y", `${this._y(position.y)}`);
947
- node.setAttribute("width", `${width * this.scale.x}`);
948
- node.setAttribute("height", `${height * this.scale.y}`);
949
- return this._bindFillDraw(node, "rect", color, lineWidth || 1);
950
- }
951
- /**
952
- * Draw a grid of horizontal and vertical lines with the given (CSS-) color.
953
- *
954
- * @method grid
955
- * @param {XYCoords} center - The center of the grid.
956
- * @param {number} width - The total width of the grid (width/2 each to the left and to the right).
957
- * @param {number} height - The total height of the grid (height/2 each to the top and to the bottom).
958
- * @param {number} sizeX - The horizontal grid size.
959
- * @param {number} sizeY - The vertical grid size.
960
- * @param {string} color - The CSS color to draw the grid with.
961
- * @return {void}
962
- * @instance
963
- * @memberof drawutilssvg
964
- */
965
- grid(center, width, height, sizeX, sizeY, color) {
966
- // console.log("grid");
967
- // const node: SVGElement = this.makeNode("pattern");
968
- // var patternId = "pattern_id_" + Math.floor(Math.random() * 65365);
969
- // node.setAttribute("id", patternId);
970
- // node.setAttribute("viewBox", `0,0,${sizeX},${sizeY}`);
971
- // node.setAttribute("width", `${sizeX}`);
972
- // node.setAttribute("height", `${sizeX}`);
973
- // var pattern: SVGElement = this.makeNode("path");
974
- // const d: SVGPathParams = [];
975
- // d.push("M", sizeX / 2.0, 0);
976
- // d.push("L", sizeX / 2.0, sizeY);
977
- // d.push("M", 0, sizeY / 2.0);
978
- // d.push("L", sizeX, sizeY / 2.0);
979
- // node.setAttribute("d", d.join(" "));
980
- // this.bufferedNodeDefs.append(pattern);
981
- // const fillNode: SVGElement = this.makeNode("rect");
982
- // // For some strange reason SVG rotation transforms use degrees instead of radians
983
- // // Note that the background does not scale with the zoom level (always covers full element)
984
- // fillNode.setAttribute("x", "0");
985
- // fillNode.setAttribute("y", "0");
986
- // fillNode.setAttribute("width", `${this.canvasSize.width}`);
987
- // fillNode.setAttribute("height", `${this.canvasSize.height}`);
988
- // fillNode.setAttribute("fill", `url(#${patternId})`);
989
- // return this._bindFillDraw(fillNode, "grid", "red", 1);
990
- const node = this.makeNode("path");
991
- const d = [];
992
- var yMin = -Math.ceil((height * 0.5) / sizeY) * sizeY;
993
- var yMax = height / 2;
994
- for (var x = -Math.ceil((width * 0.5) / sizeX) * sizeX; x < width / 2; x += sizeX) {
995
- d.push("M", this._x(center.x + x), this._y(center.y + yMin));
996
- d.push("L", this._x(center.x + x), this._y(center.y + yMax));
997
- }
998
- var xMin = -Math.ceil((width * 0.5) / sizeX) * sizeX;
999
- var xMax = width / 2;
1000
- for (var y = -Math.ceil((height * 0.5) / sizeY) * sizeY; y < height / 2; y += sizeY) {
1001
- d.push("M", this._x(center.x + xMin), this._y(center.y + y));
1002
- d.push("L", this._x(center.x + xMax), this._y(center.y + y));
1003
- }
1004
- node.setAttribute("d", d.join(" "));
1005
- return this._bindFillDraw(node, "grid", color, 1);
1006
- }
1007
- /**
1008
- * Draw a raster of crosshairs in the given grid.<br>
1009
- *
1010
- * This works analogue to the grid() function
1011
- *
1012
- * @method raster
1013
- * @param {XYCoords} center - The center of the raster.
1014
- * @param {number} width - The total width of the raster (width/2 each to the left and to the right).
1015
- * @param {number} height - The total height of the raster (height/2 each to the top and to the bottom).
1016
- * @param {number} sizeX - The horizontal raster size.
1017
- * @param {number} sizeY - The vertical raster size.
1018
- * @param {string} color - The CSS color to draw the raster with.
1019
- * @return {void}
1020
- * @instance
1021
- * @memberof drawutilssvg
1022
- */
1023
- raster(center, width, height, sizeX, sizeY, color) {
1024
- const node = this.makeNode("path");
1025
- const d = [];
1026
- for (var x = -Math.ceil((width * 0.5) / sizeX) * sizeX; x < width / 2; x += sizeX) {
1027
- for (var y = -Math.ceil((height * 0.5) / sizeY) * sizeY; y < height / 2; y += sizeY) {
1028
- // Draw a crosshair
1029
- d.push("M", this._x(center.x + x) - 4, this._y(center.y + y));
1030
- d.push("L", this._x(center.x + x) + 4, this._y(center.y + y));
1031
- d.push("M", this._x(center.x + x), this._y(center.y + y) - 4);
1032
- d.push("L", this._x(center.x + x), this._y(center.y + y) + 4);
1033
- }
1034
- }
1035
- node.setAttribute("d", d.join(" "));
1036
- return this._bindFillDraw(node, "raster", color, 1);
1037
- }
1038
- /**
1039
- * Draw a diamond handle (square rotated by 45°) with the given CSS color.
1040
- *
1041
- * It is an inherent featur of the handle functions that the drawn elements are not scaled and not
1042
- * distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn
1043
- * as even shaped diamonds.
1044
- *
1045
- * @method diamondHandle
1046
- * @param {XYCoords} center - The center of the diamond.
1047
- * @param {number} size - The x/y-size of the diamond.
1048
- * @param {string} color - The CSS color to draw the diamond with.
1049
- * @return {void}
1050
- * @instance
1051
- * @memberof drawutilssvg
1052
- */
1053
- diamondHandle(center, size, color) {
1054
- const node = this.makeNode("path");
1055
- const d = [
1056
- "M",
1057
- this._x(center.x) - size / 2.0,
1058
- this._y(center.y),
1059
- "L",
1060
- this._x(center.x),
1061
- this._y(center.y) - size / 2.0,
1062
- "L",
1063
- this._x(center.x) + size / 2.0,
1064
- this._y(center.y),
1065
- "L",
1066
- this._x(center.x),
1067
- this._y(center.y) + size / 2.0,
1068
- "Z"
1069
- ];
1070
- node.setAttribute("d", d.join(" "));
1071
- return this._bindFillDraw(node, "diamondHandle", color, 1);
1072
- }
1073
- /**
1074
- * Draw a square handle with the given CSS color.<br>
1075
- * <br>
1076
- * It is an inherent featur of the handle functions that the drawn elements are not scaled and not
1077
- * distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn
1078
- * as even shaped squares.
1079
- *
1080
- * @method squareHandle
1081
- * @param {XYCoords} center - The center of the square.
1082
- * @param {XYCoords} size - The x/y-size of the square.
1083
- * @param {string} color - The CSS color to draw the square with.
1084
- * @return {void}
1085
- * @instance
1086
- * @memberof drawutilssvg
1087
- */
1088
- squareHandle(center, size, color) {
1089
- const node = this.makeNode("rect");
1090
- node.setAttribute("x", `${this._x(center.x) - size / 2.0}`);
1091
- node.setAttribute("y", `${this._y(center.y) - size / 2.0}`);
1092
- node.setAttribute("width", `${size}`);
1093
- node.setAttribute("height", `${size}`);
1094
- return this._bindFillDraw(node, "squareHandle", color, 1);
1095
- }
1096
- /**
1097
- * Draw a circle handle with the given CSS color.<br>
1098
- * <br>
1099
- * It is an inherent featur of the handle functions that the drawn elements are not scaled and not
1100
- * distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn
1101
- * as even shaped circles.
1102
- *
1103
- * @method circleHandle
1104
- * @param {XYCoords} center - The center of the circle.
1105
- * @param {number} radius - The radius of the circle.
1106
- * @param {string} color - The CSS color to draw the circle with.
1107
- * @return {void}
1108
- * @instance
1109
- * @memberof drawutilssvg
1110
- */
1111
- circleHandle(center, radius, color) {
1112
- radius = radius || 3;
1113
- const node = this.makeNode("circle");
1114
- node.setAttribute("cx", `${this._x(center.x)}`);
1115
- node.setAttribute("cy", `${this._y(center.y)}`);
1116
- node.setAttribute("r", `${radius}`);
1117
- return this._bindFillDraw(node, "circleHandle", color, 1);
1118
- }
1119
- /**
1120
- * Draw a crosshair with given radius and color at the given position.<br>
1121
- * <br>
1122
- * Note that the crosshair radius will not be affected by scaling.
1123
- *
1124
- * @method crosshair
1125
- * @param {XYCoords} center - The center of the crosshair.
1126
- * @param {number} radius - The radius of the crosshair.
1127
- * @param {string} color - The CSS color to draw the crosshair with.
1128
- * @param {number=0.5} lineWidth - (optional, default=0.5) The line width to use.
1129
- * @return {void}
1130
- * @instance
1131
- * @memberof drawutilssvg
1132
- */
1133
- crosshair(center, radius, color, lineWidth) {
1134
- const node = this.makeNode("path");
1135
- const d = [
1136
- "M",
1137
- this._x(center.x) - radius,
1138
- this._y(center.y),
1139
- "L",
1140
- this._x(center.x) + radius,
1141
- this._y(center.y),
1142
- "M",
1143
- this._x(center.x),
1144
- this._y(center.y) - radius,
1145
- "L",
1146
- this._x(center.x),
1147
- this._y(center.y) + radius
1148
- ];
1149
- node.setAttribute("d", d.join(" "));
1150
- return this._bindFillDraw(node, "crosshair", color, lineWidth || 0.5);
1151
- }
1152
- /**
1153
- * Draw a cross with diagonal axes with given radius, color and lineWidth at the given position.<br>
1154
- * <br>
1155
- * Note that the x's radius will not be affected by scaling.
1156
- *
1157
- * @method crosshair
1158
- * @param {XYCoords} center - The center of the crosshair.
1159
- * @param {number} radius - The radius of the crosshair.
1160
- * @param {string} color - The CSS color to draw the crosshair with.
1161
- * @param {number=1} lineWidth - (optional, default=1.0) The line width to use.
1162
- * @return {void}
1163
- * @instance
1164
- * @memberof drawutils
1165
- */
1166
- cross(center, radius, color, lineWidth) {
1167
- const node = this.makeNode("path");
1168
- const d = [
1169
- "M",
1170
- this._x(center.x) - radius,
1171
- this._y(center.y) - radius,
1172
- "L",
1173
- this._x(center.x) + radius,
1174
- this._y(center.y) + radius,
1175
- "M",
1176
- this._x(center.x) - radius,
1177
- this._y(center.y) + radius,
1178
- "L",
1179
- this._x(center.x) + radius,
1180
- this._y(center.y) - radius
1181
- ];
1182
- node.setAttribute("d", d.join(" "));
1183
- return this._bindFillDraw(node, "cross", color, lineWidth || 1.0);
1184
- }
1185
- /**
1186
- * Draw a polygon.
1187
- *
1188
- * @method polygon
1189
- * @param {Polygon} polygon - The polygon to draw.
1190
- * @param {string} color - The CSS color to draw the polygon with.
1191
- * @param {number=} lineWidth - (optional) The line width to use; default is 1.
1192
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
1193
- * @return {void}
1194
- * @instance
1195
- * @memberof drawutilssvg
1196
- */
1197
- polygon(polygon, color, lineWidth, strokeOptions) {
1198
- return this.polyline(polygon.vertices, polygon.isOpen, color, lineWidth, strokeOptions);
1199
- }
1200
- /**
1201
- * Draw a polygon line (alternative function to the polygon).
1202
- *
1203
- * @method polyline
1204
- * @param {XYCoords[]} vertices - The polygon vertices to draw.
1205
- * @param {boolan} isOpen - If true the polyline will not be closed at its end.
1206
- * @param {string} color - The CSS color to draw the polygon with.
1207
- * @param {number=} lineWidth - (optional) The line width to use; default is 1.
1208
- * @param {StrokeOptions=} strokeOptions - (optional) Stroke settings to use.
1209
- *
1210
- * @return {void}
1211
- * @instance
1212
- * @memberof drawutilssvg
1213
- */
1214
- polyline(vertices, isOpen, color, lineWidth, strokeOptions) {
1215
- const node = this.makeNode("path");
1216
- this.applyStrokeOpts(node, strokeOptions);
1217
- if (vertices.length == 0) {
1218
- return node;
1219
- }
1220
- // Draw curve
1221
- const d = ["M", this._x(vertices[0].x), this._y(vertices[0].y)];
1222
- var n = vertices.length;
1223
- for (var i = 1; i < n; i++) {
1224
- d.push("L", this._x(vertices[i].x), this._y(vertices[i].y));
1225
- }
1226
- if (!isOpen)
1227
- d.push("Z");
1228
- node.setAttribute("d", d.join(" "));
1229
- return this._bindFillDraw(node, "polygon", color, lineWidth || 1);
1230
- }
1231
- /**
1232
- * Draw a text at the given relative position.
1233
- *
1234
- * @method text
1235
- * @param {string} text - The text to draw.
1236
- * @param {number} x - The x-position to draw the text at.
1237
- * @param {number} y - The y-position to draw the text at.
1238
- * @param {string=} options.color - The Color to use.
1239
- * @param {string=} options.fontFamily - The font family to use.
1240
- * @param {number=} options.fontSize - The font size (in pixels) to use.
1241
- * @param {FontStyle=} options.fontStyle - The font style to use.
1242
- * @param {FontWeight=} options.fontWeight - The font weight to use.
1243
- * @param {number=} options.lineHeight - The line height (in pixels) to use.
1244
- * @param {number=} options.rotation - The (optional) rotation in radians.
1245
- * @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"`.
1246
- * @return {void}
1247
- * @instance
1248
- * @memberof drawutils
1249
- */
1250
- text(text, x, y, options) {
1251
- var _a, _b, _c;
1252
- options = options || {};
1253
- const color = options.color || "black";
1254
- const lineHeight = ((_b = (_a = options.lineHeight) !== null && _a !== void 0 ? _a : options.fontSize) !== null && _b !== void 0 ? _b : 0) * this.scale.x;
1255
- // https://www.w3.org/TR/SVG/text.html#TextAnchorProperty
1256
- // start | middle | end
1257
- const textAlign = options.textAlign === "left" || options.textAlign === "start"
1258
- ? "start"
1259
- : options.textAlign === "center"
1260
- ? "middle"
1261
- : options.textAlign === "right" || options.textAlign === "end"
1262
- ? "end"
1263
- : "start";
1264
- const transformOrigin = `${this._x(x)}px ${this._y(y)}px`;
1265
- const translate = `translate(${this._x(x)} ${this._y(y) + lineHeight / 2})`;
1266
- // Safari has a transform-origin/rotation bug.
1267
- // It's essential to use rotate(r,x,y) here. "rotate(r)"" with transform-origin(x,y) won't do the job.
1268
- // And rotate and translate cannot be used is combination on a text object.
1269
- // So wrap the text inside a <g>, translate the <g>, and rotate the text inside.
1270
- const rotate = options.rotation ? `rotate(${options.rotation * RAD_TO_DEG} 0 0)` : ``;
1271
- const node = this.makeNode("g");
1272
- const curId = this.curId;
1273
- this.curId = curId + "_text";
1274
- const textNode = this.makeNode("text");
1275
- node.appendChild(textNode);
1276
- textNode.setAttribute("font-family", (_c = options.fontFamily) !== null && _c !== void 0 ? _c : ""); // May be undefined
1277
- textNode.setAttribute("font-size", options.fontSize ? `${options.fontSize * this.scale.x}` : "");
1278
- textNode.setAttribute("font-style", options.fontStyle ? `${options.fontStyle}` : "");
1279
- textNode.setAttribute("font-weight", options.fontWeight ? `${options.fontWeight}` : "");
1280
- textNode.setAttribute("text-anchor", textAlign);
1281
- textNode.setAttribute("transform-origin", "0 0");
1282
- textNode.setAttribute("transform", rotate);
1283
- node.setAttribute("transform-origin", transformOrigin);
1284
- node.setAttribute("transform", translate);
1285
- textNode.innerHTML = text;
1286
- // Restore old ID
1287
- this.curId = curId;
1288
- return this._bindFillDraw(node, "text", color, 1);
1289
- }
1290
- /**
1291
- * Draw a non-scaling text label at the given position.
1292
- *
1293
- * @method label
1294
- * @param {string} text - The text to draw.
1295
- * @param {number} x - The x-position to draw the text at.
1296
- * @param {number} y - The y-position to draw the text at.
1297
- * @param {number=} rotation - The (optional) rotation in radians.
1298
- * @param {string="black"} color - The color to use (default is black).
1299
- * @return {void}
1300
- * @instance
1301
- * @memberof drawutilssvg
1302
- */
1303
- label(text, x, y, rotation, color) {
1304
- const node = this.makeNode("text");
1305
- // For some strange reason SVG rotation transforms use degrees instead of radians
1306
- node.setAttribute("transform", `translate(${x},${y}), rotate(${((rotation || 0) / Math.PI) * 180})`);
1307
- node.setAttribute("font-family", "Arial");
1308
- node.setAttribute("font-size", "9pt");
1309
- node.setAttribute("font-style", "normal");
1310
- node.setAttribute("font-weight", "lighter");
1311
- node.innerHTML = text;
1312
- return this._bindFillDraw(node, "label", color || "black", null);
1313
- }
1314
- /**
1315
- * Draw an SVG-like path given by the specified path data.
1316
- *
1317
- * @method path
1318
- * @param {SVGPathData} pathData - An array of path commands and params.
1319
- * @param {string=null} color - (optional) The color to draw this path with (default is null).
1320
- * @param {number=1} lineWidth - (optional) the line width to use (default is 1).
1321
- * @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.
1322
- * @param {number=} options.dashOffset - (optional) `See StrokeOptions`.
1323
- * @param {number=[]} options.dashArray - (optional) `See StrokeOptions`.
1324
- *
1325
- * @instance
1326
- * @memberof drawutils
1327
- * @return {R} An instance representing the drawn path.
1328
- */
1329
- path(pathData, color, lineWidth, options) {
1330
- const node = this.makeNode("path");
1331
- this.applyStrokeOpts(node, options);
1332
- // Transform the path: in-place (fast) or copy (slower)
1333
- const d = options && options.inplace ? pathData : drawutilssvg.copyPathData(pathData);
1334
- drawutilssvg.transformPathData(d, this.offset, this.scale);
1335
- node.setAttribute("d", d.join(" "));
1336
- return this._bindFillDraw(node, "path", color, lineWidth);
1337
- }
1338
- /**
1339
- * Due to gl compatibility there is a generic 'clear' function required
1340
- * to avoid accessing the context object itself directly.
1341
- *
1342
- * This function just fills the whole canvas with a single color.
1343
- *
1344
- * @param {string} color - The color to clear with.
1345
- * @return {void}
1346
- * @instance
1347
- * @memberof drawutilssvg
1348
- **/
1349
- clear(color) {
1350
- // If this isn't the primary handler then do not remove anything here.
1351
- // The primary handler will do that (no double work).
1352
- if (this.isSecondary) {
1353
- return;
1354
- }
1355
- // Add a covering rect with the given background color
1356
- this.curId = "background";
1357
- this.curClassName = null; // undefined;
1358
- const node = this.makeNode("rect");
1359
- // For some strange reason SVG rotation transforms use degrees instead of radians
1360
- // Note that the background does not scale with the zoom level (always covers full element)
1361
- node.setAttribute("x", "0");
1362
- node.setAttribute("y", "0");
1363
- node.setAttribute("width", `${this.canvasSize.width}`);
1364
- node.setAttribute("height", `${this.canvasSize.height}`);
1365
- // Bind this special element into the document
1366
- this._bindFillDraw(node, this.curId, null, null);
1367
- node.setAttribute("fill", typeof color === "undefined" ? "none" : color);
1368
- // Clear the current ID again
1369
- this.curId = null; // undefined;
1370
- }
1371
- /**
1372
- * A private helper function to clear all SVG nodes from the &gt;g> node.
1373
- *
1374
- * @private
1375
- */
1376
- removeAllChildNodes() {
1377
- while (this.bufferGNode.lastChild) {
1378
- this.bufferGNode.removeChild(this.bufferGNode.lastChild);
1379
- }
1380
- while (this.bufferedNodeDefs.lastChild) {
1381
- this.bufferedNodeDefs.removeChild(this.bufferedNodeDefs.lastChild);
1382
- }
1383
- }
1384
- /**
1385
- * Create a new and empty `SVGElement` &lt;svg&gt; in the svg-namespace.
1386
- *
1387
- * @name createSvg
1388
- * @static
1389
- * @memberof drawutilssvg
1390
- * @return SVGElement
1391
- */
1392
- static createSvg() {
1393
- return document.createElementNS("http://www.w3.org/2000/svg", "svg");
1394
- }
1395
- /**
1396
- * Create a copy of the given path data. As path data only consists of strings and numbers,
1397
- * the copy will be shallow by definition.
1398
- *
1399
- * @name copyPathData
1400
- * @static
1401
- * @memberof drawutilssvg
1402
- */
1403
- static copyPathData(data) {
1404
- const copy = new Array(data.length);
1405
- for (var i = 0, n = data.length; i < n; i++) {
1406
- copy[i] = data[i];
1407
- }
1408
- return copy;
1409
- }
1410
- /**
1411
- * Transform the given path data (translate and scale. rotating is not intended here).
1412
- *
1413
- * @name transformPathData
1414
- * @static
1415
- * @memberof drawutilssvg
1416
- * @param {SVGPathParams} data - The data to transform.
1417
- * @param {XYCoords} offset - The translation offset (neutral is x=0, y=0).
1418
- * @param {XYCoords} scale - The scale factors (neutral is x=1, y=1).
1419
- */
1420
- static transformPathData(data, offset, scale) {
1421
- // Scale and translate {x,y}
1422
- const _stx = (index) => {
1423
- data[index] = offset.x + scale.x * Number(data[index]);
1424
- };
1425
- const _sty = (index) => {
1426
- data[index] = offset.y + scale.y * Number(data[index]);
1427
- };
1428
- // scale only {x,y}
1429
- const _sx = (index) => {
1430
- data[index] = scale.x * Number(data[index]);
1431
- };
1432
- const _sy = (index) => {
1433
- data[index] = scale.y * Number(data[index]);
1434
- };
1435
- var i = 0;
1436
- var lastPoint = { x: NaN, y: NaN };
1437
- // "save last point"
1438
- var _slp = (index) => {
1439
- lastPoint.x = Number(data[index]);
1440
- lastPoint.y = Number(data[index + 1]);
1441
- };
1442
- while (i < data.length) {
1443
- const cmd = data[i];
1444
- switch (cmd) {
1445
- case "M":
1446
- // MoveTo: M|m x y
1447
- case "L":
1448
- // LineTo L|l x y
1449
- case "T":
1450
- // Shorthand/smooth quadratic Bézier curveto: T|t x y
1451
- _stx(i + 1);
1452
- _sty(i + 2);
1453
- _slp(i + 1);
1454
- i += 3;
1455
- break;
1456
- case "m":
1457
- // MoveTo: M|m x y
1458
- case "l":
1459
- // LineTo L|l x y
1460
- case "t":
1461
- // Shorthand/smooth quadratic Bézier curveto: T|t x y
1462
- _sx(i + 1);
1463
- _sy(i + 2);
1464
- _slp(i + 1);
1465
- i += 3;
1466
- break;
1467
- case "H":
1468
- // HorizontalLineTo: H|h x
1469
- _stx(i + 1);
1470
- lastPoint.x = Number(data[i + 1]);
1471
- i += 2;
1472
- break;
1473
- case "h":
1474
- // HorizontalLineTo: H|h x
1475
- _sx(i + 1);
1476
- lastPoint.x = Number(data[i + 1]);
1477
- i += 2;
1478
- break;
1479
- case "V":
1480
- // VerticalLineTo: V|v y
1481
- _sty(i + 1);
1482
- lastPoint.y = Number(data[i + 1]);
1483
- i += 2;
1484
- break;
1485
- case "v":
1486
- // VerticalLineTo: V|v y
1487
- _sy(i + 1);
1488
- lastPoint.y = Number(data[i + 1]);
1489
- i += 2;
1490
- break;
1491
- case "C":
1492
- // CurveTo: C|c x1 y1 x2 y2 x y
1493
- _stx(i + 1);
1494
- _sty(i + 2);
1495
- _stx(i + 3);
1496
- _sty(i + 4);
1497
- _stx(i + 5);
1498
- _sty(i + 6);
1499
- _slp(i + 5);
1500
- i += 7;
1501
- break;
1502
- case "c":
1503
- // CurveTo: C|c x1 y1 x2 y2 x y
1504
- _sx(i + 1);
1505
- _sy(i + 2);
1506
- _sx(i + 3);
1507
- _sy(i + 4);
1508
- _sx(i + 5);
1509
- _sy(i + 6);
1510
- _slp(i + 5);
1511
- i += 7;
1512
- break;
1513
- case "S":
1514
- case "Q":
1515
- // Shorthand-/SmoothCurveTo: S|s x2 y2 x y
1516
- // QuadraticCurveTo: Q|q x1 y1 x y
1517
- _stx(i + 1);
1518
- _sty(i + 2);
1519
- _stx(i + 3);
1520
- _sty(i + 4);
1521
- _slp(i + 3);
1522
- i += 5;
1523
- break;
1524
- case "s":
1525
- case "q":
1526
- // Shorthand-/SmoothCurveTo: S|s x2 y2 x y
1527
- // QuadraticCurveTo: Q|q x1 y1 x y
1528
- _sx(i + 1);
1529
- _sy(i + 2);
1530
- _sx(i + 3);
1531
- _sy(i + 4);
1532
- _slp(i + 3);
1533
- i += 5;
1534
- break;
1535
- case "A":
1536
- // EllipticalArcTo: A|a rx ry x-axis-rotation large-arc-flag sweep-flag x y
1537
- // Uniform scale: just scale
1538
- // NOTE: here is something TODO
1539
- // * if scalex!=scaleY this won't work
1540
- // * Arcs have to be converted to Bézier curves here in that case
1541
- _sx(i + 1);
1542
- _sy(i + 2);
1543
- _stx(i + 6);
1544
- _sty(i + 7);
1545
- _slp(i + 6);
1546
- // Update the arc flag when x _or_ y scale is negative
1547
- if ((scale.x < 0 && scale.y >= 0) || (scale.x >= 0 && scale.y < 0)) {
1548
- data[i + 5] = data[i + 5] ? 0 : 1;
1549
- }
1550
- i += 8;
1551
- break;
1552
- case "a":
1553
- // EllipticalArcTo: A|a rx ry x-axis-rotation large-arc-flag sweep-flag x y
1554
- _sx(i + 1);
1555
- _sy(i + 2);
1556
- _sx(i + 6);
1557
- _sy(i + 7);
1558
- _slp(i + 6);
1559
- i += 8;
1560
- break;
1561
- case "z":
1562
- case "Z":
1563
- // ClosePath: Z|z (no arguments)
1564
- // lastPoint.x = firstPoint.x;
1565
- // lastPoint.y = firstPoint.y;
1566
- i++;
1567
- break;
1568
- // Safepoint: continue reading token by token until something is recognized again
1569
- default:
1570
- i++;
1571
- }
1572
- } // END while
1573
- } // END transformPathData
1574
- static nodeSupportsLineDash(nodeName) {
1575
- return ["line", "path", "circle", "ellipse", "rectangle", "rect"].includes(nodeName);
1576
- }
1577
- static nodeSupportsLineJoin(nodeName) {
1578
- return ["line", "path", "circle", "ellipse", "rectangle", "rect"].includes(nodeName);
1579
- }
1580
- /**
1581
- * Creates a basic <line> node with start and end coordinates. The created node will not
1582
- * be bound to any root node.
1583
- *
1584
- * @private
1585
- * @method makeLineNode
1586
- * @param {XYCoords} zA - The line's start position.
1587
- * @param {XYCoords} zB - The line's start position.
1588
- * @param {string} color - The CSS color to draw the point with.
1589
- * @param {number=1} lineWidth - (optional) The line width to use.
1590
- * @param {StrokeOptions=} strokeOptions - (optional) Additional stroke options to use.
1591
- * @param {string=} classNameOverride - (optional) If nothing is passed the default classname 'path' will be used.
1592
- * @return {SVGLineElement}
1593
- * @instance
1594
- * @memberof drawutilssvg
1595
- */
1596
- makeLineNode(zA, zB, color, lineWidth, strokeOptions, classNameOverride) {
1597
- const line = this.makeNode("line");
1598
- line.setAttribute("x1", `${this._x(zA.x)}`);
1599
- line.setAttribute("y1", `${this._y(zA.y)}`);
1600
- line.setAttribute("x2", `${this._x(zB.x)}`);
1601
- line.setAttribute("y2", `${this._y(zB.y)}`);
1602
- this._configureNode(line, classNameOverride !== null && classNameOverride !== void 0 ? classNameOverride : "line", this.fillShapes, color, lineWidth || 1, strokeOptions);
1603
- return line;
1604
- }
1605
- /**
1606
- * Creates a basic <path> node with given path string data. The created node will not
1607
- * be bound to any root node.
1608
- *
1609
- * @private
1610
- * @method makePathNode
1611
- * @param {string} pathString - The path data (must be a valid path data string).
1612
- * @param {string} color - The CSS color to draw the point with.
1613
- * @param {number=1} lineWidth - (optional) The line width to use.
1614
- * @param {StrokeOptions=} strokeOptions - (optional) Additional stroke options to use.
1615
- * @param {string=} classNameOverride - (optional) If nothing is passed the default classname 'path' will be used.
1616
- * @return {SVGPathElement}
1617
- * @instance
1618
- * @memberof drawutilssvg
1619
- */
1620
- makePathNode(pathString, color, lineWidth, strokeOptions, classNameOverride) {
1621
- const path = this.makeNode("path");
1622
- path.setAttribute("d", pathString);
1623
- this._configureNode(path, classNameOverride !== null && classNameOverride !== void 0 ? classNameOverride : "path", this.fillShapes, color, lineWidth || 1, strokeOptions);
1624
- return path;
1625
- }
1626
- /**
1627
- * Creates a basic arrow head node (<path> node) at the end of the given line coordinates. The created node will not
1628
- * be bound to any root node.
1629
- *
1630
- * @private
1631
- * @method makeArrowHeadNode
1632
- * @param {string} pathString - The path data (must be a valid path data string).
1633
- * @param {string} color - The CSS color to draw the point with.
1634
- * @param {number=1} lineWidth - (optional) The line width to use.
1635
- * @param {number=8} headLength - (optional) The length of the arrow head; if none is specified then the head will be 8 absolute units long.
1636
- * @param {StrokeOptions=} strokeOptions - (optional) Additional stroke options to use.
1637
- * @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.
1638
- * @return {SVGPathElement}
1639
- * @instance
1640
- * @memberof drawutilssvg
1641
- */
1642
- makeArrowHeadNode(zA, zB, color, lineWidth, headLength = 8, strokeOptions, arrowHeadBasePositionBuffer) {
1643
- var vertices = Vector_1.Vector.utils.buildArrowHead(zA, zB, headLength, this.scale.x, this.scale.y);
1644
- const d = ["M", this.offset.x + vertices[0].x, this.offset.y + vertices[0].y];
1645
- if (arrowHeadBasePositionBuffer) {
1646
- arrowHeadBasePositionBuffer.x = vertices[0].x / this.scale.x;
1647
- arrowHeadBasePositionBuffer.y = vertices[0].y / this.scale.y;
1648
- }
1649
- for (var i = 1; i <= vertices.length; i++) {
1650
- d.push("L");
1651
- // Note: only use offset here (the vertices are already scaled)
1652
- d.push(this.offset.x + vertices[i % vertices.length].x);
1653
- d.push(this.offset.y + vertices[i % vertices.length].y);
1654
- }
1655
- const node = this.makePathNode(d.join(" "), color, lineWidth, strokeOptions, "arrowhead");
1656
- return node;
1657
- }
1658
- /**
1659
- * Creates a basic cubic Bézier path node (<path> node) with the given cubic Bézier data. The created node will not
1660
- * be bound to any root node.
1661
- *
1662
- * @private
1663
- * @method makeCubicBezierNode
1664
- * @param {XYCoords} startPoint - The start point of the cubic Bézier curve
1665
- * @param {XYCoords} endPoint - The end point the cubic Bézier curve.
1666
- * @param {XYCoords} startControlPoint - The start control point the cubic Bézier curve.
1667
- * @param {XYCoords} endControlPoint - The end control point the cubic Bézier curve.
1668
- * @param {string} color - The CSS color to draw the point with.
1669
- * @param {number=1} lineWidth - (optional) The line width to use.
1670
- * @param {StrokeOptions=} strokeOptions - (optional) Additional stroke options to use.
1671
- * @param {string=} classNameOverride - (optional) If nothing is passed the default classname 'path' will be used.
1672
- * @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.
1673
- * @return {SVGPathElement}
1674
- * @instance
1675
- * @memberof drawutilssvg
1676
- */
1677
- makeCubicBezierNode(startPoint, endPoint, startControlPoint, endControlPoint, color, lineWidth, strokeOptions) {
1678
- if (startPoint instanceof CubicBezierCurve_1.CubicBezierCurve) {
1679
- return this.cubicBezier(startPoint.startPoint, startPoint.endPoint, startPoint.startControlPoint, startPoint.endControlPoint, color, lineWidth);
1680
- }
1681
- // Draw curve
1682
- const d = [
1683
- "M",
1684
- this._x(startPoint.x),
1685
- this._y(startPoint.y),
1686
- "C",
1687
- this._x(startControlPoint.x),
1688
- this._y(startControlPoint.y),
1689
- this._x(endControlPoint.x),
1690
- this._y(endControlPoint.y),
1691
- this._x(endPoint.x),
1692
- this._y(endPoint.y)
1693
- ];
1694
- const node = this.makePathNode(d.join(" "), color, lineWidth, strokeOptions, "cubicBezier");
1695
- return node;
1696
- }
1697
- }
1698
- exports.drawutilssvg = drawutilssvg;
1699
- drawutilssvg.HEAD_XML = [
1700
- '<?xml version="1.0" encoding="UTF-8" standalone="no"?>',
1701
- '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" ',
1702
- ' "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">',
1703
- ""
1704
- ].join("\n");
1705
- //# sourceMappingURL=drawutilssvg.js.map