plotboilerplate 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/README.md +2 -0
  2. package/dist/index.esm.js +222 -76
  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 +492 -337
  9. package/dist/plotboilerplate.min.js +1 -1
  10. package/package.json +5 -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 +1 -1
  30. package/src/cjs/PlotBoilerplate.js +77 -63
  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/index.js +5 -1
  64. package/src/cjs/interfaces/index.js.map +1 -1
  65. package/src/cjs/utils/NGons.d.ts +13 -0
  66. package/src/cjs/utils/NGons.js +36 -0
  67. package/src/cjs/utils/NGons.js.map +1 -0
  68. package/src/cjs/utils/Params.js.map +1 -1
  69. package/src/cjs/utils/WebColors.js.map +1 -1
  70. package/src/cjs/utils/WebColorsContrast.js +1 -1
  71. package/src/cjs/utils/WebColorsContrast.js.map +1 -1
  72. package/src/cjs/utils/algorithms/CatmullRomPath.js.map +1 -1
  73. package/src/cjs/utils/algorithms/CircleIntersections.d.ts +3 -2
  74. package/src/cjs/utils/algorithms/CircleIntersections.js +12 -20
  75. package/src/cjs/utils/algorithms/CircleIntersections.js.map +1 -1
  76. package/src/cjs/utils/algorithms/ContourLineDetection.js +5 -5
  77. package/src/cjs/utils/algorithms/ContourLineDetection.js.map +1 -1
  78. package/src/cjs/utils/algorithms/CubicSplinePath.js.map +1 -1
  79. package/src/cjs/utils/algorithms/HobbyPath.js.map +1 -1
  80. package/src/cjs/utils/algorithms/Metaballs.d.ts +30 -0
  81. package/src/cjs/utils/algorithms/Metaballs.js +114 -0
  82. package/src/cjs/utils/algorithms/Metaballs.js.map +1 -0
  83. package/src/cjs/utils/algorithms/arrayResize.d.ts +8 -0
  84. package/src/cjs/utils/algorithms/arrayResize.js +24 -0
  85. package/src/cjs/utils/algorithms/arrayResize.js.map +1 -0
  86. package/src/cjs/utils/algorithms/clearDuplicateVertices.js.map +1 -1
  87. package/src/cjs/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
  88. package/src/cjs/utils/algorithms/convexHull.js.map +1 -1
  89. package/src/cjs/utils/algorithms/convexPolygonIncircle.js.map +1 -1
  90. package/src/cjs/utils/algorithms/delaunay.js.map +1 -1
  91. package/src/cjs/utils/algorithms/delaunay2voronoi.js.map +1 -1
  92. package/src/cjs/utils/algorithms/detectPaths.js.map +1 -1
  93. package/src/cjs/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
  94. package/src/cjs/utils/algorithms/matrixFill.js +1 -1
  95. package/src/cjs/utils/algorithms/matrixFill.js.map +1 -1
  96. package/src/cjs/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
  97. package/src/cjs/utils/algorithms/sutherlandHodgman.js.map +1 -1
  98. package/src/cjs/utils/cloneVertexArray.js.map +1 -1
  99. package/src/cjs/utils/creategui.js +20 -12
  100. package/src/cjs/utils/datastructures/CircularIntervalSet.js.map +1 -1
  101. package/src/cjs/utils/datastructures/Color.d.ts +2 -1
  102. package/src/cjs/utils/datastructures/Color.js +35 -16
  103. package/src/cjs/utils/datastructures/Color.js.map +1 -1
  104. package/src/cjs/utils/datastructures/DataGrid2d.d.ts +1 -1
  105. package/src/cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +2 -2
  106. package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js +1 -1
  107. package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js.map +1 -1
  108. package/src/cjs/utils/datastructures/GenericPath.js.map +1 -1
  109. package/src/cjs/utils/datastructures/Girih.d.ts +3 -2
  110. package/src/cjs/utils/datastructures/Girih.js +2 -1
  111. package/src/cjs/utils/datastructures/Girih.js.map +1 -1
  112. package/src/cjs/utils/datastructures/GirihBowtie.js +2 -0
  113. package/src/cjs/utils/datastructures/GirihBowtie.js.map +1 -1
  114. package/src/cjs/utils/datastructures/GirihDecagon.js +2 -0
  115. package/src/cjs/utils/datastructures/GirihDecagon.js.map +1 -1
  116. package/src/cjs/utils/datastructures/GirihHexagon.js +2 -0
  117. package/src/cjs/utils/datastructures/GirihHexagon.js.map +1 -1
  118. package/src/cjs/utils/datastructures/GirihPenroseRhombus.js +3 -1
  119. package/src/cjs/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
  120. package/src/cjs/utils/datastructures/GirihPentagon.js +2 -0
  121. package/src/cjs/utils/datastructures/GirihPentagon.js.map +1 -1
  122. package/src/cjs/utils/datastructures/GirihRhombus.js +2 -0
  123. package/src/cjs/utils/datastructures/GirihRhombus.js.map +1 -1
  124. package/src/cjs/utils/datastructures/GirihTile.js +4 -2
  125. package/src/cjs/utils/datastructures/GirihTile.js.map +1 -1
  126. package/src/cjs/utils/datastructures/Matrix4x4.js.map +1 -1
  127. package/src/cjs/utils/datastructures/VoronoiCell.js.map +1 -1
  128. package/src/cjs/utils/datastructures/interfaces.d.ts +3 -3
  129. package/src/cjs/utils/detectDarkMode.js.map +1 -1
  130. package/src/cjs/utils/dom/getAvailableContainerSpace.js +1 -1
  131. package/src/cjs/utils/dom/getAvailableContainerSpace.js.map +1 -1
  132. package/src/cjs/utils/findInVertexArray.js.map +1 -1
  133. package/src/cjs/utils/gup.d.ts +8 -0
  134. package/src/cjs/utils/gup.js +8 -0
  135. package/src/cjs/utils/gup.js.map +1 -1
  136. package/src/cjs/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
  137. package/src/cjs/utils/helpers/BezierPathInteractionHelper.js +3 -2
  138. package/src/cjs/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
  139. package/src/cjs/utils/helpers/CircleHelper.d.ts +38 -3
  140. package/src/cjs/utils/helpers/CircleHelper.js +51 -11
  141. package/src/cjs/utils/helpers/CircleHelper.js.map +1 -1
  142. package/src/cjs/utils/helpers/CircleSectorHelper.d.ts +47 -1
  143. package/src/cjs/utils/helpers/CircleSectorHelper.js +85 -14
  144. package/src/cjs/utils/helpers/CircleSectorHelper.js.map +1 -1
  145. package/src/cjs/utils/io/FileDrop.d.ts +3 -3
  146. package/src/cjs/utils/io/FileDrop.js.map +1 -1
  147. package/src/cjs/utils/parsers/OBJParser.d.ts +2 -2
  148. package/src/cjs/utils/parsers/OBJParser.js.map +1 -1
  149. package/src/cjs/utils/parsers/STLParser.d.ts +4 -3
  150. package/src/cjs/utils/parsers/STLParser.js +62 -12
  151. package/src/cjs/utils/parsers/STLParser.js.map +1 -1
  152. package/src/cjs/utils/parsers/svg/parseSVGPathData.js +1 -1
  153. package/src/cjs/utils/parsers/svg/parseSVGPathData.js.map +1 -1
  154. package/src/cjs/utils/parsers/svg/splitSVGPathData.js.map +1 -1
  155. package/src/cjs/utils/parsers/svg/types.d.ts +13 -13
  156. package/src/createDemoDrawables.js +48 -3
  157. package/src/esm/BezierPath.js.map +1 -1
  158. package/src/esm/Bounds.js.map +1 -1
  159. package/src/esm/Circle.js.map +1 -1
  160. package/src/esm/CircleSector.d.ts +64 -1
  161. package/src/esm/CircleSector.js +121 -1
  162. package/src/esm/CircleSector.js.map +1 -1
  163. package/src/esm/CubicBezierCurve.js.map +1 -1
  164. package/src/esm/Grid.js.map +1 -1
  165. package/src/esm/KeyHandler.d.ts +1 -1
  166. package/src/esm/KeyHandler.js +13 -13
  167. package/src/esm/KeyHandler.js.map +1 -1
  168. package/src/esm/Line.js.map +1 -1
  169. package/src/esm/MouseHandler.d.ts +2 -2
  170. package/src/esm/MouseHandler.js +4 -4
  171. package/src/esm/MouseHandler.js.map +1 -1
  172. package/src/esm/PlotBoilerplate.d.ts +1 -1
  173. package/src/esm/PlotBoilerplate.js +43 -29
  174. package/src/esm/PlotBoilerplate.js.map +1 -1
  175. package/src/esm/Polygon.js.map +1 -1
  176. package/src/esm/Triangle.js.map +1 -1
  177. package/src/esm/VEllipse.js.map +1 -1
  178. package/src/esm/VEllipseSector.js +1 -1
  179. package/src/esm/VEllipseSector.js.map +1 -1
  180. package/src/esm/Vector.js.map +1 -1
  181. package/src/esm/VertTuple.js.map +1 -1
  182. package/src/esm/Vertex.d.ts +3 -2
  183. package/src/esm/Vertex.js +9 -3
  184. package/src/esm/Vertex.js.map +1 -1
  185. package/src/esm/VertexAttr.d.ts +2 -1
  186. package/src/esm/VertexAttr.js +2 -1
  187. package/src/esm/VertexAttr.js.map +1 -1
  188. package/src/esm/VertexListeners.d.ts +1 -1
  189. package/src/esm/VertexListeners.js.map +1 -1
  190. package/src/esm/draw.js.map +1 -1
  191. package/src/esm/drawgl.js.map +1 -1
  192. package/src/esm/drawutilssvg.d.ts +17 -3
  193. package/src/esm/drawutilssvg.js +28 -22
  194. package/src/esm/drawutilssvg.js.map +1 -1
  195. package/src/esm/geomutils.js +2 -2
  196. package/src/esm/geomutils.js.map +1 -1
  197. package/src/esm/interfaces/DrawLib.d.ts +2 -2
  198. package/src/esm/interfaces/core.d.ts +3 -3
  199. package/src/esm/utils/NGons.d.ts +13 -0
  200. package/src/esm/utils/NGons.js +33 -0
  201. package/src/esm/utils/NGons.js.map +1 -0
  202. package/src/esm/utils/Params.js.map +1 -1
  203. package/src/esm/utils/WebColors.js.map +1 -1
  204. package/src/esm/utils/algorithms/CatmullRomPath.js.map +1 -1
  205. package/src/esm/utils/algorithms/CircleIntersections.d.ts +3 -2
  206. package/src/esm/utils/algorithms/CircleIntersections.js +11 -19
  207. package/src/esm/utils/algorithms/CircleIntersections.js.map +1 -1
  208. package/src/esm/utils/algorithms/ContourLineDetection.js.map +1 -1
  209. package/src/esm/utils/algorithms/CubicSplinePath.js.map +1 -1
  210. package/src/esm/utils/algorithms/HobbyPath.js.map +1 -1
  211. package/src/esm/utils/algorithms/Metaballs.d.ts +30 -0
  212. package/src/esm/utils/algorithms/Metaballs.js +109 -0
  213. package/src/esm/utils/algorithms/Metaballs.js.map +1 -0
  214. package/src/esm/utils/algorithms/arrayResize.d.ts +8 -0
  215. package/src/esm/utils/algorithms/arrayResize.js +20 -0
  216. package/src/esm/utils/algorithms/arrayResize.js.map +1 -0
  217. package/src/esm/utils/algorithms/clearDuplicateVertices.js.map +1 -1
  218. package/src/esm/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
  219. package/src/esm/utils/algorithms/convexHull.js.map +1 -1
  220. package/src/esm/utils/algorithms/convexPolygonIncircle.js.map +1 -1
  221. package/src/esm/utils/algorithms/delaunay.js.map +1 -1
  222. package/src/esm/utils/algorithms/delaunay2voronoi.js.map +1 -1
  223. package/src/esm/utils/algorithms/detectPaths.js.map +1 -1
  224. package/src/esm/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
  225. package/src/esm/utils/algorithms/matrixFill.js.map +1 -1
  226. package/src/esm/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
  227. package/src/esm/utils/algorithms/sutherlandHodgman.js.map +1 -1
  228. package/src/esm/utils/cloneVertexArray.js.map +1 -1
  229. package/src/esm/utils/datastructures/CircularIntervalSet.js.map +1 -1
  230. package/src/esm/utils/datastructures/Color.d.ts +2 -1
  231. package/src/esm/utils/datastructures/Color.js +33 -14
  232. package/src/esm/utils/datastructures/Color.js.map +1 -1
  233. package/src/esm/utils/datastructures/DataGrid2d.d.ts +1 -1
  234. package/src/esm/utils/datastructures/DataGrid2dListAdapter.d.ts +2 -2
  235. package/src/esm/utils/datastructures/DataGrid2dListAdapter.js.map +1 -1
  236. package/src/esm/utils/datastructures/GenericPath.js.map +1 -1
  237. package/src/esm/utils/datastructures/Girih.d.ts +3 -2
  238. package/src/esm/utils/datastructures/Girih.js +2 -1
  239. package/src/esm/utils/datastructures/Girih.js.map +1 -1
  240. package/src/esm/utils/datastructures/GirihBowtie.js.map +1 -1
  241. package/src/esm/utils/datastructures/GirihDecagon.js.map +1 -1
  242. package/src/esm/utils/datastructures/GirihHexagon.js.map +1 -1
  243. package/src/esm/utils/datastructures/GirihPenroseRhombus.js +1 -1
  244. package/src/esm/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
  245. package/src/esm/utils/datastructures/GirihPentagon.js.map +1 -1
  246. package/src/esm/utils/datastructures/GirihRhombus.js.map +1 -1
  247. package/src/esm/utils/datastructures/GirihTile.js.map +1 -1
  248. package/src/esm/utils/datastructures/Matrix4x4.js.map +1 -1
  249. package/src/esm/utils/datastructures/VoronoiCell.js.map +1 -1
  250. package/src/esm/utils/datastructures/interfaces.d.ts +3 -3
  251. package/src/esm/utils/detectDarkMode.js.map +1 -1
  252. package/src/esm/utils/findInVertexArray.js.map +1 -1
  253. package/src/esm/utils/gup.d.ts +8 -0
  254. package/src/esm/utils/gup.js +8 -0
  255. package/src/esm/utils/gup.js.map +1 -1
  256. package/src/esm/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
  257. package/src/esm/utils/helpers/BezierPathInteractionHelper.js +3 -2
  258. package/src/esm/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
  259. package/src/esm/utils/helpers/CircleHelper.d.ts +38 -3
  260. package/src/esm/utils/helpers/CircleHelper.js +51 -11
  261. package/src/esm/utils/helpers/CircleHelper.js.map +1 -1
  262. package/src/esm/utils/helpers/CircleSectorHelper.d.ts +47 -1
  263. package/src/esm/utils/helpers/CircleSectorHelper.js +85 -14
  264. package/src/esm/utils/helpers/CircleSectorHelper.js.map +1 -1
  265. package/src/esm/utils/io/FileDrop.d.ts +3 -3
  266. package/src/esm/utils/io/FileDrop.js.map +1 -1
  267. package/src/esm/utils/parsers/OBJParser.d.ts +2 -2
  268. package/src/esm/utils/parsers/OBJParser.js.map +1 -1
  269. package/src/esm/utils/parsers/STLParser.d.ts +4 -3
  270. package/src/esm/utils/parsers/STLParser.js +63 -13
  271. package/src/esm/utils/parsers/STLParser.js.map +1 -1
  272. package/src/esm/utils/parsers/svg/parseSVGPathData.js.map +1 -1
  273. package/src/esm/utils/parsers/svg/splitSVGPathData.js.map +1 -1
  274. package/src/esm/utils/parsers/svg/types.d.ts +13 -13
  275. package/src/index-gl.js +77 -85
  276. package/src/index.js +124 -129
  277. package/src/ts/CircleSector.ts +134 -3
  278. package/src/ts/PlotBoilerplate.ts +20 -11
  279. package/src/ts/Vertex.ts +8 -3
  280. package/src/ts/VertexAttr.ts +3 -2
  281. package/src/ts/drawutilssvg.ts +38 -25
  282. package/src/ts/geomutils.ts +60 -64
  283. package/src/ts/interfaces/DrawLib.ts +0 -15
  284. package/src/ts/utils/NGons.ts +35 -0
  285. package/src/ts/utils/algorithms/CircleIntersections.ts +280 -288
  286. package/src/ts/utils/algorithms/Metaballs.ts +144 -0
  287. package/src/ts/utils/algorithms/arrayResize.ts +22 -0
  288. package/src/ts/utils/datastructures/Color.ts +39 -15
  289. package/src/ts/utils/datastructures/Girih.ts +9 -8
  290. package/src/ts/utils/gup.ts +10 -2
  291. package/src/ts/utils/helpers/BezierPathInteractionHelper.ts +9 -8
  292. package/src/ts/utils/helpers/CircleHelper.ts +70 -22
  293. package/src/ts/utils/helpers/CircleSectorHelper.ts +101 -17
  294. package/src/ts/utils/parsers/STLParser.ts +50 -16
