plotboilerplate 1.22.0 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/README.md +2 -0
  2. package/dist/index.esm.js +240 -79
  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 +510 -340
  9. package/dist/plotboilerplate.min.js +1 -1
  10. package/package.json +7 -4
  11. package/src/cjs/BezierPath.js.map +1 -1
  12. package/src/cjs/Bounds.js +1 -1
  13. package/src/cjs/Bounds.js.map +1 -1
  14. package/src/cjs/Circle.js.map +1 -1
  15. package/src/cjs/CircleSector.d.ts +64 -1
  16. package/src/cjs/CircleSector.js +121 -1
  17. package/src/cjs/CircleSector.js.map +1 -1
  18. package/src/cjs/CubicBezierCurve.js +2 -2
  19. package/src/cjs/CubicBezierCurve.js.map +1 -1
  20. package/src/cjs/Grid.js.map +1 -1
  21. package/src/cjs/KeyHandler.d.ts +1 -1
  22. package/src/cjs/KeyHandler.js +13 -13
  23. package/src/cjs/KeyHandler.js.map +1 -1
  24. package/src/cjs/Line.js +2 -0
  25. package/src/cjs/Line.js.map +1 -1
  26. package/src/cjs/MouseHandler.d.ts +2 -2
  27. package/src/cjs/MouseHandler.js +7 -5
  28. package/src/cjs/MouseHandler.js.map +1 -1
  29. package/src/cjs/PlotBoilerplate.d.ts +17 -4
  30. package/src/cjs/PlotBoilerplate.js +95 -66
  31. package/src/cjs/PlotBoilerplate.js.map +1 -1
  32. package/src/cjs/Polygon.js.map +1 -1
  33. package/src/cjs/Triangle.js +1 -1
  34. package/src/cjs/Triangle.js.map +1 -1
  35. package/src/cjs/UIDGenerator.js +1 -1
  36. package/src/cjs/UIDGenerator.js.map +1 -1
  37. package/src/cjs/VEllipse.js.map +1 -1
  38. package/src/cjs/VEllipseSector.js +1 -1
  39. package/src/cjs/VEllipseSector.js.map +1 -1
  40. package/src/cjs/Vector.js +2 -0
  41. package/src/cjs/Vector.js.map +1 -1
  42. package/src/cjs/VertTuple.js.map +1 -1
  43. package/src/cjs/Vertex.d.ts +3 -2
  44. package/src/cjs/Vertex.js +13 -7
  45. package/src/cjs/Vertex.js.map +1 -1
  46. package/src/cjs/VertexAttr.d.ts +2 -1
  47. package/src/cjs/VertexAttr.js +2 -1
  48. package/src/cjs/VertexAttr.js.map +1 -1
  49. package/src/cjs/VertexListeners.d.ts +1 -1
  50. package/src/cjs/VertexListeners.js.map +1 -1
  51. package/src/cjs/draw.js +1 -1
  52. package/src/cjs/draw.js.map +1 -1
  53. package/src/cjs/drawgl.js.map +1 -1
  54. package/src/cjs/drawutilssvg.d.ts +17 -3
  55. package/src/cjs/drawutilssvg.js +97 -91
  56. package/src/cjs/drawutilssvg.js.map +1 -1
  57. package/src/cjs/geomutils.js +2 -2
  58. package/src/cjs/geomutils.js.map +1 -1
  59. package/src/cjs/index.js +5 -1
  60. package/src/cjs/index.js.map +1 -1
  61. package/src/cjs/interfaces/DrawLib.d.ts +2 -2
  62. package/src/cjs/interfaces/core.d.ts +3 -3
  63. package/src/cjs/interfaces/externals.d.ts +12 -0
  64. package/src/cjs/interfaces/index.js +5 -1
  65. package/src/cjs/interfaces/index.js.map +1 -1
  66. package/src/cjs/utils/InitializationObserver.d.ts +18 -0
  67. package/src/cjs/utils/InitializationObserver.js +56 -0
  68. package/src/cjs/utils/InitializationObserver.js.map +1 -0
  69. package/src/cjs/utils/NGons.d.ts +13 -0
  70. package/src/cjs/utils/NGons.js +36 -0
  71. package/src/cjs/utils/NGons.js.map +1 -0
  72. package/src/cjs/utils/Params.js.map +1 -1
  73. package/src/cjs/utils/WebColors.js.map +1 -1
  74. package/src/cjs/utils/WebColorsContrast.js +1 -1
  75. package/src/cjs/utils/WebColorsContrast.js.map +1 -1
  76. package/src/cjs/utils/algorithms/CatmullRomPath.js.map +1 -1
  77. package/src/cjs/utils/algorithms/CircleIntersections.d.ts +3 -2
  78. package/src/cjs/utils/algorithms/CircleIntersections.js +12 -20
  79. package/src/cjs/utils/algorithms/CircleIntersections.js.map +1 -1
  80. package/src/cjs/utils/algorithms/ContourLineDetection.js +5 -5
  81. package/src/cjs/utils/algorithms/ContourLineDetection.js.map +1 -1
  82. package/src/cjs/utils/algorithms/CubicSplinePath.js.map +1 -1
  83. package/src/cjs/utils/algorithms/HobbyPath.js.map +1 -1
  84. package/src/cjs/utils/algorithms/Metaballs.d.ts +30 -0
  85. package/src/cjs/utils/algorithms/Metaballs.js +114 -0
  86. package/src/cjs/utils/algorithms/Metaballs.js.map +1 -0
  87. package/src/cjs/utils/algorithms/arrayResize.d.ts +8 -0
  88. package/src/cjs/utils/algorithms/arrayResize.js +24 -0
  89. package/src/cjs/utils/algorithms/arrayResize.js.map +1 -0
  90. package/src/cjs/utils/algorithms/clearDuplicateVertices.js.map +1 -1
  91. package/src/cjs/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
  92. package/src/cjs/utils/algorithms/convexHull.js.map +1 -1
  93. package/src/cjs/utils/algorithms/convexPolygonIncircle.js.map +1 -1
  94. package/src/cjs/utils/algorithms/delaunay.js.map +1 -1
  95. package/src/cjs/utils/algorithms/delaunay2voronoi.js.map +1 -1
  96. package/src/cjs/utils/algorithms/detectPaths.js.map +1 -1
  97. package/src/cjs/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
  98. package/src/cjs/utils/algorithms/matrixFill.js +1 -1
  99. package/src/cjs/utils/algorithms/matrixFill.js.map +1 -1
  100. package/src/cjs/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
  101. package/src/cjs/utils/algorithms/sutherlandHodgman.js.map +1 -1
  102. package/src/cjs/utils/cloneVertexArray.js.map +1 -1
  103. package/src/cjs/utils/creategui.js +320 -244
  104. package/src/cjs/utils/dat.gui.arrowbounce.polyfill.js +74 -73
  105. package/src/cjs/utils/dat.gui.title.polyfill.js +9 -7
  106. package/src/cjs/utils/datastructures/CircularIntervalSet.js.map +1 -1
  107. package/src/cjs/utils/datastructures/Color.d.ts +2 -1
  108. package/src/cjs/utils/datastructures/Color.js +35 -16
  109. package/src/cjs/utils/datastructures/Color.js.map +1 -1
  110. package/src/cjs/utils/datastructures/DataGrid2d.d.ts +1 -1
  111. package/src/cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +2 -2
  112. package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js +1 -1
  113. package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js.map +1 -1
  114. package/src/cjs/utils/datastructures/GenericPath.js.map +1 -1
  115. package/src/cjs/utils/datastructures/Girih.d.ts +3 -2
  116. package/src/cjs/utils/datastructures/Girih.js +2 -1
  117. package/src/cjs/utils/datastructures/Girih.js.map +1 -1
  118. package/src/cjs/utils/datastructures/GirihBowtie.js +2 -0
  119. package/src/cjs/utils/datastructures/GirihBowtie.js.map +1 -1
  120. package/src/cjs/utils/datastructures/GirihDecagon.js +2 -0
  121. package/src/cjs/utils/datastructures/GirihDecagon.js.map +1 -1
  122. package/src/cjs/utils/datastructures/GirihHexagon.js +2 -0
  123. package/src/cjs/utils/datastructures/GirihHexagon.js.map +1 -1
  124. package/src/cjs/utils/datastructures/GirihPenroseRhombus.js +3 -1
  125. package/src/cjs/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
  126. package/src/cjs/utils/datastructures/GirihPentagon.js +2 -0
  127. package/src/cjs/utils/datastructures/GirihPentagon.js.map +1 -1
  128. package/src/cjs/utils/datastructures/GirihRhombus.js +2 -0
  129. package/src/cjs/utils/datastructures/GirihRhombus.js.map +1 -1
  130. package/src/cjs/utils/datastructures/GirihTile.js +4 -2
  131. package/src/cjs/utils/datastructures/GirihTile.js.map +1 -1
  132. package/src/cjs/utils/datastructures/Matrix4x4.js.map +1 -1
  133. package/src/cjs/utils/datastructures/VoronoiCell.js.map +1 -1
  134. package/src/cjs/utils/datastructures/interfaces.d.ts +3 -3
  135. package/src/cjs/utils/detectDarkMode.js.map +1 -1
  136. package/src/cjs/utils/dom/getAvailableContainerSpace.js +1 -1
  137. package/src/cjs/utils/dom/getAvailableContainerSpace.js.map +1 -1
  138. package/src/cjs/utils/dom/guiSizeToggler.d.ts +17 -0
  139. package/src/cjs/utils/dom/guiSizeToggler.js +42 -0
  140. package/src/cjs/utils/dom/guiSizeToggler.js.map +1 -0
  141. package/src/cjs/utils/findInVertexArray.js.map +1 -1
  142. package/src/cjs/utils/gup.d.ts +8 -0
  143. package/src/cjs/utils/gup.js +8 -0
  144. package/src/cjs/utils/gup.js.map +1 -1
  145. package/src/cjs/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
  146. package/src/cjs/utils/helpers/BezierPathInteractionHelper.js +3 -2
  147. package/src/cjs/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
  148. package/src/cjs/utils/helpers/CircleHelper.d.ts +38 -3
  149. package/src/cjs/utils/helpers/CircleHelper.js +51 -11
  150. package/src/cjs/utils/helpers/CircleHelper.js.map +1 -1
  151. package/src/cjs/utils/helpers/CircleSectorHelper.d.ts +47 -1
  152. package/src/cjs/utils/helpers/CircleSectorHelper.js +85 -14
  153. package/src/cjs/utils/helpers/CircleSectorHelper.js.map +1 -1
  154. package/src/cjs/utils/io/FileDrop.d.ts +3 -3
  155. package/src/cjs/utils/io/FileDrop.js.map +1 -1
  156. package/src/cjs/utils/lil.gui.arrowbounce.polyfill.js +133 -0
  157. package/src/cjs/utils/lil.gui.title.polyfill.js +32 -0
  158. package/src/cjs/utils/parsers/OBJParser.d.ts +2 -2
  159. package/src/cjs/utils/parsers/OBJParser.js.map +1 -1
  160. package/src/cjs/utils/parsers/STLParser.d.ts +4 -3
  161. package/src/cjs/utils/parsers/STLParser.js +62 -12
  162. package/src/cjs/utils/parsers/STLParser.js.map +1 -1
  163. package/src/cjs/utils/parsers/svg/parseSVGPathData.js +1 -1
  164. package/src/cjs/utils/parsers/svg/parseSVGPathData.js.map +1 -1
  165. package/src/cjs/utils/parsers/svg/splitSVGPathData.js.map +1 -1
  166. package/src/cjs/utils/parsers/svg/types.d.ts +13 -13
  167. package/src/createDemoDrawables.js +48 -3
  168. package/src/esm/BezierPath.js.map +1 -1
  169. package/src/esm/Bounds.js.map +1 -1
  170. package/src/esm/Circle.js.map +1 -1
  171. package/src/esm/CircleSector.d.ts +64 -1
  172. package/src/esm/CircleSector.js +121 -1
  173. package/src/esm/CircleSector.js.map +1 -1
  174. package/src/esm/CubicBezierCurve.js.map +1 -1
  175. package/src/esm/Grid.js.map +1 -1
  176. package/src/esm/KeyHandler.d.ts +1 -1
  177. package/src/esm/KeyHandler.js +13 -13
  178. package/src/esm/KeyHandler.js.map +1 -1
  179. package/src/esm/Line.js.map +1 -1
  180. package/src/esm/MouseHandler.d.ts +2 -2
  181. package/src/esm/MouseHandler.js +4 -4
  182. package/src/esm/MouseHandler.js.map +1 -1
  183. package/src/esm/PlotBoilerplate.d.ts +17 -4
  184. package/src/esm/PlotBoilerplate.js +61 -32
  185. package/src/esm/PlotBoilerplate.js.map +1 -1
  186. package/src/esm/Polygon.js.map +1 -1
  187. package/src/esm/Triangle.js.map +1 -1
  188. package/src/esm/VEllipse.js.map +1 -1
  189. package/src/esm/VEllipseSector.js +1 -1
  190. package/src/esm/VEllipseSector.js.map +1 -1
  191. package/src/esm/Vector.js.map +1 -1
  192. package/src/esm/VertTuple.js.map +1 -1
  193. package/src/esm/Vertex.d.ts +3 -2
  194. package/src/esm/Vertex.js +9 -3
  195. package/src/esm/Vertex.js.map +1 -1
  196. package/src/esm/VertexAttr.d.ts +2 -1
  197. package/src/esm/VertexAttr.js +2 -1
  198. package/src/esm/VertexAttr.js.map +1 -1
  199. package/src/esm/VertexListeners.d.ts +1 -1
  200. package/src/esm/VertexListeners.js.map +1 -1
  201. package/src/esm/draw.js.map +1 -1
  202. package/src/esm/drawgl.js.map +1 -1
  203. package/src/esm/drawutilssvg.d.ts +17 -3
  204. package/src/esm/drawutilssvg.js +28 -22
  205. package/src/esm/drawutilssvg.js.map +1 -1
  206. package/src/esm/geomutils.js +2 -2
  207. package/src/esm/geomutils.js.map +1 -1
  208. package/src/esm/interfaces/DrawLib.d.ts +2 -2
  209. package/src/esm/interfaces/core.d.ts +3 -3
  210. package/src/esm/interfaces/externals.d.ts +12 -0
  211. package/src/esm/utils/InitializationObserver.d.ts +18 -0
  212. package/src/esm/utils/InitializationObserver.js +50 -0
  213. package/src/esm/utils/InitializationObserver.js.map +1 -0
  214. package/src/esm/utils/NGons.d.ts +13 -0
  215. package/src/esm/utils/NGons.js +33 -0
  216. package/src/esm/utils/NGons.js.map +1 -0
  217. package/src/esm/utils/Params.js.map +1 -1
  218. package/src/esm/utils/WebColors.js.map +1 -1
  219. package/src/esm/utils/algorithms/CatmullRomPath.js.map +1 -1
  220. package/src/esm/utils/algorithms/CircleIntersections.d.ts +3 -2
  221. package/src/esm/utils/algorithms/CircleIntersections.js +11 -19
  222. package/src/esm/utils/algorithms/CircleIntersections.js.map +1 -1
  223. package/src/esm/utils/algorithms/ContourLineDetection.js.map +1 -1
  224. package/src/esm/utils/algorithms/CubicSplinePath.js.map +1 -1
  225. package/src/esm/utils/algorithms/HobbyPath.js.map +1 -1
  226. package/src/esm/utils/algorithms/Metaballs.d.ts +30 -0
  227. package/src/esm/utils/algorithms/Metaballs.js +109 -0
  228. package/src/esm/utils/algorithms/Metaballs.js.map +1 -0
  229. package/src/esm/utils/algorithms/arrayResize.d.ts +8 -0
  230. package/src/esm/utils/algorithms/arrayResize.js +20 -0
  231. package/src/esm/utils/algorithms/arrayResize.js.map +1 -0
  232. package/src/esm/utils/algorithms/clearDuplicateVertices.js.map +1 -1
  233. package/src/esm/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
  234. package/src/esm/utils/algorithms/convexHull.js.map +1 -1
  235. package/src/esm/utils/algorithms/convexPolygonIncircle.js.map +1 -1
  236. package/src/esm/utils/algorithms/delaunay.js.map +1 -1
  237. package/src/esm/utils/algorithms/delaunay2voronoi.js.map +1 -1
  238. package/src/esm/utils/algorithms/detectPaths.js.map +1 -1
  239. package/src/esm/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
  240. package/src/esm/utils/algorithms/matrixFill.js.map +1 -1
  241. package/src/esm/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
  242. package/src/esm/utils/algorithms/sutherlandHodgman.js.map +1 -1
  243. package/src/esm/utils/cloneVertexArray.js.map +1 -1
  244. package/src/esm/utils/datastructures/CircularIntervalSet.js.map +1 -1
  245. package/src/esm/utils/datastructures/Color.d.ts +2 -1
  246. package/src/esm/utils/datastructures/Color.js +33 -14
  247. package/src/esm/utils/datastructures/Color.js.map +1 -1
  248. package/src/esm/utils/datastructures/DataGrid2d.d.ts +1 -1
  249. package/src/esm/utils/datastructures/DataGrid2dListAdapter.d.ts +2 -2
  250. package/src/esm/utils/datastructures/DataGrid2dListAdapter.js.map +1 -1
  251. package/src/esm/utils/datastructures/GenericPath.js.map +1 -1
  252. package/src/esm/utils/datastructures/Girih.d.ts +3 -2
  253. package/src/esm/utils/datastructures/Girih.js +2 -1
  254. package/src/esm/utils/datastructures/Girih.js.map +1 -1
  255. package/src/esm/utils/datastructures/GirihBowtie.js.map +1 -1
  256. package/src/esm/utils/datastructures/GirihDecagon.js.map +1 -1
  257. package/src/esm/utils/datastructures/GirihHexagon.js.map +1 -1
  258. package/src/esm/utils/datastructures/GirihPenroseRhombus.js +1 -1
  259. package/src/esm/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
  260. package/src/esm/utils/datastructures/GirihPentagon.js.map +1 -1
  261. package/src/esm/utils/datastructures/GirihRhombus.js.map +1 -1
  262. package/src/esm/utils/datastructures/GirihTile.js.map +1 -1
  263. package/src/esm/utils/datastructures/Matrix4x4.js.map +1 -1
  264. package/src/esm/utils/datastructures/VoronoiCell.js.map +1 -1
  265. package/src/esm/utils/datastructures/interfaces.d.ts +3 -3
  266. package/src/esm/utils/detectDarkMode.js.map +1 -1
  267. package/src/esm/utils/dom/guiSizeToggler.d.ts +17 -0
  268. package/src/esm/utils/dom/guiSizeToggler.js +38 -0
  269. package/src/esm/utils/dom/guiSizeToggler.js.map +1 -0
  270. package/src/esm/utils/findInVertexArray.js.map +1 -1
  271. package/src/esm/utils/gup.d.ts +8 -0
  272. package/src/esm/utils/gup.js +8 -0
  273. package/src/esm/utils/gup.js.map +1 -1
  274. package/src/esm/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
  275. package/src/esm/utils/helpers/BezierPathInteractionHelper.js +3 -2
  276. package/src/esm/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
  277. package/src/esm/utils/helpers/CircleHelper.d.ts +38 -3
  278. package/src/esm/utils/helpers/CircleHelper.js +51 -11
  279. package/src/esm/utils/helpers/CircleHelper.js.map +1 -1
  280. package/src/esm/utils/helpers/CircleSectorHelper.d.ts +47 -1
  281. package/src/esm/utils/helpers/CircleSectorHelper.js +85 -14
  282. package/src/esm/utils/helpers/CircleSectorHelper.js.map +1 -1
  283. package/src/esm/utils/io/FileDrop.d.ts +3 -3
  284. package/src/esm/utils/io/FileDrop.js.map +1 -1
  285. package/src/esm/utils/parsers/OBJParser.d.ts +2 -2
  286. package/src/esm/utils/parsers/OBJParser.js.map +1 -1
  287. package/src/esm/utils/parsers/STLParser.d.ts +4 -3
  288. package/src/esm/utils/parsers/STLParser.js +63 -13
  289. package/src/esm/utils/parsers/STLParser.js.map +1 -1
  290. package/src/esm/utils/parsers/svg/parseSVGPathData.js.map +1 -1
  291. package/src/esm/utils/parsers/svg/splitSVGPathData.js.map +1 -1
  292. package/src/esm/utils/parsers/svg/types.d.ts +13 -13
  293. package/src/index-gl.js +77 -85
  294. package/src/index.js +124 -129
  295. package/src/ts/CircleSector.ts +134 -3
  296. package/src/ts/PlotBoilerplate.ts +51 -14
  297. package/src/ts/Vertex.ts +8 -3
  298. package/src/ts/VertexAttr.ts +3 -2
  299. package/src/ts/drawutilssvg.ts +38 -25
  300. package/src/ts/geomutils.ts +60 -64
  301. package/src/ts/interfaces/DrawLib.ts +0 -15
  302. package/src/ts/interfaces/externals.ts +16 -0
  303. package/src/ts/utils/InitializationObserver.ts +63 -0
  304. package/src/ts/utils/NGons.ts +35 -0
  305. package/src/ts/utils/algorithms/CircleIntersections.ts +280 -288
  306. package/src/ts/utils/algorithms/Metaballs.ts +144 -0
  307. package/src/ts/utils/algorithms/arrayResize.ts +22 -0
  308. package/src/ts/utils/datastructures/Color.ts +39 -15
  309. package/src/ts/utils/datastructures/Girih.ts +9 -8
  310. package/src/ts/utils/dom/guiSizeToggler.ts +45 -0
  311. package/src/ts/utils/gup.ts +10 -2
  312. package/src/ts/utils/helpers/BezierPathInteractionHelper.ts +9 -8
  313. package/src/ts/utils/helpers/CircleHelper.ts +70 -22
  314. package/src/ts/utils/helpers/CircleSectorHelper.ts +101 -17
  315. package/src/ts/utils/parsers/STLParser.ts +50 -16
