plotboilerplate 1.28.0 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1087) hide show
  1. package/README.md +8 -0
  2. package/dist/index.esm.js +335 -39
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.esm.min.js +1 -1
  5. package/dist/index.esm.min.js.map +1 -1
  6. package/dist/plotboilerplate.browser.min.js +1 -1
  7. package/dist/plotboilerplate.browser.min.js.map +1 -1
  8. package/dist/plotboilerplate.js +335 -37
  9. package/dist/plotboilerplate.min.js +1 -1
  10. package/package.json +1 -1
  11. package/src/cjs/Circle.d.ts +70 -3
  12. package/src/cjs/Circle.js +159 -4
  13. package/src/cjs/Circle.js.map +1 -1
  14. package/src/cjs/Triangle.d.ts +40 -4
  15. package/src/cjs/Triangle.js +127 -31
  16. package/src/cjs/Triangle.js.map +1 -1
  17. package/src/cjs/VertTuple.d.ts +4 -1
  18. package/src/cjs/VertTuple.js +6 -1
  19. package/src/cjs/VertTuple.js.map +1 -1
  20. package/src/cjs/Vertex.d.ts +25 -2
  21. package/src/cjs/Vertex.js +43 -1
  22. package/src/cjs/Vertex.js.map +1 -1
  23. package/src/cjs/utils/algorithms/minimalContainingCircleFromPoints.d.ts +21 -0
  24. package/src/cjs/utils/algorithms/minimalContainingCircleFromPoints.js +73 -0
  25. package/src/cjs/utils/algorithms/minimalContainingCircleFromPoints.js.map +1 -0
  26. package/src/cjs/utils/algorithms/minimalEnclosingCircleFromPoints.d.ts +21 -0
  27. package/src/cjs/utils/algorithms/minimalEnclosingCircleFromPoints.js +73 -0
  28. package/src/cjs/utils/algorithms/minimalEnclosingCircleFromPoints.js.map +1 -0
  29. package/src/cjs/utils/algorithms/pointsMinimalContainingCircle.d.ts +21 -0
  30. package/src/cjs/utils/algorithms/pointsMinimalContainingCircle.js +73 -0
  31. package/src/cjs/utils/algorithms/pointsMinimalContainingCircle.js.map +1 -0
  32. package/src/cjs/utils/algorithms/solveApollonius3.d.ts +69 -0
  33. package/src/cjs/utils/algorithms/solveApollonius3.js +118 -0
  34. package/src/cjs/utils/algorithms/solveApollonius3.js.map +1 -0
  35. package/src/esm/Circle.d.ts +70 -3
  36. package/src/esm/Circle.js +159 -4
  37. package/src/esm/Circle.js.map +1 -1
  38. package/src/esm/Triangle.d.ts +40 -4
  39. package/src/esm/Triangle.js +128 -32
  40. package/src/esm/Triangle.js.map +1 -1
  41. package/src/esm/VertTuple.d.ts +4 -1
  42. package/src/esm/VertTuple.js +6 -1
  43. package/src/esm/VertTuple.js.map +1 -1
  44. package/src/esm/Vertex.d.ts +25 -2
  45. package/src/esm/Vertex.js +44 -2
  46. package/src/esm/Vertex.js.map +1 -1
  47. package/src/esm/utils/algorithms/minimalContainingCircleFromPoints.d.ts +21 -0
  48. package/src/esm/utils/algorithms/minimalContainingCircleFromPoints.js +69 -0
  49. package/src/esm/utils/algorithms/minimalContainingCircleFromPoints.js.map +1 -0
  50. package/src/esm/utils/algorithms/minimalEnclosingCircleFromPoints.d.ts +21 -0
  51. package/src/esm/utils/algorithms/minimalEnclosingCircleFromPoints.js +69 -0
  52. package/src/esm/utils/algorithms/minimalEnclosingCircleFromPoints.js.map +1 -0
  53. package/src/esm/utils/algorithms/pointsMinimalContainingCircle.d.ts +21 -0
  54. package/src/esm/utils/algorithms/pointsMinimalContainingCircle.js +69 -0
  55. package/src/esm/utils/algorithms/pointsMinimalContainingCircle.js.map +1 -0
  56. package/src/esm/utils/algorithms/solveApollonius3.d.ts +69 -0
  57. package/src/esm/utils/algorithms/solveApollonius3.js +114 -0
  58. package/src/esm/utils/algorithms/solveApollonius3.js.map +1 -0
  59. package/src/index-gl.js +5 -2
  60. package/src/index.js +25 -17
  61. package/src/ts/Circle.ts +178 -5
  62. package/src/ts/Triangle.ts +148 -41
  63. package/src/ts/VertTuple.ts +14 -1
  64. package/src/ts/Vertex.ts +44 -2
  65. package/src/ts/utils/algorithms/minimalEnclosingCircleFromPoints.ts +69 -0
  66. package/src/ts/utils/algorithms/solveApollonius3.ts +132 -0
  67. package/src/_cjs/BezierPath.d.ts +0 -610
  68. package/src/_cjs/BezierPath.js +0 -1127
  69. package/src/_cjs/BezierPath.js.map +0 -1
  70. package/src/_cjs/Bounds.d.ts +0 -252
  71. package/src/_cjs/Bounds.js +0 -320
  72. package/src/_cjs/Bounds.js.map +0 -1
  73. package/src/_cjs/Circle.d.ts +0 -214
  74. package/src/_cjs/Circle.js +0 -339
  75. package/src/_cjs/Circle.js.map +0 -1
  76. package/src/_cjs/CircleSector.d.ts +0 -211
  77. package/src/_cjs/CircleSector.js +0 -364
  78. package/src/_cjs/CircleSector.js.map +0 -1
  79. package/src/_cjs/CubicBezierCurve.d.ts +0 -656
  80. package/src/_cjs/CubicBezierCurve.js +0 -1062
  81. package/src/_cjs/CubicBezierCurve.js.map +0 -1
  82. package/src/_cjs/Grid.d.ts +0 -83
  83. package/src/_cjs/Grid.js +0 -90
  84. package/src/_cjs/Grid.js.map +0 -1
  85. package/src/_cjs/KeyHandler.d.ts +0 -177
  86. package/src/_cjs/KeyHandler.js +0 -435
  87. package/src/_cjs/KeyHandler.js.map +0 -1
  88. package/src/_cjs/Line.d.ts +0 -134
  89. package/src/_cjs/Line.js +0 -220
  90. package/src/_cjs/Line.js.map +0 -1
  91. package/src/_cjs/MouseHandler.d.ts +0 -283
  92. package/src/_cjs/MouseHandler.js +0 -423
  93. package/src/_cjs/MouseHandler.js.map +0 -1
  94. package/src/_cjs/PBImage.d.ts +0 -81
  95. package/src/_cjs/PBImage.js +0 -61
  96. package/src/_cjs/PBImage.js.map +0 -1
  97. package/src/_cjs/PBText.d.ts +0 -118
  98. package/src/_cjs/PBText.js +0 -63
  99. package/src/_cjs/PBText.js.map +0 -1
  100. package/src/_cjs/PlotBoilerplate.d.ts +0 -899
  101. package/src/_cjs/PlotBoilerplate.js +0 -2348
  102. package/src/_cjs/PlotBoilerplate.js.map +0 -1
  103. package/src/_cjs/Polygon.d.ts +0 -520
  104. package/src/_cjs/Polygon.js +0 -933
  105. package/src/_cjs/Polygon.js.map +0 -1
  106. package/src/_cjs/SVGBuilder.d.ts +0 -47
  107. package/src/_cjs/SVGBuilder.js +0 -100
  108. package/src/_cjs/SVGBuilder.js.map +0 -1
  109. package/src/_cjs/Triangle.d.ts +0 -392
  110. package/src/_cjs/Triangle.js +0 -497
  111. package/src/_cjs/Triangle.js.map +0 -1
  112. package/src/_cjs/UIDGenerator.d.ts +0 -12
  113. package/src/_cjs/UIDGenerator.js +0 -21
  114. package/src/_cjs/UIDGenerator.js.map +0 -1
  115. package/src/_cjs/VEllipse.d.ts +0 -319
  116. package/src/_cjs/VEllipse.js +0 -578
  117. package/src/_cjs/VEllipse.js.map +0 -1
  118. package/src/_cjs/VEllipseSector.d.ts +0 -230
  119. package/src/_cjs/VEllipseSector.js +0 -428
  120. package/src/_cjs/VEllipseSector.js.map +0 -1
  121. package/src/_cjs/Vector.d.ts +0 -126
  122. package/src/_cjs/Vector.js +0 -199
  123. package/src/_cjs/Vector.js.map +0 -1
  124. package/src/_cjs/VertTuple.d.ts +0 -284
  125. package/src/_cjs/VertTuple.js +0 -348
  126. package/src/_cjs/VertTuple.js.map +0 -1
  127. package/src/_cjs/Vertex.d.ts +0 -498
  128. package/src/_cjs/Vertex.js +0 -703
  129. package/src/_cjs/Vertex.js.map +0 -1
  130. package/src/_cjs/VertexAttr.d.ts +0 -72
  131. package/src/_cjs/VertexAttr.js +0 -59
  132. package/src/_cjs/VertexAttr.js.map +0 -1
  133. package/src/_cjs/VertexListeners.d.ts +0 -208
  134. package/src/_cjs/VertexListeners.js +0 -267
  135. package/src/_cjs/VertexListeners.js.map +0 -1
  136. package/src/_cjs/draw.d.ts +0 -657
  137. package/src/_cjs/draw.js +0 -1164
  138. package/src/_cjs/draw.js.map +0 -1
  139. package/src/_cjs/drawgl.d.ts +0 -544
  140. package/src/_cjs/drawgl.js +0 -794
  141. package/src/_cjs/drawgl.js.map +0 -1
  142. package/src/_cjs/drawutilssvg.d.ts +0 -954
  143. package/src/_cjs/drawutilssvg.js +0 -1713
  144. package/src/_cjs/drawutilssvg.js.map +0 -1
  145. package/src/_cjs/entry-glsupport.js +0 -28
  146. package/src/_cjs/entry.js +0 -29
  147. package/src/_cjs/geomutils.d.ts +0 -77
  148. package/src/_cjs/geomutils.js +0 -126
  149. package/src/_cjs/geomutils.js.map +0 -1
  150. package/src/_cjs/index.d.ts +0 -102
  151. package/src/_cjs/index.js +0 -128
  152. package/src/_cjs/index.js.map +0 -1
  153. package/src/_cjs/interfaces/DrawLib.d.ts +0 -582
  154. package/src/_cjs/interfaces/DrawLib.js +0 -32
  155. package/src/_cjs/interfaces/DrawLib.js.map +0 -1
  156. package/src/_cjs/interfaces/additionals.d.ts +0 -95
  157. package/src/_cjs/interfaces/additionals.js +0 -3
  158. package/src/_cjs/interfaces/additionals.js.map +0 -1
  159. package/src/_cjs/interfaces/core.d.ts +0 -286
  160. package/src/_cjs/interfaces/core.js +0 -30
  161. package/src/_cjs/interfaces/core.js.map +0 -1
  162. package/src/_cjs/interfaces/externals.d.ts +0 -56
  163. package/src/_cjs/interfaces/externals.js +0 -8
  164. package/src/_cjs/interfaces/externals.js.map +0 -1
  165. package/src/_cjs/interfaces/index.d.ts +0 -4
  166. package/src/_cjs/interfaces/index.js +0 -21
  167. package/src/_cjs/interfaces/index.js.map +0 -1
  168. package/src/_cjs/module.d.ts +0 -26
  169. package/src/_cjs/module.js +0 -60
  170. package/src/_cjs/module.js.map +0 -1
  171. package/src/_cjs/utils/InitializationObserver.d.ts +0 -18
  172. package/src/_cjs/utils/InitializationObserver.js +0 -63
  173. package/src/_cjs/utils/InitializationObserver.js.map +0 -1
  174. package/src/_cjs/utils/LissajousFigure.d.ts +0 -34
  175. package/src/_cjs/utils/LissajousFigure.js +0 -100
  176. package/src/_cjs/utils/LissajousFigure.js.map +0 -1
  177. package/src/_cjs/utils/NGons.d.ts +0 -13
  178. package/src/_cjs/utils/NGons.js +0 -36
  179. package/src/_cjs/utils/NGons.js.map +0 -1
  180. package/src/_cjs/utils/Params.d.ts +0 -17
  181. package/src/_cjs/utils/Params.js +0 -53
  182. package/src/_cjs/utils/Params.js.map +0 -1
  183. package/src/_cjs/utils/PerlinNoise.d.ts +0 -19
  184. package/src/_cjs/utils/PerlinNoise.js +0 -352
  185. package/src/_cjs/utils/PerlinNoise.js.map +0 -1
  186. package/src/_cjs/utils/SVGPathUtils.d.ts +0 -22
  187. package/src/_cjs/utils/SVGPathUtils.js +0 -45
  188. package/src/_cjs/utils/SVGPathUtils.js.map +0 -1
  189. package/src/_cjs/utils/WebColors.d.ts +0 -35
  190. package/src/_cjs/utils/WebColors.js +0 -58
  191. package/src/_cjs/utils/WebColors.js.map +0 -1
  192. package/src/_cjs/utils/WebColorsContrast.d.ts +0 -6
  193. package/src/_cjs/utils/WebColorsContrast.js +0 -12
  194. package/src/_cjs/utils/WebColorsContrast.js.map +0 -1
  195. package/src/_cjs/utils/WebColorsMalachite.d.ts +0 -12
  196. package/src/_cjs/utils/WebColorsMalachite.js +0 -28
  197. package/src/_cjs/utils/WebColorsMalachite.js.map +0 -1
  198. package/src/_cjs/utils/_gup.js_ +0 -13
  199. package/src/_cjs/utils/algorithms/CatmullRomPath.d.ts +0 -60
  200. package/src/_cjs/utils/algorithms/CatmullRomPath.js +0 -108
  201. package/src/_cjs/utils/algorithms/CatmullRomPath.js.map +0 -1
  202. package/src/_cjs/utils/algorithms/CircleIntersections.d.ts +0 -170
  203. package/src/_cjs/utils/algorithms/CircleIntersections.js +0 -310
  204. package/src/_cjs/utils/algorithms/CircleIntersections.js.map +0 -1
  205. package/src/_cjs/utils/algorithms/ContourLineDetection.d.ts +0 -150
  206. package/src/_cjs/utils/algorithms/ContourLineDetection.js +0 -367
  207. package/src/_cjs/utils/algorithms/ContourLineDetection.js.map +0 -1
  208. package/src/_cjs/utils/algorithms/CubicSplinePath.d.ts +0 -63
  209. package/src/_cjs/utils/algorithms/CubicSplinePath.js +0 -175
  210. package/src/_cjs/utils/algorithms/CubicSplinePath.js.map +0 -1
  211. package/src/_cjs/utils/algorithms/HobbyPath.d.ts +0 -81
  212. package/src/_cjs/utils/algorithms/HobbyPath.js +0 -278
  213. package/src/_cjs/utils/algorithms/HobbyPath.js.map +0 -1
  214. package/src/_cjs/utils/algorithms/Metaballs.d.ts +0 -30
  215. package/src/_cjs/utils/algorithms/Metaballs.js +0 -114
  216. package/src/_cjs/utils/algorithms/Metaballs.js.map +0 -1
  217. package/src/_cjs/utils/algorithms/PolygonInset.d.ts +0 -184
  218. package/src/_cjs/utils/algorithms/PolygonInset.js +0 -431
  219. package/src/_cjs/utils/algorithms/PolygonInset.js.map +0 -1
  220. package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
  221. package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.js +0 -269
  222. package/src/_cjs/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
  223. package/src/_cjs/utils/algorithms/arrayFill.d.ts +0 -8
  224. package/src/_cjs/utils/algorithms/arrayFill.js +0 -18
  225. package/src/_cjs/utils/algorithms/arrayFill.js.map +0 -1
  226. package/src/_cjs/utils/algorithms/arrayResize.d.ts +0 -8
  227. package/src/_cjs/utils/algorithms/arrayResize.js +0 -24
  228. package/src/_cjs/utils/algorithms/arrayResize.js.map +0 -1
  229. package/src/_cjs/utils/algorithms/arrayShuffle.d.ts +0 -8
  230. package/src/_cjs/utils/algorithms/arrayShuffle.js +0 -15
  231. package/src/_cjs/utils/algorithms/arrayShuffle.js.map +0 -1
  232. package/src/_cjs/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
  233. package/src/_cjs/utils/algorithms/clearDuplicateVertices.js +0 -51
  234. package/src/_cjs/utils/algorithms/clearDuplicateVertices.js.map +0 -1
  235. package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
  236. package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.js +0 -61
  237. package/src/_cjs/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
  238. package/src/_cjs/utils/algorithms/convexHull.d.ts +0 -23
  239. package/src/_cjs/utils/algorithms/convexHull.js +0 -71
  240. package/src/_cjs/utils/algorithms/convexHull.js.map +0 -1
  241. package/src/_cjs/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
  242. package/src/_cjs/utils/algorithms/convexPolygonIncircle.js +0 -145
  243. package/src/_cjs/utils/algorithms/convexPolygonIncircle.js.map +0 -1
  244. package/src/_cjs/utils/algorithms/delaunay.d.ts +0 -30
  245. package/src/_cjs/utils/algorithms/delaunay.js +0 -158
  246. package/src/_cjs/utils/algorithms/delaunay.js.map +0 -1
  247. package/src/_cjs/utils/algorithms/delaunay2voronoi.d.ts +0 -25
  248. package/src/_cjs/utils/algorithms/delaunay2voronoi.js +0 -104
  249. package/src/_cjs/utils/algorithms/delaunay2voronoi.js.map +0 -1
  250. package/src/_cjs/utils/algorithms/detectPaths.d.ts +0 -21
  251. package/src/_cjs/utils/algorithms/detectPaths.js +0 -169
  252. package/src/_cjs/utils/algorithms/detectPaths.js.map +0 -1
  253. package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
  254. package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.js +0 -51
  255. package/src/_cjs/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
  256. package/src/_cjs/utils/algorithms/getContrastColor.d.ts +0 -13
  257. package/src/_cjs/utils/algorithms/getContrastColor.js +0 -26
  258. package/src/_cjs/utils/algorithms/getContrastColor.js.map +0 -1
  259. package/src/_cjs/utils/algorithms/matrixFill.d.ts +0 -10
  260. package/src/_cjs/utils/algorithms/matrixFill.js +0 -21
  261. package/src/_cjs/utils/algorithms/matrixFill.js.map +0 -1
  262. package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
  263. package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.js +0 -270
  264. package/src/_cjs/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
  265. package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
  266. package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.js +0 -102
  267. package/src/_cjs/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
  268. package/src/_cjs/utils/algorithms/sutherlandHodgman.d.ts +0 -16
  269. package/src/_cjs/utils/algorithms/sutherlandHodgman.js +0 -76
  270. package/src/_cjs/utils/algorithms/sutherlandHodgman.js.map +0 -1
  271. package/src/_cjs/utils/cloneVertexArray.d.ts +0 -13
  272. package/src/_cjs/utils/cloneVertexArray.js +0 -23
  273. package/src/_cjs/utils/cloneVertexArray.js.map +0 -1
  274. package/src/_cjs/utils/createRandomizedPolygon.d.ts +0 -14
  275. package/src/_cjs/utils/createRandomizedPolygon.js +0 -32
  276. package/src/_cjs/utils/createRandomizedPolygon.js.map +0 -1
  277. package/src/_cjs/utils/creategui.js +0 -434
  278. package/src/_cjs/utils/dat.gui.arrowbounce.polyfill.js +0 -128
  279. package/src/_cjs/utils/dat.gui.title.polyfill.js +0 -35
  280. package/src/_cjs/utils/datastructures/CircularIntervalSet.d.ts +0 -83
  281. package/src/_cjs/utils/datastructures/CircularIntervalSet.js +0 -163
  282. package/src/_cjs/utils/datastructures/CircularIntervalSet.js.map +0 -1
  283. package/src/_cjs/utils/datastructures/Color.d.ts +0 -391
  284. package/src/_cjs/utils/datastructures/Color.js +0 -1084
  285. package/src/_cjs/utils/datastructures/Color.js.map +0 -1
  286. package/src/_cjs/utils/datastructures/ColorGradient.d.ts +0 -81
  287. package/src/_cjs/utils/datastructures/ColorGradient.js +0 -176
  288. package/src/_cjs/utils/datastructures/ColorGradient.js.map +0 -1
  289. package/src/_cjs/utils/datastructures/DataGrid2d.d.ts +0 -53
  290. package/src/_cjs/utils/datastructures/DataGrid2d.js +0 -20
  291. package/src/_cjs/utils/datastructures/DataGrid2d.js.map +0 -1
  292. package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
  293. package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.js +0 -155
  294. package/src/_cjs/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
  295. package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
  296. package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.js +0 -84
  297. package/src/_cjs/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
  298. package/src/_cjs/utils/datastructures/GenericPath.d.ts +0 -86
  299. package/src/_cjs/utils/datastructures/GenericPath.js +0 -122
  300. package/src/_cjs/utils/datastructures/GenericPath.js.map +0 -1
  301. package/src/_cjs/utils/datastructures/GeometryMesh.d.ts +0 -49
  302. package/src/_cjs/utils/datastructures/GeometryMesh.js +0 -58
  303. package/src/_cjs/utils/datastructures/GeometryMesh.js.map +0 -1
  304. package/src/_cjs/utils/datastructures/Girih.d.ts +0 -181
  305. package/src/_cjs/utils/datastructures/Girih.js +0 -266
  306. package/src/_cjs/utils/datastructures/Girih.js.map +0 -1
  307. package/src/_cjs/utils/datastructures/GirihBowtie.d.ts +0 -37
  308. package/src/_cjs/utils/datastructures/GirihBowtie.js +0 -152
  309. package/src/_cjs/utils/datastructures/GirihBowtie.js.map +0 -1
  310. package/src/_cjs/utils/datastructures/GirihDecagon.d.ts +0 -52
  311. package/src/_cjs/utils/datastructures/GirihDecagon.js +0 -132
  312. package/src/_cjs/utils/datastructures/GirihDecagon.js.map +0 -1
  313. package/src/_cjs/utils/datastructures/GirihHexagon.d.ts +0 -39
  314. package/src/_cjs/utils/datastructures/GirihHexagon.js +0 -200
  315. package/src/_cjs/utils/datastructures/GirihHexagon.js.map +0 -1
  316. package/src/_cjs/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
  317. package/src/_cjs/utils/datastructures/GirihPenroseRhombus.js +0 -189
  318. package/src/_cjs/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
  319. package/src/_cjs/utils/datastructures/GirihPentagon.d.ts +0 -37
  320. package/src/_cjs/utils/datastructures/GirihPentagon.js +0 -109
  321. package/src/_cjs/utils/datastructures/GirihPentagon.js.map +0 -1
  322. package/src/_cjs/utils/datastructures/GirihRhombus.d.ts +0 -38
  323. package/src/_cjs/utils/datastructures/GirihRhombus.js +0 -155
  324. package/src/_cjs/utils/datastructures/GirihRhombus.js.map +0 -1
  325. package/src/_cjs/utils/datastructures/GirihTile.d.ts +0 -283
  326. package/src/_cjs/utils/datastructures/GirihTile.js +0 -308
  327. package/src/_cjs/utils/datastructures/GirihTile.js.map +0 -1
  328. package/src/_cjs/utils/datastructures/Matrix4x4.d.ts +0 -244
  329. package/src/_cjs/utils/datastructures/Matrix4x4.js +0 -262
  330. package/src/_cjs/utils/datastructures/Matrix4x4.js.map +0 -1
  331. package/src/_cjs/utils/datastructures/VoronoiCell.d.ts +0 -122
  332. package/src/_cjs/utils/datastructures/VoronoiCell.js +0 -183
  333. package/src/_cjs/utils/datastructures/VoronoiCell.js.map +0 -1
  334. package/src/_cjs/utils/datastructures/interfaces.d.ts +0 -13
  335. package/src/_cjs/utils/datastructures/interfaces.js +0 -10
  336. package/src/_cjs/utils/datastructures/interfaces.js.map +0 -1
  337. package/src/_cjs/utils/detectDarkMode.d.ts +0 -10
  338. package/src/_cjs/utils/detectDarkMode.js +0 -41
  339. package/src/_cjs/utils/detectDarkMode.js.map +0 -1
  340. package/src/_cjs/utils/dom/components/ColorGradientPicker.d.ts +0 -246
  341. package/src/_cjs/utils/dom/components/ColorGradientPicker.js +0 -667
  342. package/src/_cjs/utils/dom/components/ColorGradientPicker.js.map +0 -1
  343. package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.d.ts +0 -129
  344. package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.js +0 -520
  345. package/src/_cjs/utils/dom/components/ColorGradientPickerJSX.js.map +0 -1
  346. package/src/_cjs/utils/dom/components/ColorGradientSelector.d.ts +0 -118
  347. package/src/_cjs/utils/dom/components/ColorGradientSelector.js +0 -327
  348. package/src/_cjs/utils/dom/components/ColorGradientSelector.js.map +0 -1
  349. package/src/_cjs/utils/dom/components/Test.d.ts +0 -7
  350. package/src/_cjs/utils/dom/components/Test.js +0 -30
  351. package/src/_cjs/utils/dom/components/Test.js.map +0 -1
  352. package/src/_cjs/utils/dom/getAvailableContainerSpace.d.ts +0 -2
  353. package/src/_cjs/utils/dom/getAvailableContainerSpace.js +0 -29
  354. package/src/_cjs/utils/dom/getAvailableContainerSpace.js.map +0 -1
  355. package/src/_cjs/utils/dom/getFProp.d.ts +0 -5
  356. package/src/_cjs/utils/dom/getFProp.js +0 -12
  357. package/src/_cjs/utils/dom/getFProp.js.map +0 -1
  358. package/src/_cjs/utils/dom/guiSizeToggler.d.ts +0 -18
  359. package/src/_cjs/utils/dom/guiSizeToggler.js +0 -44
  360. package/src/_cjs/utils/dom/guiSizeToggler.js.map +0 -1
  361. package/src/_cjs/utils/findInVertexArray.d.ts +0 -19
  362. package/src/_cjs/utils/findInVertexArray.js +0 -29
  363. package/src/_cjs/utils/findInVertexArray.js.map +0 -1
  364. package/src/_cjs/utils/getFProp.d.ts +0 -5
  365. package/src/_cjs/utils/getFProp.js +0 -12
  366. package/src/_cjs/utils/getFProp.js.map +0 -1
  367. package/src/_cjs/utils/gup.d.ts +0 -14
  368. package/src/_cjs/utils/gup.js +0 -31
  369. package/src/_cjs/utils/gup.js.map +0 -1
  370. package/src/_cjs/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
  371. package/src/_cjs/utils/helpers/BezierPathInteractionHelper.js +0 -655
  372. package/src/_cjs/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
  373. package/src/_cjs/utils/helpers/CircleHelper.d.ts +0 -73
  374. package/src/_cjs/utils/helpers/CircleHelper.js +0 -93
  375. package/src/_cjs/utils/helpers/CircleHelper.js.map +0 -1
  376. package/src/_cjs/utils/helpers/CircleSectorHelper.d.ts +0 -90
  377. package/src/_cjs/utils/helpers/CircleSectorHelper.js +0 -114
  378. package/src/_cjs/utils/helpers/CircleSectorHelper.js.map +0 -1
  379. package/src/_cjs/utils/helpers/TriangleHelper.d.ts +0 -57
  380. package/src/_cjs/utils/helpers/TriangleHelper.js +0 -83
  381. package/src/_cjs/utils/helpers/TriangleHelper.js.map +0 -1
  382. package/src/_cjs/utils/helpers/VEllipseHelper.d.ts +0 -32
  383. package/src/_cjs/utils/helpers/VEllipseHelper.js +0 -88
  384. package/src/_cjs/utils/helpers/VEllipseHelper.js.map +0 -1
  385. package/src/_cjs/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
  386. package/src/_cjs/utils/helpers/VEllipseSectorHelper.js +0 -135
  387. package/src/_cjs/utils/helpers/VEllipseSectorHelper.js.map +0 -1
  388. package/src/_cjs/utils/io/DndFileHandler.d.ts +0 -63
  389. package/src/_cjs/utils/io/DndFileHandler.js +0 -112
  390. package/src/_cjs/utils/io/DndFileHandler.js.map +0 -1
  391. package/src/_cjs/utils/io/FileDrop.d.ts +0 -110
  392. package/src/_cjs/utils/io/FileDrop.js +0 -177
  393. package/src/_cjs/utils/io/FileDrop.js.map +0 -1
  394. package/src/_cjs/utils/lil.gui.arrowbounce.polyfill.js +0 -133
  395. package/src/_cjs/utils/lil.gui.title.polyfill.js +0 -32
  396. package/src/_cjs/utils/module.js +0 -18
  397. package/src/_cjs/utils/parsers/LinearColorGradientParser.d.ts +0 -78
  398. package/src/_cjs/utils/parsers/LinearColorGradientParser.js +0 -224
  399. package/src/_cjs/utils/parsers/LinearColorGradientParser.js.map +0 -1
  400. package/src/_cjs/utils/parsers/OBJParser.d.ts +0 -24
  401. package/src/_cjs/utils/parsers/OBJParser.js +0 -77
  402. package/src/_cjs/utils/parsers/OBJParser.js.map +0 -1
  403. package/src/_cjs/utils/parsers/STLParser.d.ts +0 -61
  404. package/src/_cjs/utils/parsers/STLParser.js +0 -182
  405. package/src/_cjs/utils/parsers/STLParser.js.map +0 -1
  406. package/src/_cjs/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
  407. package/src/_cjs/utils/parsers/svg/parseSVGPathData.js +0 -486
  408. package/src/_cjs/utils/parsers/svg/parseSVGPathData.js.map +0 -1
  409. package/src/_cjs/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
  410. package/src/_cjs/utils/parsers/svg/splitSVGPathData.js +0 -53
  411. package/src/_cjs/utils/parsers/svg/splitSVGPathData.js.map +0 -1
  412. package/src/_cjs/utils/parsers/svg/types.d.ts +0 -63
  413. package/src/_cjs/utils/parsers/svg/types.js +0 -17
  414. package/src/_cjs/utils/parsers/svg/types.js.map +0 -1
  415. package/src/_cjs/utils/ts-runner.js +0 -146
  416. package/src/_cjs/utils/tsAsyncScriptLoader.js +0 -74
  417. package/src/_esm/BezierPath.d.ts +0 -610
  418. package/src/_esm/BezierPath.js +0 -1124
  419. package/src/_esm/BezierPath.js.map +0 -1
  420. package/src/_esm/Bounds.d.ts +0 -252
  421. package/src/_esm/Bounds.js +0 -317
  422. package/src/_esm/Bounds.js.map +0 -1
  423. package/src/_esm/Circle.d.ts +0 -214
  424. package/src/_esm/Circle.js +0 -335
  425. package/src/_esm/Circle.js.map +0 -1
  426. package/src/_esm/CircleSector.d.ts +0 -211
  427. package/src/_esm/CircleSector.js +0 -359
  428. package/src/_esm/CircleSector.js.map +0 -1
  429. package/src/_esm/CubicBezierCurve.d.ts +0 -656
  430. package/src/_esm/CubicBezierCurve.js +0 -1057
  431. package/src/_esm/CubicBezierCurve.js.map +0 -1
  432. package/src/_esm/Grid.d.ts +0 -83
  433. package/src/_esm/Grid.js +0 -89
  434. package/src/_esm/Grid.js.map +0 -1
  435. package/src/_esm/KeyHandler.d.ts +0 -177
  436. package/src/_esm/KeyHandler.js +0 -434
  437. package/src/_esm/KeyHandler.js.map +0 -1
  438. package/src/_esm/Line.d.ts +0 -134
  439. package/src/_esm/Line.js +0 -200
  440. package/src/_esm/Line.js.map +0 -1
  441. package/src/_esm/MouseHandler.d.ts +0 -283
  442. package/src/_esm/MouseHandler.js +0 -397
  443. package/src/_esm/MouseHandler.js.map +0 -1
  444. package/src/_esm/PBImage.d.ts +0 -81
  445. package/src/_esm/PBImage.js +0 -60
  446. package/src/_esm/PBImage.js.map +0 -1
  447. package/src/_esm/PBText.d.ts +0 -118
  448. package/src/_esm/PBText.js +0 -62
  449. package/src/_esm/PBText.js.map +0 -1
  450. package/src/_esm/PlotBoilerplate.d.ts +0 -899
  451. package/src/_esm/PlotBoilerplate.js +0 -2347
  452. package/src/_esm/PlotBoilerplate.js.map +0 -1
  453. package/src/_esm/Polygon.d.ts +0 -520
  454. package/src/_esm/Polygon.js +0 -924
  455. package/src/_esm/Polygon.js.map +0 -1
  456. package/src/_esm/SVGBuilder.d.ts +0 -47
  457. package/src/_esm/SVGBuilder.js +0 -95
  458. package/src/_esm/SVGBuilder.js.map +0 -1
  459. package/src/_esm/Triangle.d.ts +0 -392
  460. package/src/_esm/Triangle.js +0 -493
  461. package/src/_esm/Triangle.js.map +0 -1
  462. package/src/_esm/UIDGenerator.d.ts +0 -12
  463. package/src/_esm/UIDGenerator.js +0 -18
  464. package/src/_esm/UIDGenerator.js.map +0 -1
  465. package/src/_esm/VEllipse.d.ts +0 -319
  466. package/src/_esm/VEllipse.js +0 -574
  467. package/src/_esm/VEllipse.js.map +0 -1
  468. package/src/_esm/VEllipseSector.d.ts +0 -230
  469. package/src/_esm/VEllipseSector.js +0 -422
  470. package/src/_esm/VEllipseSector.js.map +0 -1
  471. package/src/_esm/Vector.d.ts +0 -126
  472. package/src/_esm/Vector.js +0 -181
  473. package/src/_esm/Vector.js.map +0 -1
  474. package/src/_esm/VertTuple.d.ts +0 -284
  475. package/src/_esm/VertTuple.js +0 -347
  476. package/src/_esm/VertTuple.js.map +0 -1
  477. package/src/_esm/Vertex.d.ts +0 -498
  478. package/src/_esm/Vertex.js +0 -702
  479. package/src/_esm/Vertex.js.map +0 -1
  480. package/src/_esm/VertexAttr.d.ts +0 -72
  481. package/src/_esm/VertexAttr.js +0 -58
  482. package/src/_esm/VertexAttr.js.map +0 -1
  483. package/src/_esm/VertexListeners.d.ts +0 -209
  484. package/src/_esm/VertexListeners.js +0 -270
  485. package/src/_esm/VertexListeners.js.map +0 -1
  486. package/src/_esm/draw.d.ts +0 -657
  487. package/src/_esm/draw.js +0 -1159
  488. package/src/_esm/draw.js.map +0 -1
  489. package/src/_esm/drawgl.d.ts +0 -544
  490. package/src/_esm/drawgl.js +0 -812
  491. package/src/_esm/drawgl.js.map +0 -1
  492. package/src/_esm/drawutilssvg.d.ts +0 -954
  493. package/src/_esm/drawutilssvg.js +0 -1705
  494. package/src/_esm/drawutilssvg.js.map +0 -1
  495. package/src/_esm/entry-glsupport.js +0 -28
  496. package/src/_esm/entry.js +0 -29
  497. package/src/_esm/geomutils.d.ts +0 -77
  498. package/src/_esm/geomutils.js +0 -126
  499. package/src/_esm/geomutils.js.map +0 -1
  500. package/src/_esm/index.d.ts +0 -102
  501. package/src/_esm/index.js +0 -128
  502. package/src/_esm/index.js.map +0 -1
  503. package/src/_esm/interfaces/DrawLib.d.ts +0 -582
  504. package/src/_esm/interfaces/DrawLib.js +0 -32
  505. package/src/_esm/interfaces/DrawLib.js.map +0 -1
  506. package/src/_esm/interfaces/additionals.d.ts +0 -95
  507. package/src/_esm/interfaces/additionals.js +0 -3
  508. package/src/_esm/interfaces/additionals.js.map +0 -1
  509. package/src/_esm/interfaces/core.d.ts +0 -286
  510. package/src/_esm/interfaces/core.js +0 -30
  511. package/src/_esm/interfaces/core.js.map +0 -1
  512. package/src/_esm/interfaces/externals.d.ts +0 -56
  513. package/src/_esm/interfaces/externals.js +0 -8
  514. package/src/_esm/interfaces/externals.js.map +0 -1
  515. package/src/_esm/interfaces/index.d.ts +0 -4
  516. package/src/_esm/interfaces/index.js +0 -21
  517. package/src/_esm/interfaces/index.js.map +0 -1
  518. package/src/_esm/module.d.ts +0 -26
  519. package/src/_esm/module.js +0 -60
  520. package/src/_esm/module.js.map +0 -1
  521. package/src/_esm/src/ts/BezierPath.d.ts +0 -610
  522. package/src/_esm/src/ts/BezierPath.js +0 -1120
  523. package/src/_esm/src/ts/BezierPath.js.map +0 -1
  524. package/src/_esm/src/ts/Bounds.d.ts +0 -252
  525. package/src/_esm/src/ts/Bounds.js +0 -313
  526. package/src/_esm/src/ts/Bounds.js.map +0 -1
  527. package/src/_esm/src/ts/Circle.d.ts +0 -214
  528. package/src/_esm/src/ts/Circle.js +0 -331
  529. package/src/_esm/src/ts/Circle.js.map +0 -1
  530. package/src/_esm/src/ts/CircleSector.d.ts +0 -211
  531. package/src/_esm/src/ts/CircleSector.js +0 -355
  532. package/src/_esm/src/ts/CircleSector.js.map +0 -1
  533. package/src/_esm/src/ts/CubicBezierCurve.d.ts +0 -656
  534. package/src/_esm/src/ts/CubicBezierCurve.js +0 -1053
  535. package/src/_esm/src/ts/CubicBezierCurve.js.map +0 -1
  536. package/src/_esm/src/ts/Grid.d.ts +0 -83
  537. package/src/_esm/src/ts/Grid.js +0 -85
  538. package/src/_esm/src/ts/Grid.js.map +0 -1
  539. package/src/_esm/src/ts/KeyHandler.d.ts +0 -177
  540. package/src/_esm/src/ts/KeyHandler.js +0 -430
  541. package/src/_esm/src/ts/KeyHandler.js.map +0 -1
  542. package/src/_esm/src/ts/Line.d.ts +0 -134
  543. package/src/_esm/src/ts/Line.js +0 -196
  544. package/src/_esm/src/ts/Line.js.map +0 -1
  545. package/src/_esm/src/ts/MouseHandler.d.ts +0 -283
  546. package/src/_esm/src/ts/MouseHandler.js +0 -391
  547. package/src/_esm/src/ts/MouseHandler.js.map +0 -1
  548. package/src/_esm/src/ts/PBImage.d.ts +0 -81
  549. package/src/_esm/src/ts/PBImage.js +0 -56
  550. package/src/_esm/src/ts/PBImage.js.map +0 -1
  551. package/src/_esm/src/ts/PBText.d.ts +0 -118
  552. package/src/_esm/src/ts/PBText.js +0 -58
  553. package/src/_esm/src/ts/PBText.js.map +0 -1
  554. package/src/_esm/src/ts/PlotBoilerplate.d.ts +0 -899
  555. package/src/_esm/src/ts/PlotBoilerplate.js +0 -2340
  556. package/src/_esm/src/ts/PlotBoilerplate.js.map +0 -1
  557. package/src/_esm/src/ts/Polygon.d.ts +0 -520
  558. package/src/_esm/src/ts/Polygon.js +0 -920
  559. package/src/_esm/src/ts/Polygon.js.map +0 -1
  560. package/src/_esm/src/ts/Triangle.d.ts +0 -392
  561. package/src/_esm/src/ts/Triangle.js +0 -489
  562. package/src/_esm/src/ts/Triangle.js.map +0 -1
  563. package/src/_esm/src/ts/UIDGenerator.d.ts +0 -12
  564. package/src/_esm/src/ts/UIDGenerator.js +0 -14
  565. package/src/_esm/src/ts/UIDGenerator.js.map +0 -1
  566. package/src/_esm/src/ts/VEllipse.d.ts +0 -319
  567. package/src/_esm/src/ts/VEllipse.js +0 -570
  568. package/src/_esm/src/ts/VEllipse.js.map +0 -1
  569. package/src/_esm/src/ts/VEllipseSector.d.ts +0 -230
  570. package/src/_esm/src/ts/VEllipseSector.js +0 -418
  571. package/src/_esm/src/ts/VEllipseSector.js.map +0 -1
  572. package/src/_esm/src/ts/Vector.d.ts +0 -126
  573. package/src/_esm/src/ts/Vector.js +0 -177
  574. package/src/_esm/src/ts/Vector.js.map +0 -1
  575. package/src/_esm/src/ts/VertTuple.d.ts +0 -284
  576. package/src/_esm/src/ts/VertTuple.js +0 -343
  577. package/src/_esm/src/ts/VertTuple.js.map +0 -1
  578. package/src/_esm/src/ts/Vertex.d.ts +0 -498
  579. package/src/_esm/src/ts/Vertex.js +0 -698
  580. package/src/_esm/src/ts/Vertex.js.map +0 -1
  581. package/src/_esm/src/ts/VertexAttr.d.ts +0 -72
  582. package/src/_esm/src/ts/VertexAttr.js +0 -54
  583. package/src/_esm/src/ts/VertexAttr.js.map +0 -1
  584. package/src/_esm/src/ts/VertexListeners.d.ts +0 -209
  585. package/src/_esm/src/ts/VertexListeners.js +0 -266
  586. package/src/_esm/src/ts/VertexListeners.js.map +0 -1
  587. package/src/_esm/src/ts/draw.d.ts +0 -657
  588. package/src/_esm/src/ts/draw.js +0 -1155
  589. package/src/_esm/src/ts/draw.js.map +0 -1
  590. package/src/_esm/src/ts/drawgl.d.ts +0 -544
  591. package/src/_esm/src/ts/drawgl.js +0 -808
  592. package/src/_esm/src/ts/drawgl.js.map +0 -1
  593. package/src/_esm/src/ts/drawutilssvg.d.ts +0 -954
  594. package/src/_esm/src/ts/drawutilssvg.js +0 -1701
  595. package/src/_esm/src/ts/drawutilssvg.js.map +0 -1
  596. package/src/_esm/src/ts/geomutils.d.ts +0 -77
  597. package/src/_esm/src/ts/geomutils.js +0 -123
  598. package/src/_esm/src/ts/geomutils.js.map +0 -1
  599. package/src/_esm/src/ts/index.d.ts +0 -102
  600. package/src/_esm/src/ts/index.js +0 -112
  601. package/src/_esm/src/ts/index.js.map +0 -1
  602. package/src/_esm/src/ts/interfaces/DrawLib.d.ts +0 -582
  603. package/src/_esm/src/ts/interfaces/DrawLib.js +0 -31
  604. package/src/_esm/src/ts/interfaces/DrawLib.js.map +0 -1
  605. package/src/_esm/src/ts/interfaces/additionals.d.ts +0 -95
  606. package/src/_esm/src/ts/interfaces/additionals.js +0 -2
  607. package/src/_esm/src/ts/interfaces/additionals.js.map +0 -1
  608. package/src/_esm/src/ts/interfaces/core.d.ts +0 -286
  609. package/src/_esm/src/ts/interfaces/core.js +0 -29
  610. package/src/_esm/src/ts/interfaces/core.js.map +0 -1
  611. package/src/_esm/src/ts/interfaces/externals.d.ts +0 -56
  612. package/src/_esm/src/ts/interfaces/externals.js +0 -7
  613. package/src/_esm/src/ts/interfaces/externals.js.map +0 -1
  614. package/src/_esm/src/ts/interfaces/index.d.ts +0 -4
  615. package/src/_esm/src/ts/interfaces/index.js +0 -5
  616. package/src/_esm/src/ts/interfaces/index.js.map +0 -1
  617. package/src/_esm/src/ts/module.d.ts +0 -26
  618. package/src/_esm/src/ts/module.js +0 -38
  619. package/src/_esm/src/ts/module.js.map +0 -1
  620. package/src/_esm/src/ts/utils/InitializationObserver.d.ts +0 -18
  621. package/src/_esm/src/ts/utils/InitializationObserver.js +0 -57
  622. package/src/_esm/src/ts/utils/InitializationObserver.js.map +0 -1
  623. package/src/_esm/src/ts/utils/LissajousFigure.d.ts +0 -34
  624. package/src/_esm/src/ts/utils/LissajousFigure.js +0 -95
  625. package/src/_esm/src/ts/utils/LissajousFigure.js.map +0 -1
  626. package/src/_esm/src/ts/utils/NGons.d.ts +0 -13
  627. package/src/_esm/src/ts/utils/NGons.js +0 -33
  628. package/src/_esm/src/ts/utils/NGons.js.map +0 -1
  629. package/src/_esm/src/ts/utils/Params.d.ts +0 -17
  630. package/src/_esm/src/ts/utils/Params.js +0 -48
  631. package/src/_esm/src/ts/utils/Params.js.map +0 -1
  632. package/src/_esm/src/ts/utils/PerlinNoise.d.ts +0 -19
  633. package/src/_esm/src/ts/utils/PerlinNoise.js +0 -346
  634. package/src/_esm/src/ts/utils/PerlinNoise.js.map +0 -1
  635. package/src/_esm/src/ts/utils/SVGPathUtils.d.ts +0 -22
  636. package/src/_esm/src/ts/utils/SVGPathUtils.js +0 -42
  637. package/src/_esm/src/ts/utils/SVGPathUtils.js.map +0 -1
  638. package/src/_esm/src/ts/utils/WebColors.d.ts +0 -35
  639. package/src/_esm/src/ts/utils/WebColors.js +0 -54
  640. package/src/_esm/src/ts/utils/WebColors.js.map +0 -1
  641. package/src/_esm/src/ts/utils/WebColorsContrast.d.ts +0 -6
  642. package/src/_esm/src/ts/utils/WebColorsContrast.js +0 -9
  643. package/src/_esm/src/ts/utils/WebColorsContrast.js.map +0 -1
  644. package/src/_esm/src/ts/utils/WebColorsMalachite.d.ts +0 -12
  645. package/src/_esm/src/ts/utils/WebColorsMalachite.js +0 -25
  646. package/src/_esm/src/ts/utils/WebColorsMalachite.js.map +0 -1
  647. package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.d.ts +0 -60
  648. package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.js +0 -103
  649. package/src/_esm/src/ts/utils/algorithms/CatmullRomPath.js.map +0 -1
  650. package/src/_esm/src/ts/utils/algorithms/CircleIntersections.d.ts +0 -170
  651. package/src/_esm/src/ts/utils/algorithms/CircleIntersections.js +0 -303
  652. package/src/_esm/src/ts/utils/algorithms/CircleIntersections.js.map +0 -1
  653. package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.d.ts +0 -150
  654. package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.js +0 -362
  655. package/src/_esm/src/ts/utils/algorithms/ContourLineDetection.js.map +0 -1
  656. package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.d.ts +0 -63
  657. package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.js +0 -170
  658. package/src/_esm/src/ts/utils/algorithms/CubicSplinePath.js.map +0 -1
  659. package/src/_esm/src/ts/utils/algorithms/HobbyPath.d.ts +0 -81
  660. package/src/_esm/src/ts/utils/algorithms/HobbyPath.js +0 -273
  661. package/src/_esm/src/ts/utils/algorithms/HobbyPath.js.map +0 -1
  662. package/src/_esm/src/ts/utils/algorithms/Metaballs.d.ts +0 -30
  663. package/src/_esm/src/ts/utils/algorithms/Metaballs.js +0 -109
  664. package/src/_esm/src/ts/utils/algorithms/Metaballs.js.map +0 -1
  665. package/src/_esm/src/ts/utils/algorithms/PolygonInset.d.ts +0 -184
  666. package/src/_esm/src/ts/utils/algorithms/PolygonInset.js +0 -424
  667. package/src/_esm/src/ts/utils/algorithms/PolygonInset.js.map +0 -1
  668. package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
  669. package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.js +0 -262
  670. package/src/_esm/src/ts/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
  671. package/src/_esm/src/ts/utils/algorithms/arrayFill.d.ts +0 -8
  672. package/src/_esm/src/ts/utils/algorithms/arrayFill.js +0 -14
  673. package/src/_esm/src/ts/utils/algorithms/arrayFill.js.map +0 -1
  674. package/src/_esm/src/ts/utils/algorithms/arrayResize.d.ts +0 -8
  675. package/src/_esm/src/ts/utils/algorithms/arrayResize.js +0 -20
  676. package/src/_esm/src/ts/utils/algorithms/arrayResize.js.map +0 -1
  677. package/src/_esm/src/ts/utils/algorithms/arrayShuffle.d.ts +0 -8
  678. package/src/_esm/src/ts/utils/algorithms/arrayShuffle.js +0 -11
  679. package/src/_esm/src/ts/utils/algorithms/arrayShuffle.js.map +0 -1
  680. package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
  681. package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.js +0 -47
  682. package/src/_esm/src/ts/utils/algorithms/clearDuplicateVertices.js.map +0 -1
  683. package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
  684. package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.js +0 -57
  685. package/src/_esm/src/ts/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
  686. package/src/_esm/src/ts/utils/algorithms/convexHull.d.ts +0 -23
  687. package/src/_esm/src/ts/utils/algorithms/convexHull.js +0 -67
  688. package/src/_esm/src/ts/utils/algorithms/convexHull.js.map +0 -1
  689. package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
  690. package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.js +0 -141
  691. package/src/_esm/src/ts/utils/algorithms/convexPolygonIncircle.js.map +0 -1
  692. package/src/_esm/src/ts/utils/algorithms/delaunay.d.ts +0 -30
  693. package/src/_esm/src/ts/utils/algorithms/delaunay.js +0 -153
  694. package/src/_esm/src/ts/utils/algorithms/delaunay.js.map +0 -1
  695. package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.d.ts +0 -25
  696. package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.js +0 -99
  697. package/src/_esm/src/ts/utils/algorithms/delaunay2voronoi.js.map +0 -1
  698. package/src/_esm/src/ts/utils/algorithms/detectPaths.d.ts +0 -21
  699. package/src/_esm/src/ts/utils/algorithms/detectPaths.js +0 -165
  700. package/src/_esm/src/ts/utils/algorithms/detectPaths.js.map +0 -1
  701. package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
  702. package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.js +0 -47
  703. package/src/_esm/src/ts/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
  704. package/src/_esm/src/ts/utils/algorithms/getContrastColor.d.ts +0 -13
  705. package/src/_esm/src/ts/utils/algorithms/getContrastColor.js +0 -22
  706. package/src/_esm/src/ts/utils/algorithms/getContrastColor.js.map +0 -1
  707. package/src/_esm/src/ts/utils/algorithms/matrixFill.d.ts +0 -10
  708. package/src/_esm/src/ts/utils/algorithms/matrixFill.js +0 -17
  709. package/src/_esm/src/ts/utils/algorithms/matrixFill.js.map +0 -1
  710. package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
  711. package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.js +0 -266
  712. package/src/_esm/src/ts/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
  713. package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
  714. package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.js +0 -99
  715. package/src/_esm/src/ts/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
  716. package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.d.ts +0 -16
  717. package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.js +0 -72
  718. package/src/_esm/src/ts/utils/algorithms/sutherlandHodgman.js.map +0 -1
  719. package/src/_esm/src/ts/utils/cloneVertexArray.d.ts +0 -13
  720. package/src/_esm/src/ts/utils/cloneVertexArray.js +0 -19
  721. package/src/_esm/src/ts/utils/cloneVertexArray.js.map +0 -1
  722. package/src/_esm/src/ts/utils/createRandomizedPolygon.d.ts +0 -14
  723. package/src/_esm/src/ts/utils/createRandomizedPolygon.js +0 -28
  724. package/src/_esm/src/ts/utils/createRandomizedPolygon.js.map +0 -1
  725. package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.d.ts +0 -83
  726. package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.js +0 -158
  727. package/src/_esm/src/ts/utils/datastructures/CircularIntervalSet.js.map +0 -1
  728. package/src/_esm/src/ts/utils/datastructures/Color.d.ts +0 -391
  729. package/src/_esm/src/ts/utils/datastructures/Color.js +0 -1063
  730. package/src/_esm/src/ts/utils/datastructures/Color.js.map +0 -1
  731. package/src/_esm/src/ts/utils/datastructures/ColorGradient.d.ts +0 -81
  732. package/src/_esm/src/ts/utils/datastructures/ColorGradient.js +0 -171
  733. package/src/_esm/src/ts/utils/datastructures/ColorGradient.js.map +0 -1
  734. package/src/_esm/src/ts/utils/datastructures/DataGrid2d.d.ts +0 -53
  735. package/src/_esm/src/ts/utils/datastructures/DataGrid2d.js +0 -19
  736. package/src/_esm/src/ts/utils/datastructures/DataGrid2d.js.map +0 -1
  737. package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
  738. package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.js +0 -150
  739. package/src/_esm/src/ts/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
  740. package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
  741. package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.js +0 -79
  742. package/src/_esm/src/ts/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
  743. package/src/_esm/src/ts/utils/datastructures/GenericPath.d.ts +0 -86
  744. package/src/_esm/src/ts/utils/datastructures/GenericPath.js +0 -117
  745. package/src/_esm/src/ts/utils/datastructures/GenericPath.js.map +0 -1
  746. package/src/_esm/src/ts/utils/datastructures/GeometryMesh.d.ts +0 -49
  747. package/src/_esm/src/ts/utils/datastructures/GeometryMesh.js +0 -53
  748. package/src/_esm/src/ts/utils/datastructures/GeometryMesh.js.map +0 -1
  749. package/src/_esm/src/ts/utils/datastructures/Girih.d.ts +0 -181
  750. package/src/_esm/src/ts/utils/datastructures/Girih.js +0 -261
  751. package/src/_esm/src/ts/utils/datastructures/Girih.js.map +0 -1
  752. package/src/_esm/src/ts/utils/datastructures/GirihBowtie.d.ts +0 -37
  753. package/src/_esm/src/ts/utils/datastructures/GirihBowtie.js +0 -130
  754. package/src/_esm/src/ts/utils/datastructures/GirihBowtie.js.map +0 -1
  755. package/src/_esm/src/ts/utils/datastructures/GirihDecagon.d.ts +0 -52
  756. package/src/_esm/src/ts/utils/datastructures/GirihDecagon.js +0 -110
  757. package/src/_esm/src/ts/utils/datastructures/GirihDecagon.js.map +0 -1
  758. package/src/_esm/src/ts/utils/datastructures/GirihHexagon.d.ts +0 -39
  759. package/src/_esm/src/ts/utils/datastructures/GirihHexagon.js +0 -178
  760. package/src/_esm/src/ts/utils/datastructures/GirihHexagon.js.map +0 -1
  761. package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
  762. package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.js +0 -167
  763. package/src/_esm/src/ts/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
  764. package/src/_esm/src/ts/utils/datastructures/GirihPentagon.d.ts +0 -37
  765. package/src/_esm/src/ts/utils/datastructures/GirihPentagon.js +0 -87
  766. package/src/_esm/src/ts/utils/datastructures/GirihPentagon.js.map +0 -1
  767. package/src/_esm/src/ts/utils/datastructures/GirihRhombus.d.ts +0 -38
  768. package/src/_esm/src/ts/utils/datastructures/GirihRhombus.js +0 -133
  769. package/src/_esm/src/ts/utils/datastructures/GirihRhombus.js.map +0 -1
  770. package/src/_esm/src/ts/utils/datastructures/GirihTile.d.ts +0 -283
  771. package/src/_esm/src/ts/utils/datastructures/GirihTile.js +0 -286
  772. package/src/_esm/src/ts/utils/datastructures/GirihTile.js.map +0 -1
  773. package/src/_esm/src/ts/utils/datastructures/Matrix4x4.d.ts +0 -244
  774. package/src/_esm/src/ts/utils/datastructures/Matrix4x4.js +0 -246
  775. package/src/_esm/src/ts/utils/datastructures/Matrix4x4.js.map +0 -1
  776. package/src/_esm/src/ts/utils/datastructures/VoronoiCell.d.ts +0 -122
  777. package/src/_esm/src/ts/utils/datastructures/VoronoiCell.js +0 -178
  778. package/src/_esm/src/ts/utils/datastructures/VoronoiCell.js.map +0 -1
  779. package/src/_esm/src/ts/utils/datastructures/interfaces.d.ts +0 -13
  780. package/src/_esm/src/ts/utils/datastructures/interfaces.js +0 -9
  781. package/src/_esm/src/ts/utils/datastructures/interfaces.js.map +0 -1
  782. package/src/_esm/src/ts/utils/detectDarkMode.d.ts +0 -10
  783. package/src/_esm/src/ts/utils/detectDarkMode.js +0 -37
  784. package/src/_esm/src/ts/utils/detectDarkMode.js.map +0 -1
  785. package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.d.ts +0 -246
  786. package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.js +0 -743
  787. package/src/_esm/src/ts/utils/dom/components/ColorGradientPicker.js.map +0 -1
  788. package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.d.ts +0 -118
  789. package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.js +0 -339
  790. package/src/_esm/src/ts/utils/dom/components/ColorGradientSelector.js.map +0 -1
  791. package/src/_esm/src/ts/utils/dom/components/Test.d.ts +0 -7
  792. package/src/_esm/src/ts/utils/dom/components/Test.js +0 -26
  793. package/src/_esm/src/ts/utils/dom/components/Test.js.map +0 -1
  794. package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.d.ts +0 -2
  795. package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.js +0 -25
  796. package/src/_esm/src/ts/utils/dom/getAvailableContainerSpace.js.map +0 -1
  797. package/src/_esm/src/ts/utils/dom/getFProp.d.ts +0 -5
  798. package/src/_esm/src/ts/utils/dom/getFProp.js +0 -8
  799. package/src/_esm/src/ts/utils/dom/getFProp.js.map +0 -1
  800. package/src/_esm/src/ts/utils/dom/guiSizeToggler.d.ts +0 -18
  801. package/src/_esm/src/ts/utils/dom/guiSizeToggler.js +0 -40
  802. package/src/_esm/src/ts/utils/dom/guiSizeToggler.js.map +0 -1
  803. package/src/_esm/src/ts/utils/findInVertexArray.d.ts +0 -19
  804. package/src/_esm/src/ts/utils/findInVertexArray.js +0 -25
  805. package/src/_esm/src/ts/utils/findInVertexArray.js.map +0 -1
  806. package/src/_esm/src/ts/utils/gup.d.ts +0 -14
  807. package/src/_esm/src/ts/utils/gup.js +0 -27
  808. package/src/_esm/src/ts/utils/gup.js.map +0 -1
  809. package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
  810. package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.js +0 -648
  811. package/src/_esm/src/ts/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
  812. package/src/_esm/src/ts/utils/helpers/CircleHelper.d.ts +0 -73
  813. package/src/_esm/src/ts/utils/helpers/CircleHelper.js +0 -88
  814. package/src/_esm/src/ts/utils/helpers/CircleHelper.js.map +0 -1
  815. package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.d.ts +0 -90
  816. package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.js +0 -109
  817. package/src/_esm/src/ts/utils/helpers/CircleSectorHelper.js.map +0 -1
  818. package/src/_esm/src/ts/utils/helpers/TriangleHelper.d.ts +0 -57
  819. package/src/_esm/src/ts/utils/helpers/TriangleHelper.js +0 -78
  820. package/src/_esm/src/ts/utils/helpers/TriangleHelper.js.map +0 -1
  821. package/src/_esm/src/ts/utils/helpers/VEllipseHelper.d.ts +0 -32
  822. package/src/_esm/src/ts/utils/helpers/VEllipseHelper.js +0 -83
  823. package/src/_esm/src/ts/utils/helpers/VEllipseHelper.js.map +0 -1
  824. package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
  825. package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.js +0 -130
  826. package/src/_esm/src/ts/utils/helpers/VEllipseSectorHelper.js.map +0 -1
  827. package/src/_esm/src/ts/utils/io/FileDrop.d.ts +0 -110
  828. package/src/_esm/src/ts/utils/io/FileDrop.js +0 -171
  829. package/src/_esm/src/ts/utils/io/FileDrop.js.map +0 -1
  830. package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.d.ts +0 -78
  831. package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.js +0 -217
  832. package/src/_esm/src/ts/utils/parsers/LinearColorGradientParser.js.map +0 -1
  833. package/src/_esm/src/ts/utils/parsers/OBJParser.d.ts +0 -24
  834. package/src/_esm/src/ts/utils/parsers/OBJParser.js +0 -72
  835. package/src/_esm/src/ts/utils/parsers/OBJParser.js.map +0 -1
  836. package/src/_esm/src/ts/utils/parsers/STLParser.d.ts +0 -61
  837. package/src/_esm/src/ts/utils/parsers/STLParser.js +0 -175
  838. package/src/_esm/src/ts/utils/parsers/STLParser.js.map +0 -1
  839. package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
  840. package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.js +0 -482
  841. package/src/_esm/src/ts/utils/parsers/svg/parseSVGPathData.js.map +0 -1
  842. package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
  843. package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.js +0 -49
  844. package/src/_esm/src/ts/utils/parsers/svg/splitSVGPathData.js.map +0 -1
  845. package/src/_esm/src/ts/utils/parsers/svg/types.d.ts +0 -63
  846. package/src/_esm/src/ts/utils/parsers/svg/types.js +0 -16
  847. package/src/_esm/src/ts/utils/parsers/svg/types.js.map +0 -1
  848. package/src/_esm/utils/InitializationObserver.d.ts +0 -18
  849. package/src/_esm/utils/InitializationObserver.js +0 -61
  850. package/src/_esm/utils/InitializationObserver.js.map +0 -1
  851. package/src/_esm/utils/LissajousFigure.d.ts +0 -34
  852. package/src/_esm/utils/LissajousFigure.js +0 -99
  853. package/src/_esm/utils/LissajousFigure.js.map +0 -1
  854. package/src/_esm/utils/NGons.d.ts +0 -13
  855. package/src/_esm/utils/NGons.js +0 -36
  856. package/src/_esm/utils/NGons.js.map +0 -1
  857. package/src/_esm/utils/Params.d.ts +0 -17
  858. package/src/_esm/utils/Params.js +0 -52
  859. package/src/_esm/utils/Params.js.map +0 -1
  860. package/src/_esm/utils/PerlinNoise.d.ts +0 -19
  861. package/src/_esm/utils/PerlinNoise.js +0 -350
  862. package/src/_esm/utils/PerlinNoise.js.map +0 -1
  863. package/src/_esm/utils/SVGPathUtils.d.ts +0 -22
  864. package/src/_esm/utils/SVGPathUtils.js +0 -45
  865. package/src/_esm/utils/SVGPathUtils.js.map +0 -1
  866. package/src/_esm/utils/WebColors.d.ts +0 -35
  867. package/src/_esm/utils/WebColors.js +0 -58
  868. package/src/_esm/utils/WebColors.js.map +0 -1
  869. package/src/_esm/utils/WebColorsContrast.d.ts +0 -6
  870. package/src/_esm/utils/WebColorsContrast.js +0 -12
  871. package/src/_esm/utils/WebColorsContrast.js.map +0 -1
  872. package/src/_esm/utils/WebColorsMalachite.d.ts +0 -12
  873. package/src/_esm/utils/WebColorsMalachite.js +0 -28
  874. package/src/_esm/utils/WebColorsMalachite.js.map +0 -1
  875. package/src/_esm/utils/algorithms/CatmullRomPath.d.ts +0 -60
  876. package/src/_esm/utils/algorithms/CatmullRomPath.js +0 -107
  877. package/src/_esm/utils/algorithms/CatmullRomPath.js.map +0 -1
  878. package/src/_esm/utils/algorithms/CircleIntersections.d.ts +0 -170
  879. package/src/_esm/utils/algorithms/CircleIntersections.js +0 -307
  880. package/src/_esm/utils/algorithms/CircleIntersections.js.map +0 -1
  881. package/src/_esm/utils/algorithms/ContourLineDetection.d.ts +0 -150
  882. package/src/_esm/utils/algorithms/ContourLineDetection.js +0 -366
  883. package/src/_esm/utils/algorithms/ContourLineDetection.js.map +0 -1
  884. package/src/_esm/utils/algorithms/CubicSplinePath.d.ts +0 -63
  885. package/src/_esm/utils/algorithms/CubicSplinePath.js +0 -174
  886. package/src/_esm/utils/algorithms/CubicSplinePath.js.map +0 -1
  887. package/src/_esm/utils/algorithms/HobbyPath.d.ts +0 -81
  888. package/src/_esm/utils/algorithms/HobbyPath.js +0 -277
  889. package/src/_esm/utils/algorithms/HobbyPath.js.map +0 -1
  890. package/src/_esm/utils/algorithms/Metaballs.d.ts +0 -30
  891. package/src/_esm/utils/algorithms/Metaballs.js +0 -113
  892. package/src/_esm/utils/algorithms/Metaballs.js.map +0 -1
  893. package/src/_esm/utils/algorithms/PolygonInset.d.ts +0 -184
  894. package/src/_esm/utils/algorithms/PolygonInset.js +0 -428
  895. package/src/_esm/utils/algorithms/PolygonInset.js.map +0 -1
  896. package/src/_esm/utils/algorithms/PolygonTesselationOutlines.d.ts +0 -145
  897. package/src/_esm/utils/algorithms/PolygonTesselationOutlines.js +0 -267
  898. package/src/_esm/utils/algorithms/PolygonTesselationOutlines.js.map +0 -1
  899. package/src/_esm/utils/algorithms/arrayFill.d.ts +0 -8
  900. package/src/_esm/utils/algorithms/arrayFill.js +0 -18
  901. package/src/_esm/utils/algorithms/arrayFill.js.map +0 -1
  902. package/src/_esm/utils/algorithms/arrayResize.d.ts +0 -8
  903. package/src/_esm/utils/algorithms/arrayResize.js +0 -24
  904. package/src/_esm/utils/algorithms/arrayResize.js.map +0 -1
  905. package/src/_esm/utils/algorithms/arrayShuffle.d.ts +0 -8
  906. package/src/_esm/utils/algorithms/arrayShuffle.js +0 -15
  907. package/src/_esm/utils/algorithms/arrayShuffle.js.map +0 -1
  908. package/src/_esm/utils/algorithms/clearDuplicateVertices.d.ts +0 -22
  909. package/src/_esm/utils/algorithms/clearDuplicateVertices.js +0 -51
  910. package/src/_esm/utils/algorithms/clearDuplicateVertices.js.map +0 -1
  911. package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.d.ts +0 -24
  912. package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.js +0 -61
  913. package/src/_esm/utils/algorithms/clearPolygonDuplicateVertices.js.map +0 -1
  914. package/src/_esm/utils/algorithms/convexHull.d.ts +0 -23
  915. package/src/_esm/utils/algorithms/convexHull.js +0 -71
  916. package/src/_esm/utils/algorithms/convexHull.js.map +0 -1
  917. package/src/_esm/utils/algorithms/convexPolygonIncircle.d.ts +0 -41
  918. package/src/_esm/utils/algorithms/convexPolygonIncircle.js +0 -145
  919. package/src/_esm/utils/algorithms/convexPolygonIncircle.js.map +0 -1
  920. package/src/_esm/utils/algorithms/createRandomizedPolygon.d.ts +0 -14
  921. package/src/_esm/utils/algorithms/createRandomizedPolygon.js +0 -28
  922. package/src/_esm/utils/algorithms/createRandomizedPolygon.js.map +0 -1
  923. package/src/_esm/utils/algorithms/delaunay.d.ts +0 -30
  924. package/src/_esm/utils/algorithms/delaunay.js +0 -157
  925. package/src/_esm/utils/algorithms/delaunay.js.map +0 -1
  926. package/src/_esm/utils/algorithms/delaunay2voronoi.d.ts +0 -25
  927. package/src/_esm/utils/algorithms/delaunay2voronoi.js +0 -103
  928. package/src/_esm/utils/algorithms/delaunay2voronoi.js.map +0 -1
  929. package/src/_esm/utils/algorithms/detectPaths.d.ts +0 -21
  930. package/src/_esm/utils/algorithms/detectPaths.js +0 -169
  931. package/src/_esm/utils/algorithms/detectPaths.js.map +0 -1
  932. package/src/_esm/utils/algorithms/findPolygonSelfIntersections.d.ts +0 -21
  933. package/src/_esm/utils/algorithms/findPolygonSelfIntersections.js +0 -51
  934. package/src/_esm/utils/algorithms/findPolygonSelfIntersections.js.map +0 -1
  935. package/src/_esm/utils/algorithms/getContrastColor.d.ts +0 -13
  936. package/src/_esm/utils/algorithms/getContrastColor.js +0 -26
  937. package/src/_esm/utils/algorithms/getContrastColor.js.map +0 -1
  938. package/src/_esm/utils/algorithms/matrixFill.d.ts +0 -10
  939. package/src/_esm/utils/algorithms/matrixFill.js +0 -21
  940. package/src/_esm/utils/algorithms/matrixFill.js.map +0 -1
  941. package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.d.ts +0 -23
  942. package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.js +0 -270
  943. package/src/_esm/utils/algorithms/pixelCornersToRoundPaths.js.map +0 -1
  944. package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.d.ts +0 -28
  945. package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.js +0 -102
  946. package/src/_esm/utils/algorithms/splitPolygonToNonIntersecting.js.map +0 -1
  947. package/src/_esm/utils/algorithms/sutherlandHodgman.d.ts +0 -16
  948. package/src/_esm/utils/algorithms/sutherlandHodgman.js +0 -76
  949. package/src/_esm/utils/algorithms/sutherlandHodgman.js.map +0 -1
  950. package/src/_esm/utils/cloneVertexArray.d.ts +0 -13
  951. package/src/_esm/utils/cloneVertexArray.js +0 -23
  952. package/src/_esm/utils/cloneVertexArray.js.map +0 -1
  953. package/src/_esm/utils/createRandomizedPolygon.d.ts +0 -14
  954. package/src/_esm/utils/createRandomizedPolygon.js +0 -32
  955. package/src/_esm/utils/createRandomizedPolygon.js.map +0 -1
  956. package/src/_esm/utils/datastructures/CircularIntervalSet.d.ts +0 -83
  957. package/src/_esm/utils/datastructures/CircularIntervalSet.js +0 -162
  958. package/src/_esm/utils/datastructures/CircularIntervalSet.js.map +0 -1
  959. package/src/_esm/utils/datastructures/Color.d.ts +0 -391
  960. package/src/_esm/utils/datastructures/Color.js +0 -1067
  961. package/src/_esm/utils/datastructures/Color.js.map +0 -1
  962. package/src/_esm/utils/datastructures/ColorGradient.d.ts +0 -81
  963. package/src/_esm/utils/datastructures/ColorGradient.js +0 -175
  964. package/src/_esm/utils/datastructures/ColorGradient.js.map +0 -1
  965. package/src/_esm/utils/datastructures/DataGrid2d.d.ts +0 -53
  966. package/src/_esm/utils/datastructures/DataGrid2d.js +0 -20
  967. package/src/_esm/utils/datastructures/DataGrid2d.js.map +0 -1
  968. package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.d.ts +0 -88
  969. package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.js +0 -154
  970. package/src/_esm/utils/datastructures/DataGrid2dArrayMatrix.js.map +0 -1
  971. package/src/_esm/utils/datastructures/DataGrid2dListAdapter.d.ts +0 -59
  972. package/src/_esm/utils/datastructures/DataGrid2dListAdapter.js +0 -83
  973. package/src/_esm/utils/datastructures/DataGrid2dListAdapter.js.map +0 -1
  974. package/src/_esm/utils/datastructures/GenericPath.d.ts +0 -86
  975. package/src/_esm/utils/datastructures/GenericPath.js +0 -121
  976. package/src/_esm/utils/datastructures/GenericPath.js.map +0 -1
  977. package/src/_esm/utils/datastructures/GeometryMesh.d.ts +0 -49
  978. package/src/_esm/utils/datastructures/GeometryMesh.js +0 -57
  979. package/src/_esm/utils/datastructures/GeometryMesh.js.map +0 -1
  980. package/src/_esm/utils/datastructures/Girih.d.ts +0 -181
  981. package/src/_esm/utils/datastructures/Girih.js +0 -265
  982. package/src/_esm/utils/datastructures/Girih.js.map +0 -1
  983. package/src/_esm/utils/datastructures/GirihBowtie.d.ts +0 -37
  984. package/src/_esm/utils/datastructures/GirihBowtie.js +0 -134
  985. package/src/_esm/utils/datastructures/GirihBowtie.js.map +0 -1
  986. package/src/_esm/utils/datastructures/GirihDecagon.d.ts +0 -52
  987. package/src/_esm/utils/datastructures/GirihDecagon.js +0 -114
  988. package/src/_esm/utils/datastructures/GirihDecagon.js.map +0 -1
  989. package/src/_esm/utils/datastructures/GirihHexagon.d.ts +0 -39
  990. package/src/_esm/utils/datastructures/GirihHexagon.js +0 -182
  991. package/src/_esm/utils/datastructures/GirihHexagon.js.map +0 -1
  992. package/src/_esm/utils/datastructures/GirihPenroseRhombus.d.ts +0 -46
  993. package/src/_esm/utils/datastructures/GirihPenroseRhombus.js +0 -171
  994. package/src/_esm/utils/datastructures/GirihPenroseRhombus.js.map +0 -1
  995. package/src/_esm/utils/datastructures/GirihPentagon.d.ts +0 -37
  996. package/src/_esm/utils/datastructures/GirihPentagon.js +0 -91
  997. package/src/_esm/utils/datastructures/GirihPentagon.js.map +0 -1
  998. package/src/_esm/utils/datastructures/GirihRhombus.d.ts +0 -38
  999. package/src/_esm/utils/datastructures/GirihRhombus.js +0 -137
  1000. package/src/_esm/utils/datastructures/GirihRhombus.js.map +0 -1
  1001. package/src/_esm/utils/datastructures/GirihTile.d.ts +0 -283
  1002. package/src/_esm/utils/datastructures/GirihTile.js +0 -290
  1003. package/src/_esm/utils/datastructures/GirihTile.js.map +0 -1
  1004. package/src/_esm/utils/datastructures/Matrix4x4.d.ts +0 -244
  1005. package/src/_esm/utils/datastructures/Matrix4x4.js +0 -250
  1006. package/src/_esm/utils/datastructures/Matrix4x4.js.map +0 -1
  1007. package/src/_esm/utils/datastructures/VoronoiCell.d.ts +0 -122
  1008. package/src/_esm/utils/datastructures/VoronoiCell.js +0 -182
  1009. package/src/_esm/utils/datastructures/VoronoiCell.js.map +0 -1
  1010. package/src/_esm/utils/datastructures/interfaces.d.ts +0 -13
  1011. package/src/_esm/utils/datastructures/interfaces.js +0 -10
  1012. package/src/_esm/utils/datastructures/interfaces.js.map +0 -1
  1013. package/src/_esm/utils/detectDarkMode.d.ts +0 -10
  1014. package/src/_esm/utils/detectDarkMode.js +0 -41
  1015. package/src/_esm/utils/detectDarkMode.js.map +0 -1
  1016. package/src/_esm/utils/dom/components/ColorGradientPicker.d.ts +0 -246
  1017. package/src/_esm/utils/dom/components/ColorGradientPicker.js +0 -780
  1018. package/src/_esm/utils/dom/components/ColorGradientPicker.js.map +0 -1
  1019. package/src/_esm/utils/dom/components/ColorGradientPickerJSX.d.ts +0 -129
  1020. package/src/_esm/utils/dom/components/ColorGradientPickerJSX.js +0 -582
  1021. package/src/_esm/utils/dom/components/ColorGradientPickerJSX.js.map +0 -1
  1022. package/src/_esm/utils/dom/components/ColorGradientSelector.d.ts +0 -118
  1023. package/src/_esm/utils/dom/components/ColorGradientSelector.js +0 -376
  1024. package/src/_esm/utils/dom/components/ColorGradientSelector.js.map +0 -1
  1025. package/src/_esm/utils/dom/components/Test.d.ts +0 -7
  1026. package/src/_esm/utils/dom/components/Test.js +0 -63
  1027. package/src/_esm/utils/dom/components/Test.js.map +0 -1
  1028. package/src/_esm/utils/dom/getAvailableContainerSpace.d.ts +0 -2
  1029. package/src/_esm/utils/dom/getAvailableContainerSpace.js +0 -29
  1030. package/src/_esm/utils/dom/getAvailableContainerSpace.js.map +0 -1
  1031. package/src/_esm/utils/dom/getFProp.d.ts +0 -5
  1032. package/src/_esm/utils/dom/getFProp.js +0 -12
  1033. package/src/_esm/utils/dom/getFProp.js.map +0 -1
  1034. package/src/_esm/utils/dom/guiSizeToggler.d.ts +0 -18
  1035. package/src/_esm/utils/dom/guiSizeToggler.js +0 -44
  1036. package/src/_esm/utils/dom/guiSizeToggler.js.map +0 -1
  1037. package/src/_esm/utils/findInVertexArray.d.ts +0 -19
  1038. package/src/_esm/utils/findInVertexArray.js +0 -29
  1039. package/src/_esm/utils/findInVertexArray.js.map +0 -1
  1040. package/src/_esm/utils/getFProp.d.ts +0 -5
  1041. package/src/_esm/utils/getFProp.js +0 -8
  1042. package/src/_esm/utils/getFProp.js.map +0 -1
  1043. package/src/_esm/utils/gup.d.ts +0 -14
  1044. package/src/_esm/utils/gup.js +0 -31
  1045. package/src/_esm/utils/gup.js.map +0 -1
  1046. package/src/_esm/utils/helpers/BezierPathInteractionHelper.d.ts +0 -272
  1047. package/src/_esm/utils/helpers/BezierPathInteractionHelper.js +0 -655
  1048. package/src/_esm/utils/helpers/BezierPathInteractionHelper.js.map +0 -1
  1049. package/src/_esm/utils/helpers/CircleHelper.d.ts +0 -73
  1050. package/src/_esm/utils/helpers/CircleHelper.js +0 -92
  1051. package/src/_esm/utils/helpers/CircleHelper.js.map +0 -1
  1052. package/src/_esm/utils/helpers/CircleSectorHelper.d.ts +0 -90
  1053. package/src/_esm/utils/helpers/CircleSectorHelper.js +0 -113
  1054. package/src/_esm/utils/helpers/CircleSectorHelper.js.map +0 -1
  1055. package/src/_esm/utils/helpers/TriangleHelper.d.ts +0 -57
  1056. package/src/_esm/utils/helpers/TriangleHelper.js +0 -82
  1057. package/src/_esm/utils/helpers/TriangleHelper.js.map +0 -1
  1058. package/src/_esm/utils/helpers/VEllipseHelper.d.ts +0 -32
  1059. package/src/_esm/utils/helpers/VEllipseHelper.js +0 -87
  1060. package/src/_esm/utils/helpers/VEllipseHelper.js.map +0 -1
  1061. package/src/_esm/utils/helpers/VEllipseSectorHelper.d.ts +0 -52
  1062. package/src/_esm/utils/helpers/VEllipseSectorHelper.js +0 -134
  1063. package/src/_esm/utils/helpers/VEllipseSectorHelper.js.map +0 -1
  1064. package/src/_esm/utils/io/DndFileHandler.d.ts +0 -63
  1065. package/src/_esm/utils/io/DndFileHandler.js +0 -106
  1066. package/src/_esm/utils/io/DndFileHandler.js.map +0 -1
  1067. package/src/_esm/utils/io/FileDrop.d.ts +0 -110
  1068. package/src/_esm/utils/io/FileDrop.js +0 -175
  1069. package/src/_esm/utils/io/FileDrop.js.map +0 -1
  1070. package/src/_esm/utils/parsers/LinearColorGradientParser.d.ts +0 -78
  1071. package/src/_esm/utils/parsers/LinearColorGradientParser.js +0 -223
  1072. package/src/_esm/utils/parsers/LinearColorGradientParser.js.map +0 -1
  1073. package/src/_esm/utils/parsers/OBJParser.d.ts +0 -25
  1074. package/src/_esm/utils/parsers/OBJParser.js +0 -78
  1075. package/src/_esm/utils/parsers/OBJParser.js.map +0 -1
  1076. package/src/_esm/utils/parsers/STLParser.d.ts +0 -61
  1077. package/src/_esm/utils/parsers/STLParser.js +0 -179
  1078. package/src/_esm/utils/parsers/STLParser.js.map +0 -1
  1079. package/src/_esm/utils/parsers/svg/parseSVGPathData.d.ts +0 -27
  1080. package/src/_esm/utils/parsers/svg/parseSVGPathData.js +0 -486
  1081. package/src/_esm/utils/parsers/svg/parseSVGPathData.js.map +0 -1
  1082. package/src/_esm/utils/parsers/svg/splitSVGPathData.d.ts +0 -20
  1083. package/src/_esm/utils/parsers/svg/splitSVGPathData.js +0 -53
  1084. package/src/_esm/utils/parsers/svg/splitSVGPathData.js.map +0 -1
  1085. package/src/_esm/utils/parsers/svg/types.d.ts +0 -63
  1086. package/src/_esm/utils/parsers/svg/types.js +0 -17
  1087. 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