@@ -45,8 +45,9 @@
45
45
  * @modified 2023-09-29 Added the `arrowHead(...)` function to the 'DrawLib.arrow()` interface.
46
46
  * @modified 2023-09-29 Added the `cubicBezierArrow(...)` function to the 'DrawLib.arrow()` interface.
47
47
  * @modified 2023-10-04 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
48
- *
49
- * @version 1.6.7
48
+ * @modified 2024-01-30 Fixing an issue with immutable style sets; changes to the global draw config did not reflect here (do now).
49
+ * @modified 2024-03-10 Fixing some types for Typescript 5 compatibility.
50
+ * @version 1.6.9
50
51
  **/
51
52
  Object.defineProperty(exports, "__esModule", { value: true });
52
53
  exports.drawutilssvg = void 0;
@@ -66,6 +67,10 @@ var RAD_TO_DEG = 180 / Math.PI;
66
67
  * @requires XYCoords
67
68
  */
68
69
  var drawutilssvg = /** @class */ (function () {
70
+ /**
71
+ * Passed from primary to secondary instance.
72
+ */
73
+ //private nodeStyle: SVGStyleElement;
69
74
  /**
70
75
  * The constructor.
71
76
  *
@@ -80,12 +85,13 @@ var drawutilssvg = /** @class */ (function () {
80
85
  * @param {boolean=} isSecondary - (optional) Indicates if this is the primary or secondary instance. Only primary instances manage child nodes.
81
86
  * @param {SVGGElement=} gNode - (optional) Primary and seconday instances share the same <g> node.
82
87
  **/
83
- function drawutilssvg(svgNode, offset, scale, canvasSize, fillShapes, drawConfig, isSecondary, gNode, bufferGNode, nodeDefs, bufferNodeDefs) {
88
+ function drawutilssvg(svgNode, offset, scale, canvasSize, fillShapes, drawConfig, isSecondary, gNode, bufferGNode, nodeDefs, bufferNodeDefs, nodeStyle) {
84
89
  this.svgNode = svgNode;
85
90
  this.offset = new Vertex_1.Vertex(0, 0).set(offset);
86
91
  this.scale = new Vertex_1.Vertex(1, 1).set(scale);
87
92
  this.fillShapes = fillShapes;
88
93
  this.isSecondary = Boolean(isSecondary);
94
+ this.drawConfig = drawConfig;
89
95
  this.drawlibConfiguration = {};
90
96
  this.cache = new Map();
91
97
  this.setSize(canvasSize);
@@ -97,6 +103,9 @@ var drawutilssvg = /** @class */ (function () {
97
103
  this.bufferGNode = bufferGNode;
98
104
  this.nodeDefs = nodeDefs;
99
105
  this.bufferedNodeDefs = bufferNodeDefs;
106
+ if (nodeStyle) {
107
+ this.nodeStyle = nodeStyle;
108
+ }
100
109
  }
101
110
  else {
102
111
  this.addStyleDefs(drawConfig);
@@ -115,11 +124,19 @@ var drawutilssvg = /** @class */ (function () {
115
124
  drawutilssvg.prototype.addStyleDefs = function (drawConfig) {
116
125
  this.nodeStyle = this.createSVGNode("style");
117
126
  this.svgNode.appendChild(this.nodeStyle);
127
+ this.rebuildStyleDefs(drawConfig);
128
+ };
129
+ /**
130
+ * This method is required to re-define the global style defs. It is needed
131
+ * if any value in the DrawConfig changed in the meantime.
132
+ * @param drawConfig
133
+ */
134
+ drawutilssvg.prototype.rebuildStyleDefs = function (drawConfig) {
118
135
  // Which default styles to add? -> All from the DrawConfig.
119
136
  // Compare with DrawConfig interface
120
137
  var keys = {
121
- // "bezier": "CubicBezierCurve", // TODO: is this correct?
122
- "bezierPath": "BezierPath",
138
+ "bezier": "CubicBezierCurve",
139
+ //"bezierPath": "BezierPath", // TODO: is this correct?
123
140
  "polygon": "Polygon",
124
141
  "triangle": "Triangle",
125
142
  "ellipse": "Ellipse",
@@ -134,14 +151,15 @@ var drawutilssvg = /** @class */ (function () {
134
151
  };
135
152
  // Question: why isn't this working if the svgNode is created dynamically? (nodeStyle.sheet is null)
136
153
  var rules = [];
154
+ // console.log("drawConfig", drawConfig);
137
155
  for (var k in keys) {
138
156
  var className = keys[k];
139
157
  var drawSettings = drawConfig[k];
140
158
  if (drawSettings) {
141
- rules.push("." + className + " { fill : none; stroke: " + drawSettings.color + "; stroke-width: " + drawSettings.lineWidth + "px }");
159
+ rules.push(".".concat(className, " { fill : none; stroke: ").concat(drawSettings.color, "; stroke-width: ").concat(drawSettings.lineWidth, "px }"));
142
160
  }
143
161
  else {
144
- console.warn("Warning: your draw config is missing the key '" + k + "' which is required.");
162
+ console.warn("Warning: your draw config is missing the key '".concat(k, "' which is required."));
145
163
  }
146
164
  }
147
165
  this.nodeStyle.innerHTML = rules.join("\n");
@@ -231,7 +249,8 @@ var drawutilssvg = /** @class */ (function () {
231
249
  node = this.createSVGNode(nodeName);
232
250
  }
233
251
  if (this.drawlibConfiguration.blendMode) {
234
- node.style["mix-blend-mode"] = this.drawlibConfiguration.blendMode;
252
+ // node.style["mix-blend-mode"] = this.drawlibConfiguration.blendMode;
253
+ node.style["mix-blend-mode"](this.drawlibConfiguration.blendMode);
235
254
  }
236
255
  // if (this.lineDashEnabled && this.lineDash && this.lineDash.length > 0 && drawutilssvg.nodeSupportsLineDash(nodeName)) {
237
256
  // node.setAttribute("stroke-dasharray", this.lineDash.join(" "));
@@ -295,7 +314,7 @@ var drawutilssvg = /** @class */ (function () {
295
314
  */
296
315
  drawutilssvg.prototype._addCSSClasses = function (node, className) {
297
316
  if (this.curClassName) {
298
- node.setAttribute("class", className + " " + this.curClassName);
317
+ node.setAttribute("class", "".concat(className, " ").concat(this.curClassName));
299
318
  }
300
319
  else {
301
320
  node.setAttribute("class", className);
@@ -305,9 +324,9 @@ var drawutilssvg = /** @class */ (function () {
305
324
  this._addCSSClasses(node, className);
306
325
  node.setAttribute("fill", fillMode && color ? color : "none");
307
326
  node.setAttribute("stroke", fillMode ? "none" : color || "none");
308
- node.setAttribute("stroke-width", "" + (lineWidth || 1));
327
+ node.setAttribute("stroke-width", "".concat(lineWidth || 1));
309
328
  if (this.curId) {
310
- node.setAttribute("id", "" + this.curId); // Maybe React-style 'key' would be better?
329
+ node.setAttribute("id", "".concat(this.curId)); // Maybe React-style 'key' would be better?
311
330
  }
312
331
  this.applyStrokeOpts(node, strokeOptions);
313
332
  return node;
@@ -322,18 +341,18 @@ var drawutilssvg = /** @class */ (function () {
322
341
  */
323
342
  drawutilssvg.prototype.setSize = function (canvasSize) {
324
343
  this.canvasSize = canvasSize;
325
- this.svgNode.setAttribute("viewBox", "0 0 " + this.canvasSize.width + " " + this.canvasSize.height);
326
- this.svgNode.setAttribute("width", "" + this.canvasSize.width);
327
- this.svgNode.setAttribute("height", "" + this.canvasSize.height);
344
+ this.svgNode.setAttribute("viewBox", "0 0 ".concat(this.canvasSize.width, " ").concat(this.canvasSize.height));
345
+ this.svgNode.setAttribute("width", "".concat(this.canvasSize.width));
346
+ this.svgNode.setAttribute("height", "".concat(this.canvasSize.height));
328
347
  };
329
348
  /**
330
349
  * Creates a 'shallow' (non deep) copy of this instance. This implies
331
350
  * that under the hood the same gl context and gl program will be used.
332
351
  */
333
352
  drawutilssvg.prototype.copyInstance = function (fillShapes) {
334
- var copy = new drawutilssvg(this.svgNode, this.offset, this.scale, this.canvasSize, fillShapes, null, // no DrawConfig – this will work as long as `isSecondary===true`
353
+ 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`
335
354
  true, // isSecondary
336
- this.gNode, this.bufferGNode, this.nodeDefs, this.bufferedNodeDefs);
355
+ this.gNode, this.bufferGNode, this.nodeDefs, this.bufferedNodeDefs, this.nodeStyle);
337
356
  return copy;
338
357
  };
339
358
  /**
@@ -346,20 +365,6 @@ var drawutilssvg = /** @class */ (function () {
346
365
  drawutilssvg.prototype.setConfiguration = function (configuration) {
347
366
  this.drawlibConfiguration = configuration;
348
367
  };
349
- // /**
350
- // * Set or clear the line-dash configuration. Pass `null` for un-dashed lines.
351
- // *
352
- // * See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
353
- // * and https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
354
- // * for how line dashes work.
355
- // *
356
- // * @method
357
- // * @param {Array<number> lineDashes - The line-dash array configuration.
358
- // * @returns {void}
359
- // */
360
- // setLineDash(lineDashes: Array<number>) {
361
- // this.lineDash = lineDashes;
362
- // }
363
368
  /**
364
369
  * This method shouled be called each time the currently drawn `Drawable` changes.
365
370
  * It is used by some libraries for identifying elemente on re-renders.
@@ -419,6 +424,7 @@ var drawutilssvg = /** @class */ (function () {
419
424
  * @instance
420
425
  **/
421
426
  drawutilssvg.prototype.endDrawCycle = function (renderTime) {
427
+ this.rebuildStyleDefs(this.drawConfig);
422
428
  if (!this.isSecondary) {
423
429
  // All elements are drawn into the buffer; they are NOT yet visible, not did the browser perform any
424
430
  // layout updates.
@@ -451,7 +457,7 @@ var drawutilssvg = /** @class */ (function () {
451
457
  })
452
458
  .join(" "));
453
459
  if (strokeOptions.dashOffset) {
454
- node.setAttribute("stroke-dashoffset", "" + strokeOptions.dashOffset * this.scale.x);
460
+ node.setAttribute("stroke-dashoffset", "".concat(strokeOptions.dashOffset * this.scale.x));
455
461
  }
456
462
  }
457
463
  };
@@ -587,13 +593,13 @@ var drawutilssvg = /** @class */ (function () {
587
593
  if (image.naturalWidth) {
588
594
  var ratioX = size.x / image.naturalWidth;
589
595
  var ratioY = size.y / image.naturalHeight;
590
- node.setAttribute("width", "" + image.naturalWidth * _this.scale.x);
591
- node.setAttribute("height", "" + image.naturalHeight * _this.scale.y);
596
+ node.setAttribute("width", "".concat(image.naturalWidth * _this.scale.x));
597
+ node.setAttribute("height", "".concat(image.naturalHeight * _this.scale.y));
592
598
  node.setAttribute("display", null); // Dislay when loaded
593
599
  // if (alpha) {
594
- node.setAttribute("opacity", "" + alpha);
600
+ node.setAttribute("opacity", "".concat(alpha));
595
601
  // }
596
- node.setAttribute("transform", "translate(" + _this._x(position.x) + " " + _this._y(position.y) + ") scale(" + ratioX + " " + ratioY + ")");
602
+ node.setAttribute("transform", "translate(".concat(_this._x(position.x), " ").concat(_this._y(position.y), ") scale(").concat(ratioX, " ").concat(ratioY, ")"));
597
603
  }
598
604
  };
599
605
  image.addEventListener("load", function (event) {
@@ -601,8 +607,8 @@ var drawutilssvg = /** @class */ (function () {
601
607
  });
602
608
  // Safari has a transform-origin bug.
603
609
  // Use x=0, y=0 and translate/scale instead (see above)
604
- node.setAttribute("x", "" + 0);
605
- node.setAttribute("y", "" + 0);
610
+ node.setAttribute("x", "".concat(0));
611
+ node.setAttribute("y", "".concat(0));
606
612
  node.setAttribute("display", "none"); // Hide before loaded
607
613
  setImageSize(image);
608
614
  node.setAttribute("href", image.src);
@@ -643,36 +649,36 @@ var drawutilssvg = /** @class */ (function () {
643
649
  // </image>
644
650
  // ...
645
651
  var clipPathNode = this.makeNode("clipPath");
646
- var clipPathId = "clippath_" + UIDGenerator_1.UIDGenerator.next(); // TODO: use a better UUID generator here?
652
+ var clipPathId = "clippath_".concat(UIDGenerator_1.UIDGenerator.next()); // TODO: use a better UUID generator here?
647
653
  clipPathNode.setAttribute("id", clipPathId);
648
654
  var gNode = this.makeNode("g");
649
655
  var imageNode = this.makeNode("image");
650
- imageNode.setAttribute("x", "" + this._x(rotatedScalingOrigin.x));
651
- imageNode.setAttribute("y", "" + this._y(rotatedScalingOrigin.y));
652
- imageNode.setAttribute("width", "" + textureSize.width);
653
- imageNode.setAttribute("height", "" + textureSize.height);
656
+ imageNode.setAttribute("x", "".concat(this._x(rotatedScalingOrigin.x)));
657
+ imageNode.setAttribute("y", "".concat(this._y(rotatedScalingOrigin.y)));
658
+ imageNode.setAttribute("width", "".concat(textureSize.width));
659
+ imageNode.setAttribute("height", "".concat(textureSize.height));
654
660
  imageNode.setAttribute("href", textureImage.src);
655
661
  // imageNode.setAttribute("opacity", "0.5");
656
662
  // SVG rotations in degrees
657
- imageNode.setAttribute("transform", "rotate(" + rotation * RAD_TO_DEG + ", " + this._x(rotatedScalingOrigin.x) + ", " + this._y(rotatedScalingOrigin.y) + ")");
663
+ imageNode.setAttribute("transform", "rotate(".concat(rotation * RAD_TO_DEG, ", ").concat(this._x(rotatedScalingOrigin.x), ", ").concat(this._y(rotatedScalingOrigin.y), ")"));
658
664
  var pathNode = this.makeNode("path");
659
665
  var pathData = [];
660
666
  if (polygon.vertices.length > 0) {
661
667
  var self_1 = this;
662
- pathData.push("M", "" + this._x(polygon.vertices[0].x), "" + this._y(polygon.vertices[0].y));
668
+ pathData.push("M", "".concat(this._x(polygon.vertices[0].x)), "".concat(this._y(polygon.vertices[0].y)));
663
669
  for (var i = 1; i < polygon.vertices.length; i++) {
664
- pathData.push("L", "" + this._x(polygon.vertices[i].x), "" + this._y(polygon.vertices[i].y));
670
+ pathData.push("L", "".concat(this._x(polygon.vertices[i].x)), "".concat(this._y(polygon.vertices[i].y)));
665
671
  }
666
672
  }
667
673
  pathNode.setAttribute("d", pathData.join(" "));
668
674
  clipPathNode.appendChild(pathNode);
669
675
  this.bufferedNodeDefs.appendChild(clipPathNode);
670
676
  gNode.appendChild(imageNode);
671
- gNode.setAttribute("transform-origin", this._x(rotatedScalingOrigin.x) + " " + this._y(rotatedScalingOrigin.y));
672
- gNode.setAttribute("transform", "scale(" + this.scale.x + ", " + this.scale.y + ")");
677
+ gNode.setAttribute("transform-origin", "".concat(this._x(rotatedScalingOrigin.x), " ").concat(this._y(rotatedScalingOrigin.y)));
678
+ gNode.setAttribute("transform", "scale(".concat(this.scale.x, ", ").concat(this.scale.y, ")"));
673
679
  var clipNode = this.makeNode("g");
674
680
  clipNode.appendChild(gNode);
675
- clipNode.setAttribute("clip-path", "url(#" + clipPathId + ")");
681
+ clipNode.setAttribute("clip-path", "url(#".concat(clipPathId, ")"));
676
682
  // TODO: check if the image class is correct here or if we should use a 'clippedImage' class here
677
683
  this._bindFillDraw(clipNode, "image", null, null); // No color, no lineWidth
678
684
  return clipNode;
@@ -777,10 +783,10 @@ var drawutilssvg = /** @class */ (function () {
777
783
  */
778
784
  drawutilssvg.prototype.dot = function (p, color) {
779
785
  var node = this.makeNode("line");
780
- node.setAttribute("x1", "" + this._x(p.x));
781
- node.setAttribute("y1", "" + this._y(p.y));
782
- node.setAttribute("x2", "" + this._x(p.x));
783
- node.setAttribute("y2", "" + this._y(p.y));
786
+ node.setAttribute("x1", "".concat(this._x(p.x)));
787
+ node.setAttribute("y1", "".concat(this._y(p.y)));
788
+ node.setAttribute("x2", "".concat(this._x(p.x)));
789
+ node.setAttribute("y2", "".concat(this._y(p.y)));
784
790
  return this._bindFillDraw(node, "dot", color, 1);
785
791
  };
786
792
  /**
@@ -796,9 +802,9 @@ var drawutilssvg = /** @class */ (function () {
796
802
  drawutilssvg.prototype.point = function (p, color) {
797
803
  var radius = 3;
798
804
  var node = this.makeNode("circle");
799
- node.setAttribute("cx", "" + this._x(p.x));
800
- node.setAttribute("cy", "" + this._y(p.y));
801
- node.setAttribute("r", "" + radius);
805
+ node.setAttribute("cx", "".concat(this._x(p.x)));
806
+ node.setAttribute("cy", "".concat(this._y(p.y)));
807
+ node.setAttribute("r", "".concat(radius));
802
808
  return this._bindFillDraw(node, "point", color, 1);
803
809
  };
804
810
  /**
@@ -821,9 +827,9 @@ var drawutilssvg = /** @class */ (function () {
821
827
  // Todo: draw ellipse when scalex!=scaley
822
828
  var node = this.makeNode("circle");
823
829
  this.applyStrokeOpts(node, strokeOptions);
824
- node.setAttribute("cx", "" + this._x(center.x));
825
- node.setAttribute("cy", "" + this._y(center.y));
826
- node.setAttribute("r", "" + radius * this.scale.x); // y?
830
+ node.setAttribute("cx", "".concat(this._x(center.x)));
831
+ node.setAttribute("cy", "".concat(this._y(center.y)));
832
+ node.setAttribute("r", "".concat(radius * this.scale.x)); // y?
827
833
  return this._bindFillDraw(node, "circle", color, lineWidth || 1);
828
834
  };
829
835
  /**
@@ -871,12 +877,12 @@ var drawutilssvg = /** @class */ (function () {
871
877
  }
872
878
  var node = this.makeNode("ellipse");
873
879
  this.applyStrokeOpts(node, strokeOptions);
874
- node.setAttribute("cx", "" + this._x(center.x));
875
- node.setAttribute("cy", "" + this._y(center.y));
876
- node.setAttribute("rx", "" + radiusX * this.scale.x);
877
- node.setAttribute("ry", "" + radiusY * this.scale.y);
880
+ node.setAttribute("cx", "".concat(this._x(center.x)));
881
+ node.setAttribute("cy", "".concat(this._y(center.y)));
882
+ node.setAttribute("rx", "".concat(radiusX * this.scale.x));
883
+ node.setAttribute("ry", "".concat(radiusY * this.scale.y));
878
884
  // node.setAttribute( 'style', `transform: rotate(${rotation} ${center.x} ${center.y})` );
879
- node.setAttribute("transform", "rotate(" + (rotation * 180) / Math.PI + " " + this._x(center.x) + " " + this._y(center.y) + ")");
885
+ node.setAttribute("transform", "rotate(".concat((rotation * 180) / Math.PI, " ").concat(this._x(center.x), " ").concat(this._y(center.y), ")"));
880
886
  return this._bindFillDraw(node, "ellipse", color, lineWidth || 1);
881
887
  };
882
888
  /**
@@ -898,10 +904,10 @@ var drawutilssvg = /** @class */ (function () {
898
904
  drawutilssvg.prototype.square = function (center, size, color, lineWidth, strokeOptions) {
899
905
  var node = this.makeNode("rectangle");
900
906
  this.applyStrokeOpts(node, strokeOptions);
901
- node.setAttribute("x", "" + this._x(center.x - size / 2.0));
902
- node.setAttribute("y", "" + this._y(center.y - size / 2.0));
903
- node.setAttribute("width", "" + size * this.scale.x);
904
- node.setAttribute("height", "" + size * this.scale.y);
907
+ node.setAttribute("x", "".concat(this._x(center.x - size / 2.0)));
908
+ node.setAttribute("y", "".concat(this._y(center.y - size / 2.0)));
909
+ node.setAttribute("width", "".concat(size * this.scale.x));
910
+ node.setAttribute("height", "".concat(size * this.scale.y));
905
911
  return this._bindFillDraw(node, "square", color, lineWidth || 1);
906
912
  };
907
913
  /**
@@ -921,10 +927,10 @@ var drawutilssvg = /** @class */ (function () {
921
927
  drawutilssvg.prototype.rect = function (position, width, height, color, lineWidth, strokeOptions) {
922
928
  var node = this.makeNode("rect");
923
929
  this.applyStrokeOpts(node, strokeOptions);
924
- node.setAttribute("x", "" + this._x(position.x));
925
- node.setAttribute("y", "" + this._y(position.y));
926
- node.setAttribute("width", "" + width * this.scale.x);
927
- node.setAttribute("height", "" + height * this.scale.y);
930
+ node.setAttribute("x", "".concat(this._x(position.x)));
931
+ node.setAttribute("y", "".concat(this._y(position.y)));
932
+ node.setAttribute("width", "".concat(width * this.scale.x));
933
+ node.setAttribute("height", "".concat(height * this.scale.y));
928
934
  return this._bindFillDraw(node, "rect", color, lineWidth || 1);
929
935
  };
930
936
  /**
@@ -1042,10 +1048,10 @@ var drawutilssvg = /** @class */ (function () {
1042
1048
  */
1043
1049
  drawutilssvg.prototype.squareHandle = function (center, size, color) {
1044
1050
  var node = this.makeNode("rect");
1045
- node.setAttribute("x", "" + (this._x(center.x) - size / 2.0));
1046
- node.setAttribute("y", "" + (this._y(center.y) - size / 2.0));
1047
- node.setAttribute("width", "" + size);
1048
- node.setAttribute("height", "" + size);
1051
+ node.setAttribute("x", "".concat(this._x(center.x) - size / 2.0));
1052
+ node.setAttribute("y", "".concat(this._y(center.y) - size / 2.0));
1053
+ node.setAttribute("width", "".concat(size));
1054
+ node.setAttribute("height", "".concat(size));
1049
1055
  return this._bindFillDraw(node, "squareHandle", color, 1);
1050
1056
  };
1051
1057
  /**
@@ -1066,9 +1072,9 @@ var drawutilssvg = /** @class */ (function () {
1066
1072
  drawutilssvg.prototype.circleHandle = function (center, radius, color) {
1067
1073
  radius = radius || 3;
1068
1074
  var node = this.makeNode("circle");
1069
- node.setAttribute("cx", "" + this._x(center.x));
1070
- node.setAttribute("cy", "" + this._y(center.y));
1071
- node.setAttribute("r", "" + radius);
1075
+ node.setAttribute("cx", "".concat(this._x(center.x)));
1076
+ node.setAttribute("cy", "".concat(this._y(center.y)));
1077
+ node.setAttribute("r", "".concat(radius));
1072
1078
  return this._bindFillDraw(node, "circleHandle", color, 1);
1073
1079
  };
1074
1080
  /**
@@ -1215,22 +1221,22 @@ var drawutilssvg = /** @class */ (function () {
1215
1221
  : options.textAlign === "right" || options.textAlign === "end"
1216
1222
  ? "end"
1217
1223
  : "start";
1218
- var transformOrigin = this._x(x) + "px " + this._y(y) + "px";
1219
- var translate = "translate(" + this._x(x) + " " + (this._y(y) + lineHeight / 2) + ")";
1224
+ var transformOrigin = "".concat(this._x(x), "px ").concat(this._y(y), "px");
1225
+ var translate = "translate(".concat(this._x(x), " ").concat(this._y(y) + lineHeight / 2, ")");
1220
1226
  // Safari has a transform-origin/rotation bug.
1221
1227
  // It's essential to use rotate(r,x,y) here. "rotate(r)"" with transform-origin(x,y) won't do the job.
1222
1228
  // And rotate and translate cannot be used is combination on a text object.
1223
1229
  // So wrap the text inside a <g>, translate the <g>, and rotate the text inside.
1224
- var rotate = options.rotation ? "rotate(" + options.rotation * RAD_TO_DEG + " 0 0)" : "";
1230
+ var rotate = options.rotation ? "rotate(".concat(options.rotation * RAD_TO_DEG, " 0 0)") : "";
1225
1231
  var node = this.makeNode("g");
1226
1232
  var curId = this.curId;
1227
1233
  this.curId = curId + "_text";
1228
1234
  var textNode = this.makeNode("text");
1229
1235
  node.appendChild(textNode);
1230
1236
  textNode.setAttribute("font-family", (_c = options.fontFamily) !== null && _c !== void 0 ? _c : ""); // May be undefined
1231
- textNode.setAttribute("font-size", options.fontSize ? "" + options.fontSize * this.scale.x : "");
1232
- textNode.setAttribute("font-style", options.fontStyle ? "" + options.fontStyle : "");
1233
- textNode.setAttribute("font-weight", options.fontWeight ? "" + options.fontWeight : "");
1237
+ textNode.setAttribute("font-size", options.fontSize ? "".concat(options.fontSize * this.scale.x) : "");
1238
+ textNode.setAttribute("font-style", options.fontStyle ? "".concat(options.fontStyle) : "");
1239
+ textNode.setAttribute("font-weight", options.fontWeight ? "".concat(options.fontWeight) : "");
1234
1240
  textNode.setAttribute("text-anchor", textAlign);
1235
1241
  textNode.setAttribute("transform-origin", "0 0");
1236
1242
  textNode.setAttribute("transform", rotate);
@@ -1257,7 +1263,7 @@ var drawutilssvg = /** @class */ (function () {
1257
1263
  drawutilssvg.prototype.label = function (text, x, y, rotation, color) {
1258
1264
  var node = this.makeNode("text");
1259
1265
  // For some strange reason SVG rotation transforms use degrees instead of radians
1260
- node.setAttribute("transform", "translate(" + x + "," + y + "), rotate(" + ((rotation || 0) / Math.PI) * 180 + ")");
1266
+ node.setAttribute("transform", "translate(".concat(x, ",").concat(y, "), rotate(").concat(((rotation || 0) / Math.PI) * 180, ")"));
1261
1267
  node.setAttribute("font-family", "Arial");
1262
1268
  node.setAttribute("font-size", "9pt");
1263
1269
  node.setAttribute("font-style", "normal");
@@ -1314,8 +1320,8 @@ var drawutilssvg = /** @class */ (function () {
1314
1320
  // Note that the background does not scale with the zoom level (always covers full element)
1315
1321
  node.setAttribute("x", "0");
1316
1322
  node.setAttribute("y", "0");
1317
- node.setAttribute("width", "" + this.canvasSize.width);
1318
- node.setAttribute("height", "" + this.canvasSize.height);
1323
+ node.setAttribute("width", "".concat(this.canvasSize.width));
1324
+ node.setAttribute("height", "".concat(this.canvasSize.height));
1319
1325
  // Bind this special element into the document
1320
1326
  this._bindFillDraw(node, this.curId, null, null);
1321
1327
  node.setAttribute("fill", typeof color === "undefined" ? "none" : color);
@@ -1546,10 +1552,10 @@ var drawutilssvg = /** @class */ (function () {
1546
1552
  */
1547
1553
  drawutilssvg.prototype.makeLineNode = function (zA, zB, color, lineWidth, strokeOptions, classNameOverride) {
1548
1554
  var line = this.makeNode("line");
1549
- line.setAttribute("x1", "" + this._x(zA.x));
1550
- line.setAttribute("y1", "" + this._y(zA.y));
1551
- line.setAttribute("x2", "" + this._x(zB.x));
1552
- line.setAttribute("y2", "" + this._y(zB.y));
1555
+ line.setAttribute("x1", "".concat(this._x(zA.x)));
1556
+ line.setAttribute("y1", "".concat(this._y(zA.y)));
1557
+ line.setAttribute("x2", "".concat(this._x(zB.x)));
1558
+ line.setAttribute("y2", "".concat(this._y(zB.y)));
1553
1559
  this._configureNode(line, classNameOverride !== null && classNameOverride !== void 0 ? classNameOverride : "line", this.fillShapes, color, lineWidth || 1, strokeOptions);
1554
1560
  return line;
1555
1561
  };