@@ -2,7 +2,7 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 318:
5
+ /***/ 597:
6
6
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  // ESM COMPAT FLAG
@@ -10,11 +10,11 @@ __webpack_require__.r(__webpack_exports__);
10
10
 
11
11
  // EXPORTS
12
12
  __webpack_require__.d(__webpack_exports__, {
13
- "AlloyFinger": () => /* reexport */ AlloyFinger,
14
- "default": () => /* binding */ esm
13
+ AlloyFinger: () => (/* reexport */ AlloyFinger),
14
+ "default": () => (/* binding */ esm)
15
15
  });
16
16
 
17
- // CONCATENATED MODULE: ./node_modules/alloyfinger-typescript/src/esm/alloy_finger.js
17
+ ;// CONCATENATED MODULE: ./node_modules/alloyfinger-typescript/src/esm/alloy_finger.js
18
18
  /* Port from AlloyFinger v0.1.15
19
19
  * Original by dntzhang
20
20
  * Typescript port by Ikaros Kappler
@@ -404,7 +404,7 @@ class AlloyFinger {
404
404
  ;
405
405
  /* harmony default export */ const alloy_finger = ((/* unused pure expression or super */ null && (AlloyFinger)));
406
406
  //# sourceMappingURL=alloy_finger.js.map
407
- // CONCATENATED MODULE: ./node_modules/alloyfinger-typescript/src/esm/index.js
407
+ ;// CONCATENATED MODULE: ./node_modules/alloyfinger-typescript/src/esm/index.js
408
408
  /**
409
409
  * TypeScript port by Ikaros Kappler.
410
410
  *
@@ -419,7 +419,7 @@ class AlloyFinger {
419
419
 
420
420
  /***/ }),
421
421
 
422
- /***/ 126:
422
+ /***/ 733:
423
423
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
424
424
 
425
425
 
@@ -457,10 +457,10 @@ class AlloyFinger {
457
457
  **/
458
458
  Object.defineProperty(exports, "__esModule", ({ value: true }));
459
459
  exports.BezierPath = void 0;
460
- var Bounds_1 = __webpack_require__(262);
461
- var CubicBezierCurve_1 = __webpack_require__(510);
462
- var UIDGenerator_1 = __webpack_require__(197);
463
- var Vertex_1 = __webpack_require__(421);
460
+ var Bounds_1 = __webpack_require__(76);
461
+ var CubicBezierCurve_1 = __webpack_require__(973);
462
+ var UIDGenerator_1 = __webpack_require__(938);
463
+ var Vertex_1 = __webpack_require__(787);
464
464
  /**
465
465
  * @classdesc A BezierPath class.
466
466
  *
@@ -1502,7 +1502,7 @@ exports.BezierPath = BezierPath;
1502
1502
 
1503
1503
  /***/ }),
1504
1504
 
1505
- /***/ 262:
1505
+ /***/ 76:
1506
1506
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1507
1507
 
1508
1508
 
@@ -1521,8 +1521,8 @@ exports.BezierPath = BezierPath;
1521
1521
  **/
1522
1522
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1523
1523
  exports.Bounds = void 0;
1524
- var Polygon_1 = __webpack_require__(661);
1525
- var Vertex_1 = __webpack_require__(421);
1524
+ var Polygon_1 = __webpack_require__(687);
1525
+ var Vertex_1 = __webpack_require__(787);
1526
1526
  /**
1527
1527
  * @classdesc A bounds class with min and max values. Implementing IBounds.
1528
1528
  *
@@ -1598,7 +1598,7 @@ var Bounds = /** @class */ (function () {
1598
1598
  * @returns {string} Get these bounds in a human readable form.
1599
1599
  */
1600
1600
  Bounds.prototype.toString = function () {
1601
- return "{ min: " + this.min.toString() + ", max : " + this.max.toString() + ", width: " + this.width + ", height : " + this.height + " }";
1601
+ return "{ min: ".concat(this.min.toString(), ", max : ").concat(this.max.toString(), ", width: ").concat(this.width, ", height : ").concat(this.height, " }");
1602
1602
  };
1603
1603
  /**
1604
1604
  * Clone this bounds object (create a deep clone).
@@ -1657,7 +1657,7 @@ exports.Bounds = Bounds;
1657
1657
 
1658
1658
  /***/ }),
1659
1659
 
1660
- /***/ 913:
1660
+ /***/ 118:
1661
1661
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1662
1662
 
1663
1663
 
@@ -1679,10 +1679,10 @@ exports.Bounds = Bounds;
1679
1679
  **/
1680
1680
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1681
1681
  exports.Circle = void 0;
1682
- var Line_1 = __webpack_require__(831);
1683
- var UIDGenerator_1 = __webpack_require__(197);
1684
- var Vector_1 = __webpack_require__(73);
1685
- var Vertex_1 = __webpack_require__(421);
1682
+ var Line_1 = __webpack_require__(939);
1683
+ var UIDGenerator_1 = __webpack_require__(938);
1684
+ var Vector_1 = __webpack_require__(30);
1685
+ var Vertex_1 = __webpack_require__(787);
1686
1686
  /**
1687
1687
  * @classdesc A simple circle: center point and radius.
1688
1688
  *
@@ -1923,7 +1923,7 @@ exports.Circle = Circle;
1923
1923
 
1924
1924
  /***/ }),
1925
1925
 
1926
- /***/ 946:
1926
+ /***/ 135:
1927
1927
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1928
1928
 
1929
1929
 
@@ -1932,11 +1932,17 @@ exports.Circle = Circle;
1932
1932
  * @date 2020-12-17
1933
1933
  * @modified 2021-01-20 Added UID.
1934
1934
  * @modified 2021-02-26 Fixed an error in the svg-arc-calculation (case angle<90deg and anti-clockwise).
1935
- * @version 1.1.1
1935
+ * @modified 2024-01-30 Added a missing type in the `describeSVGArc` function.
1936
+ * @modified 2024-03-01 Added the `getStartPoint` and `getEndPoint` methods.
1937
+ * @modified 2024-03-08 Added the `containsAngle` method.
1938
+ * @modified 2024-03-09 Added the `circleSectorIntersection` method to find coherent sector intersections..
1939
+ * @modified 2024-03-09 Added the `angleAt` method to determine any angle at some ratio.
1940
+ * @version 1.2.0
1936
1941
  **/
1937
1942
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1938
1943
  exports.CircleSector = void 0;
1939
- var UIDGenerator_1 = __webpack_require__(197);
1944
+ var Circle_1 = __webpack_require__(118);
1945
+ var UIDGenerator_1 = __webpack_require__(938);
1940
1946
  /**
1941
1947
  * @classdesc A simple circle sector: circle, start- and end-angle.
1942
1948
  *
@@ -1966,10 +1972,124 @@ var CircleSector = /** @class */ (function () {
1966
1972
  this.startAngle = startAngle;
1967
1973
  this.endAngle = endAngle;
1968
1974
  }
1975
+ /**
1976
+ * Checks wether the given angle (must be inside 0 and PI*2) is contained inside this sector.
1977
+ *
1978
+ * @param {number} angle - The numeric angle to check.
1979
+ * @method containsAngle
1980
+ * @instance
1981
+ * @memberof CircleSector
1982
+ * @return {boolean} True if (and only if) this sector contains the given angle.
1983
+ */
1984
+ CircleSector.prototype.containsAngle = function (angle) {
1985
+ if (this.startAngle <= this.endAngle) {
1986
+ return angle >= this.startAngle && angle < this.endAngle;
1987
+ }
1988
+ else {
1989
+ // startAngle > endAngle
1990
+ return angle >= this.startAngle || angle < this.endAngle;
1991
+ }
1992
+ };
1993
+ /**
1994
+ * Get the angle inside this sector for a given ratio. 0.0 means startAngle, and 1.0 means endAngle.
1995
+ *
1996
+ * @param {number} t - The ratio inside [0..1].
1997
+ * @method angleAt
1998
+ * @instance
1999
+ * @memberof CircleSector
2000
+ * @return {number} The angle inside this sector at a given ratio.
2001
+ */
2002
+ CircleSector.prototype.angleAt = function (t) {
2003
+ if (this.startAngle <= this.endAngle) {
2004
+ var angleAtRatio = this.startAngle + (this.endAngle - this.startAngle) * t;
2005
+ return angleAtRatio % (Math.PI * 2.0);
2006
+ }
2007
+ else {
2008
+ // startAngle > endAngle
2009
+ var angleAtRatio = this.startAngle + (Math.PI * 2 - this.startAngle + this.endAngle) * t;
2010
+ return angleAtRatio % (Math.PI * 2.0);
2011
+ }
2012
+ };
2013
+ /**
2014
+ * Get the sectors starting point (on the underlying circle, located at the start angle).
2015
+ *
2016
+ * @method getStartPoint
2017
+ * @instance
2018
+ * @memberof CircleSector
2019
+ * @return {Vertex} The sector's stating point.
2020
+ */
2021
+ CircleSector.prototype.getStartPoint = function () {
2022
+ return this.circle.vertAt(this.startAngle);
2023
+ };
2024
+ /**
2025
+ * Get the sectors ending point (on the underlying circle, located at the end angle).
2026
+ *
2027
+ * @method getEndPoint
2028
+ * @instance
2029
+ * @memberof CircleSector
2030
+ * @return {Vertex} The sector's ending point.
2031
+ */
2032
+ CircleSector.prototype.getEndPoint = function () {
2033
+ return this.circle.vertAt(this.endAngle);
2034
+ };
2035
+ /**
2036
+ * Calculate the intersection of this circle sector and some other sector.
2037
+ *
2038
+ * If the two sectors do not corerently intersect (when not both points of the
2039
+ * radical line are containted in both source sectors) then null is returned.
2040
+ *
2041
+ * See demo/53-circle-sector-intersections for a geometric visualisation.
2042
+ *
2043
+ * @method circleSectorIntersection
2044
+ * @instance
2045
+ * @memberof CircleSector
2046
+ * @return {CircleSector | null} The intersecion of both sectors or null if they don't intersect.
2047
+ */
2048
+ CircleSector.prototype.circleSectorIntersection = function (sector) {
2049
+ var radicalLine = this.circle.circleIntersection(sector.circle);
2050
+ if (!radicalLine) {
2051
+ // The circles to not intersect at all.
2052
+ return null;
2053
+ }
2054
+ // Circles intersect. Check if this sector interval intersects, too.
2055
+ var thisIntersectionAngleA = this.circle.center.angle(radicalLine.a);
2056
+ var thisIntersectionAngleB = this.circle.center.angle(radicalLine.b);
2057
+ // Is intersection inside this sector?
2058
+ if (!this.containsAngle(thisIntersectionAngleA) || !this.containsAngle(thisIntersectionAngleB)) {
2059
+ // At least one circle intersection point is not located in this sector.
2060
+ // -> no valid intersection at all
2061
+ return null;
2062
+ }
2063
+ // Circles intersect. Check if the passed sector interval intersects, too.
2064
+ var thatIntersectionAngleA = sector.circle.center.angle(radicalLine.a);
2065
+ var thatIntersectionAngleB = sector.circle.center.angle(radicalLine.b);
2066
+ // Is intersection inside this sector?
2067
+ if (!sector.containsAngle(thatIntersectionAngleA) || !sector.containsAngle(thatIntersectionAngleB)) {
2068
+ // At least one circle intersection point is not located in this sector.
2069
+ // -> no valid intersection at all
2070
+ return null;
2071
+ }
2072
+ // The radical line has no direction. Thus the resulting sector _might_ be in reverse order.
2073
+ // Make a quick logical check: the center of the gap must still be located inside the result sector.
2074
+ // If not: reverse result.
2075
+ var gapSector = new CircleSector(this.circle, this.endAngle, this.startAngle);
2076
+ var centerOfOriginalGap = gapSector.angleAt(0.5);
2077
+ var resultSector = new CircleSector(new Circle_1.Circle(this.circle.center.clone(), this.circle.radius), thisIntersectionAngleA, thisIntersectionAngleB);
2078
+ if (resultSector.containsAngle(centerOfOriginalGap)) {
2079
+ resultSector.startAngle = thisIntersectionAngleB;
2080
+ resultSector.endAngle = thisIntersectionAngleA;
2081
+ }
2082
+ return resultSector;
2083
+ };
1969
2084
  /**
1970
2085
  * This function should invalidate any installed listeners and invalidate this object.
1971
2086
  * After calling this function the object might not hold valid data any more and
1972
2087
  * should not be used.
2088
+ *
2089
+ * @method destroy
2090
+ * @instance
2091
+ * @memberof CircleSector
2092
+ * @return {void}
1973
2093
  */
1974
2094
  CircleSector.prototype.destroy = function () {
1975
2095
  this.circle.destroy();
@@ -2037,7 +2157,7 @@ exports.CircleSector = CircleSector;
2037
2157
 
2038
2158
  /***/ }),
2039
2159
 
2040
- /***/ 510:
2160
+ /***/ 973:
2041
2161
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2042
2162
 
2043
2163
 
@@ -2073,10 +2193,10 @@ exports.CircleSector = CircleSector;
2073
2193
  **/
2074
2194
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2075
2195
  exports.CubicBezierCurve = void 0;
2076
- var Bounds_1 = __webpack_require__(262);
2077
- var UIDGenerator_1 = __webpack_require__(197);
2078
- var Vertex_1 = __webpack_require__(421);
2079
- var Vector_1 = __webpack_require__(73);
2196
+ var Bounds_1 = __webpack_require__(76);
2197
+ var UIDGenerator_1 = __webpack_require__(938);
2198
+ var Vertex_1 = __webpack_require__(787);
2199
+ var Vector_1 = __webpack_require__(30);
2080
2200
  /**
2081
2201
  * @classdesc A refactored cubic bezier curve class.
2082
2202
  *
@@ -2152,7 +2272,7 @@ var CubicBezierCurve = /** @class */ (function () {
2152
2272
  this.getEndControlPoint().add(moveAmount);
2153
2273
  }
2154
2274
  else {
2155
- console.log("[CubicBezierCurve.moveCurvePoint] pointID '" + pointID + "' invalid.");
2275
+ console.log("[CubicBezierCurve.moveCurvePoint] pointID '".concat(pointID, "' invalid."));
2156
2276
  }
2157
2277
  if (updateArcLengths)
2158
2278
  this.updateArcLengths();
@@ -2393,7 +2513,7 @@ var CubicBezierCurve = /** @class */ (function () {
2393
2513
  return this.startControlPoint;
2394
2514
  if (id == this.END_CONTROL_POINT)
2395
2515
  return this.endControlPoint;
2396
- throw new Error("Invalid point ID '" + id + "'.");
2516
+ throw new Error("Invalid point ID '".concat(id, "'."));
2397
2517
  };
2398
2518
  /**
2399
2519
  * Get the curve point at a given position t, where t is in [0,1].<br>
@@ -2857,7 +2977,7 @@ exports.CubicBezierCurve = CubicBezierCurve;
2857
2977
 
2858
2978
  /***/ }),
2859
2979
 
2860
- /***/ 843:
2980
+ /***/ 289:
2861
2981
  /***/ ((__unused_webpack_module, exports) => {
2862
2982
 
2863
2983
 
@@ -2953,7 +3073,7 @@ exports.Grid = Grid;
2953
3073
 
2954
3074
  /***/ }),
2955
3075
 
2956
- /***/ 909:
3076
+ /***/ 531:
2957
3077
  /***/ ((__unused_webpack_module, exports) => {
2958
3078
 
2959
3079
 
@@ -3196,7 +3316,7 @@ var KeyHandler = /** @class */ (function () {
3196
3316
  */
3197
3317
  // prettier-ignore
3198
3318
  KeyHandler.KEY_CODES = {
3199
- 'break': 3,
3319
+ 'break': 3, // alternate: 19
3200
3320
  'backspace': 8,
3201
3321
  // 'delete' : 8, // alternate: 46
3202
3322
  'tab': 9,
@@ -3212,12 +3332,12 @@ var KeyHandler = /** @class */ (function () {
3212
3332
  'hanja': 25,
3213
3333
  'escape': 27,
3214
3334
  'conversion': 28,
3215
- 'non-conversion': 29,
3335
+ 'non-conversion': 29, // alternate: 235?
3216
3336
  'spacebar': 32,
3217
3337
  'pageup': 33,
3218
3338
  'pagedown': 34,
3219
3339
  'end': 35,
3220
- 'home': 36,
3340
+ 'home': 36, // alternate: 172?
3221
3341
  'leftarrow': 37,
3222
3342
  'uparrow': 38,
3223
3343
  'rightarrow': 39,
@@ -3227,7 +3347,7 @@ var KeyHandler = /** @class */ (function () {
3227
3347
  'execute': 43,
3228
3348
  'printscreen': 44,
3229
3349
  'insert': 45,
3230
- 'delete': 46,
3350
+ 'delete': 46, // alternate: 8
3231
3351
  'help': 47,
3232
3352
  '0': 48,
3233
3353
  '1': 49,
@@ -3273,11 +3393,11 @@ var KeyHandler = /** @class */ (function () {
3273
3393
  'y': 89,
3274
3394
  'z': 90,
3275
3395
  'windows': 91,
3276
- 'leftcommand': 91,
3396
+ 'leftcommand': 91, // left ⌘
3277
3397
  'chromebooksearch': 91,
3278
3398
  'rightwindowkey': 92,
3279
3399
  'windowsmenu': 93,
3280
- 'rightcommant': 93,
3400
+ 'rightcommant': 93, // right ⌘
3281
3401
  'sleep': 95,
3282
3402
  'numpad0': 96,
3283
3403
  'numpad1': 97,
@@ -3291,7 +3411,7 @@ var KeyHandler = /** @class */ (function () {
3291
3411
  'numpad9': 105,
3292
3412
  'multiply': 106,
3293
3413
  'add': 107,
3294
- 'numpadperiod': 108,
3414
+ 'numpadperiod': 108, // firefox, 194 on chrome
3295
3415
  'subtract': 109,
3296
3416
  'decimalpoint': 110,
3297
3417
  'divide': 111,
@@ -3330,11 +3450,11 @@ var KeyHandler = /** @class */ (function () {
3330
3450
  'pagebackward': 166,
3331
3451
  'pageforward': 167,
3332
3452
  'refresh': 168,
3333
- 'closingparen': 169,
3453
+ 'closingparen': 169, // (AZERTY)
3334
3454
  '*': 170,
3335
3455
  '~+*': 171,
3336
3456
  // 'home' : 172,
3337
- 'minus': 173,
3457
+ 'minus': 173, // firefox
3338
3458
  // 'mute' : 173,
3339
3459
  // 'unmute' : 173,
3340
3460
  'decreasevolumelevel': 174,
@@ -3344,8 +3464,8 @@ var KeyHandler = /** @class */ (function () {
3344
3464
  'stop': 178,
3345
3465
  'play/pause': 179,
3346
3466
  'email': 180,
3347
- 'mute': 181,
3348
- 'unmute': 181,
3467
+ 'mute': 181, // firefox, alternate: 173
3468
+ 'unmute': 181, // alternate: 173?
3349
3469
  //'decreasevolumelevel' 182 // firefox
3350
3470
  //'increasevolumelevel' 183 // firefox
3351
3471
  'semicolon': 186,
@@ -3355,7 +3475,7 @@ var KeyHandler = /** @class */ (function () {
3355
3475
  'dash': 189,
3356
3476
  'period': 190,
3357
3477
  'forwardslash': 191,
3358
- 'ç': 191,
3478
+ 'ç': 191, // 231 alternate?
3359
3479
  'grave accent': 192,
3360
3480
  //'ñ' 192,
3361
3481
  'æ': 192,
@@ -3384,7 +3504,7 @@ var KeyHandler = /** @class */ (function () {
3384
3504
  'half-width': 243,
3385
3505
  'full-width': 243,
3386
3506
  'kanji': 244,
3387
- 'unlocktrackpad': 251,
3507
+ 'unlocktrackpad': 251, // Chrome/Edge
3388
3508
  'toggletouchpad': 255
3389
3509
  };
3390
3510
  return KeyHandler;
@@ -3394,7 +3514,7 @@ exports.KeyHandler = KeyHandler;
3394
3514
 
3395
3515
  /***/ }),
3396
3516
 
3397
- /***/ 831:
3517
+ /***/ 939:
3398
3518
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3399
3519
 
3400
3520
 
@@ -3429,6 +3549,8 @@ var __extends = (this && this.__extends) || (function () {
3429
3549
  return extendStatics(d, b);
3430
3550
  };
3431
3551
  return function (d, b) {
3552
+ if (typeof b !== "function" && b !== null)
3553
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3432
3554
  extendStatics(d, b);
3433
3555
  function __() { this.constructor = d; }
3434
3556
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3436,8 +3558,8 @@ var __extends = (this && this.__extends) || (function () {
3436
3558
  })();
3437
3559
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3438
3560
  exports.Line = void 0;
3439
- var VertTuple_1 = __webpack_require__(72);
3440
- var Vertex_1 = __webpack_require__(421);
3561
+ var VertTuple_1 = __webpack_require__(590);
3562
+ var Vertex_1 = __webpack_require__(787);
3441
3563
  /**
3442
3564
  * @classdesc A line consists of two vertices a and b.<br>
3443
3565
  * <br>
@@ -3555,7 +3677,7 @@ exports.Line = Line;
3555
3677
 
3556
3678
  /***/ }),
3557
3679
 
3558
- /***/ 293:
3680
+ /***/ 912:
3559
3681
  /***/ (function(__unused_webpack_module, exports) {
3560
3682
 
3561
3683
 
@@ -3592,6 +3714,8 @@ var __extends = (this && this.__extends) || (function () {
3592
3714
  return extendStatics(d, b);
3593
3715
  };
3594
3716
  return function (d, b) {
3717
+ if (typeof b !== "function" && b !== null)
3718
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3595
3719
  extendStatics(d, b);
3596
3720
  function __() { this.constructor = d; }
3597
3721
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3779,10 +3903,10 @@ var MouseHandler = /** @class */ (function () {
3779
3903
  name: eventName,
3780
3904
  isTouchEvent: false,
3781
3905
  pos: rel,
3782
- button: event.button,
3783
- leftButton: event.button === 0,
3784
- middleButton: event.button === 1,
3785
- rightButton: event.button === 2,
3906
+ button: event.button, // this.mouseButton,
3907
+ leftButton: event.button === 0, // this.mouseButton === 0,
3908
+ middleButton: event.button === 1, // this.mouseButton === 1,
3909
+ rightButton: event.button === 2, // this.mouseButton === 2,
3786
3910
  mouseDownPos: (_a = this.mouseDownPos) !== null && _a !== void 0 ? _a : { x: NaN, y: NaN },
3787
3911
  draggedFrom: (_b = this.mouseDragPos) !== null && _b !== void 0 ? _b : { x: NaN, y: NaN },
3788
3912
  wasDragged: this.mouseDownPos != null && (this.mouseDownPos.x != rel.x || this.mouseDownPos.y != rel.y),
@@ -3950,7 +4074,7 @@ var MouseHandler = /** @class */ (function () {
3950
4074
  * @return {void}
3951
4075
  */
3952
4076
  MouseHandler.prototype.throwAlreadyInstalled = function (name) {
3953
- throw "This MouseHandler already has a '" + name + "' callback. To keep the code simple there is only room for one.";
4077
+ throw "This MouseHandler already has a '".concat(name, "' callback. To keep the code simple there is only room for one.");
3954
4078
  };
3955
4079
  /**
3956
4080
  * Call this when your work is done.
@@ -3982,7 +4106,7 @@ exports.MouseHandler = MouseHandler;
3982
4106
 
3983
4107
  /***/ }),
3984
4108
 
3985
- /***/ 699:
4109
+ /***/ 862:
3986
4110
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3987
4111
 
3988
4112
 
@@ -4003,7 +4127,7 @@ exports.MouseHandler = MouseHandler;
4003
4127
  **/
4004
4128
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4005
4129
  exports.PBImage = void 0;
4006
- var UIDGenerator_1 = __webpack_require__(197);
4130
+ var UIDGenerator_1 = __webpack_require__(938);
4007
4131
  /**
4008
4132
  * @classdesc A wrapper for image objects. Has an upper left and a lower right corner point.
4009
4133
  *
@@ -4049,7 +4173,7 @@ exports.PBImage = PBImage;
4049
4173
 
4050
4174
  /***/ }),
4051
4175
 
4052
- /***/ 196:
4176
+ /***/ 628:
4053
4177
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4054
4178
 
4055
4179
 
@@ -4062,8 +4186,8 @@ exports.PBImage = PBImage;
4062
4186
  **/
4063
4187
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4064
4188
  exports.PBText = void 0;
4065
- var UIDGenerator_1 = __webpack_require__(197);
4066
- var Vertex_1 = __webpack_require__(421);
4189
+ var UIDGenerator_1 = __webpack_require__(938);
4190
+ var Vertex_1 = __webpack_require__(787);
4067
4191
  /**
4068
4192
  * @classdesc A simple text element: position, fontSize, fontFamily, color, textAlign, lineHeight and rotation.
4069
4193
  *
@@ -4118,10 +4242,9 @@ exports.PBText = PBText;
4118
4242
 
4119
4243
  /***/ }),
4120
4244
 
4121
- /***/ 919:
4122
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4245
+ /***/ 559:
4246
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4123
4247
 
4124
- var __webpack_unused_export__;
4125
4248
 
4126
4249
  /**
4127
4250
  * @author Ikaros Kappler
@@ -4208,35 +4331,41 @@ var __webpack_unused_export__;
4208
4331
  * @modified 2023-02-10 Cleaning up most type errors in the main class (mostly null checks).
4209
4332
  * @modified 2023-02-10 Adding `enableZoom` and `enablePan` (both default true) to have the option to disable these functions.
4210
4333
  * @modified 2023-09-29 Adding proper dicionary key and value types to the params of `PlotBoilerplate.utils.safeMergeByKeys` (was `object` before).
4211
- * @version 1.17.3
4334
+ * @modified 2024-07-08 Adding `PlotBoilerplate.getGUI()` to retrieve the GUI instance.
4335
+ *
4336
+ * @version 1.18.0
4212
4337
  *
4213
4338
  * @file PlotBoilerplate
4214
4339
  * @fileoverview The main class.
4215
4340
  * @public
4216
4341
  **/
4217
- __webpack_unused_export__ = ({ value: true });
4218
- exports.H4 = void 0;
4219
- var alloyfinger_typescript_1 = __webpack_require__(318);
4220
- var draw_1 = __webpack_require__(149);
4221
- var drawgl_1 = __webpack_require__(349);
4222
- var drawutilssvg_1 = __webpack_require__(829);
4223
- var BezierPath_1 = __webpack_require__(126);
4224
- var Bounds_1 = __webpack_require__(262);
4225
- var Circle_1 = __webpack_require__(913);
4226
- var CircleSector_1 = __webpack_require__(946);
4227
- var Grid_1 = __webpack_require__(843);
4228
- var KeyHandler_1 = __webpack_require__(909);
4229
- var Line_1 = __webpack_require__(831);
4230
- var MouseHandler_1 = __webpack_require__(293);
4231
- var PBImage_1 = __webpack_require__(699);
4232
- var Polygon_1 = __webpack_require__(661);
4233
- var Triangle_1 = __webpack_require__(212);
4234
- var VEllipse_1 = __webpack_require__(112);
4235
- var VEllipseSector_1 = __webpack_require__(965);
4236
- var Vector_1 = __webpack_require__(73);
4237
- var Vertex_1 = __webpack_require__(421);
4238
- var VertexAttr_1 = __webpack_require__(861);
4239
- var PBText_1 = __webpack_require__(196);
4342
+ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
4343
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
4344
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
4345
+ };
4346
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
4347
+ exports.PlotBoilerplate = void 0;
4348
+ var alloyfinger_typescript_1 = __webpack_require__(597);
4349
+ var draw_1 = __webpack_require__(39);
4350
+ var drawgl_1 = __webpack_require__(264);
4351
+ var drawutilssvg_1 = __webpack_require__(378);
4352
+ var BezierPath_1 = __webpack_require__(733);
4353
+ var Bounds_1 = __webpack_require__(76);
4354
+ var Circle_1 = __webpack_require__(118);
4355
+ var CircleSector_1 = __webpack_require__(135);
4356
+ var Grid_1 = __webpack_require__(289);
4357
+ var KeyHandler_1 = __webpack_require__(531);
4358
+ var Line_1 = __webpack_require__(939);
4359
+ var MouseHandler_1 = __webpack_require__(912);
4360
+ var PBImage_1 = __webpack_require__(862);
4361
+ var Polygon_1 = __webpack_require__(687);
4362
+ var Triangle_1 = __webpack_require__(737);
4363
+ var VEllipse_1 = __webpack_require__(881);
4364
+ var VEllipseSector_1 = __webpack_require__(719);
4365
+ var Vector_1 = __webpack_require__(30);
4366
+ var Vertex_1 = __webpack_require__(787);
4367
+ var VertexAttr_1 = __webpack_require__(476);
4368
+ var PBText_1 = __webpack_require__(628);
4240
4369
  /**
4241
4370
  * @classdesc The main class of the PlotBoilerplate.
4242
4371
  *
@@ -4327,8 +4456,8 @@ var PlotBoilerplate = /** @class */ (function () {
4327
4456
  * Note that changes from the postDraw hook might not be visible in the export.
4328
4457
  * @param {string=} [config.title=null] - Specify any hover tile here. It will be attached as a `title` attribute to the most elevated element.
4329
4458
  */
4330
- function PlotBoilerplate(config) {
4331
- var _a, _b;
4459
+ function PlotBoilerplate(config, drawConfig) {
4460
+ var _b, _c;
4332
4461
  /**
4333
4462
  * A discrete timestamp to identify single render cycles.
4334
4463
  * Note that using system time milliseconds is not a safe way to identify render frames, as on modern powerful machines
@@ -4339,6 +4468,10 @@ var PlotBoilerplate = /** @class */ (function () {
4339
4468
  * @private
4340
4469
  */
4341
4470
  this.renderTime = 0;
4471
+ /**
4472
+ * A storage variable for retrieving the GUI instance once it was created.
4473
+ */
4474
+ this._gui = null;
4342
4475
  // This should be in some static block ...
4343
4476
  VertexAttr_1.VertexAttr.model = {
4344
4477
  bezierAutoAdjust: false,
@@ -4402,8 +4535,8 @@ var PlotBoilerplate = /** @class */ (function () {
4402
4535
  enableTouch: f.bool(config, "enableTouch", true),
4403
4536
  enableKeys: f.bool(config, "enableKeys", true),
4404
4537
  enableMouseWheel: f.bool(config, "enableMouseWheel", true),
4405
- enableZoom: f.bool(config, "enableZoom", true),
4406
- enablePan: f.bool(config, "enablePan", true),
4538
+ enableZoom: f.bool(config, "enableZoom", true), // default=true
4539
+ enablePan: f.bool(config, "enablePan", true), // default=true
4407
4540
  // Experimental (and unfinished)
4408
4541
  enableGL: f.bool(config, "enableGL", false)
4409
4542
  }; // END confog
@@ -4505,7 +4638,7 @@ var PlotBoilerplate = /** @class */ (function () {
4505
4638
  this.canvasSize = { width: PlotBoilerplate.DEFAULT_CANVAS_WIDTH, height: PlotBoilerplate.DEFAULT_CANVAS_HEIGHT };
4506
4639
  var canvasElement = typeof config.canvas === "string" ? document.querySelector(config.canvas) : config.canvas;
4507
4640
  if (typeof canvasElement === "undefined") {
4508
- throw "Cannot initialize PlotBoilerplate with a null canvas (element \"" + config.canvas + " not found).";
4641
+ throw "Cannot initialize PlotBoilerplate with a null canvas (element \"".concat(config.canvas, " not found).");
4509
4642
  }
4510
4643
  // Which renderer to use: Canvas2D, WebGL (experimental) or SVG?
4511
4644
  if (canvasElement.tagName.toLowerCase() === "canvas") {
@@ -4563,8 +4696,8 @@ var PlotBoilerplate = /** @class */ (function () {
4563
4696
  if (config.title) {
4564
4697
  this.eventCatcher.setAttribute("title", config.title);
4565
4698
  }
4566
- this.draw.scale.set((_a = this.config.scaleX) !== null && _a !== void 0 ? _a : 1.0, this.config.scaleY);
4567
- this.fill.scale.set((_b = this.config.scaleX) !== null && _b !== void 0 ? _b : 1.0, this.config.scaleY);
4699
+ this.draw.scale.set((_b = this.config.scaleX) !== null && _b !== void 0 ? _b : 1.0, this.config.scaleY);
4700
+ this.fill.scale.set((_c = this.config.scaleX) !== null && _c !== void 0 ? _c : 1.0, this.config.scaleY);
4568
4701
  this.vertices = [];
4569
4702
  this.selectPolygon = null;
4570
4703
  this.draggedElements = [];
@@ -4630,8 +4763,9 @@ var PlotBoilerplate = /** @class */ (function () {
4630
4763
  var blob = new Blob(['<?xml version="1.0" encoding="utf-8"?>\n' + svgCode], { type: "image/svg;charset=utf-8" });
4631
4764
  // See documentation for FileSaver.js for usage.
4632
4765
  // https://github.com/eligrey/FileSaver.js
4633
- if (typeof globalThis["saveAs"] !== "function")
4766
+ if (typeof globalThis["saveAs"] !== "function") {
4634
4767
  throw "Cannot save file; did you load the ./utils/savefile helper function and the eligrey/SaveFile library?";
4768
+ }
4635
4769
  var _saveAs = globalThis["saveAs"];
4636
4770
  _saveAs(blob, "plotboilerplate.svg");
4637
4771
  };
@@ -4702,12 +4836,12 @@ var PlotBoilerplate = /** @class */ (function () {
4702
4836
  * @private
4703
4837
  **/
4704
4838
  PlotBoilerplate.prototype.updateCSSscale = function () {
4705
- var _a, _b, _c, _d;
4839
+ var _b, _c, _d, _e;
4706
4840
  if (this.config.cssUniformScale) {
4707
- PlotBoilerplate.utils.setCSSscale(this.canvas, (_a = this.config.cssScaleX) !== null && _a !== void 0 ? _a : 1.0, (_b = this.config.cssScaleX) !== null && _b !== void 0 ? _b : 1.0);
4841
+ PlotBoilerplate.utils.setCSSscale(this.canvas, (_b = this.config.cssScaleX) !== null && _b !== void 0 ? _b : 1.0, (_c = this.config.cssScaleX) !== null && _c !== void 0 ? _c : 1.0);
4708
4842
  }
4709
4843
  else {
4710
- PlotBoilerplate.utils.setCSSscale(this.canvas, (_c = this.config.cssScaleX) !== null && _c !== void 0 ? _c : 1.0, (_d = this.config.cssScaleY) !== null && _d !== void 0 ? _d : 1.0);
4844
+ PlotBoilerplate.utils.setCSSscale(this.canvas, (_d = this.config.cssScaleX) !== null && _d !== void 0 ? _d : 1.0, (_e = this.config.cssScaleY) !== null && _e !== void 0 ? _e : 1.0);
4711
4845
  }
4712
4846
  };
4713
4847
  /**
@@ -4980,8 +5114,8 @@ var PlotBoilerplate = /** @class */ (function () {
4980
5114
  * @return The vertex near the given position or undefined if none was found there.
4981
5115
  **/
4982
5116
  PlotBoilerplate.prototype.getVertexNear = function (pixelPosition, pixelTolerance) {
4983
- var _a, _b;
4984
- var p = this.locatePointNear(this.transformMousePosition(pixelPosition.x, pixelPosition.y), pixelTolerance / Math.min((_a = this.config.cssScaleX) !== null && _a !== void 0 ? _a : 1.0, (_b = this.config.cssScaleY) !== null && _b !== void 0 ? _b : 1.0));
5117
+ var _b, _c;
5118
+ var p = this.locatePointNear(this.transformMousePosition(pixelPosition.x, pixelPosition.y), pixelTolerance / Math.min((_b = this.config.cssScaleX) !== null && _b !== void 0 ? _b : 1.0, (_c = this.config.cssScaleY) !== null && _c !== void 0 ? _c : 1.0));
4985
5119
  if (p && p.typeName == "vertex") {
4986
5120
  return this.vertices[p.vindex];
4987
5121
  }
@@ -5099,16 +5233,16 @@ var PlotBoilerplate = /** @class */ (function () {
5099
5233
  var curveIndex = 0;
5100
5234
  for (var c in d.bezierCurves) {
5101
5235
  // Restore these settings again in each loop (will be overwritten)
5102
- this.draw.setCurrentId(d.uid + "-" + curveIndex);
5103
- this.fill.setCurrentId(d.uid + "-" + curveIndex);
5236
+ this.draw.setCurrentId("".concat(d.uid, "-").concat(curveIndex));
5237
+ this.fill.setCurrentId("".concat(d.uid, "-").concat(curveIndex));
5104
5238
  this.draw.setCurrentClassName(d.className);
5105
5239
  this.fill.setCurrentClassName(d.className);
5106
5240
  draw.cubicBezier(d.bezierCurves[c].startPoint, d.bezierCurves[c].endPoint, d.bezierCurves[c].startControlPoint, d.bezierCurves[c].endControlPoint, this.drawConfig.bezier.color, this.drawConfig.bezier.lineWidth);
5107
5241
  if (this.drawConfig.drawBezierHandlePoints && this.drawConfig.drawHandlePoints) {
5108
5242
  if (d.bezierCurves[c].startPoint.attr.visible) {
5109
5243
  var df = this.drawConfig.bezier.pathVertex.fill ? fill : draw;
5110
- df.setCurrentId(d.uid + "_h0");
5111
- df.setCurrentClassName(d.className + "-start-handle");
5244
+ df.setCurrentId("".concat(d.uid, "_h0"));
5245
+ df.setCurrentClassName("".concat(d.className, "-start-handle"));
5112
5246
  if (d.bezierCurves[c].startPoint.attr.bezierAutoAdjust) {
5113
5247
  df.squareHandle(d.bezierCurves[c].startPoint, 5, this._handleColor(d.bezierCurves[c].startPoint, this.drawConfig.bezier.pathVertex.color));
5114
5248
  }
@@ -5119,8 +5253,8 @@ var PlotBoilerplate = /** @class */ (function () {
5119
5253
  d.bezierCurves[c].startPoint.attr.renderTime = renderTime;
5120
5254
  if (d.bezierCurves[c].endPoint.attr.visible) {
5121
5255
  var df = this.drawConfig.bezier.pathVertex.fill ? fill : draw;
5122
- df.setCurrentId(d.uid + "_h0");
5123
- df.setCurrentClassName(d.className + "-start-handle");
5256
+ df.setCurrentId("".concat(d.uid, "_h0"));
5257
+ df.setCurrentClassName("".concat(d.className, "-start-handle"));
5124
5258
  if (d.bezierCurves[c].endPoint.attr.bezierAutoAdjust) {
5125
5259
  df.squareHandle(d.bezierCurves[c].endPoint, 5, this._handleColor(d.bezierCurves[c].endPoint, this.drawConfig.bezier.pathVertex.color));
5126
5260
  }
@@ -5130,14 +5264,14 @@ var PlotBoilerplate = /** @class */ (function () {
5130
5264
  }
5131
5265
  if (d.bezierCurves[c].startControlPoint.attr.visible) {
5132
5266
  var df = this.drawConfig.bezier.controlVertex.fill ? fill : draw;
5133
- df.setCurrentId(d.uid + "_h2");
5134
- df.setCurrentClassName(d.className + "-start-control-handle");
5267
+ df.setCurrentId("".concat(d.uid, "_h2"));
5268
+ df.setCurrentClassName("".concat(d.className, "-start-control-handle"));
5135
5269
  df.circleHandle(d.bezierCurves[c].startControlPoint, 3, this._handleColor(d.bezierCurves[c].startControlPoint, this.drawConfig.bezier.controlVertex.color));
5136
5270
  }
5137
5271
  if (d.bezierCurves[c].endControlPoint.attr.visible) {
5138
5272
  var df = this.drawConfig.bezier.controlVertex.fill ? fill : draw;
5139
- df.setCurrentId(d.uid + "_h3");
5140
- df.setCurrentClassName(d.className + "-end-control-handle");
5273
+ df.setCurrentId("".concat(d.uid, "_h3"));
5274
+ df.setCurrentClassName("".concat(d.className, "-end-control-handle"));
5141
5275
  df.circleHandle(d.bezierCurves[c].endControlPoint, 3, this._handleColor(d.bezierCurves[c].endControlPoint, this.drawConfig.bezier.controlVertex.color));
5142
5276
  }
5143
5277
  d.bezierCurves[c].startPoint.attr.renderTime = renderTime;
@@ -5152,11 +5286,11 @@ var PlotBoilerplate = /** @class */ (function () {
5152
5286
  d.bezierCurves[c].endControlPoint.attr.renderTime = renderTime;
5153
5287
  }
5154
5288
  if (this.drawConfig.drawBezierHandleLines && this.drawConfig.drawHandleLines) {
5155
- draw.setCurrentId(d.uid + "_l0");
5156
- draw.setCurrentClassName(d.className + "-start-line");
5289
+ draw.setCurrentId("".concat(d.uid, "_l0"));
5290
+ draw.setCurrentClassName("".concat(d.className, "-start-line"));
5157
5291
  draw.handleLine(d.bezierCurves[c].startPoint, d.bezierCurves[c].startControlPoint);
5158
- draw.setCurrentId(d.uid + "_l1");
5159
- draw.setCurrentClassName(d.className + "-end-line");
5292
+ draw.setCurrentId("".concat(d.uid, "_l1"));
5293
+ draw.setCurrentClassName("".concat(d.className, "-end-line"));
5160
5294
  draw.handleLine(d.bezierCurves[c].endPoint, d.bezierCurves[c].endControlPoint);
5161
5295
  }
5162
5296
  curveIndex++;
@@ -5177,17 +5311,17 @@ var PlotBoilerplate = /** @class */ (function () {
5177
5311
  }
5178
5312
  else if (d instanceof VEllipse_1.VEllipse) {
5179
5313
  if (this.drawConfig.drawHandleLines) {
5180
- draw.setCurrentId(d.uid + "_e0");
5181
- draw.setCurrentClassName(d.className + "-v-line");
5314
+ draw.setCurrentId("".concat(d.uid, "_e0"));
5315
+ draw.setCurrentClassName("".concat(d.className, "-v-line"));
5182
5316
  // draw.line( d.center.clone().add(0,d.axis.y-d.center.y), d.axis, '#c8c8c8' );
5183
5317
  draw.handleLine(d.center.clone().add(0, d.signedRadiusV()).rotate(d.rotation, d.center), d.axis); // , "#c8c8c8");
5184
- draw.setCurrentId(d.uid + "_e1");
5185
- draw.setCurrentClassName(d.className + "-h-line");
5318
+ draw.setCurrentId("".concat(d.uid, "_e1"));
5319
+ draw.setCurrentClassName("".concat(d.className, "-h-line"));
5186
5320
  // draw.line( d.center.clone().add(d.axis.x-d.center.x,0), d.axis, '#c8c8c8' );
5187
5321
  draw.handleLine(d.center.clone().add(d.signedRadiusH(), 0).rotate(d.rotation, d.center), d.axis); // , "#c8c8c8");
5188
5322
  }
5189
5323
  draw.setCurrentId(d.uid);
5190
- draw.setCurrentClassName("" + d.className);
5324
+ draw.setCurrentClassName("".concat(d.className));
5191
5325
  draw.ellipse(d.center,
5192
5326
  // Math.abs(d.axis.x-d.center.x), Math.abs(d.axis.y-d.center.y),
5193
5327
  d.radiusH(), d.radiusV(), this.drawConfig.ellipse.color, this.drawConfig.ellipse.lineWidth, d.rotation);
@@ -5198,7 +5332,7 @@ var PlotBoilerplate = /** @class */ (function () {
5198
5332
  }
5199
5333
  else if (d instanceof VEllipseSector_1.VEllipseSector) {
5200
5334
  draw.setCurrentId(d.uid);
5201
- draw.setCurrentClassName("" + d.className);
5335
+ draw.setCurrentClassName("".concat(d.className));
5202
5336
  /* draw.ellipse( d.center,
5203
5337
  // Math.abs(d.axis.x-d.center.x), Math.abs(d.axis.y-d.center.y),
5204
5338
  d.radiusH(), d.radiusV(),
@@ -5231,8 +5365,8 @@ var PlotBoilerplate = /** @class */ (function () {
5231
5365
  else if (d instanceof Vector_1.Vector) {
5232
5366
  draw.arrow(d.a, d.b, this.drawConfig.vector.color);
5233
5367
  if (this.drawConfig.drawHandlePoints && d.b.attr.selectable && d.b.attr.visible) {
5234
- draw.setCurrentId(d.uid + "_h0");
5235
- draw.setCurrentClassName(d.className + "-handle");
5368
+ draw.setCurrentId("".concat(d.uid, "_h0"));
5369
+ draw.setCurrentClassName("".concat(d.className, "-handle"));
5236
5370
  draw.circleHandle(d.b, 3, "#a8a8a8");
5237
5371
  }
5238
5372
  else {
@@ -5245,15 +5379,15 @@ var PlotBoilerplate = /** @class */ (function () {
5245
5379
  }
5246
5380
  else if (d instanceof PBImage_1.PBImage) {
5247
5381
  if (this.drawConfig.drawHandleLines) {
5248
- draw.setCurrentId(d.uid + "_l0");
5249
- draw.setCurrentClassName(d.className + "-line");
5382
+ draw.setCurrentId("".concat(d.uid, "_l0"));
5383
+ draw.setCurrentClassName("".concat(d.className, "-line"));
5250
5384
  draw.line(d.upperLeft, d.lowerRight, this.drawConfig.image.color, this.drawConfig.image.lineWidth);
5251
5385
  }
5252
5386
  fill.setCurrentId(d.uid);
5253
5387
  fill.image(d.image, d.upperLeft, d.lowerRight.clone().sub(d.upperLeft));
5254
5388
  if (this.drawConfig.drawHandlePoints) {
5255
- draw.setCurrentId(d.uid + "_h0");
5256
- draw.setCurrentClassName(d.className + "-lower-right");
5389
+ draw.setCurrentId("".concat(d.uid, "_h0"));
5390
+ draw.setCurrentClassName("".concat(d.className, "-lower-right"));
5257
5391
  draw.circleHandle(d.lowerRight, 3, this.drawConfig.image.color);
5258
5392
  d.lowerRight.attr.renderTime = renderTime;
5259
5393
  }
@@ -5262,8 +5396,8 @@ var PlotBoilerplate = /** @class */ (function () {
5262
5396
  fill.setCurrentId(d.uid);
5263
5397
  fill.text(d.text, d.anchor.x, d.anchor.y, d);
5264
5398
  if (this.drawConfig.text.anchor) {
5265
- draw.setCurrentId(d.uid + "_a0");
5266
- draw.setCurrentClassName(d.className + "-anchor");
5399
+ draw.setCurrentId("".concat(d.uid, "_a0"));
5400
+ draw.setCurrentClassName("".concat(d.className, "-anchor"));
5267
5401
  (this.drawConfig.text.fill ? fill : draw).point(d.anchor, this.drawConfig.text.color);
5268
5402
  }
5269
5403
  d.anchor.attr.renderTime = renderTime;
@@ -5410,8 +5544,8 @@ var PlotBoilerplate = /** @class */ (function () {
5410
5544
  * @return {Bounds} The current viewport.
5411
5545
  **/
5412
5546
  PlotBoilerplate.prototype.viewport = function () {
5413
- var _a, _b;
5414
- return new Bounds_1.Bounds(this.transformMousePosition(0, 0), this.transformMousePosition(this.canvasSize.width * ((_a = this.config.cssScaleX) !== null && _a !== void 0 ? _a : 1.0), this.canvasSize.height * ((_b = this.config.cssScaleY) !== null && _b !== void 0 ? _b : 1.0)));
5547
+ var _b, _c;
5548
+ return new Bounds_1.Bounds(this.transformMousePosition(0, 0), this.transformMousePosition(this.canvasSize.width * ((_b = this.config.cssScaleX) !== null && _b !== void 0 ? _b : 1.0), this.canvasSize.height * ((_c = this.config.cssScaleY) !== null && _c !== void 0 ? _c : 1.0)));
5415
5549
  };
5416
5550
  /**
5417
5551
  * Trigger the saveFile.hook.
@@ -5460,12 +5594,12 @@ var PlotBoilerplate = /** @class */ (function () {
5460
5594
  **/
5461
5595
  PlotBoilerplate.prototype.resizeCanvas = function () {
5462
5596
  var _this = this;
5463
- var _a, _b, _c, _d, _e, _f;
5597
+ var _b, _c, _d, _e, _f, _g;
5464
5598
  var _self = this;
5465
5599
  var _setSize = function (w, h) {
5466
- var _a, _b;
5467
- w *= (_a = _self.config.canvasWidthFactor) !== null && _a !== void 0 ? _a : 1.0;
5468
- h *= (_b = _self.config.canvasHeightFactor) !== null && _b !== void 0 ? _b : 1.0;
5600
+ var _b, _c;
5601
+ w *= (_b = _self.config.canvasWidthFactor) !== null && _b !== void 0 ? _b : 1.0;
5602
+ h *= (_c = _self.config.canvasHeightFactor) !== null && _c !== void 0 ? _c : 1.0;
5469
5603
  _self.canvasSize.width = w;
5470
5604
  _self.canvasSize.height = h;
5471
5605
  if (_self.canvas instanceof HTMLCanvasElement) {
@@ -5473,12 +5607,12 @@ var PlotBoilerplate = /** @class */ (function () {
5473
5607
  _self.canvas.height = h;
5474
5608
  }
5475
5609
  else if (_self.canvas instanceof SVGElement) {
5476
- _this.canvas.setAttribute("viewBox", "0 0 " + w + " " + h);
5477
- _this.canvas.setAttribute("width", "" + w);
5478
- _this.canvas.setAttribute("height", "" + h);
5610
+ _this.canvas.setAttribute("viewBox", "0 0 ".concat(w, " ").concat(h));
5611
+ _this.canvas.setAttribute("width", "".concat(w));
5612
+ _this.canvas.setAttribute("height", "".concat(h));
5479
5613
  _this.draw.setSize(_self.canvasSize); // No need to set size to this.fill (instance copy)
5480
- _this.eventCatcher.style.width = w + "px";
5481
- _this.eventCatcher.style.height = h + "px";
5614
+ _this.eventCatcher.style.width = "".concat(w, "px");
5615
+ _this.eventCatcher.style.height = "".concat(h, "px");
5482
5616
  }
5483
5617
  else {
5484
5618
  console.error("Error: cannot resize canvas element because it seems neither be a HTMLCanvasElement nor an SVGElement.");
@@ -5494,8 +5628,8 @@ var PlotBoilerplate = /** @class */ (function () {
5494
5628
  var width = globalThis.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
5495
5629
  var height = globalThis.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
5496
5630
  _self.canvas.style.position = "absolute";
5497
- _self.canvas.style.width = ((_a = _self.config.canvasWidthFactor) !== null && _a !== void 0 ? _a : 1.0) * width + "px";
5498
- _self.canvas.style.height = ((_b = _self.config.canvasWidthFactor) !== null && _b !== void 0 ? _b : 1.0) * height + "px";
5631
+ _self.canvas.style.width = ((_b = _self.config.canvasWidthFactor) !== null && _b !== void 0 ? _b : 1.0) * width + "px";
5632
+ _self.canvas.style.height = ((_c = _self.config.canvasWidthFactor) !== null && _c !== void 0 ? _c : 1.0) * height + "px";
5499
5633
  _self.canvas.style.top = "0px";
5500
5634
  _self.canvas.style.left = "0px";
5501
5635
  _setSize(width, height);
@@ -5504,8 +5638,8 @@ var PlotBoilerplate = /** @class */ (function () {
5504
5638
  // Set editor size
5505
5639
  _self.canvas.style.position = "static";
5506
5640
  var space = this.getAvailableContainerSpace();
5507
- _self.canvas.style.width = ((_c = _self.config.canvasWidthFactor) !== null && _c !== void 0 ? _c : 1.0) * space.width + "px";
5508
- _self.canvas.style.height = ((_d = _self.config.canvasHeightFactor) !== null && _d !== void 0 ? _d : 1.0) * space.height + "px";
5641
+ _self.canvas.style.width = ((_d = _self.config.canvasWidthFactor) !== null && _d !== void 0 ? _d : 1.0) * space.width + "px";
5642
+ _self.canvas.style.height = ((_e = _self.config.canvasHeightFactor) !== null && _e !== void 0 ? _e : 1.0) * space.height + "px";
5509
5643
  _self.canvas.style.top = "";
5510
5644
  _self.canvas.style.left = "";
5511
5645
  _setSize(space.width, space.height);
@@ -5513,7 +5647,7 @@ var PlotBoilerplate = /** @class */ (function () {
5513
5647
  else {
5514
5648
  _self.canvas.style.width = "";
5515
5649
  _self.canvas.style.height = "";
5516
- _setSize((_e = _self.config.defaultCanvasWidth) !== null && _e !== void 0 ? _e : 1024, (_f = _self.config.defaultCanvasHeight) !== null && _f !== void 0 ? _f : 768);
5650
+ _setSize((_f = _self.config.defaultCanvasWidth) !== null && _f !== void 0 ? _f : 1024, (_g = _self.config.defaultCanvasHeight) !== null && _g !== void 0 ? _g : 768);
5517
5651
  }
5518
5652
  if (_self.config.redrawOnResize)
5519
5653
  _self.redraw();
@@ -5882,7 +6016,8 @@ var PlotBoilerplate = /** @class */ (function () {
5882
6016
  return { x: pos.x - bounds.left, y: pos.y - bounds.top };
5883
6017
  };
5884
6018
  // Make PB work together with both, AlloyFinger as a esm module or a commonjs function.
5885
- if (typeof globalThis["AlloyFinger"] === "function" || typeof globalThis["createAlloyFinger"] === "function") {
6019
+ if (typeof globalThis["AlloyFinger"] === "function" ||
6020
+ typeof globalThis["createAlloyFinger"] === "function") {
5886
6021
  try {
5887
6022
  var touchMovePos = null;
5888
6023
  var touchDownPos = null;
@@ -6017,7 +6152,9 @@ var PlotBoilerplate = /** @class */ (function () {
6017
6152
  }
6018
6153
  }; // END afProps
6019
6154
  if (window["createAlloyFinger"]) {
6020
- window["createAlloyFinger"](this.eventCatcher ? this.eventCatcher : this.canvas, afProps);
6155
+ // window["createAlloyFinger"](this.eventCatcher ? this.eventCatcher : this.canvas, afProps);
6156
+ var createAlloyFinger = window["createAlloyFinger"];
6157
+ createAlloyFinger(this.eventCatcher ? this.eventCatcher : this.canvas, afProps);
6021
6158
  }
6022
6159
  else {
6023
6160
  /* tslint:disable-next-line */
@@ -6075,10 +6212,23 @@ var PlotBoilerplate = /** @class */ (function () {
6075
6212
  PlotBoilerplate.prototype.createGUI = function (props) {
6076
6213
  // This function moved to the helper utils.
6077
6214
  // We do not want to include the whole dat.GUI package.
6078
- if (globalThis["utils"] && typeof globalThis["utils"].createGUI == "function")
6079
- return globalThis["utils"].createGUI(this, props);
6080
- else
6081
- throw "Cannot create dat.GUI instance; did you load the ./utils/creategui helper function an the dat.GUI library?";
6215
+ var utils = globalThis["utils"];
6216
+ // if (globalThis["utils"] && typeof globalThis["utils"].createGUI == "function") {
6217
+ // return (globalThis["utils" as keyof Object] as any as ({createGUI : (pb:PlotBoilerplate,props:DatGuiProps|undefined)=>GUI })).createGUI(this, props);
6218
+ if (utils && typeof utils.createGUI === "function") {
6219
+ return (this._gui = utils.createGUI(this, props));
6220
+ }
6221
+ else {
6222
+ throw "Cannot create dat.GUI or lil-gui instance; did you load the ./utils/creategui helper function an the dat.GUI/lil-gui library?";
6223
+ }
6224
+ };
6225
+ /**
6226
+ * Retriebe the GUI once it was created. If the `createGUI` method was not called or failed to create any
6227
+ * GUI then null is returned.
6228
+ * @returns {GUI | null}
6229
+ */
6230
+ PlotBoilerplate.prototype.getGUI = function () {
6231
+ return this._gui;
6082
6232
  };
6083
6233
  var _a;
6084
6234
  /** @constant {number} */
@@ -6107,6 +6257,7 @@ var PlotBoilerplate = /** @class */ (function () {
6107
6257
  };
6108
6258
  return class_1;
6109
6259
  }()),
6260
+ __setFunctionName(_a, "Draggable"),
6110
6261
  _a.VERTEX = "vertex",
6111
6262
  _a);
6112
6263
  /**
@@ -6196,7 +6347,8 @@ var PlotBoilerplate = /** @class */ (function () {
6196
6347
  * @return {void}
6197
6348
  **/
6198
6349
  setCSSscale: function (element, scaleX, scaleY) {
6199
- element.style["transform-origin"] = "0 0";
6350
+ // element.style["transform-origin"] = "0 0";
6351
+ element.style.transformOrigin = "0 0";
6200
6352
  if (scaleX == 1.0 && scaleY == 1.0) {
6201
6353
  // element.style.transform = null;
6202
6354
  element.style.removeProperty("transform");
@@ -6279,7 +6431,7 @@ var PlotBoilerplate = /** @class */ (function () {
6279
6431
  return fallback;
6280
6432
  return obj[key];
6281
6433
  }
6282
- },
6434
+ }, // END fetch
6283
6435
  /**
6284
6436
  * Installs vertex listeners to the path's vertices so that controlpoints
6285
6437
  * move with their path points when dragged.
@@ -6332,13 +6484,13 @@ var PlotBoilerplate = /** @class */ (function () {
6332
6484
  }; // END utils
6333
6485
  return PlotBoilerplate;
6334
6486
  }()); // END class PlotBoilerplate
6335
- exports.H4 = PlotBoilerplate;
6336
- __webpack_unused_export__ = PlotBoilerplate;
6487
+ exports.PlotBoilerplate = PlotBoilerplate;
6488
+ exports["default"] = PlotBoilerplate;
6337
6489
  //# sourceMappingURL=PlotBoilerplate.js.map
6338
6490
 
6339
6491
  /***/ }),
6340
6492
 
6341
- /***/ 661:
6493
+ /***/ 687:
6342
6494
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6343
6495
 
6344
6496
 
@@ -6379,11 +6531,11 @@ __webpack_unused_export__ = PlotBoilerplate;
6379
6531
  **/
6380
6532
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6381
6533
  exports.Polygon = void 0;
6382
- var BezierPath_1 = __webpack_require__(126);
6383
- var Bounds_1 = __webpack_require__(262);
6384
- var Line_1 = __webpack_require__(831);
6385
- var UIDGenerator_1 = __webpack_require__(197);
6386
- var Vertex_1 = __webpack_require__(421);
6534
+ var BezierPath_1 = __webpack_require__(733);
6535
+ var Bounds_1 = __webpack_require__(76);
6536
+ var Line_1 = __webpack_require__(939);
6537
+ var UIDGenerator_1 = __webpack_require__(938);
6538
+ var Vertex_1 = __webpack_require__(787);
6387
6539
  /**
6388
6540
  * @classdesc A polygon class. Any polygon consists of an array of vertices; polygons can be open or closed.
6389
6541
  *
@@ -6950,7 +7102,7 @@ exports.Polygon = Polygon;
6950
7102
 
6951
7103
  /***/ }),
6952
7104
 
6953
- /***/ 212:
7105
+ /***/ 737:
6954
7106
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6955
7107
 
6956
7108
 
@@ -6985,13 +7137,13 @@ exports.Polygon = Polygon;
6985
7137
  **/
6986
7138
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6987
7139
  exports.Triangle = void 0;
6988
- var Bounds_1 = __webpack_require__(262);
6989
- var Circle_1 = __webpack_require__(913);
6990
- var Line_1 = __webpack_require__(831);
6991
- var Polygon_1 = __webpack_require__(661);
6992
- var UIDGenerator_1 = __webpack_require__(197);
6993
- var Vertex_1 = __webpack_require__(421);
6994
- var geomutils_1 = __webpack_require__(22);
7140
+ var Bounds_1 = __webpack_require__(76);
7141
+ var Circle_1 = __webpack_require__(118);
7142
+ var Line_1 = __webpack_require__(939);
7143
+ var Polygon_1 = __webpack_require__(687);
7144
+ var UIDGenerator_1 = __webpack_require__(938);
7145
+ var Vertex_1 = __webpack_require__(787);
7146
+ var geomutils_1 = __webpack_require__(328);
6995
7147
  /**
6996
7148
  * @classdesc A triangle class for triangulations.
6997
7149
  *
@@ -7044,7 +7196,7 @@ var Triangle = /** @class */ (function () {
7044
7196
  **/
7045
7197
  Triangle.fromArray = function (arr) {
7046
7198
  if (arr.length < 3)
7047
- throw "Cannot create triangle from array with less than three vertices (" + arr.length + ")";
7199
+ throw "Cannot create triangle from array with less than three vertices (".concat(arr.length, ")");
7048
7200
  return new Triangle(arr[0], arr[1], arr[2]);
7049
7201
  };
7050
7202
  /**
@@ -7361,7 +7513,7 @@ exports.Triangle = Triangle;
7361
7513
 
7362
7514
  /***/ }),
7363
7515
 
7364
- /***/ 197:
7516
+ /***/ 938:
7365
7517
  /***/ ((__unused_webpack_module, exports) => {
7366
7518
 
7367
7519
 
@@ -7378,7 +7530,7 @@ var UIDGenerator = /** @class */ (function () {
7378
7530
  function UIDGenerator() {
7379
7531
  }
7380
7532
  UIDGenerator.next = function () {
7381
- return "" + UIDGenerator.current++;
7533
+ return "".concat(UIDGenerator.current++);
7382
7534
  };
7383
7535
  UIDGenerator.current = 0;
7384
7536
  return UIDGenerator;
@@ -7388,7 +7540,7 @@ exports.UIDGenerator = UIDGenerator;
7388
7540
 
7389
7541
  /***/ }),
7390
7542
 
7391
- /***/ 112:
7543
+ /***/ 881:
7392
7544
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7393
7545
 
7394
7546
 
@@ -7416,11 +7568,11 @@ exports.UIDGenerator = UIDGenerator;
7416
7568
  **/
7417
7569
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7418
7570
  exports.VEllipse = void 0;
7419
- var Line_1 = __webpack_require__(831);
7420
- var Vector_1 = __webpack_require__(73);
7421
- var Vertex_1 = __webpack_require__(421);
7422
- var UIDGenerator_1 = __webpack_require__(197);
7423
- var CubicBezierCurve_1 = __webpack_require__(510);
7571
+ var Line_1 = __webpack_require__(939);
7572
+ var Vector_1 = __webpack_require__(30);
7573
+ var Vertex_1 = __webpack_require__(787);
7574
+ var UIDGenerator_1 = __webpack_require__(938);
7575
+ var CubicBezierCurve_1 = __webpack_require__(973);
7424
7576
  /**
7425
7577
  * @classdesc An ellipse class based on two vertices [centerX,centerY] and [radiusX,radiusY].
7426
7578
  *
@@ -7808,7 +7960,7 @@ exports.VEllipse = VEllipse;
7808
7960
 
7809
7961
  /***/ }),
7810
7962
 
7811
- /***/ 965:
7963
+ /***/ 719:
7812
7964
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7813
7965
 
7814
7966
 
@@ -7824,12 +7976,12 @@ exports.VEllipse = VEllipse;
7824
7976
  */
7825
7977
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7826
7978
  exports.VEllipseSector = void 0;
7827
- var CubicBezierCurve_1 = __webpack_require__(510);
7828
- var geomutils_1 = __webpack_require__(22);
7829
- var Line_1 = __webpack_require__(831);
7830
- var UIDGenerator_1 = __webpack_require__(197);
7831
- var VEllipse_1 = __webpack_require__(112);
7832
- var Vertex_1 = __webpack_require__(421);
7979
+ var CubicBezierCurve_1 = __webpack_require__(973);
7980
+ var geomutils_1 = __webpack_require__(328);
7981
+ var Line_1 = __webpack_require__(939);
7982
+ var UIDGenerator_1 = __webpack_require__(938);
7983
+ var VEllipse_1 = __webpack_require__(881);
7984
+ var Vertex_1 = __webpack_require__(787);
7833
7985
  /**
7834
7986
  * @classdesc A class for elliptic sectors.
7835
7987
  *
@@ -7971,7 +8123,7 @@ var VEllipseSector = /** @class */ (function () {
7971
8123
  var r2d = 180 / Math.PI;
7972
8124
  pathData.push("A", radiusH, radiusV, rotation * r2d, largeArcFlag, sweepFlag, end.x, end.y);
7973
8125
  return pathData;
7974
- },
8126
+ }, // END function describeSVGArc
7975
8127
  /**
7976
8128
  * Helper function to find second-kind elliptic angles, so that the euclidean distance along the the
7977
8129
  * elliptic sector is the same for all.
@@ -8098,7 +8250,7 @@ exports.VEllipseSector = VEllipseSector;
8098
8250
 
8099
8251
  /***/ }),
8100
8252
 
8101
- /***/ 73:
8253
+ /***/ 30:
8102
8254
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8103
8255
 
8104
8256
 
@@ -8129,6 +8281,8 @@ var __extends = (this && this.__extends) || (function () {
8129
8281
  return extendStatics(d, b);
8130
8282
  };
8131
8283
  return function (d, b) {
8284
+ if (typeof b !== "function" && b !== null)
8285
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
8132
8286
  extendStatics(d, b);
8133
8287
  function __() { this.constructor = d; }
8134
8288
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -8136,8 +8290,8 @@ var __extends = (this && this.__extends) || (function () {
8136
8290
  })();
8137
8291
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8138
8292
  exports.Vector = void 0;
8139
- var VertTuple_1 = __webpack_require__(72);
8140
- var Vertex_1 = __webpack_require__(421);
8293
+ var VertTuple_1 = __webpack_require__(590);
8294
+ var Vertex_1 = __webpack_require__(787);
8141
8295
  /**
8142
8296
  * @classdesc A vector (Vertex,Vertex) is a line with a visible direction.<br>
8143
8297
  * <br>
@@ -8288,7 +8442,7 @@ exports.Vector = Vector;
8288
8442
 
8289
8443
  /***/ }),
8290
8444
 
8291
- /***/ 72:
8445
+ /***/ 590:
8292
8446
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8293
8447
 
8294
8448
 
@@ -8308,8 +8462,8 @@ exports.Vector = Vector;
8308
8462
  */
8309
8463
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8310
8464
  exports.VertTuple = void 0;
8311
- var Vertex_1 = __webpack_require__(421);
8312
- var UIDGenerator_1 = __webpack_require__(197);
8465
+ var Vertex_1 = __webpack_require__(787);
8466
+ var UIDGenerator_1 = __webpack_require__(938);
8313
8467
  /**
8314
8468
  * @classdesc An abstract base classes for vertex tuple constructs, like Lines or Vectors.
8315
8469
  * @abstract
@@ -8604,7 +8758,7 @@ exports.VertTuple = VertTuple;
8604
8758
 
8605
8759
  /***/ }),
8606
8760
 
8607
- /***/ 421:
8761
+ /***/ 787:
8608
8762
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8609
8763
 
8610
8764
 
@@ -8641,16 +8795,17 @@ exports.VertTuple = VertTuple;
8641
8795
  * @modified 2022-11-28 Added the `subXY`, `subX` and `subY` methods to the `Vertex` class.
8642
8796
  * @modified 2023-09-29 Downgraded types for the `Vertex.utils.buildArrowHead` function (replacing Vertex params by more generic XYCoords type).
8643
8797
  * @modified 2023-09-29 Added the `Vertex.abs()` method as it seems useful.
8644
- * @version 2.8.0
8798
+ * @modified 2024-03-08 Added the optional `precision` param to the `toString` method.
8799
+ * @version 2.9.0
8645
8800
  *
8646
8801
  * @file Vertex
8647
8802
  * @public
8648
8803
  **/
8649
8804
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8650
8805
  exports.Vertex = void 0;
8651
- var VertexAttr_1 = __webpack_require__(861);
8652
- var UIDGenerator_1 = __webpack_require__(197);
8653
- var VertexListeners_1 = __webpack_require__(76);
8806
+ var VertexAttr_1 = __webpack_require__(476);
8807
+ var UIDGenerator_1 = __webpack_require__(938);
8808
+ var VertexListeners_1 = __webpack_require__(934);
8654
8809
  /**
8655
8810
  * @classdesc A vertex is a pair of two numbers.<br>
8656
8811
  * <br>
@@ -8828,11 +8983,11 @@ var Vertex = /** @class */ (function () {
8828
8983
  if (typeof x == "number")
8829
8984
  this.x += x;
8830
8985
  else
8831
- throw "Cannot add " + typeof x + " to numeric x component!";
8986
+ throw "Cannot add ".concat(typeof x, " to numeric x component!");
8832
8987
  if (typeof y == "number")
8833
8988
  this.y += y;
8834
8989
  else
8835
- throw "Cannot add " + typeof y + " to numeric y component!";
8990
+ throw "Cannot add ".concat(typeof y, " to numeric y component!");
8836
8991
  }
8837
8992
  }
8838
8993
  return this;
@@ -8906,11 +9061,11 @@ var Vertex = /** @class */ (function () {
8906
9061
  if (typeof x == "number")
8907
9062
  this.x -= x;
8908
9063
  else
8909
- throw "Cannot add " + typeof x + " to numeric x component!";
9064
+ throw "Cannot add ".concat(typeof x, " to numeric x component!");
8910
9065
  if (typeof y == "number")
8911
9066
  this.y -= y;
8912
9067
  else
8913
- throw "Cannot add " + typeof y + " to numeric y component!";
9068
+ throw "Cannot add ".concat(typeof y, " to numeric y component!");
8914
9069
  }
8915
9070
  }
8916
9071
  return this;
@@ -9183,8 +9338,13 @@ var Vertex = /** @class */ (function () {
9183
9338
  * @instance
9184
9339
  * @memberof Vertex
9185
9340
  **/
9186
- Vertex.prototype.toString = function () {
9187
- return "(" + this.x + "," + this.y + ")";
9341
+ Vertex.prototype.toString = function (precision) {
9342
+ if (typeof precision === "undefined") {
9343
+ return "(" + this.x + "," + this.y + ")";
9344
+ }
9345
+ else {
9346
+ return "(" + this.x.toFixed(precision) + "," + this.y.toFixed(precision) + ")";
9347
+ }
9188
9348
  };
9189
9349
  /**
9190
9350
  * This function should invalidate any installed listeners and invalidate this object.
@@ -9270,7 +9430,7 @@ exports.Vertex = Vertex;
9270
9430
 
9271
9431
  /***/ }),
9272
9432
 
9273
- /***/ 861:
9433
+ /***/ 476:
9274
9434
  /***/ ((__unused_webpack_module, exports) => {
9275
9435
 
9276
9436
 
@@ -9282,7 +9442,8 @@ exports.Vertex = Vertex;
9282
9442
  * @modified 2019-03-20 Added JSDoc tags.
9283
9443
  * @modified 2020-02-29 Added the 'selectable' attribute.
9284
9444
  * @modified 2020-03-23 Ported to Typescript from JS.
9285
- * @version 1.1.1
9445
+ * @modified 2024-03-10 Fixed some types for Typescript 5 compatibility.
9446
+ * @version 1.1.2
9286
9447
  *
9287
9448
  * @file VertexAttr
9288
9449
  * @public
@@ -9334,7 +9495,7 @@ exports.VertexAttr = VertexAttr;
9334
9495
 
9335
9496
  /***/ }),
9336
9497
 
9337
- /***/ 76:
9498
+ /***/ 934:
9338
9499
  /***/ ((__unused_webpack_module, exports) => {
9339
9500
 
9340
9501
 
@@ -9607,7 +9768,7 @@ exports.VertexListeners = VertexListeners;
9607
9768
 
9608
9769
  /***/ }),
9609
9770
 
9610
- /***/ 149:
9771
+ /***/ 39:
9611
9772
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9612
9773
 
9613
9774
 
@@ -9673,10 +9834,10 @@ exports.VertexListeners = VertexListeners;
9673
9834
  **/
9674
9835
  Object.defineProperty(exports, "__esModule", ({ value: true }));
9675
9836
  exports.drawutils = void 0;
9676
- var CubicBezierCurve_1 = __webpack_require__(510);
9677
- var Vertex_1 = __webpack_require__(421);
9678
- var drawutilssvg_1 = __webpack_require__(829);
9679
- var Vector_1 = __webpack_require__(73);
9837
+ var CubicBezierCurve_1 = __webpack_require__(973);
9838
+ var Vertex_1 = __webpack_require__(787);
9839
+ var drawutilssvg_1 = __webpack_require__(378);
9840
+ var Vector_1 = __webpack_require__(30);
9680
9841
  // Todo: rename this class to Drawutils?
9681
9842
  /**
9682
9843
  * @classdesc A wrapper class for basic drawing operations.
@@ -10648,7 +10809,7 @@ var drawutils = /** @class */ (function () {
10648
10809
  (options.fontFamily
10649
10810
  ? options.fontFamily.indexOf(" ") === -1
10650
10811
  ? options.fontFamily
10651
- : "\"" + options.fontFamily + "\""
10812
+ : "\"".concat(options.fontFamily, "\"")
10652
10813
  : "Arial");
10653
10814
  }
10654
10815
  if (options.textAlign) {
@@ -10771,7 +10932,7 @@ exports.drawutils = drawutils;
10771
10932
 
10772
10933
  /***/ }),
10773
10934
 
10774
- /***/ 349:
10935
+ /***/ 264:
10775
10936
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10776
10937
 
10777
10938
 
@@ -10797,7 +10958,7 @@ exports.drawutils = drawutils;
10797
10958
  **/
10798
10959
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10799
10960
  exports.drawutilsgl = void 0;
10800
- var Vertex_1 = __webpack_require__(421);
10961
+ var Vertex_1 = __webpack_require__(787);
10801
10962
  /**
10802
10963
  * @classdesc A wrapper class for basic drawing operations. This is the WebGL
10803
10964
  * implementation whih sould work with shaders.
@@ -11570,7 +11731,7 @@ var GLU = /** @class */ (function () {
11570
11731
 
11571
11732
  /***/ }),
11572
11733
 
11573
- /***/ 829:
11734
+ /***/ 378:
11574
11735
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11575
11736
 
11576
11737
 
@@ -11620,16 +11781,17 @@ var GLU = /** @class */ (function () {
11620
11781
  * @modified 2023-09-29 Added the `arrowHead(...)` function to the 'DrawLib.arrow()` interface.
11621
11782
  * @modified 2023-09-29 Added the `cubicBezierArrow(...)` function to the 'DrawLib.arrow()` interface.
11622
11783
  * @modified 2023-10-04 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
11623
- *
11624
- * @version 1.6.7
11784
+ * @modified 2024-01-30 Fixing an issue with immutable style sets; changes to the global draw config did not reflect here (do now).
11785
+ * @modified 2024-03-10 Fixing some types for Typescript 5 compatibility.
11786
+ * @version 1.6.9
11625
11787
  **/
11626
11788
  Object.defineProperty(exports, "__esModule", ({ value: true }));
11627
11789
  exports.drawutilssvg = void 0;
11628
- var CircleSector_1 = __webpack_require__(946);
11629
- var CubicBezierCurve_1 = __webpack_require__(510);
11630
- var Vertex_1 = __webpack_require__(421);
11631
- var UIDGenerator_1 = __webpack_require__(197);
11632
- var Vector_1 = __webpack_require__(73);
11790
+ var CircleSector_1 = __webpack_require__(135);
11791
+ var CubicBezierCurve_1 = __webpack_require__(973);
11792
+ var Vertex_1 = __webpack_require__(787);
11793
+ var UIDGenerator_1 = __webpack_require__(938);
11794
+ var Vector_1 = __webpack_require__(30);
11633
11795
  var RAD_TO_DEG = 180 / Math.PI;
11634
11796
  /**
11635
11797
  * @classdesc A helper class for basic SVG drawing operations. This class should
@@ -11641,6 +11803,10 @@ var RAD_TO_DEG = 180 / Math.PI;
11641
11803
  * @requires XYCoords
11642
11804
  */
11643
11805
  var drawutilssvg = /** @class */ (function () {
11806
+ /**
11807
+ * Passed from primary to secondary instance.
11808
+ */
11809
+ //private nodeStyle: SVGStyleElement;
11644
11810
  /**
11645
11811
  * The constructor.
11646
11812
  *
@@ -11655,12 +11821,13 @@ var drawutilssvg = /** @class */ (function () {
11655
11821
  * @param {boolean=} isSecondary - (optional) Indicates if this is the primary or secondary instance. Only primary instances manage child nodes.
11656
11822
  * @param {SVGGElement=} gNode - (optional) Primary and seconday instances share the same &lt;g> node.
11657
11823
  **/
11658
- function drawutilssvg(svgNode, offset, scale, canvasSize, fillShapes, drawConfig, isSecondary, gNode, bufferGNode, nodeDefs, bufferNodeDefs) {
11824
+ function drawutilssvg(svgNode, offset, scale, canvasSize, fillShapes, drawConfig, isSecondary, gNode, bufferGNode, nodeDefs, bufferNodeDefs, nodeStyle) {
11659
11825
  this.svgNode = svgNode;
11660
11826
  this.offset = new Vertex_1.Vertex(0, 0).set(offset);
11661
11827
  this.scale = new Vertex_1.Vertex(1, 1).set(scale);
11662
11828
  this.fillShapes = fillShapes;
11663
11829
  this.isSecondary = Boolean(isSecondary);
11830
+ this.drawConfig = drawConfig;
11664
11831
  this.drawlibConfiguration = {};
11665
11832
  this.cache = new Map();
11666
11833
  this.setSize(canvasSize);
@@ -11672,6 +11839,9 @@ var drawutilssvg = /** @class */ (function () {
11672
11839
  this.bufferGNode = bufferGNode;
11673
11840
  this.nodeDefs = nodeDefs;
11674
11841
  this.bufferedNodeDefs = bufferNodeDefs;
11842
+ if (nodeStyle) {
11843
+ this.nodeStyle = nodeStyle;
11844
+ }
11675
11845
  }
11676
11846
  else {
11677
11847
  this.addStyleDefs(drawConfig);
@@ -11690,11 +11860,19 @@ var drawutilssvg = /** @class */ (function () {
11690
11860
  drawutilssvg.prototype.addStyleDefs = function (drawConfig) {
11691
11861
  this.nodeStyle = this.createSVGNode("style");
11692
11862
  this.svgNode.appendChild(this.nodeStyle);
11863
+ this.rebuildStyleDefs(drawConfig);
11864
+ };
11865
+ /**
11866
+ * This method is required to re-define the global style defs. It is needed
11867
+ * if any value in the DrawConfig changed in the meantime.
11868
+ * @param drawConfig
11869
+ */
11870
+ drawutilssvg.prototype.rebuildStyleDefs = function (drawConfig) {
11693
11871
  // Which default styles to add? -> All from the DrawConfig.
11694
11872
  // Compare with DrawConfig interface
11695
11873
  var keys = {
11696
- // "bezier": "CubicBezierCurve", // TODO: is this correct?
11697
- "bezierPath": "BezierPath",
11874
+ "bezier": "CubicBezierCurve",
11875
+ //"bezierPath": "BezierPath", // TODO: is this correct?
11698
11876
  "polygon": "Polygon",
11699
11877
  "triangle": "Triangle",
11700
11878
  "ellipse": "Ellipse",
@@ -11709,14 +11887,15 @@ var drawutilssvg = /** @class */ (function () {
11709
11887
  };
11710
11888
  // Question: why isn't this working if the svgNode is created dynamically? (nodeStyle.sheet is null)
11711
11889
  var rules = [];
11890
+ // console.log("drawConfig", drawConfig);
11712
11891
  for (var k in keys) {
11713
11892
  var className = keys[k];
11714
11893
  var drawSettings = drawConfig[k];
11715
11894
  if (drawSettings) {
11716
- rules.push("." + className + " { fill : none; stroke: " + drawSettings.color + "; stroke-width: " + drawSettings.lineWidth + "px }");
11895
+ rules.push(".".concat(className, " { fill : none; stroke: ").concat(drawSettings.color, "; stroke-width: ").concat(drawSettings.lineWidth, "px }"));
11717
11896
  }
11718
11897
  else {
11719
- console.warn("Warning: your draw config is missing the key '" + k + "' which is required.");
11898
+ console.warn("Warning: your draw config is missing the key '".concat(k, "' which is required."));
11720
11899
  }
11721
11900
  }
11722
11901
  this.nodeStyle.innerHTML = rules.join("\n");
@@ -11806,7 +11985,8 @@ var drawutilssvg = /** @class */ (function () {
11806
11985
  node = this.createSVGNode(nodeName);
11807
11986
  }
11808
11987
  if (this.drawlibConfiguration.blendMode) {
11809
- node.style["mix-blend-mode"] = this.drawlibConfiguration.blendMode;
11988
+ // node.style["mix-blend-mode"] = this.drawlibConfiguration.blendMode;
11989
+ node.style["mix-blend-mode"](this.drawlibConfiguration.blendMode);
11810
11990
  }
11811
11991
  // if (this.lineDashEnabled && this.lineDash && this.lineDash.length > 0 && drawutilssvg.nodeSupportsLineDash(nodeName)) {
11812
11992
  // node.setAttribute("stroke-dasharray", this.lineDash.join(" "));
@@ -11870,7 +12050,7 @@ var drawutilssvg = /** @class */ (function () {
11870
12050
  */
11871
12051
  drawutilssvg.prototype._addCSSClasses = function (node, className) {
11872
12052
  if (this.curClassName) {
11873
- node.setAttribute("class", className + " " + this.curClassName);
12053
+ node.setAttribute("class", "".concat(className, " ").concat(this.curClassName));
11874
12054
  }
11875
12055
  else {
11876
12056
  node.setAttribute("class", className);
@@ -11880,9 +12060,9 @@ var drawutilssvg = /** @class */ (function () {
11880
12060
  this._addCSSClasses(node, className);
11881
12061
  node.setAttribute("fill", fillMode && color ? color : "none");
11882
12062
  node.setAttribute("stroke", fillMode ? "none" : color || "none");
11883
- node.setAttribute("stroke-width", "" + (lineWidth || 1));
12063
+ node.setAttribute("stroke-width", "".concat(lineWidth || 1));
11884
12064
  if (this.curId) {
11885
- node.setAttribute("id", "" + this.curId); // Maybe React-style 'key' would be better?
12065
+ node.setAttribute("id", "".concat(this.curId)); // Maybe React-style 'key' would be better?
11886
12066
  }
11887
12067
  this.applyStrokeOpts(node, strokeOptions);
11888
12068
  return node;
@@ -11897,18 +12077,18 @@ var drawutilssvg = /** @class */ (function () {
11897
12077
  */
11898
12078
  drawutilssvg.prototype.setSize = function (canvasSize) {
11899
12079
  this.canvasSize = canvasSize;
11900
- this.svgNode.setAttribute("viewBox", "0 0 " + this.canvasSize.width + " " + this.canvasSize.height);
11901
- this.svgNode.setAttribute("width", "" + this.canvasSize.width);
11902
- this.svgNode.setAttribute("height", "" + this.canvasSize.height);
12080
+ this.svgNode.setAttribute("viewBox", "0 0 ".concat(this.canvasSize.width, " ").concat(this.canvasSize.height));
12081
+ this.svgNode.setAttribute("width", "".concat(this.canvasSize.width));
12082
+ this.svgNode.setAttribute("height", "".concat(this.canvasSize.height));
11903
12083
  };
11904
12084
  /**
11905
12085
  * Creates a 'shallow' (non deep) copy of this instance. This implies
11906
12086
  * that under the hood the same gl context and gl program will be used.
11907
12087
  */
11908
12088
  drawutilssvg.prototype.copyInstance = function (fillShapes) {
11909
- var copy = new drawutilssvg(this.svgNode, this.offset, this.scale, this.canvasSize, fillShapes, null, // no DrawConfig – this will work as long as `isSecondary===true`
12089
+ 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`
11910
12090
  true, // isSecondary
11911
- this.gNode, this.bufferGNode, this.nodeDefs, this.bufferedNodeDefs);
12091
+ this.gNode, this.bufferGNode, this.nodeDefs, this.bufferedNodeDefs, this.nodeStyle);
11912
12092
  return copy;
11913
12093
  };
11914
12094
  /**
@@ -11921,20 +12101,6 @@ var drawutilssvg = /** @class */ (function () {
11921
12101
  drawutilssvg.prototype.setConfiguration = function (configuration) {
11922
12102
  this.drawlibConfiguration = configuration;
11923
12103
  };
11924
- // /**
11925
- // * Set or clear the line-dash configuration. Pass `null` for un-dashed lines.
11926
- // *
11927
- // * See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
11928
- // * and https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
11929
- // * for how line dashes work.
11930
- // *
11931
- // * @method
11932
- // * @param {Array<number> lineDashes - The line-dash array configuration.
11933
- // * @returns {void}
11934
- // */
11935
- // setLineDash(lineDashes: Array<number>) {
11936
- // this.lineDash = lineDashes;
11937
- // }
11938
12104
  /**
11939
12105
  * This method shouled be called each time the currently drawn `Drawable` changes.
11940
12106
  * It is used by some libraries for identifying elemente on re-renders.
@@ -11994,6 +12160,7 @@ var drawutilssvg = /** @class */ (function () {
11994
12160
  * @instance
11995
12161
  **/
11996
12162
  drawutilssvg.prototype.endDrawCycle = function (renderTime) {
12163
+ this.rebuildStyleDefs(this.drawConfig);
11997
12164
  if (!this.isSecondary) {
11998
12165
  // All elements are drawn into the buffer; they are NOT yet visible, not did the browser perform any
11999
12166
  // layout updates.
@@ -12026,7 +12193,7 @@ var drawutilssvg = /** @class */ (function () {
12026
12193
  })
12027
12194
  .join(" "));
12028
12195
  if (strokeOptions.dashOffset) {
12029
- node.setAttribute("stroke-dashoffset", "" + strokeOptions.dashOffset * this.scale.x);
12196
+ node.setAttribute("stroke-dashoffset", "".concat(strokeOptions.dashOffset * this.scale.x));
12030
12197
  }
12031
12198
  }
12032
12199
  };
@@ -12162,13 +12329,13 @@ var drawutilssvg = /** @class */ (function () {
12162
12329
  if (image.naturalWidth) {
12163
12330
  var ratioX = size.x / image.naturalWidth;
12164
12331
  var ratioY = size.y / image.naturalHeight;
12165
- node.setAttribute("width", "" + image.naturalWidth * _this.scale.x);
12166
- node.setAttribute("height", "" + image.naturalHeight * _this.scale.y);
12332
+ node.setAttribute("width", "".concat(image.naturalWidth * _this.scale.x));
12333
+ node.setAttribute("height", "".concat(image.naturalHeight * _this.scale.y));
12167
12334
  node.setAttribute("display", null); // Dislay when loaded
12168
12335
  // if (alpha) {
12169
- node.setAttribute("opacity", "" + alpha);
12336
+ node.setAttribute("opacity", "".concat(alpha));
12170
12337
  // }
12171
- node.setAttribute("transform", "translate(" + _this._x(position.x) + " " + _this._y(position.y) + ") scale(" + ratioX + " " + ratioY + ")");
12338
+ node.setAttribute("transform", "translate(".concat(_this._x(position.x), " ").concat(_this._y(position.y), ") scale(").concat(ratioX, " ").concat(ratioY, ")"));
12172
12339
  }
12173
12340
  };
12174
12341
  image.addEventListener("load", function (event) {
@@ -12176,8 +12343,8 @@ var drawutilssvg = /** @class */ (function () {
12176
12343
  });
12177
12344
  // Safari has a transform-origin bug.
12178
12345
  // Use x=0, y=0 and translate/scale instead (see above)
12179
- node.setAttribute("x", "" + 0);
12180
- node.setAttribute("y", "" + 0);
12346
+ node.setAttribute("x", "".concat(0));
12347
+ node.setAttribute("y", "".concat(0));
12181
12348
  node.setAttribute("display", "none"); // Hide before loaded
12182
12349
  setImageSize(image);
12183
12350
  node.setAttribute("href", image.src);
@@ -12218,36 +12385,36 @@ var drawutilssvg = /** @class */ (function () {
12218
12385
  // </image>
12219
12386
  // ...
12220
12387
  var clipPathNode = this.makeNode("clipPath");
12221
- var clipPathId = "clippath_" + UIDGenerator_1.UIDGenerator.next(); // TODO: use a better UUID generator here?
12388
+ var clipPathId = "clippath_".concat(UIDGenerator_1.UIDGenerator.next()); // TODO: use a better UUID generator here?
12222
12389
  clipPathNode.setAttribute("id", clipPathId);
12223
12390
  var gNode = this.makeNode("g");
12224
12391
  var imageNode = this.makeNode("image");
12225
- imageNode.setAttribute("x", "" + this._x(rotatedScalingOrigin.x));
12226
- imageNode.setAttribute("y", "" + this._y(rotatedScalingOrigin.y));
12227
- imageNode.setAttribute("width", "" + textureSize.width);
12228
- imageNode.setAttribute("height", "" + textureSize.height);
12392
+ imageNode.setAttribute("x", "".concat(this._x(rotatedScalingOrigin.x)));
12393
+ imageNode.setAttribute("y", "".concat(this._y(rotatedScalingOrigin.y)));
12394
+ imageNode.setAttribute("width", "".concat(textureSize.width));
12395
+ imageNode.setAttribute("height", "".concat(textureSize.height));
12229
12396
  imageNode.setAttribute("href", textureImage.src);
12230
12397
  // imageNode.setAttribute("opacity", "0.5");
12231
12398
  // SVG rotations in degrees
12232
- imageNode.setAttribute("transform", "rotate(" + rotation * RAD_TO_DEG + ", " + this._x(rotatedScalingOrigin.x) + ", " + this._y(rotatedScalingOrigin.y) + ")");
12399
+ imageNode.setAttribute("transform", "rotate(".concat(rotation * RAD_TO_DEG, ", ").concat(this._x(rotatedScalingOrigin.x), ", ").concat(this._y(rotatedScalingOrigin.y), ")"));
12233
12400
  var pathNode = this.makeNode("path");
12234
12401
  var pathData = [];
12235
12402
  if (polygon.vertices.length > 0) {
12236
12403
  var self_1 = this;
12237
- pathData.push("M", "" + this._x(polygon.vertices[0].x), "" + this._y(polygon.vertices[0].y));
12404
+ pathData.push("M", "".concat(this._x(polygon.vertices[0].x)), "".concat(this._y(polygon.vertices[0].y)));
12238
12405
  for (var i = 1; i < polygon.vertices.length; i++) {
12239
- pathData.push("L", "" + this._x(polygon.vertices[i].x), "" + this._y(polygon.vertices[i].y));
12406
+ pathData.push("L", "".concat(this._x(polygon.vertices[i].x)), "".concat(this._y(polygon.vertices[i].y)));
12240
12407
  }
12241
12408
  }
12242
12409
  pathNode.setAttribute("d", pathData.join(" "));
12243
12410
  clipPathNode.appendChild(pathNode);
12244
12411
  this.bufferedNodeDefs.appendChild(clipPathNode);
12245
12412
  gNode.appendChild(imageNode);
12246
- gNode.setAttribute("transform-origin", this._x(rotatedScalingOrigin.x) + " " + this._y(rotatedScalingOrigin.y));
12247
- gNode.setAttribute("transform", "scale(" + this.scale.x + ", " + this.scale.y + ")");
12413
+ gNode.setAttribute("transform-origin", "".concat(this._x(rotatedScalingOrigin.x), " ").concat(this._y(rotatedScalingOrigin.y)));
12414
+ gNode.setAttribute("transform", "scale(".concat(this.scale.x, ", ").concat(this.scale.y, ")"));
12248
12415
  var clipNode = this.makeNode("g");
12249
12416
  clipNode.appendChild(gNode);
12250
- clipNode.setAttribute("clip-path", "url(#" + clipPathId + ")");
12417
+ clipNode.setAttribute("clip-path", "url(#".concat(clipPathId, ")"));
12251
12418
  // TODO: check if the image class is correct here or if we should use a 'clippedImage' class here
12252
12419
  this._bindFillDraw(clipNode, "image", null, null); // No color, no lineWidth
12253
12420
  return clipNode;
@@ -12352,10 +12519,10 @@ var drawutilssvg = /** @class */ (function () {
12352
12519
  */
12353
12520
  drawutilssvg.prototype.dot = function (p, color) {
12354
12521
  var node = this.makeNode("line");
12355
- node.setAttribute("x1", "" + this._x(p.x));
12356
- node.setAttribute("y1", "" + this._y(p.y));
12357
- node.setAttribute("x2", "" + this._x(p.x));
12358
- node.setAttribute("y2", "" + this._y(p.y));
12522
+ node.setAttribute("x1", "".concat(this._x(p.x)));
12523
+ node.setAttribute("y1", "".concat(this._y(p.y)));
12524
+ node.setAttribute("x2", "".concat(this._x(p.x)));
12525
+ node.setAttribute("y2", "".concat(this._y(p.y)));
12359
12526
  return this._bindFillDraw(node, "dot", color, 1);
12360
12527
  };
12361
12528
  /**
@@ -12371,9 +12538,9 @@ var drawutilssvg = /** @class */ (function () {
12371
12538
  drawutilssvg.prototype.point = function (p, color) {
12372
12539
  var radius = 3;
12373
12540
  var node = this.makeNode("circle");
12374
- node.setAttribute("cx", "" + this._x(p.x));
12375
- node.setAttribute("cy", "" + this._y(p.y));
12376
- node.setAttribute("r", "" + radius);
12541
+ node.setAttribute("cx", "".concat(this._x(p.x)));
12542
+ node.setAttribute("cy", "".concat(this._y(p.y)));
12543
+ node.setAttribute("r", "".concat(radius));
12377
12544
  return this._bindFillDraw(node, "point", color, 1);
12378
12545
  };
12379
12546
  /**
@@ -12396,9 +12563,9 @@ var drawutilssvg = /** @class */ (function () {
12396
12563
  // Todo: draw ellipse when scalex!=scaley
12397
12564
  var node = this.makeNode("circle");
12398
12565
  this.applyStrokeOpts(node, strokeOptions);
12399
- node.setAttribute("cx", "" + this._x(center.x));
12400
- node.setAttribute("cy", "" + this._y(center.y));
12401
- node.setAttribute("r", "" + radius * this.scale.x); // y?
12566
+ node.setAttribute("cx", "".concat(this._x(center.x)));
12567
+ node.setAttribute("cy", "".concat(this._y(center.y)));
12568
+ node.setAttribute("r", "".concat(radius * this.scale.x)); // y?
12402
12569
  return this._bindFillDraw(node, "circle", color, lineWidth || 1);
12403
12570
  };
12404
12571
  /**
@@ -12446,12 +12613,12 @@ var drawutilssvg = /** @class */ (function () {
12446
12613
  }
12447
12614
  var node = this.makeNode("ellipse");
12448
12615
  this.applyStrokeOpts(node, strokeOptions);
12449
- node.setAttribute("cx", "" + this._x(center.x));
12450
- node.setAttribute("cy", "" + this._y(center.y));
12451
- node.setAttribute("rx", "" + radiusX * this.scale.x);
12452
- node.setAttribute("ry", "" + radiusY * this.scale.y);
12616
+ node.setAttribute("cx", "".concat(this._x(center.x)));
12617
+ node.setAttribute("cy", "".concat(this._y(center.y)));
12618
+ node.setAttribute("rx", "".concat(radiusX * this.scale.x));
12619
+ node.setAttribute("ry", "".concat(radiusY * this.scale.y));
12453
12620
  // node.setAttribute( 'style', `transform: rotate(${rotation} ${center.x} ${center.y})` );
12454
- node.setAttribute("transform", "rotate(" + (rotation * 180) / Math.PI + " " + this._x(center.x) + " " + this._y(center.y) + ")");
12621
+ node.setAttribute("transform", "rotate(".concat((rotation * 180) / Math.PI, " ").concat(this._x(center.x), " ").concat(this._y(center.y), ")"));
12455
12622
  return this._bindFillDraw(node, "ellipse", color, lineWidth || 1);
12456
12623
  };
12457
12624
  /**
@@ -12473,10 +12640,10 @@ var drawutilssvg = /** @class */ (function () {
12473
12640
  drawutilssvg.prototype.square = function (center, size, color, lineWidth, strokeOptions) {
12474
12641
  var node = this.makeNode("rectangle");
12475
12642
  this.applyStrokeOpts(node, strokeOptions);
12476
- node.setAttribute("x", "" + this._x(center.x - size / 2.0));
12477
- node.setAttribute("y", "" + this._y(center.y - size / 2.0));
12478
- node.setAttribute("width", "" + size * this.scale.x);
12479
- node.setAttribute("height", "" + size * this.scale.y);
12643
+ node.setAttribute("x", "".concat(this._x(center.x - size / 2.0)));
12644
+ node.setAttribute("y", "".concat(this._y(center.y - size / 2.0)));
12645
+ node.setAttribute("width", "".concat(size * this.scale.x));
12646
+ node.setAttribute("height", "".concat(size * this.scale.y));
12480
12647
  return this._bindFillDraw(node, "square", color, lineWidth || 1);
12481
12648
  };
12482
12649
  /**
@@ -12496,10 +12663,10 @@ var drawutilssvg = /** @class */ (function () {
12496
12663
  drawutilssvg.prototype.rect = function (position, width, height, color, lineWidth, strokeOptions) {
12497
12664
  var node = this.makeNode("rect");
12498
12665
  this.applyStrokeOpts(node, strokeOptions);
12499
- node.setAttribute("x", "" + this._x(position.x));
12500
- node.setAttribute("y", "" + this._y(position.y));
12501
- node.setAttribute("width", "" + width * this.scale.x);
12502
- node.setAttribute("height", "" + height * this.scale.y);
12666
+ node.setAttribute("x", "".concat(this._x(position.x)));
12667
+ node.setAttribute("y", "".concat(this._y(position.y)));
12668
+ node.setAttribute("width", "".concat(width * this.scale.x));
12669
+ node.setAttribute("height", "".concat(height * this.scale.y));
12503
12670
  return this._bindFillDraw(node, "rect", color, lineWidth || 1);
12504
12671
  };
12505
12672
  /**
@@ -12617,10 +12784,10 @@ var drawutilssvg = /** @class */ (function () {
12617
12784
  */
12618
12785
  drawutilssvg.prototype.squareHandle = function (center, size, color) {
12619
12786
  var node = this.makeNode("rect");
12620
- node.setAttribute("x", "" + (this._x(center.x) - size / 2.0));
12621
- node.setAttribute("y", "" + (this._y(center.y) - size / 2.0));
12622
- node.setAttribute("width", "" + size);
12623
- node.setAttribute("height", "" + size);
12787
+ node.setAttribute("x", "".concat(this._x(center.x) - size / 2.0));
12788
+ node.setAttribute("y", "".concat(this._y(center.y) - size / 2.0));
12789
+ node.setAttribute("width", "".concat(size));
12790
+ node.setAttribute("height", "".concat(size));
12624
12791
  return this._bindFillDraw(node, "squareHandle", color, 1);
12625
12792
  };
12626
12793
  /**
@@ -12641,9 +12808,9 @@ var drawutilssvg = /** @class */ (function () {
12641
12808
  drawutilssvg.prototype.circleHandle = function (center, radius, color) {
12642
12809
  radius = radius || 3;
12643
12810
  var node = this.makeNode("circle");
12644
- node.setAttribute("cx", "" + this._x(center.x));
12645
- node.setAttribute("cy", "" + this._y(center.y));
12646
- node.setAttribute("r", "" + radius);
12811
+ node.setAttribute("cx", "".concat(this._x(center.x)));
12812
+ node.setAttribute("cy", "".concat(this._y(center.y)));
12813
+ node.setAttribute("r", "".concat(radius));
12647
12814
  return this._bindFillDraw(node, "circleHandle", color, 1);
12648
12815
  };
12649
12816
  /**
@@ -12790,22 +12957,22 @@ var drawutilssvg = /** @class */ (function () {
12790
12957
  : options.textAlign === "right" || options.textAlign === "end"
12791
12958
  ? "end"
12792
12959
  : "start";
12793
- var transformOrigin = this._x(x) + "px " + this._y(y) + "px";
12794
- var translate = "translate(" + this._x(x) + " " + (this._y(y) + lineHeight / 2) + ")";
12960
+ var transformOrigin = "".concat(this._x(x), "px ").concat(this._y(y), "px");
12961
+ var translate = "translate(".concat(this._x(x), " ").concat(this._y(y) + lineHeight / 2, ")");
12795
12962
  // Safari has a transform-origin/rotation bug.
12796
12963
  // It's essential to use rotate(r,x,y) here. "rotate(r)"" with transform-origin(x,y) won't do the job.
12797
12964
  // And rotate and translate cannot be used is combination on a text object.
12798
12965
  // So wrap the text inside a <g>, translate the <g>, and rotate the text inside.
12799
- var rotate = options.rotation ? "rotate(" + options.rotation * RAD_TO_DEG + " 0 0)" : "";
12966
+ var rotate = options.rotation ? "rotate(".concat(options.rotation * RAD_TO_DEG, " 0 0)") : "";
12800
12967
  var node = this.makeNode("g");
12801
12968
  var curId = this.curId;
12802
12969
  this.curId = curId + "_text";
12803
12970
  var textNode = this.makeNode("text");
12804
12971
  node.appendChild(textNode);
12805
12972
  textNode.setAttribute("font-family", (_c = options.fontFamily) !== null && _c !== void 0 ? _c : ""); // May be undefined
12806
- textNode.setAttribute("font-size", options.fontSize ? "" + options.fontSize * this.scale.x : "");
12807
- textNode.setAttribute("font-style", options.fontStyle ? "" + options.fontStyle : "");
12808
- textNode.setAttribute("font-weight", options.fontWeight ? "" + options.fontWeight : "");
12973
+ textNode.setAttribute("font-size", options.fontSize ? "".concat(options.fontSize * this.scale.x) : "");
12974
+ textNode.setAttribute("font-style", options.fontStyle ? "".concat(options.fontStyle) : "");
12975
+ textNode.setAttribute("font-weight", options.fontWeight ? "".concat(options.fontWeight) : "");
12809
12976
  textNode.setAttribute("text-anchor", textAlign);
12810
12977
  textNode.setAttribute("transform-origin", "0 0");
12811
12978
  textNode.setAttribute("transform", rotate);
@@ -12832,7 +12999,7 @@ var drawutilssvg = /** @class */ (function () {
12832
12999
  drawutilssvg.prototype.label = function (text, x, y, rotation, color) {
12833
13000
  var node = this.makeNode("text");
12834
13001
  // For some strange reason SVG rotation transforms use degrees instead of radians
12835
- node.setAttribute("transform", "translate(" + x + "," + y + "), rotate(" + ((rotation || 0) / Math.PI) * 180 + ")");
13002
+ node.setAttribute("transform", "translate(".concat(x, ",").concat(y, "), rotate(").concat(((rotation || 0) / Math.PI) * 180, ")"));
12836
13003
  node.setAttribute("font-family", "Arial");
12837
13004
  node.setAttribute("font-size", "9pt");
12838
13005
  node.setAttribute("font-style", "normal");
@@ -12889,8 +13056,8 @@ var drawutilssvg = /** @class */ (function () {
12889
13056
  // Note that the background does not scale with the zoom level (always covers full element)
12890
13057
  node.setAttribute("x", "0");
12891
13058
  node.setAttribute("y", "0");
12892
- node.setAttribute("width", "" + this.canvasSize.width);
12893
- node.setAttribute("height", "" + this.canvasSize.height);
13059
+ node.setAttribute("width", "".concat(this.canvasSize.width));
13060
+ node.setAttribute("height", "".concat(this.canvasSize.height));
12894
13061
  // Bind this special element into the document
12895
13062
  this._bindFillDraw(node, this.curId, null, null);
12896
13063
  node.setAttribute("fill", typeof color === "undefined" ? "none" : color);
@@ -13121,10 +13288,10 @@ var drawutilssvg = /** @class */ (function () {
13121
13288
  */
13122
13289
  drawutilssvg.prototype.makeLineNode = function (zA, zB, color, lineWidth, strokeOptions, classNameOverride) {
13123
13290
  var line = this.makeNode("line");
13124
- line.setAttribute("x1", "" + this._x(zA.x));
13125
- line.setAttribute("y1", "" + this._y(zA.y));
13126
- line.setAttribute("x2", "" + this._x(zB.x));
13127
- line.setAttribute("y2", "" + this._y(zB.y));
13291
+ line.setAttribute("x1", "".concat(this._x(zA.x)));
13292
+ line.setAttribute("y1", "".concat(this._y(zA.y)));
13293
+ line.setAttribute("x2", "".concat(this._x(zB.x)));
13294
+ line.setAttribute("y2", "".concat(this._y(zB.y)));
13128
13295
  this._configureNode(line, classNameOverride !== null && classNameOverride !== void 0 ? classNameOverride : "line", this.fillShapes, color, lineWidth || 1, strokeOptions);
13129
13296
  return line;
13130
13297
  };
@@ -13234,7 +13401,7 @@ exports.drawutilssvg = drawutilssvg;
13234
13401
 
13235
13402
  /***/ }),
13236
13403
 
13237
- /***/ 22:
13404
+ /***/ 328:
13238
13405
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13239
13406
 
13240
13407
 
@@ -13246,8 +13413,8 @@ exports.drawutilssvg = drawutilssvg;
13246
13413
  **/
13247
13414
  Object.defineProperty(exports, "__esModule", ({ value: true }));
13248
13415
  exports.geomutils = void 0;
13249
- var Line_1 = __webpack_require__(831);
13250
- var Triangle_1 = __webpack_require__(212);
13416
+ var Line_1 = __webpack_require__(939);
13417
+ var Triangle_1 = __webpack_require__(737);
13251
13418
  /**
13252
13419
  * A collection of usefull geometry utilities.
13253
13420
  *
@@ -13278,14 +13445,14 @@ exports.geomutils = {
13278
13445
  if (insideAngle < 0)
13279
13446
  insideAngle = 2 * Math.PI + insideAngle;
13280
13447
  if (!clockwise)
13281
- insideAngle = (2 * Math.PI - insideAngle) * (-1);
13448
+ insideAngle = (2 * Math.PI - insideAngle) * -1;
13282
13449
  // Scale the rotated lines to the max leg length (looks better)
13283
13450
  var lineLength = Math.max(lineAB.length(), lineAC.length());
13284
13451
  var scaleFactor = lineLength / lineAB.length();
13285
13452
  var result = [];
13286
13453
  for (var i = 1; i < n; i++) {
13287
13454
  // Compute the i-th inner sector line
13288
- result.push(new Line_1.Line(pA, pB.clone().rotate((-i * (insideAngle / n)), pA)).scale(scaleFactor));
13455
+ result.push(new Line_1.Line(pA, pB.clone().rotate(-i * (insideAngle / n), pA)).scale(scaleFactor));
13289
13456
  }
13290
13457
  return result;
13291
13458
  },
@@ -13328,8 +13495,9 @@ exports.geomutils = {
13328
13495
  /******/ // The require function
13329
13496
  /******/ function __webpack_require__(moduleId) {
13330
13497
  /******/ // Check if module is in cache
13331
- /******/ if(__webpack_module_cache__[moduleId]) {
13332
- /******/ return __webpack_module_cache__[moduleId].exports;
13498
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
13499
+ /******/ if (cachedModule !== undefined) {
13500
+ /******/ return cachedModule.exports;
13333
13501
  /******/ }
13334
13502
  /******/ // Create a new module (and put it into the cache)
13335
13503
  /******/ var module = __webpack_module_cache__[moduleId] = {
@@ -13360,7 +13528,7 @@ exports.geomutils = {
13360
13528
  /******/
13361
13529
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
13362
13530
  /******/ (() => {
13363
- /******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
13531
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
13364
13532
  /******/ })();
13365
13533
  /******/
13366
13534
  /******/ /* webpack/runtime/make namespace object */
@@ -13375,36 +13543,38 @@ exports.geomutils = {
13375
13543
  /******/ })();
13376
13544
  /******/
13377
13545
  /************************************************************************/
13546
+ var __webpack_exports__ = {};
13547
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
13378
13548
  (() => {
13379
13549
 
13380
13550
  /* Imports for webpack */
13381
13551
 
13382
- globalThis.UIDGenerator = __webpack_require__(197).UIDGenerator;
13383
- globalThis.VertexAttr = __webpack_require__(861).VertexAttr;
13384
- globalThis.VertexListeners = __webpack_require__(76).VertexListeners;
13385
- globalThis.Vertex = __webpack_require__(421).Vertex;
13552
+ globalThis.UIDGenerator = (__webpack_require__(938).UIDGenerator);
13553
+ globalThis.VertexAttr = (__webpack_require__(476).VertexAttr);
13554
+ globalThis.VertexListeners = (__webpack_require__(934).VertexListeners);
13555
+ globalThis.Vertex = (__webpack_require__(787).Vertex);
13386
13556
 
13387
- globalThis.Bounds = __webpack_require__(262).Bounds;
13388
- globalThis.Grid = __webpack_require__(843).Grid;
13389
- globalThis.Line = __webpack_require__(831).Line;
13390
- globalThis.Vector = __webpack_require__(73).Vector;
13391
- globalThis.CubicBezierCurve = __webpack_require__(510).CubicBezierCurve;
13392
- globalThis.BezierPath = __webpack_require__(126).BezierPath;
13393
- globalThis.Polygon = __webpack_require__(661).Polygon;
13394
- globalThis.Triangle = __webpack_require__(212).Triangle;
13395
- globalThis.VEllipse = __webpack_require__(112).VEllipse;
13396
- globalThis.VEllipseSector = __webpack_require__(965).VEllipseSector;
13397
- globalThis.Circle = __webpack_require__(913).Circle;
13398
- globalThis.CircleSector = __webpack_require__(946).CircleSector;
13399
- globalThis.PBImage = __webpack_require__(699).PBImage;
13400
- globalThis.PBText = __webpack_require__(196).PBText;
13401
- globalThis.MouseHandler = __webpack_require__(293).MouseHandler;
13402
- globalThis.KeyHandler = __webpack_require__(909).KeyHandler;
13403
- globalThis.drawutils = __webpack_require__(149).drawutils;
13557
+ globalThis.Bounds = (__webpack_require__(76).Bounds);
13558
+ globalThis.Grid = (__webpack_require__(289).Grid);
13559
+ globalThis.Line = (__webpack_require__(939).Line);
13560
+ globalThis.Vector = (__webpack_require__(30).Vector);
13561
+ globalThis.CubicBezierCurve = (__webpack_require__(973).CubicBezierCurve);
13562
+ globalThis.BezierPath = (__webpack_require__(733).BezierPath);
13563
+ globalThis.Polygon = (__webpack_require__(687).Polygon);
13564
+ globalThis.Triangle = (__webpack_require__(737).Triangle);
13565
+ globalThis.VEllipse = (__webpack_require__(881).VEllipse);
13566
+ globalThis.VEllipseSector = (__webpack_require__(719).VEllipseSector);
13567
+ globalThis.Circle = (__webpack_require__(118).Circle);
13568
+ globalThis.CircleSector = (__webpack_require__(135).CircleSector);
13569
+ globalThis.PBImage = (__webpack_require__(862).PBImage);
13570
+ globalThis.PBText = (__webpack_require__(628).PBText);
13571
+ globalThis.MouseHandler = (__webpack_require__(912).MouseHandler);
13572
+ globalThis.KeyHandler = (__webpack_require__(531).KeyHandler);
13573
+ globalThis.drawutils = (__webpack_require__(39).drawutils);
13404
13574
  // globalThis.drawutilsgl = require("./drawgl.js").drawutilsgl; // Unfinished
13405
- globalThis.drawutilssvg = __webpack_require__(829).drawutilssvg;
13406
- globalThis.geomutils = __webpack_require__(22).geomutils;
13407
- globalThis.PlotBoilerplate = __webpack_require__(919)/* .PlotBoilerplate */ .H4;
13575
+ globalThis.drawutilssvg = (__webpack_require__(378).drawutilssvg);
13576
+ globalThis.geomutils = (__webpack_require__(328).geomutils);
13577
+ globalThis.PlotBoilerplate = (__webpack_require__(559).PlotBoilerplate);
13408
13578
 
13409
13579
  })();
13410
13580