plotboilerplate 1.21.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.
- package/README.md +2 -0
- package/dist/index.esm.js +252 -77
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/plotboilerplate.browser.min.js +1 -1
- package/dist/plotboilerplate.browser.min.js.map +1 -1
- package/dist/plotboilerplate.js +522 -338
- package/dist/plotboilerplate.min.js +1 -1
- package/package.json +7 -5
- package/src/cjs/BezierPath.js.map +1 -1
- package/src/cjs/Bounds.js +1 -1
- package/src/cjs/Bounds.js.map +1 -1
- package/src/cjs/Circle.js.map +1 -1
- package/src/cjs/CircleSector.d.ts +64 -1
- package/src/cjs/CircleSector.js +121 -1
- package/src/cjs/CircleSector.js.map +1 -1
- package/src/cjs/CubicBezierCurve.js +2 -2
- package/src/cjs/CubicBezierCurve.js.map +1 -1
- package/src/cjs/Grid.js.map +1 -1
- package/src/cjs/KeyHandler.d.ts +1 -1
- package/src/cjs/KeyHandler.js +13 -13
- package/src/cjs/KeyHandler.js.map +1 -1
- package/src/cjs/Line.js +2 -0
- package/src/cjs/Line.js.map +1 -1
- package/src/cjs/MouseHandler.d.ts +2 -2
- package/src/cjs/MouseHandler.js +7 -5
- package/src/cjs/MouseHandler.js.map +1 -1
- package/src/cjs/PlotBoilerplate.d.ts +1 -1
- package/src/cjs/PlotBoilerplate.js +77 -63
- package/src/cjs/PlotBoilerplate.js.map +1 -1
- package/src/cjs/Polygon.d.ts +13 -1
- package/src/cjs/Polygon.js +30 -1
- package/src/cjs/Polygon.js.map +1 -1
- package/src/cjs/Triangle.js +1 -1
- package/src/cjs/Triangle.js.map +1 -1
- package/src/cjs/UIDGenerator.js +1 -1
- package/src/cjs/UIDGenerator.js.map +1 -1
- package/src/cjs/VEllipse.js.map +1 -1
- package/src/cjs/VEllipseSector.js +1 -1
- package/src/cjs/VEllipseSector.js.map +1 -1
- package/src/cjs/Vector.js +2 -0
- package/src/cjs/Vector.js.map +1 -1
- package/src/cjs/VertTuple.js.map +1 -1
- package/src/cjs/Vertex.d.ts +3 -2
- package/src/cjs/Vertex.js +13 -7
- package/src/cjs/Vertex.js.map +1 -1
- package/src/cjs/VertexAttr.d.ts +2 -1
- package/src/cjs/VertexAttr.js +2 -1
- package/src/cjs/VertexAttr.js.map +1 -1
- package/src/cjs/VertexListeners.d.ts +1 -1
- package/src/cjs/VertexListeners.js.map +1 -1
- package/src/cjs/draw.js +1 -1
- package/src/cjs/draw.js.map +1 -1
- package/src/cjs/drawgl.js.map +1 -1
- package/src/cjs/drawutilssvg.d.ts +17 -3
- package/src/cjs/drawutilssvg.js +97 -91
- package/src/cjs/drawutilssvg.js.map +1 -1
- package/src/cjs/geomutils.js +2 -2
- package/src/cjs/geomutils.js.map +1 -1
- package/src/cjs/index.js +5 -1
- package/src/cjs/index.js.map +1 -1
- package/src/cjs/interfaces/DrawLib.d.ts +2 -2
- package/src/cjs/interfaces/core.d.ts +3 -3
- package/src/cjs/interfaces/index.js +5 -1
- package/src/cjs/interfaces/index.js.map +1 -1
- package/src/cjs/utils/NGons.d.ts +13 -0
- package/src/cjs/utils/NGons.js +36 -0
- package/src/cjs/utils/NGons.js.map +1 -0
- package/src/cjs/utils/Params.d.ts +15 -0
- package/src/cjs/utils/Params.js +49 -0
- package/src/cjs/utils/Params.js.map +1 -0
- package/src/cjs/utils/WebColors.js.map +1 -1
- package/src/cjs/utils/WebColorsContrast.js +1 -1
- package/src/cjs/utils/WebColorsContrast.js.map +1 -1
- package/src/cjs/utils/algorithms/CatmullRomPath.js.map +1 -1
- package/src/cjs/utils/algorithms/CircleIntersections.d.ts +3 -2
- package/src/cjs/utils/algorithms/CircleIntersections.js +12 -20
- package/src/cjs/utils/algorithms/CircleIntersections.js.map +1 -1
- package/src/cjs/utils/algorithms/ContourLineDetection.d.ts +150 -0
- package/src/cjs/utils/algorithms/ContourLineDetection.js +367 -0
- package/src/cjs/utils/algorithms/ContourLineDetection.js.map +1 -0
- package/src/cjs/utils/algorithms/CubicSplinePath.js.map +1 -1
- package/src/cjs/utils/algorithms/HobbyPath.js.map +1 -1
- package/src/cjs/utils/algorithms/Metaballs.d.ts +30 -0
- package/src/cjs/utils/algorithms/Metaballs.js +114 -0
- package/src/cjs/utils/algorithms/Metaballs.js.map +1 -0
- package/src/cjs/utils/algorithms/arrayResize.d.ts +8 -0
- package/src/cjs/utils/algorithms/arrayResize.js +24 -0
- package/src/cjs/utils/algorithms/arrayResize.js.map +1 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.d.ts +21 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.js +48 -0
- package/src/cjs/utils/algorithms/clearDuplicateVertices.js.map +1 -0
- package/src/cjs/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
- package/src/cjs/utils/algorithms/convexHull.js.map +1 -1
- package/src/cjs/utils/algorithms/convexPolygonIncircle.js.map +1 -1
- package/src/cjs/utils/algorithms/delaunay.js.map +1 -1
- package/src/cjs/utils/algorithms/delaunay2voronoi.js.map +1 -1
- package/src/cjs/utils/algorithms/detectPaths.js.map +1 -1
- package/src/cjs/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
- package/src/cjs/utils/algorithms/matrixFill.js +1 -1
- package/src/cjs/utils/algorithms/matrixFill.js.map +1 -1
- package/src/cjs/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
- package/src/cjs/utils/algorithms/sutherlandHodgman.js.map +1 -1
- package/src/cjs/utils/cloneVertexArray.js.map +1 -1
- package/src/cjs/utils/creategui.js +20 -12
- package/src/cjs/utils/datastructures/CircularIntervalSet.js.map +1 -1
- package/src/cjs/utils/datastructures/Color.d.ts +2 -1
- package/src/cjs/utils/datastructures/Color.js +35 -16
- package/src/cjs/utils/datastructures/Color.js.map +1 -1
- package/src/cjs/utils/datastructures/DataGrid2d.d.ts +47 -0
- package/src/cjs/utils/datastructures/DataGrid2d.js +20 -0
- package/src/cjs/utils/datastructures/DataGrid2d.js.map +1 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.d.ts +65 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js +84 -0
- package/src/cjs/utils/datastructures/DataGrid2dListAdapter.js.map +1 -0
- package/src/cjs/utils/datastructures/GenericPath.d.ts +14 -3
- package/src/cjs/utils/datastructures/GenericPath.js +20 -3
- package/src/cjs/utils/datastructures/GenericPath.js.map +1 -1
- package/src/cjs/utils/datastructures/Girih.d.ts +3 -2
- package/src/cjs/utils/datastructures/Girih.js +2 -1
- package/src/cjs/utils/datastructures/Girih.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihBowtie.js +2 -0
- package/src/cjs/utils/datastructures/GirihBowtie.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihDecagon.js +2 -0
- package/src/cjs/utils/datastructures/GirihDecagon.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihHexagon.js +2 -0
- package/src/cjs/utils/datastructures/GirihHexagon.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihPenroseRhombus.js +3 -1
- package/src/cjs/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihPentagon.js +2 -0
- package/src/cjs/utils/datastructures/GirihPentagon.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihRhombus.js +2 -0
- package/src/cjs/utils/datastructures/GirihRhombus.js.map +1 -1
- package/src/cjs/utils/datastructures/GirihTile.js +4 -2
- package/src/cjs/utils/datastructures/GirihTile.js.map +1 -1
- package/src/cjs/utils/datastructures/Matrix4x4.js.map +1 -1
- package/src/cjs/utils/datastructures/VoronoiCell.js.map +1 -1
- package/src/cjs/utils/datastructures/interfaces.d.ts +3 -3
- package/src/cjs/utils/detectDarkMode.js.map +1 -1
- package/src/cjs/utils/dom/getAvailableContainerSpace.js +1 -1
- package/src/cjs/utils/dom/getAvailableContainerSpace.js.map +1 -1
- package/src/cjs/utils/findInVertexArray.js.map +1 -1
- package/src/cjs/utils/gup.d.ts +8 -0
- package/src/cjs/utils/gup.js +8 -0
- package/src/cjs/utils/gup.js.map +1 -1
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.js +3 -2
- package/src/cjs/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
- package/src/cjs/utils/helpers/CircleHelper.d.ts +38 -3
- package/src/cjs/utils/helpers/CircleHelper.js +51 -11
- package/src/cjs/utils/helpers/CircleHelper.js.map +1 -1
- package/src/cjs/utils/helpers/CircleSectorHelper.d.ts +47 -1
- package/src/cjs/utils/helpers/CircleSectorHelper.js +85 -14
- package/src/cjs/utils/helpers/CircleSectorHelper.js.map +1 -1
- package/src/cjs/utils/io/FileDrop.d.ts +3 -3
- package/src/cjs/utils/io/FileDrop.js.map +1 -1
- package/src/cjs/utils/parsers/OBJParser.d.ts +2 -2
- package/src/cjs/utils/parsers/OBJParser.js.map +1 -1
- package/src/cjs/utils/parsers/STLParser.d.ts +4 -3
- package/src/cjs/utils/parsers/STLParser.js +62 -12
- package/src/cjs/utils/parsers/STLParser.js.map +1 -1
- package/src/cjs/utils/parsers/svg/parseSVGPathData.js +1 -1
- package/src/cjs/utils/parsers/svg/parseSVGPathData.js.map +1 -1
- package/src/cjs/utils/parsers/svg/splitSVGPathData.js.map +1 -1
- package/src/cjs/utils/parsers/svg/types.d.ts +13 -13
- package/src/createDemoDrawables.js +48 -3
- package/src/esm/BezierPath.js.map +1 -1
- package/src/esm/Bounds.js.map +1 -1
- package/src/esm/Circle.js.map +1 -1
- package/src/esm/CircleSector.d.ts +64 -1
- package/src/esm/CircleSector.js +121 -1
- package/src/esm/CircleSector.js.map +1 -1
- package/src/esm/CubicBezierCurve.js.map +1 -1
- package/src/esm/Grid.js.map +1 -1
- package/src/esm/KeyHandler.d.ts +1 -1
- package/src/esm/KeyHandler.js +13 -13
- package/src/esm/KeyHandler.js.map +1 -1
- package/src/esm/Line.js.map +1 -1
- package/src/esm/MouseHandler.d.ts +2 -2
- package/src/esm/MouseHandler.js +4 -4
- package/src/esm/MouseHandler.js.map +1 -1
- package/src/esm/PlotBoilerplate.d.ts +1 -1
- package/src/esm/PlotBoilerplate.js +43 -29
- package/src/esm/PlotBoilerplate.js.map +1 -1
- package/src/esm/Polygon.d.ts +13 -1
- package/src/esm/Polygon.js +30 -1
- package/src/esm/Polygon.js.map +1 -1
- package/src/esm/Triangle.js.map +1 -1
- package/src/esm/VEllipse.js.map +1 -1
- package/src/esm/VEllipseSector.js +1 -1
- package/src/esm/VEllipseSector.js.map +1 -1
- package/src/esm/Vector.js.map +1 -1
- package/src/esm/VertTuple.js.map +1 -1
- package/src/esm/Vertex.d.ts +3 -2
- package/src/esm/Vertex.js +9 -3
- package/src/esm/Vertex.js.map +1 -1
- package/src/esm/VertexAttr.d.ts +2 -1
- package/src/esm/VertexAttr.js +2 -1
- package/src/esm/VertexAttr.js.map +1 -1
- package/src/esm/VertexListeners.d.ts +1 -1
- package/src/esm/VertexListeners.js.map +1 -1
- package/src/esm/draw.js.map +1 -1
- package/src/esm/drawgl.js.map +1 -1
- package/src/esm/drawutilssvg.d.ts +17 -3
- package/src/esm/drawutilssvg.js +28 -22
- package/src/esm/drawutilssvg.js.map +1 -1
- package/src/esm/geomutils.js +2 -2
- package/src/esm/geomutils.js.map +1 -1
- package/src/esm/interfaces/DrawLib.d.ts +2 -2
- package/src/esm/interfaces/core.d.ts +3 -3
- package/src/esm/utils/NGons.d.ts +13 -0
- package/src/esm/utils/NGons.js +33 -0
- package/src/esm/utils/NGons.js.map +1 -0
- package/src/esm/utils/Params.d.ts +15 -0
- package/src/esm/utils/Params.js +44 -0
- package/src/esm/utils/Params.js.map +1 -0
- package/src/esm/utils/WebColors.js.map +1 -1
- package/src/esm/utils/algorithms/CatmullRomPath.js.map +1 -1
- package/src/esm/utils/algorithms/CircleIntersections.d.ts +3 -2
- package/src/esm/utils/algorithms/CircleIntersections.js +11 -19
- package/src/esm/utils/algorithms/CircleIntersections.js.map +1 -1
- package/src/esm/utils/algorithms/ContourLineDetection.d.ts +150 -0
- package/src/esm/utils/algorithms/ContourLineDetection.js +362 -0
- package/src/esm/utils/algorithms/ContourLineDetection.js.map +1 -0
- package/src/esm/utils/algorithms/CubicSplinePath.js.map +1 -1
- package/src/esm/utils/algorithms/HobbyPath.js.map +1 -1
- package/src/esm/utils/algorithms/Metaballs.d.ts +30 -0
- package/src/esm/utils/algorithms/Metaballs.js +109 -0
- package/src/esm/utils/algorithms/Metaballs.js.map +1 -0
- package/src/esm/utils/algorithms/arrayResize.d.ts +8 -0
- package/src/esm/utils/algorithms/arrayResize.js +20 -0
- package/src/esm/utils/algorithms/arrayResize.js.map +1 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.d.ts +21 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.js +44 -0
- package/src/esm/utils/algorithms/clearDuplicateVertices.js.map +1 -0
- package/src/esm/utils/algorithms/clearPolygonDuplicateVertices.js.map +1 -1
- package/src/esm/utils/algorithms/convexHull.js.map +1 -1
- package/src/esm/utils/algorithms/convexPolygonIncircle.js.map +1 -1
- package/src/esm/utils/algorithms/delaunay.js.map +1 -1
- package/src/esm/utils/algorithms/delaunay2voronoi.js.map +1 -1
- package/src/esm/utils/algorithms/detectPaths.js.map +1 -1
- package/src/esm/utils/algorithms/findPolygonSelfIntersections.js.map +1 -1
- package/src/esm/utils/algorithms/matrixFill.js.map +1 -1
- package/src/esm/utils/algorithms/splitPolygonToNonIntersecting.js.map +1 -1
- package/src/esm/utils/algorithms/sutherlandHodgman.js.map +1 -1
- package/src/esm/utils/cloneVertexArray.js.map +1 -1
- package/src/esm/utils/datastructures/CircularIntervalSet.js.map +1 -1
- package/src/esm/utils/datastructures/Color.d.ts +2 -1
- package/src/esm/utils/datastructures/Color.js +33 -14
- package/src/esm/utils/datastructures/Color.js.map +1 -1
- package/src/esm/utils/datastructures/DataGrid2d.d.ts +47 -0
- package/src/esm/utils/datastructures/DataGrid2d.js +19 -0
- package/src/esm/utils/datastructures/DataGrid2d.js.map +1 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.d.ts +65 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.js +79 -0
- package/src/esm/utils/datastructures/DataGrid2dListAdapter.js.map +1 -0
- package/src/esm/utils/datastructures/GenericPath.d.ts +14 -3
- package/src/esm/utils/datastructures/GenericPath.js +20 -3
- package/src/esm/utils/datastructures/GenericPath.js.map +1 -1
- package/src/esm/utils/datastructures/Girih.d.ts +3 -2
- package/src/esm/utils/datastructures/Girih.js +2 -1
- package/src/esm/utils/datastructures/Girih.js.map +1 -1
- package/src/esm/utils/datastructures/GirihBowtie.js.map +1 -1
- package/src/esm/utils/datastructures/GirihDecagon.js.map +1 -1
- package/src/esm/utils/datastructures/GirihHexagon.js.map +1 -1
- package/src/esm/utils/datastructures/GirihPenroseRhombus.js +1 -1
- package/src/esm/utils/datastructures/GirihPenroseRhombus.js.map +1 -1
- package/src/esm/utils/datastructures/GirihPentagon.js.map +1 -1
- package/src/esm/utils/datastructures/GirihRhombus.js.map +1 -1
- package/src/esm/utils/datastructures/GirihTile.js.map +1 -1
- package/src/esm/utils/datastructures/Matrix4x4.js.map +1 -1
- package/src/esm/utils/datastructures/VoronoiCell.js.map +1 -1
- package/src/esm/utils/datastructures/interfaces.d.ts +3 -3
- package/src/esm/utils/detectDarkMode.js.map +1 -1
- package/src/esm/utils/findInVertexArray.js.map +1 -1
- package/src/esm/utils/gup.d.ts +8 -0
- package/src/esm/utils/gup.js +8 -0
- package/src/esm/utils/gup.js.map +1 -1
- package/src/esm/utils/helpers/BezierPathInteractionHelper.d.ts +6 -5
- package/src/esm/utils/helpers/BezierPathInteractionHelper.js +3 -2
- package/src/esm/utils/helpers/BezierPathInteractionHelper.js.map +1 -1
- package/src/esm/utils/helpers/CircleHelper.d.ts +38 -3
- package/src/esm/utils/helpers/CircleHelper.js +51 -11
- package/src/esm/utils/helpers/CircleHelper.js.map +1 -1
- package/src/esm/utils/helpers/CircleSectorHelper.d.ts +47 -1
- package/src/esm/utils/helpers/CircleSectorHelper.js +85 -14
- package/src/esm/utils/helpers/CircleSectorHelper.js.map +1 -1
- package/src/esm/utils/io/FileDrop.d.ts +3 -3
- package/src/esm/utils/io/FileDrop.js.map +1 -1
- package/src/esm/utils/parsers/OBJParser.d.ts +2 -2
- package/src/esm/utils/parsers/OBJParser.js.map +1 -1
- package/src/esm/utils/parsers/STLParser.d.ts +4 -3
- package/src/esm/utils/parsers/STLParser.js +63 -13
- package/src/esm/utils/parsers/STLParser.js.map +1 -1
- package/src/esm/utils/parsers/svg/parseSVGPathData.js.map +1 -1
- package/src/esm/utils/parsers/svg/splitSVGPathData.js.map +1 -1
- package/src/esm/utils/parsers/svg/types.d.ts +13 -13
- package/src/index-gl.js +77 -85
- package/src/index.js +124 -129
- package/src/ts/CircleSector.ts +134 -3
- package/src/ts/PlotBoilerplate.ts +20 -11
- package/src/ts/Polygon.ts +31 -1
- package/src/ts/Vertex.ts +8 -3
- package/src/ts/VertexAttr.ts +3 -2
- package/src/ts/drawutilssvg.ts +38 -25
- package/src/ts/geomutils.ts +60 -64
- package/src/ts/interfaces/DrawLib.ts +0 -15
- package/src/ts/utils/NGons.ts +35 -0
- package/src/ts/utils/Params.ts +47 -0
- package/src/ts/utils/algorithms/CircleIntersections.ts +280 -288
- package/src/ts/utils/algorithms/ContourLineDetection.ts +485 -0
- package/src/ts/utils/algorithms/Metaballs.ts +144 -0
- package/src/ts/utils/algorithms/arrayResize.ts +22 -0
- package/src/ts/utils/algorithms/clearDuplicateVertices.ts +49 -0
- package/src/ts/utils/datastructures/Color.ts +39 -15
- package/src/ts/utils/datastructures/DataGrid2d.ts +54 -0
- package/src/ts/utils/datastructures/DataGrid2dListAdapter.ts +121 -0
- package/src/ts/utils/datastructures/GenericPath.ts +21 -3
- package/src/ts/utils/datastructures/Girih.ts +9 -8
- package/src/ts/utils/gup.ts +10 -2
- package/src/ts/utils/helpers/BezierPathInteractionHelper.ts +9 -8
- package/src/ts/utils/helpers/CircleHelper.ts +70 -22
- package/src/ts/utils/helpers/CircleSectorHelper.ts +101 -17
- package/src/ts/utils/parsers/STLParser.ts +50 -16
package/dist/plotboilerplate.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/
|
|
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
|
-
|
|
14
|
-
"default": () => /* binding */ esm
|
|
13
|
+
AlloyFinger: () => (/* reexport */ AlloyFinger),
|
|
14
|
+
"default": () => (/* binding */ esm)
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
|
|
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
|
-
|
|
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
|
-
/***/
|
|
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__(
|
|
461
|
-
var CubicBezierCurve_1 = __webpack_require__(
|
|
462
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
463
|
-
var Vertex_1 = __webpack_require__(
|
|
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
|
-
/***/
|
|
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__(
|
|
1525
|
-
var Vertex_1 = __webpack_require__(
|
|
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: "
|
|
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
|
-
/***/
|
|
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__(
|
|
1683
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
1684
|
-
var Vector_1 = __webpack_require__(
|
|
1685
|
-
var Vertex_1 = __webpack_require__(
|
|
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
|
-
/***/
|
|
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
|
-
* @
|
|
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
|
|
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
|
-
/***/
|
|
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__(
|
|
2077
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
2078
|
-
var Vertex_1 = __webpack_require__(
|
|
2079
|
-
var Vector_1 = __webpack_require__(
|
|
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 '"
|
|
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 '"
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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__(
|
|
3440
|
-
var Vertex_1 = __webpack_require__(
|
|
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
|
-
/***/
|
|
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 '"
|
|
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
|
-
/***/
|
|
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__(
|
|
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
|
-
/***/
|
|
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__(
|
|
4066
|
-
var Vertex_1 = __webpack_require__(
|
|
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
|
-
/***/
|
|
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
|
|
@@ -4214,29 +4337,33 @@ var __webpack_unused_export__;
|
|
|
4214
4337
|
* @fileoverview The main class.
|
|
4215
4338
|
* @public
|
|
4216
4339
|
**/
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
var
|
|
4224
|
-
var
|
|
4225
|
-
var
|
|
4226
|
-
var
|
|
4227
|
-
var
|
|
4228
|
-
var
|
|
4229
|
-
var
|
|
4230
|
-
var
|
|
4231
|
-
var
|
|
4232
|
-
var
|
|
4233
|
-
var
|
|
4234
|
-
var
|
|
4235
|
-
var
|
|
4236
|
-
var
|
|
4237
|
-
var
|
|
4238
|
-
var
|
|
4239
|
-
var
|
|
4340
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
4341
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
4342
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
4343
|
+
};
|
|
4344
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4345
|
+
exports.PlotBoilerplate = void 0;
|
|
4346
|
+
var alloyfinger_typescript_1 = __webpack_require__(597);
|
|
4347
|
+
var draw_1 = __webpack_require__(39);
|
|
4348
|
+
var drawgl_1 = __webpack_require__(264);
|
|
4349
|
+
var drawutilssvg_1 = __webpack_require__(378);
|
|
4350
|
+
var BezierPath_1 = __webpack_require__(733);
|
|
4351
|
+
var Bounds_1 = __webpack_require__(76);
|
|
4352
|
+
var Circle_1 = __webpack_require__(118);
|
|
4353
|
+
var CircleSector_1 = __webpack_require__(135);
|
|
4354
|
+
var Grid_1 = __webpack_require__(289);
|
|
4355
|
+
var KeyHandler_1 = __webpack_require__(531);
|
|
4356
|
+
var Line_1 = __webpack_require__(939);
|
|
4357
|
+
var MouseHandler_1 = __webpack_require__(912);
|
|
4358
|
+
var PBImage_1 = __webpack_require__(862);
|
|
4359
|
+
var Polygon_1 = __webpack_require__(687);
|
|
4360
|
+
var Triangle_1 = __webpack_require__(737);
|
|
4361
|
+
var VEllipse_1 = __webpack_require__(881);
|
|
4362
|
+
var VEllipseSector_1 = __webpack_require__(719);
|
|
4363
|
+
var Vector_1 = __webpack_require__(30);
|
|
4364
|
+
var Vertex_1 = __webpack_require__(787);
|
|
4365
|
+
var VertexAttr_1 = __webpack_require__(476);
|
|
4366
|
+
var PBText_1 = __webpack_require__(628);
|
|
4240
4367
|
/**
|
|
4241
4368
|
* @classdesc The main class of the PlotBoilerplate.
|
|
4242
4369
|
*
|
|
@@ -4327,8 +4454,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4327
4454
|
* Note that changes from the postDraw hook might not be visible in the export.
|
|
4328
4455
|
* @param {string=} [config.title=null] - Specify any hover tile here. It will be attached as a `title` attribute to the most elevated element.
|
|
4329
4456
|
*/
|
|
4330
|
-
function PlotBoilerplate(config) {
|
|
4331
|
-
var
|
|
4457
|
+
function PlotBoilerplate(config, drawConfig) {
|
|
4458
|
+
var _b, _c;
|
|
4332
4459
|
/**
|
|
4333
4460
|
* A discrete timestamp to identify single render cycles.
|
|
4334
4461
|
* Note that using system time milliseconds is not a safe way to identify render frames, as on modern powerful machines
|
|
@@ -4402,8 +4529,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4402
4529
|
enableTouch: f.bool(config, "enableTouch", true),
|
|
4403
4530
|
enableKeys: f.bool(config, "enableKeys", true),
|
|
4404
4531
|
enableMouseWheel: f.bool(config, "enableMouseWheel", true),
|
|
4405
|
-
enableZoom: f.bool(config, "enableZoom", true),
|
|
4406
|
-
enablePan: f.bool(config, "enablePan", true),
|
|
4532
|
+
enableZoom: f.bool(config, "enableZoom", true), // default=true
|
|
4533
|
+
enablePan: f.bool(config, "enablePan", true), // default=true
|
|
4407
4534
|
// Experimental (and unfinished)
|
|
4408
4535
|
enableGL: f.bool(config, "enableGL", false)
|
|
4409
4536
|
}; // END confog
|
|
@@ -4505,7 +4632,7 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4505
4632
|
this.canvasSize = { width: PlotBoilerplate.DEFAULT_CANVAS_WIDTH, height: PlotBoilerplate.DEFAULT_CANVAS_HEIGHT };
|
|
4506
4633
|
var canvasElement = typeof config.canvas === "string" ? document.querySelector(config.canvas) : config.canvas;
|
|
4507
4634
|
if (typeof canvasElement === "undefined") {
|
|
4508
|
-
throw "Cannot initialize PlotBoilerplate with a null canvas (element \""
|
|
4635
|
+
throw "Cannot initialize PlotBoilerplate with a null canvas (element \"".concat(config.canvas, " not found).");
|
|
4509
4636
|
}
|
|
4510
4637
|
// Which renderer to use: Canvas2D, WebGL (experimental) or SVG?
|
|
4511
4638
|
if (canvasElement.tagName.toLowerCase() === "canvas") {
|
|
@@ -4563,8 +4690,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4563
4690
|
if (config.title) {
|
|
4564
4691
|
this.eventCatcher.setAttribute("title", config.title);
|
|
4565
4692
|
}
|
|
4566
|
-
this.draw.scale.set((
|
|
4567
|
-
this.fill.scale.set((
|
|
4693
|
+
this.draw.scale.set((_b = this.config.scaleX) !== null && _b !== void 0 ? _b : 1.0, this.config.scaleY);
|
|
4694
|
+
this.fill.scale.set((_c = this.config.scaleX) !== null && _c !== void 0 ? _c : 1.0, this.config.scaleY);
|
|
4568
4695
|
this.vertices = [];
|
|
4569
4696
|
this.selectPolygon = null;
|
|
4570
4697
|
this.draggedElements = [];
|
|
@@ -4630,8 +4757,9 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4630
4757
|
var blob = new Blob(['<?xml version="1.0" encoding="utf-8"?>\n' + svgCode], { type: "image/svg;charset=utf-8" });
|
|
4631
4758
|
// See documentation for FileSaver.js for usage.
|
|
4632
4759
|
// https://github.com/eligrey/FileSaver.js
|
|
4633
|
-
if (typeof globalThis["saveAs"] !== "function")
|
|
4760
|
+
if (typeof globalThis["saveAs"] !== "function") {
|
|
4634
4761
|
throw "Cannot save file; did you load the ./utils/savefile helper function and the eligrey/SaveFile library?";
|
|
4762
|
+
}
|
|
4635
4763
|
var _saveAs = globalThis["saveAs"];
|
|
4636
4764
|
_saveAs(blob, "plotboilerplate.svg");
|
|
4637
4765
|
};
|
|
@@ -4702,12 +4830,12 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4702
4830
|
* @private
|
|
4703
4831
|
**/
|
|
4704
4832
|
PlotBoilerplate.prototype.updateCSSscale = function () {
|
|
4705
|
-
var
|
|
4833
|
+
var _b, _c, _d, _e;
|
|
4706
4834
|
if (this.config.cssUniformScale) {
|
|
4707
|
-
PlotBoilerplate.utils.setCSSscale(this.canvas, (
|
|
4835
|
+
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
4836
|
}
|
|
4709
4837
|
else {
|
|
4710
|
-
PlotBoilerplate.utils.setCSSscale(this.canvas, (
|
|
4838
|
+
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
4839
|
}
|
|
4712
4840
|
};
|
|
4713
4841
|
/**
|
|
@@ -4980,8 +5108,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
4980
5108
|
* @return The vertex near the given position or undefined if none was found there.
|
|
4981
5109
|
**/
|
|
4982
5110
|
PlotBoilerplate.prototype.getVertexNear = function (pixelPosition, pixelTolerance) {
|
|
4983
|
-
var
|
|
4984
|
-
var p = this.locatePointNear(this.transformMousePosition(pixelPosition.x, pixelPosition.y), pixelTolerance / Math.min((
|
|
5111
|
+
var _b, _c;
|
|
5112
|
+
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
5113
|
if (p && p.typeName == "vertex") {
|
|
4986
5114
|
return this.vertices[p.vindex];
|
|
4987
5115
|
}
|
|
@@ -5099,16 +5227,16 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5099
5227
|
var curveIndex = 0;
|
|
5100
5228
|
for (var c in d.bezierCurves) {
|
|
5101
5229
|
// Restore these settings again in each loop (will be overwritten)
|
|
5102
|
-
this.draw.setCurrentId(d.uid
|
|
5103
|
-
this.fill.setCurrentId(d.uid
|
|
5230
|
+
this.draw.setCurrentId("".concat(d.uid, "-").concat(curveIndex));
|
|
5231
|
+
this.fill.setCurrentId("".concat(d.uid, "-").concat(curveIndex));
|
|
5104
5232
|
this.draw.setCurrentClassName(d.className);
|
|
5105
5233
|
this.fill.setCurrentClassName(d.className);
|
|
5106
5234
|
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
5235
|
if (this.drawConfig.drawBezierHandlePoints && this.drawConfig.drawHandlePoints) {
|
|
5108
5236
|
if (d.bezierCurves[c].startPoint.attr.visible) {
|
|
5109
5237
|
var df = this.drawConfig.bezier.pathVertex.fill ? fill : draw;
|
|
5110
|
-
df.setCurrentId(d.uid
|
|
5111
|
-
df.setCurrentClassName(d.className
|
|
5238
|
+
df.setCurrentId("".concat(d.uid, "_h0"));
|
|
5239
|
+
df.setCurrentClassName("".concat(d.className, "-start-handle"));
|
|
5112
5240
|
if (d.bezierCurves[c].startPoint.attr.bezierAutoAdjust) {
|
|
5113
5241
|
df.squareHandle(d.bezierCurves[c].startPoint, 5, this._handleColor(d.bezierCurves[c].startPoint, this.drawConfig.bezier.pathVertex.color));
|
|
5114
5242
|
}
|
|
@@ -5119,8 +5247,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5119
5247
|
d.bezierCurves[c].startPoint.attr.renderTime = renderTime;
|
|
5120
5248
|
if (d.bezierCurves[c].endPoint.attr.visible) {
|
|
5121
5249
|
var df = this.drawConfig.bezier.pathVertex.fill ? fill : draw;
|
|
5122
|
-
df.setCurrentId(d.uid
|
|
5123
|
-
df.setCurrentClassName(d.className
|
|
5250
|
+
df.setCurrentId("".concat(d.uid, "_h0"));
|
|
5251
|
+
df.setCurrentClassName("".concat(d.className, "-start-handle"));
|
|
5124
5252
|
if (d.bezierCurves[c].endPoint.attr.bezierAutoAdjust) {
|
|
5125
5253
|
df.squareHandle(d.bezierCurves[c].endPoint, 5, this._handleColor(d.bezierCurves[c].endPoint, this.drawConfig.bezier.pathVertex.color));
|
|
5126
5254
|
}
|
|
@@ -5130,14 +5258,14 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5130
5258
|
}
|
|
5131
5259
|
if (d.bezierCurves[c].startControlPoint.attr.visible) {
|
|
5132
5260
|
var df = this.drawConfig.bezier.controlVertex.fill ? fill : draw;
|
|
5133
|
-
df.setCurrentId(d.uid
|
|
5134
|
-
df.setCurrentClassName(d.className
|
|
5261
|
+
df.setCurrentId("".concat(d.uid, "_h2"));
|
|
5262
|
+
df.setCurrentClassName("".concat(d.className, "-start-control-handle"));
|
|
5135
5263
|
df.circleHandle(d.bezierCurves[c].startControlPoint, 3, this._handleColor(d.bezierCurves[c].startControlPoint, this.drawConfig.bezier.controlVertex.color));
|
|
5136
5264
|
}
|
|
5137
5265
|
if (d.bezierCurves[c].endControlPoint.attr.visible) {
|
|
5138
5266
|
var df = this.drawConfig.bezier.controlVertex.fill ? fill : draw;
|
|
5139
|
-
df.setCurrentId(d.uid
|
|
5140
|
-
df.setCurrentClassName(d.className
|
|
5267
|
+
df.setCurrentId("".concat(d.uid, "_h3"));
|
|
5268
|
+
df.setCurrentClassName("".concat(d.className, "-end-control-handle"));
|
|
5141
5269
|
df.circleHandle(d.bezierCurves[c].endControlPoint, 3, this._handleColor(d.bezierCurves[c].endControlPoint, this.drawConfig.bezier.controlVertex.color));
|
|
5142
5270
|
}
|
|
5143
5271
|
d.bezierCurves[c].startPoint.attr.renderTime = renderTime;
|
|
@@ -5152,11 +5280,11 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5152
5280
|
d.bezierCurves[c].endControlPoint.attr.renderTime = renderTime;
|
|
5153
5281
|
}
|
|
5154
5282
|
if (this.drawConfig.drawBezierHandleLines && this.drawConfig.drawHandleLines) {
|
|
5155
|
-
draw.setCurrentId(d.uid
|
|
5156
|
-
draw.setCurrentClassName(d.className
|
|
5283
|
+
draw.setCurrentId("".concat(d.uid, "_l0"));
|
|
5284
|
+
draw.setCurrentClassName("".concat(d.className, "-start-line"));
|
|
5157
5285
|
draw.handleLine(d.bezierCurves[c].startPoint, d.bezierCurves[c].startControlPoint);
|
|
5158
|
-
draw.setCurrentId(d.uid
|
|
5159
|
-
draw.setCurrentClassName(d.className
|
|
5286
|
+
draw.setCurrentId("".concat(d.uid, "_l1"));
|
|
5287
|
+
draw.setCurrentClassName("".concat(d.className, "-end-line"));
|
|
5160
5288
|
draw.handleLine(d.bezierCurves[c].endPoint, d.bezierCurves[c].endControlPoint);
|
|
5161
5289
|
}
|
|
5162
5290
|
curveIndex++;
|
|
@@ -5177,17 +5305,17 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5177
5305
|
}
|
|
5178
5306
|
else if (d instanceof VEllipse_1.VEllipse) {
|
|
5179
5307
|
if (this.drawConfig.drawHandleLines) {
|
|
5180
|
-
draw.setCurrentId(d.uid
|
|
5181
|
-
draw.setCurrentClassName(d.className
|
|
5308
|
+
draw.setCurrentId("".concat(d.uid, "_e0"));
|
|
5309
|
+
draw.setCurrentClassName("".concat(d.className, "-v-line"));
|
|
5182
5310
|
// draw.line( d.center.clone().add(0,d.axis.y-d.center.y), d.axis, '#c8c8c8' );
|
|
5183
5311
|
draw.handleLine(d.center.clone().add(0, d.signedRadiusV()).rotate(d.rotation, d.center), d.axis); // , "#c8c8c8");
|
|
5184
|
-
draw.setCurrentId(d.uid
|
|
5185
|
-
draw.setCurrentClassName(d.className
|
|
5312
|
+
draw.setCurrentId("".concat(d.uid, "_e1"));
|
|
5313
|
+
draw.setCurrentClassName("".concat(d.className, "-h-line"));
|
|
5186
5314
|
// draw.line( d.center.clone().add(d.axis.x-d.center.x,0), d.axis, '#c8c8c8' );
|
|
5187
5315
|
draw.handleLine(d.center.clone().add(d.signedRadiusH(), 0).rotate(d.rotation, d.center), d.axis); // , "#c8c8c8");
|
|
5188
5316
|
}
|
|
5189
5317
|
draw.setCurrentId(d.uid);
|
|
5190
|
-
draw.setCurrentClassName(""
|
|
5318
|
+
draw.setCurrentClassName("".concat(d.className));
|
|
5191
5319
|
draw.ellipse(d.center,
|
|
5192
5320
|
// Math.abs(d.axis.x-d.center.x), Math.abs(d.axis.y-d.center.y),
|
|
5193
5321
|
d.radiusH(), d.radiusV(), this.drawConfig.ellipse.color, this.drawConfig.ellipse.lineWidth, d.rotation);
|
|
@@ -5198,7 +5326,7 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5198
5326
|
}
|
|
5199
5327
|
else if (d instanceof VEllipseSector_1.VEllipseSector) {
|
|
5200
5328
|
draw.setCurrentId(d.uid);
|
|
5201
|
-
draw.setCurrentClassName(""
|
|
5329
|
+
draw.setCurrentClassName("".concat(d.className));
|
|
5202
5330
|
/* draw.ellipse( d.center,
|
|
5203
5331
|
// Math.abs(d.axis.x-d.center.x), Math.abs(d.axis.y-d.center.y),
|
|
5204
5332
|
d.radiusH(), d.radiusV(),
|
|
@@ -5231,8 +5359,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5231
5359
|
else if (d instanceof Vector_1.Vector) {
|
|
5232
5360
|
draw.arrow(d.a, d.b, this.drawConfig.vector.color);
|
|
5233
5361
|
if (this.drawConfig.drawHandlePoints && d.b.attr.selectable && d.b.attr.visible) {
|
|
5234
|
-
draw.setCurrentId(d.uid
|
|
5235
|
-
draw.setCurrentClassName(d.className
|
|
5362
|
+
draw.setCurrentId("".concat(d.uid, "_h0"));
|
|
5363
|
+
draw.setCurrentClassName("".concat(d.className, "-handle"));
|
|
5236
5364
|
draw.circleHandle(d.b, 3, "#a8a8a8");
|
|
5237
5365
|
}
|
|
5238
5366
|
else {
|
|
@@ -5245,15 +5373,15 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5245
5373
|
}
|
|
5246
5374
|
else if (d instanceof PBImage_1.PBImage) {
|
|
5247
5375
|
if (this.drawConfig.drawHandleLines) {
|
|
5248
|
-
draw.setCurrentId(d.uid
|
|
5249
|
-
draw.setCurrentClassName(d.className
|
|
5376
|
+
draw.setCurrentId("".concat(d.uid, "_l0"));
|
|
5377
|
+
draw.setCurrentClassName("".concat(d.className, "-line"));
|
|
5250
5378
|
draw.line(d.upperLeft, d.lowerRight, this.drawConfig.image.color, this.drawConfig.image.lineWidth);
|
|
5251
5379
|
}
|
|
5252
5380
|
fill.setCurrentId(d.uid);
|
|
5253
5381
|
fill.image(d.image, d.upperLeft, d.lowerRight.clone().sub(d.upperLeft));
|
|
5254
5382
|
if (this.drawConfig.drawHandlePoints) {
|
|
5255
|
-
draw.setCurrentId(d.uid
|
|
5256
|
-
draw.setCurrentClassName(d.className
|
|
5383
|
+
draw.setCurrentId("".concat(d.uid, "_h0"));
|
|
5384
|
+
draw.setCurrentClassName("".concat(d.className, "-lower-right"));
|
|
5257
5385
|
draw.circleHandle(d.lowerRight, 3, this.drawConfig.image.color);
|
|
5258
5386
|
d.lowerRight.attr.renderTime = renderTime;
|
|
5259
5387
|
}
|
|
@@ -5262,8 +5390,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5262
5390
|
fill.setCurrentId(d.uid);
|
|
5263
5391
|
fill.text(d.text, d.anchor.x, d.anchor.y, d);
|
|
5264
5392
|
if (this.drawConfig.text.anchor) {
|
|
5265
|
-
draw.setCurrentId(d.uid
|
|
5266
|
-
draw.setCurrentClassName(d.className
|
|
5393
|
+
draw.setCurrentId("".concat(d.uid, "_a0"));
|
|
5394
|
+
draw.setCurrentClassName("".concat(d.className, "-anchor"));
|
|
5267
5395
|
(this.drawConfig.text.fill ? fill : draw).point(d.anchor, this.drawConfig.text.color);
|
|
5268
5396
|
}
|
|
5269
5397
|
d.anchor.attr.renderTime = renderTime;
|
|
@@ -5410,8 +5538,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5410
5538
|
* @return {Bounds} The current viewport.
|
|
5411
5539
|
**/
|
|
5412
5540
|
PlotBoilerplate.prototype.viewport = function () {
|
|
5413
|
-
var
|
|
5414
|
-
return new Bounds_1.Bounds(this.transformMousePosition(0, 0), this.transformMousePosition(this.canvasSize.width * ((
|
|
5541
|
+
var _b, _c;
|
|
5542
|
+
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
5543
|
};
|
|
5416
5544
|
/**
|
|
5417
5545
|
* Trigger the saveFile.hook.
|
|
@@ -5460,12 +5588,12 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5460
5588
|
**/
|
|
5461
5589
|
PlotBoilerplate.prototype.resizeCanvas = function () {
|
|
5462
5590
|
var _this = this;
|
|
5463
|
-
var
|
|
5591
|
+
var _b, _c, _d, _e, _f, _g;
|
|
5464
5592
|
var _self = this;
|
|
5465
5593
|
var _setSize = function (w, h) {
|
|
5466
|
-
var
|
|
5467
|
-
w *= (
|
|
5468
|
-
h *= (
|
|
5594
|
+
var _b, _c;
|
|
5595
|
+
w *= (_b = _self.config.canvasWidthFactor) !== null && _b !== void 0 ? _b : 1.0;
|
|
5596
|
+
h *= (_c = _self.config.canvasHeightFactor) !== null && _c !== void 0 ? _c : 1.0;
|
|
5469
5597
|
_self.canvasSize.width = w;
|
|
5470
5598
|
_self.canvasSize.height = h;
|
|
5471
5599
|
if (_self.canvas instanceof HTMLCanvasElement) {
|
|
@@ -5473,12 +5601,12 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5473
5601
|
_self.canvas.height = h;
|
|
5474
5602
|
}
|
|
5475
5603
|
else if (_self.canvas instanceof SVGElement) {
|
|
5476
|
-
_this.canvas.setAttribute("viewBox", "0 0 "
|
|
5477
|
-
_this.canvas.setAttribute("width", ""
|
|
5478
|
-
_this.canvas.setAttribute("height", ""
|
|
5604
|
+
_this.canvas.setAttribute("viewBox", "0 0 ".concat(w, " ").concat(h));
|
|
5605
|
+
_this.canvas.setAttribute("width", "".concat(w));
|
|
5606
|
+
_this.canvas.setAttribute("height", "".concat(h));
|
|
5479
5607
|
_this.draw.setSize(_self.canvasSize); // No need to set size to this.fill (instance copy)
|
|
5480
|
-
_this.eventCatcher.style.width = w
|
|
5481
|
-
_this.eventCatcher.style.height = h
|
|
5608
|
+
_this.eventCatcher.style.width = "".concat(w, "px");
|
|
5609
|
+
_this.eventCatcher.style.height = "".concat(h, "px");
|
|
5482
5610
|
}
|
|
5483
5611
|
else {
|
|
5484
5612
|
console.error("Error: cannot resize canvas element because it seems neither be a HTMLCanvasElement nor an SVGElement.");
|
|
@@ -5494,8 +5622,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5494
5622
|
var width = globalThis.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
|
5495
5623
|
var height = globalThis.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
|
|
5496
5624
|
_self.canvas.style.position = "absolute";
|
|
5497
|
-
_self.canvas.style.width = ((
|
|
5498
|
-
_self.canvas.style.height = ((
|
|
5625
|
+
_self.canvas.style.width = ((_b = _self.config.canvasWidthFactor) !== null && _b !== void 0 ? _b : 1.0) * width + "px";
|
|
5626
|
+
_self.canvas.style.height = ((_c = _self.config.canvasWidthFactor) !== null && _c !== void 0 ? _c : 1.0) * height + "px";
|
|
5499
5627
|
_self.canvas.style.top = "0px";
|
|
5500
5628
|
_self.canvas.style.left = "0px";
|
|
5501
5629
|
_setSize(width, height);
|
|
@@ -5504,8 +5632,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5504
5632
|
// Set editor size
|
|
5505
5633
|
_self.canvas.style.position = "static";
|
|
5506
5634
|
var space = this.getAvailableContainerSpace();
|
|
5507
|
-
_self.canvas.style.width = ((
|
|
5508
|
-
_self.canvas.style.height = ((
|
|
5635
|
+
_self.canvas.style.width = ((_d = _self.config.canvasWidthFactor) !== null && _d !== void 0 ? _d : 1.0) * space.width + "px";
|
|
5636
|
+
_self.canvas.style.height = ((_e = _self.config.canvasHeightFactor) !== null && _e !== void 0 ? _e : 1.0) * space.height + "px";
|
|
5509
5637
|
_self.canvas.style.top = "";
|
|
5510
5638
|
_self.canvas.style.left = "";
|
|
5511
5639
|
_setSize(space.width, space.height);
|
|
@@ -5513,7 +5641,7 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
5513
5641
|
else {
|
|
5514
5642
|
_self.canvas.style.width = "";
|
|
5515
5643
|
_self.canvas.style.height = "";
|
|
5516
|
-
_setSize((
|
|
5644
|
+
_setSize((_f = _self.config.defaultCanvasWidth) !== null && _f !== void 0 ? _f : 1024, (_g = _self.config.defaultCanvasHeight) !== null && _g !== void 0 ? _g : 768);
|
|
5517
5645
|
}
|
|
5518
5646
|
if (_self.config.redrawOnResize)
|
|
5519
5647
|
_self.redraw();
|
|
@@ -6017,7 +6145,9 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6017
6145
|
}
|
|
6018
6146
|
}; // END afProps
|
|
6019
6147
|
if (window["createAlloyFinger"]) {
|
|
6020
|
-
window["createAlloyFinger"](this.eventCatcher ? this.eventCatcher : this.canvas, afProps);
|
|
6148
|
+
// window["createAlloyFinger"](this.eventCatcher ? this.eventCatcher : this.canvas, afProps);
|
|
6149
|
+
var createAlloyFinger = window["createAlloyFinger"];
|
|
6150
|
+
createAlloyFinger(this.eventCatcher ? this.eventCatcher : this.canvas, afProps);
|
|
6021
6151
|
}
|
|
6022
6152
|
else {
|
|
6023
6153
|
/* tslint:disable-next-line */
|
|
@@ -6075,10 +6205,15 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6075
6205
|
PlotBoilerplate.prototype.createGUI = function (props) {
|
|
6076
6206
|
// This function moved to the helper utils.
|
|
6077
6207
|
// We do not want to include the whole dat.GUI package.
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6208
|
+
var utils = globalThis["utils"];
|
|
6209
|
+
// if (globalThis["utils"] && typeof globalThis["utils"].createGUI == "function") {
|
|
6210
|
+
// return (globalThis["utils" as keyof Object] as any as ({createGUI : (pb:PlotBoilerplate,props:DatGuiProps|undefined)=>GUI })).createGUI(this, props);
|
|
6211
|
+
if (utils && typeof utils.createGUI === "function") {
|
|
6212
|
+
return utils.createGUI(this, props);
|
|
6213
|
+
}
|
|
6214
|
+
else {
|
|
6081
6215
|
throw "Cannot create dat.GUI instance; did you load the ./utils/creategui helper function an the dat.GUI library?";
|
|
6216
|
+
}
|
|
6082
6217
|
};
|
|
6083
6218
|
var _a;
|
|
6084
6219
|
/** @constant {number} */
|
|
@@ -6107,6 +6242,7 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6107
6242
|
};
|
|
6108
6243
|
return class_1;
|
|
6109
6244
|
}()),
|
|
6245
|
+
__setFunctionName(_a, "Draggable"),
|
|
6110
6246
|
_a.VERTEX = "vertex",
|
|
6111
6247
|
_a);
|
|
6112
6248
|
/**
|
|
@@ -6196,7 +6332,8 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6196
6332
|
* @return {void}
|
|
6197
6333
|
**/
|
|
6198
6334
|
setCSSscale: function (element, scaleX, scaleY) {
|
|
6199
|
-
element.style["transform-origin"] = "0 0";
|
|
6335
|
+
// element.style["transform-origin"] = "0 0";
|
|
6336
|
+
element.style.transformOrigin = "0 0";
|
|
6200
6337
|
if (scaleX == 1.0 && scaleY == 1.0) {
|
|
6201
6338
|
// element.style.transform = null;
|
|
6202
6339
|
element.style.removeProperty("transform");
|
|
@@ -6279,7 +6416,7 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6279
6416
|
return fallback;
|
|
6280
6417
|
return obj[key];
|
|
6281
6418
|
}
|
|
6282
|
-
},
|
|
6419
|
+
}, // END fetch
|
|
6283
6420
|
/**
|
|
6284
6421
|
* Installs vertex listeners to the path's vertices so that controlpoints
|
|
6285
6422
|
* move with their path points when dragged.
|
|
@@ -6332,13 +6469,13 @@ var PlotBoilerplate = /** @class */ (function () {
|
|
|
6332
6469
|
}; // END utils
|
|
6333
6470
|
return PlotBoilerplate;
|
|
6334
6471
|
}()); // END class PlotBoilerplate
|
|
6335
|
-
exports.
|
|
6336
|
-
|
|
6472
|
+
exports.PlotBoilerplate = PlotBoilerplate;
|
|
6473
|
+
exports["default"] = PlotBoilerplate;
|
|
6337
6474
|
//# sourceMappingURL=PlotBoilerplate.js.map
|
|
6338
6475
|
|
|
6339
6476
|
/***/ }),
|
|
6340
6477
|
|
|
6341
|
-
/***/
|
|
6478
|
+
/***/ 687:
|
|
6342
6479
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6343
6480
|
|
|
6344
6481
|
|
|
@@ -6371,18 +6508,19 @@ __webpack_unused_export__ = PlotBoilerplate;
|
|
|
6371
6508
|
* @modified 2023-09-25 Added the `Polygon.getInterpolationPolygon(number)` function.
|
|
6372
6509
|
* @modified 2023-09-25 Added the `Polygon.lineIntersections(Line,boolean)` function.
|
|
6373
6510
|
* @modified 2023-09-29 Added the `Polygon.closestLineIntersection(Line,boolean)` function.
|
|
6374
|
-
* @
|
|
6511
|
+
* @modified 2023-11-24 Added the `Polygon.containsPolygon(Polygon)' function.
|
|
6512
|
+
* @version 1.12.0
|
|
6375
6513
|
*
|
|
6376
6514
|
* @file Polygon
|
|
6377
6515
|
* @public
|
|
6378
6516
|
**/
|
|
6379
6517
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6380
6518
|
exports.Polygon = void 0;
|
|
6381
|
-
var BezierPath_1 = __webpack_require__(
|
|
6382
|
-
var Bounds_1 = __webpack_require__(
|
|
6383
|
-
var Line_1 = __webpack_require__(
|
|
6384
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
6385
|
-
var Vertex_1 = __webpack_require__(
|
|
6519
|
+
var BezierPath_1 = __webpack_require__(733);
|
|
6520
|
+
var Bounds_1 = __webpack_require__(76);
|
|
6521
|
+
var Line_1 = __webpack_require__(939);
|
|
6522
|
+
var UIDGenerator_1 = __webpack_require__(938);
|
|
6523
|
+
var Vertex_1 = __webpack_require__(787);
|
|
6386
6524
|
/**
|
|
6387
6525
|
* @classdesc A polygon class. Any polygon consists of an array of vertices; polygons can be open or closed.
|
|
6388
6526
|
*
|
|
@@ -6487,6 +6625,34 @@ var Polygon = /** @class */ (function () {
|
|
|
6487
6625
|
}
|
|
6488
6626
|
return inside;
|
|
6489
6627
|
};
|
|
6628
|
+
/**
|
|
6629
|
+
* Check if the passed polygon is completly contained inside this polygon.
|
|
6630
|
+
*
|
|
6631
|
+
* This means:
|
|
6632
|
+
* - all polygon's vertices must be inside this polygon.
|
|
6633
|
+
* - the polygon has no edge intersections with this polygon.
|
|
6634
|
+
*
|
|
6635
|
+
* @param {Polygon} polygon - The polygon to check if contained.
|
|
6636
|
+
* @return {boolean}
|
|
6637
|
+
*/
|
|
6638
|
+
Polygon.prototype.containsPolygon = function (polygon) {
|
|
6639
|
+
for (var i = 0; i < polygon.vertices.length; i++) {
|
|
6640
|
+
if (!this.containsVert(polygon.vertices[i])) {
|
|
6641
|
+
return false;
|
|
6642
|
+
}
|
|
6643
|
+
}
|
|
6644
|
+
// All vertices are inside; check for intersections
|
|
6645
|
+
var lineSegment = new Line_1.Line(new Vertex_1.Vertex(), new Vertex_1.Vertex());
|
|
6646
|
+
for (var i = 0; i < polygon.vertices.length; i++) {
|
|
6647
|
+
lineSegment.a.set(polygon.vertices[i]);
|
|
6648
|
+
lineSegment.b.set(polygon.vertices[(i + 1) % polygon.vertices.length]);
|
|
6649
|
+
if (this.lineIntersections(lineSegment, true).length > 0) {
|
|
6650
|
+
// Current segment has intersection(s) with this polygon.
|
|
6651
|
+
return false;
|
|
6652
|
+
}
|
|
6653
|
+
}
|
|
6654
|
+
return true;
|
|
6655
|
+
};
|
|
6490
6656
|
/**
|
|
6491
6657
|
* Calculate the area of the given polygon (unsigned).
|
|
6492
6658
|
*
|
|
@@ -6921,7 +7087,7 @@ exports.Polygon = Polygon;
|
|
|
6921
7087
|
|
|
6922
7088
|
/***/ }),
|
|
6923
7089
|
|
|
6924
|
-
/***/
|
|
7090
|
+
/***/ 737:
|
|
6925
7091
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6926
7092
|
|
|
6927
7093
|
|
|
@@ -6956,13 +7122,13 @@ exports.Polygon = Polygon;
|
|
|
6956
7122
|
**/
|
|
6957
7123
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6958
7124
|
exports.Triangle = void 0;
|
|
6959
|
-
var Bounds_1 = __webpack_require__(
|
|
6960
|
-
var Circle_1 = __webpack_require__(
|
|
6961
|
-
var Line_1 = __webpack_require__(
|
|
6962
|
-
var Polygon_1 = __webpack_require__(
|
|
6963
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
6964
|
-
var Vertex_1 = __webpack_require__(
|
|
6965
|
-
var geomutils_1 = __webpack_require__(
|
|
7125
|
+
var Bounds_1 = __webpack_require__(76);
|
|
7126
|
+
var Circle_1 = __webpack_require__(118);
|
|
7127
|
+
var Line_1 = __webpack_require__(939);
|
|
7128
|
+
var Polygon_1 = __webpack_require__(687);
|
|
7129
|
+
var UIDGenerator_1 = __webpack_require__(938);
|
|
7130
|
+
var Vertex_1 = __webpack_require__(787);
|
|
7131
|
+
var geomutils_1 = __webpack_require__(328);
|
|
6966
7132
|
/**
|
|
6967
7133
|
* @classdesc A triangle class for triangulations.
|
|
6968
7134
|
*
|
|
@@ -7015,7 +7181,7 @@ var Triangle = /** @class */ (function () {
|
|
|
7015
7181
|
**/
|
|
7016
7182
|
Triangle.fromArray = function (arr) {
|
|
7017
7183
|
if (arr.length < 3)
|
|
7018
|
-
throw "Cannot create triangle from array with less than three vertices ("
|
|
7184
|
+
throw "Cannot create triangle from array with less than three vertices (".concat(arr.length, ")");
|
|
7019
7185
|
return new Triangle(arr[0], arr[1], arr[2]);
|
|
7020
7186
|
};
|
|
7021
7187
|
/**
|
|
@@ -7332,7 +7498,7 @@ exports.Triangle = Triangle;
|
|
|
7332
7498
|
|
|
7333
7499
|
/***/ }),
|
|
7334
7500
|
|
|
7335
|
-
/***/
|
|
7501
|
+
/***/ 938:
|
|
7336
7502
|
/***/ ((__unused_webpack_module, exports) => {
|
|
7337
7503
|
|
|
7338
7504
|
|
|
@@ -7349,7 +7515,7 @@ var UIDGenerator = /** @class */ (function () {
|
|
|
7349
7515
|
function UIDGenerator() {
|
|
7350
7516
|
}
|
|
7351
7517
|
UIDGenerator.next = function () {
|
|
7352
|
-
return ""
|
|
7518
|
+
return "".concat(UIDGenerator.current++);
|
|
7353
7519
|
};
|
|
7354
7520
|
UIDGenerator.current = 0;
|
|
7355
7521
|
return UIDGenerator;
|
|
@@ -7359,7 +7525,7 @@ exports.UIDGenerator = UIDGenerator;
|
|
|
7359
7525
|
|
|
7360
7526
|
/***/ }),
|
|
7361
7527
|
|
|
7362
|
-
/***/
|
|
7528
|
+
/***/ 881:
|
|
7363
7529
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7364
7530
|
|
|
7365
7531
|
|
|
@@ -7387,11 +7553,11 @@ exports.UIDGenerator = UIDGenerator;
|
|
|
7387
7553
|
**/
|
|
7388
7554
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7389
7555
|
exports.VEllipse = void 0;
|
|
7390
|
-
var Line_1 = __webpack_require__(
|
|
7391
|
-
var Vector_1 = __webpack_require__(
|
|
7392
|
-
var Vertex_1 = __webpack_require__(
|
|
7393
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
7394
|
-
var CubicBezierCurve_1 = __webpack_require__(
|
|
7556
|
+
var Line_1 = __webpack_require__(939);
|
|
7557
|
+
var Vector_1 = __webpack_require__(30);
|
|
7558
|
+
var Vertex_1 = __webpack_require__(787);
|
|
7559
|
+
var UIDGenerator_1 = __webpack_require__(938);
|
|
7560
|
+
var CubicBezierCurve_1 = __webpack_require__(973);
|
|
7395
7561
|
/**
|
|
7396
7562
|
* @classdesc An ellipse class based on two vertices [centerX,centerY] and [radiusX,radiusY].
|
|
7397
7563
|
*
|
|
@@ -7779,7 +7945,7 @@ exports.VEllipse = VEllipse;
|
|
|
7779
7945
|
|
|
7780
7946
|
/***/ }),
|
|
7781
7947
|
|
|
7782
|
-
/***/
|
|
7948
|
+
/***/ 719:
|
|
7783
7949
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7784
7950
|
|
|
7785
7951
|
|
|
@@ -7795,12 +7961,12 @@ exports.VEllipse = VEllipse;
|
|
|
7795
7961
|
*/
|
|
7796
7962
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7797
7963
|
exports.VEllipseSector = void 0;
|
|
7798
|
-
var CubicBezierCurve_1 = __webpack_require__(
|
|
7799
|
-
var geomutils_1 = __webpack_require__(
|
|
7800
|
-
var Line_1 = __webpack_require__(
|
|
7801
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
7802
|
-
var VEllipse_1 = __webpack_require__(
|
|
7803
|
-
var Vertex_1 = __webpack_require__(
|
|
7964
|
+
var CubicBezierCurve_1 = __webpack_require__(973);
|
|
7965
|
+
var geomutils_1 = __webpack_require__(328);
|
|
7966
|
+
var Line_1 = __webpack_require__(939);
|
|
7967
|
+
var UIDGenerator_1 = __webpack_require__(938);
|
|
7968
|
+
var VEllipse_1 = __webpack_require__(881);
|
|
7969
|
+
var Vertex_1 = __webpack_require__(787);
|
|
7804
7970
|
/**
|
|
7805
7971
|
* @classdesc A class for elliptic sectors.
|
|
7806
7972
|
*
|
|
@@ -7942,7 +8108,7 @@ var VEllipseSector = /** @class */ (function () {
|
|
|
7942
8108
|
var r2d = 180 / Math.PI;
|
|
7943
8109
|
pathData.push("A", radiusH, radiusV, rotation * r2d, largeArcFlag, sweepFlag, end.x, end.y);
|
|
7944
8110
|
return pathData;
|
|
7945
|
-
},
|
|
8111
|
+
}, // END function describeSVGArc
|
|
7946
8112
|
/**
|
|
7947
8113
|
* Helper function to find second-kind elliptic angles, so that the euclidean distance along the the
|
|
7948
8114
|
* elliptic sector is the same for all.
|
|
@@ -8069,7 +8235,7 @@ exports.VEllipseSector = VEllipseSector;
|
|
|
8069
8235
|
|
|
8070
8236
|
/***/ }),
|
|
8071
8237
|
|
|
8072
|
-
/***/
|
|
8238
|
+
/***/ 30:
|
|
8073
8239
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
8074
8240
|
|
|
8075
8241
|
|
|
@@ -8100,6 +8266,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
8100
8266
|
return extendStatics(d, b);
|
|
8101
8267
|
};
|
|
8102
8268
|
return function (d, b) {
|
|
8269
|
+
if (typeof b !== "function" && b !== null)
|
|
8270
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
8103
8271
|
extendStatics(d, b);
|
|
8104
8272
|
function __() { this.constructor = d; }
|
|
8105
8273
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -8107,8 +8275,8 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
8107
8275
|
})();
|
|
8108
8276
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8109
8277
|
exports.Vector = void 0;
|
|
8110
|
-
var VertTuple_1 = __webpack_require__(
|
|
8111
|
-
var Vertex_1 = __webpack_require__(
|
|
8278
|
+
var VertTuple_1 = __webpack_require__(590);
|
|
8279
|
+
var Vertex_1 = __webpack_require__(787);
|
|
8112
8280
|
/**
|
|
8113
8281
|
* @classdesc A vector (Vertex,Vertex) is a line with a visible direction.<br>
|
|
8114
8282
|
* <br>
|
|
@@ -8259,7 +8427,7 @@ exports.Vector = Vector;
|
|
|
8259
8427
|
|
|
8260
8428
|
/***/ }),
|
|
8261
8429
|
|
|
8262
|
-
/***/
|
|
8430
|
+
/***/ 590:
|
|
8263
8431
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8264
8432
|
|
|
8265
8433
|
|
|
@@ -8279,8 +8447,8 @@ exports.Vector = Vector;
|
|
|
8279
8447
|
*/
|
|
8280
8448
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8281
8449
|
exports.VertTuple = void 0;
|
|
8282
|
-
var Vertex_1 = __webpack_require__(
|
|
8283
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
8450
|
+
var Vertex_1 = __webpack_require__(787);
|
|
8451
|
+
var UIDGenerator_1 = __webpack_require__(938);
|
|
8284
8452
|
/**
|
|
8285
8453
|
* @classdesc An abstract base classes for vertex tuple constructs, like Lines or Vectors.
|
|
8286
8454
|
* @abstract
|
|
@@ -8575,7 +8743,7 @@ exports.VertTuple = VertTuple;
|
|
|
8575
8743
|
|
|
8576
8744
|
/***/ }),
|
|
8577
8745
|
|
|
8578
|
-
/***/
|
|
8746
|
+
/***/ 787:
|
|
8579
8747
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8580
8748
|
|
|
8581
8749
|
|
|
@@ -8612,16 +8780,17 @@ exports.VertTuple = VertTuple;
|
|
|
8612
8780
|
* @modified 2022-11-28 Added the `subXY`, `subX` and `subY` methods to the `Vertex` class.
|
|
8613
8781
|
* @modified 2023-09-29 Downgraded types for the `Vertex.utils.buildArrowHead` function (replacing Vertex params by more generic XYCoords type).
|
|
8614
8782
|
* @modified 2023-09-29 Added the `Vertex.abs()` method as it seems useful.
|
|
8615
|
-
* @
|
|
8783
|
+
* @modified 2024-03-08 Added the optional `precision` param to the `toString` method.
|
|
8784
|
+
* @version 2.9.0
|
|
8616
8785
|
*
|
|
8617
8786
|
* @file Vertex
|
|
8618
8787
|
* @public
|
|
8619
8788
|
**/
|
|
8620
8789
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8621
8790
|
exports.Vertex = void 0;
|
|
8622
|
-
var VertexAttr_1 = __webpack_require__(
|
|
8623
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
8624
|
-
var VertexListeners_1 = __webpack_require__(
|
|
8791
|
+
var VertexAttr_1 = __webpack_require__(476);
|
|
8792
|
+
var UIDGenerator_1 = __webpack_require__(938);
|
|
8793
|
+
var VertexListeners_1 = __webpack_require__(934);
|
|
8625
8794
|
/**
|
|
8626
8795
|
* @classdesc A vertex is a pair of two numbers.<br>
|
|
8627
8796
|
* <br>
|
|
@@ -8799,11 +8968,11 @@ var Vertex = /** @class */ (function () {
|
|
|
8799
8968
|
if (typeof x == "number")
|
|
8800
8969
|
this.x += x;
|
|
8801
8970
|
else
|
|
8802
|
-
throw "Cannot add "
|
|
8971
|
+
throw "Cannot add ".concat(typeof x, " to numeric x component!");
|
|
8803
8972
|
if (typeof y == "number")
|
|
8804
8973
|
this.y += y;
|
|
8805
8974
|
else
|
|
8806
|
-
throw "Cannot add "
|
|
8975
|
+
throw "Cannot add ".concat(typeof y, " to numeric y component!");
|
|
8807
8976
|
}
|
|
8808
8977
|
}
|
|
8809
8978
|
return this;
|
|
@@ -8877,11 +9046,11 @@ var Vertex = /** @class */ (function () {
|
|
|
8877
9046
|
if (typeof x == "number")
|
|
8878
9047
|
this.x -= x;
|
|
8879
9048
|
else
|
|
8880
|
-
throw "Cannot add "
|
|
9049
|
+
throw "Cannot add ".concat(typeof x, " to numeric x component!");
|
|
8881
9050
|
if (typeof y == "number")
|
|
8882
9051
|
this.y -= y;
|
|
8883
9052
|
else
|
|
8884
|
-
throw "Cannot add "
|
|
9053
|
+
throw "Cannot add ".concat(typeof y, " to numeric y component!");
|
|
8885
9054
|
}
|
|
8886
9055
|
}
|
|
8887
9056
|
return this;
|
|
@@ -9154,8 +9323,13 @@ var Vertex = /** @class */ (function () {
|
|
|
9154
9323
|
* @instance
|
|
9155
9324
|
* @memberof Vertex
|
|
9156
9325
|
**/
|
|
9157
|
-
Vertex.prototype.toString = function () {
|
|
9158
|
-
|
|
9326
|
+
Vertex.prototype.toString = function (precision) {
|
|
9327
|
+
if (typeof precision === "undefined") {
|
|
9328
|
+
return "(" + this.x + "," + this.y + ")";
|
|
9329
|
+
}
|
|
9330
|
+
else {
|
|
9331
|
+
return "(" + this.x.toFixed(precision) + "," + this.y.toFixed(precision) + ")";
|
|
9332
|
+
}
|
|
9159
9333
|
};
|
|
9160
9334
|
/**
|
|
9161
9335
|
* This function should invalidate any installed listeners and invalidate this object.
|
|
@@ -9241,7 +9415,7 @@ exports.Vertex = Vertex;
|
|
|
9241
9415
|
|
|
9242
9416
|
/***/ }),
|
|
9243
9417
|
|
|
9244
|
-
/***/
|
|
9418
|
+
/***/ 476:
|
|
9245
9419
|
/***/ ((__unused_webpack_module, exports) => {
|
|
9246
9420
|
|
|
9247
9421
|
|
|
@@ -9253,7 +9427,8 @@ exports.Vertex = Vertex;
|
|
|
9253
9427
|
* @modified 2019-03-20 Added JSDoc tags.
|
|
9254
9428
|
* @modified 2020-02-29 Added the 'selectable' attribute.
|
|
9255
9429
|
* @modified 2020-03-23 Ported to Typescript from JS.
|
|
9256
|
-
* @
|
|
9430
|
+
* @modified 2024-03-10 Fixed some types for Typescript 5 compatibility.
|
|
9431
|
+
* @version 1.1.2
|
|
9257
9432
|
*
|
|
9258
9433
|
* @file VertexAttr
|
|
9259
9434
|
* @public
|
|
@@ -9305,7 +9480,7 @@ exports.VertexAttr = VertexAttr;
|
|
|
9305
9480
|
|
|
9306
9481
|
/***/ }),
|
|
9307
9482
|
|
|
9308
|
-
/***/
|
|
9483
|
+
/***/ 934:
|
|
9309
9484
|
/***/ ((__unused_webpack_module, exports) => {
|
|
9310
9485
|
|
|
9311
9486
|
|
|
@@ -9578,7 +9753,7 @@ exports.VertexListeners = VertexListeners;
|
|
|
9578
9753
|
|
|
9579
9754
|
/***/ }),
|
|
9580
9755
|
|
|
9581
|
-
/***/
|
|
9756
|
+
/***/ 39:
|
|
9582
9757
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9583
9758
|
|
|
9584
9759
|
|
|
@@ -9644,10 +9819,10 @@ exports.VertexListeners = VertexListeners;
|
|
|
9644
9819
|
**/
|
|
9645
9820
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9646
9821
|
exports.drawutils = void 0;
|
|
9647
|
-
var CubicBezierCurve_1 = __webpack_require__(
|
|
9648
|
-
var Vertex_1 = __webpack_require__(
|
|
9649
|
-
var drawutilssvg_1 = __webpack_require__(
|
|
9650
|
-
var Vector_1 = __webpack_require__(
|
|
9822
|
+
var CubicBezierCurve_1 = __webpack_require__(973);
|
|
9823
|
+
var Vertex_1 = __webpack_require__(787);
|
|
9824
|
+
var drawutilssvg_1 = __webpack_require__(378);
|
|
9825
|
+
var Vector_1 = __webpack_require__(30);
|
|
9651
9826
|
// Todo: rename this class to Drawutils?
|
|
9652
9827
|
/**
|
|
9653
9828
|
* @classdesc A wrapper class for basic drawing operations.
|
|
@@ -10619,7 +10794,7 @@ var drawutils = /** @class */ (function () {
|
|
|
10619
10794
|
(options.fontFamily
|
|
10620
10795
|
? options.fontFamily.indexOf(" ") === -1
|
|
10621
10796
|
? options.fontFamily
|
|
10622
|
-
: "\""
|
|
10797
|
+
: "\"".concat(options.fontFamily, "\"")
|
|
10623
10798
|
: "Arial");
|
|
10624
10799
|
}
|
|
10625
10800
|
if (options.textAlign) {
|
|
@@ -10742,7 +10917,7 @@ exports.drawutils = drawutils;
|
|
|
10742
10917
|
|
|
10743
10918
|
/***/ }),
|
|
10744
10919
|
|
|
10745
|
-
/***/
|
|
10920
|
+
/***/ 264:
|
|
10746
10921
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
10747
10922
|
|
|
10748
10923
|
|
|
@@ -10768,7 +10943,7 @@ exports.drawutils = drawutils;
|
|
|
10768
10943
|
**/
|
|
10769
10944
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
10770
10945
|
exports.drawutilsgl = void 0;
|
|
10771
|
-
var Vertex_1 = __webpack_require__(
|
|
10946
|
+
var Vertex_1 = __webpack_require__(787);
|
|
10772
10947
|
/**
|
|
10773
10948
|
* @classdesc A wrapper class for basic drawing operations. This is the WebGL
|
|
10774
10949
|
* implementation whih sould work with shaders.
|
|
@@ -11541,7 +11716,7 @@ var GLU = /** @class */ (function () {
|
|
|
11541
11716
|
|
|
11542
11717
|
/***/ }),
|
|
11543
11718
|
|
|
11544
|
-
/***/
|
|
11719
|
+
/***/ 378:
|
|
11545
11720
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11546
11721
|
|
|
11547
11722
|
|
|
@@ -11591,16 +11766,17 @@ var GLU = /** @class */ (function () {
|
|
|
11591
11766
|
* @modified 2023-09-29 Added the `arrowHead(...)` function to the 'DrawLib.arrow()` interface.
|
|
11592
11767
|
* @modified 2023-09-29 Added the `cubicBezierArrow(...)` function to the 'DrawLib.arrow()` interface.
|
|
11593
11768
|
* @modified 2023-10-04 Adding `strokeOptions` param to these draw function: line, arrow, cubicBezierArrow, cubicBezier, cubicBezierPath, circle, circleArc, ellipse, square, rect, polygon, polyline.
|
|
11594
|
-
*
|
|
11595
|
-
* @
|
|
11769
|
+
* @modified 2024-01-30 Fixing an issue with immutable style sets; changes to the global draw config did not reflect here (do now).
|
|
11770
|
+
* @modified 2024-03-10 Fixing some types for Typescript 5 compatibility.
|
|
11771
|
+
* @version 1.6.9
|
|
11596
11772
|
**/
|
|
11597
11773
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
11598
11774
|
exports.drawutilssvg = void 0;
|
|
11599
|
-
var CircleSector_1 = __webpack_require__(
|
|
11600
|
-
var CubicBezierCurve_1 = __webpack_require__(
|
|
11601
|
-
var Vertex_1 = __webpack_require__(
|
|
11602
|
-
var UIDGenerator_1 = __webpack_require__(
|
|
11603
|
-
var Vector_1 = __webpack_require__(
|
|
11775
|
+
var CircleSector_1 = __webpack_require__(135);
|
|
11776
|
+
var CubicBezierCurve_1 = __webpack_require__(973);
|
|
11777
|
+
var Vertex_1 = __webpack_require__(787);
|
|
11778
|
+
var UIDGenerator_1 = __webpack_require__(938);
|
|
11779
|
+
var Vector_1 = __webpack_require__(30);
|
|
11604
11780
|
var RAD_TO_DEG = 180 / Math.PI;
|
|
11605
11781
|
/**
|
|
11606
11782
|
* @classdesc A helper class for basic SVG drawing operations. This class should
|
|
@@ -11612,6 +11788,10 @@ var RAD_TO_DEG = 180 / Math.PI;
|
|
|
11612
11788
|
* @requires XYCoords
|
|
11613
11789
|
*/
|
|
11614
11790
|
var drawutilssvg = /** @class */ (function () {
|
|
11791
|
+
/**
|
|
11792
|
+
* Passed from primary to secondary instance.
|
|
11793
|
+
*/
|
|
11794
|
+
//private nodeStyle: SVGStyleElement;
|
|
11615
11795
|
/**
|
|
11616
11796
|
* The constructor.
|
|
11617
11797
|
*
|
|
@@ -11626,12 +11806,13 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11626
11806
|
* @param {boolean=} isSecondary - (optional) Indicates if this is the primary or secondary instance. Only primary instances manage child nodes.
|
|
11627
11807
|
* @param {SVGGElement=} gNode - (optional) Primary and seconday instances share the same <g> node.
|
|
11628
11808
|
**/
|
|
11629
|
-
function drawutilssvg(svgNode, offset, scale, canvasSize, fillShapes, drawConfig, isSecondary, gNode, bufferGNode, nodeDefs, bufferNodeDefs) {
|
|
11809
|
+
function drawutilssvg(svgNode, offset, scale, canvasSize, fillShapes, drawConfig, isSecondary, gNode, bufferGNode, nodeDefs, bufferNodeDefs, nodeStyle) {
|
|
11630
11810
|
this.svgNode = svgNode;
|
|
11631
11811
|
this.offset = new Vertex_1.Vertex(0, 0).set(offset);
|
|
11632
11812
|
this.scale = new Vertex_1.Vertex(1, 1).set(scale);
|
|
11633
11813
|
this.fillShapes = fillShapes;
|
|
11634
11814
|
this.isSecondary = Boolean(isSecondary);
|
|
11815
|
+
this.drawConfig = drawConfig;
|
|
11635
11816
|
this.drawlibConfiguration = {};
|
|
11636
11817
|
this.cache = new Map();
|
|
11637
11818
|
this.setSize(canvasSize);
|
|
@@ -11643,6 +11824,9 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11643
11824
|
this.bufferGNode = bufferGNode;
|
|
11644
11825
|
this.nodeDefs = nodeDefs;
|
|
11645
11826
|
this.bufferedNodeDefs = bufferNodeDefs;
|
|
11827
|
+
if (nodeStyle) {
|
|
11828
|
+
this.nodeStyle = nodeStyle;
|
|
11829
|
+
}
|
|
11646
11830
|
}
|
|
11647
11831
|
else {
|
|
11648
11832
|
this.addStyleDefs(drawConfig);
|
|
@@ -11661,11 +11845,19 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11661
11845
|
drawutilssvg.prototype.addStyleDefs = function (drawConfig) {
|
|
11662
11846
|
this.nodeStyle = this.createSVGNode("style");
|
|
11663
11847
|
this.svgNode.appendChild(this.nodeStyle);
|
|
11848
|
+
this.rebuildStyleDefs(drawConfig);
|
|
11849
|
+
};
|
|
11850
|
+
/**
|
|
11851
|
+
* This method is required to re-define the global style defs. It is needed
|
|
11852
|
+
* if any value in the DrawConfig changed in the meantime.
|
|
11853
|
+
* @param drawConfig
|
|
11854
|
+
*/
|
|
11855
|
+
drawutilssvg.prototype.rebuildStyleDefs = function (drawConfig) {
|
|
11664
11856
|
// Which default styles to add? -> All from the DrawConfig.
|
|
11665
11857
|
// Compare with DrawConfig interface
|
|
11666
11858
|
var keys = {
|
|
11667
|
-
|
|
11668
|
-
"bezierPath": "BezierPath",
|
|
11859
|
+
"bezier": "CubicBezierCurve",
|
|
11860
|
+
//"bezierPath": "BezierPath", // TODO: is this correct?
|
|
11669
11861
|
"polygon": "Polygon",
|
|
11670
11862
|
"triangle": "Triangle",
|
|
11671
11863
|
"ellipse": "Ellipse",
|
|
@@ -11680,14 +11872,15 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11680
11872
|
};
|
|
11681
11873
|
// Question: why isn't this working if the svgNode is created dynamically? (nodeStyle.sheet is null)
|
|
11682
11874
|
var rules = [];
|
|
11875
|
+
// console.log("drawConfig", drawConfig);
|
|
11683
11876
|
for (var k in keys) {
|
|
11684
11877
|
var className = keys[k];
|
|
11685
11878
|
var drawSettings = drawConfig[k];
|
|
11686
11879
|
if (drawSettings) {
|
|
11687
|
-
rules.push("."
|
|
11880
|
+
rules.push(".".concat(className, " { fill : none; stroke: ").concat(drawSettings.color, "; stroke-width: ").concat(drawSettings.lineWidth, "px }"));
|
|
11688
11881
|
}
|
|
11689
11882
|
else {
|
|
11690
|
-
console.warn("Warning: your draw config is missing the key '"
|
|
11883
|
+
console.warn("Warning: your draw config is missing the key '".concat(k, "' which is required."));
|
|
11691
11884
|
}
|
|
11692
11885
|
}
|
|
11693
11886
|
this.nodeStyle.innerHTML = rules.join("\n");
|
|
@@ -11777,7 +11970,8 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11777
11970
|
node = this.createSVGNode(nodeName);
|
|
11778
11971
|
}
|
|
11779
11972
|
if (this.drawlibConfiguration.blendMode) {
|
|
11780
|
-
node.style["mix-blend-mode"] = this.drawlibConfiguration.blendMode;
|
|
11973
|
+
// node.style["mix-blend-mode"] = this.drawlibConfiguration.blendMode;
|
|
11974
|
+
node.style["mix-blend-mode"](this.drawlibConfiguration.blendMode);
|
|
11781
11975
|
}
|
|
11782
11976
|
// if (this.lineDashEnabled && this.lineDash && this.lineDash.length > 0 && drawutilssvg.nodeSupportsLineDash(nodeName)) {
|
|
11783
11977
|
// node.setAttribute("stroke-dasharray", this.lineDash.join(" "));
|
|
@@ -11841,7 +12035,7 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11841
12035
|
*/
|
|
11842
12036
|
drawutilssvg.prototype._addCSSClasses = function (node, className) {
|
|
11843
12037
|
if (this.curClassName) {
|
|
11844
|
-
node.setAttribute("class", className
|
|
12038
|
+
node.setAttribute("class", "".concat(className, " ").concat(this.curClassName));
|
|
11845
12039
|
}
|
|
11846
12040
|
else {
|
|
11847
12041
|
node.setAttribute("class", className);
|
|
@@ -11851,9 +12045,9 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11851
12045
|
this._addCSSClasses(node, className);
|
|
11852
12046
|
node.setAttribute("fill", fillMode && color ? color : "none");
|
|
11853
12047
|
node.setAttribute("stroke", fillMode ? "none" : color || "none");
|
|
11854
|
-
node.setAttribute("stroke-width", ""
|
|
12048
|
+
node.setAttribute("stroke-width", "".concat(lineWidth || 1));
|
|
11855
12049
|
if (this.curId) {
|
|
11856
|
-
node.setAttribute("id", ""
|
|
12050
|
+
node.setAttribute("id", "".concat(this.curId)); // Maybe React-style 'key' would be better?
|
|
11857
12051
|
}
|
|
11858
12052
|
this.applyStrokeOpts(node, strokeOptions);
|
|
11859
12053
|
return node;
|
|
@@ -11868,18 +12062,18 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11868
12062
|
*/
|
|
11869
12063
|
drawutilssvg.prototype.setSize = function (canvasSize) {
|
|
11870
12064
|
this.canvasSize = canvasSize;
|
|
11871
|
-
this.svgNode.setAttribute("viewBox", "0 0 "
|
|
11872
|
-
this.svgNode.setAttribute("width", ""
|
|
11873
|
-
this.svgNode.setAttribute("height", ""
|
|
12065
|
+
this.svgNode.setAttribute("viewBox", "0 0 ".concat(this.canvasSize.width, " ").concat(this.canvasSize.height));
|
|
12066
|
+
this.svgNode.setAttribute("width", "".concat(this.canvasSize.width));
|
|
12067
|
+
this.svgNode.setAttribute("height", "".concat(this.canvasSize.height));
|
|
11874
12068
|
};
|
|
11875
12069
|
/**
|
|
11876
12070
|
* Creates a 'shallow' (non deep) copy of this instance. This implies
|
|
11877
12071
|
* that under the hood the same gl context and gl program will be used.
|
|
11878
12072
|
*/
|
|
11879
12073
|
drawutilssvg.prototype.copyInstance = function (fillShapes) {
|
|
11880
|
-
var copy = new drawutilssvg(this.svgNode, this.offset, this.scale, this.canvasSize, fillShapes, null, // no DrawConfig – this will work as long as `isSecondary===true`
|
|
12074
|
+
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`
|
|
11881
12075
|
true, // isSecondary
|
|
11882
|
-
this.gNode, this.bufferGNode, this.nodeDefs, this.bufferedNodeDefs);
|
|
12076
|
+
this.gNode, this.bufferGNode, this.nodeDefs, this.bufferedNodeDefs, this.nodeStyle);
|
|
11883
12077
|
return copy;
|
|
11884
12078
|
};
|
|
11885
12079
|
/**
|
|
@@ -11892,20 +12086,6 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11892
12086
|
drawutilssvg.prototype.setConfiguration = function (configuration) {
|
|
11893
12087
|
this.drawlibConfiguration = configuration;
|
|
11894
12088
|
};
|
|
11895
|
-
// /**
|
|
11896
|
-
// * Set or clear the line-dash configuration. Pass `null` for un-dashed lines.
|
|
11897
|
-
// *
|
|
11898
|
-
// * See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray
|
|
11899
|
-
// * and https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
|
|
11900
|
-
// * for how line dashes work.
|
|
11901
|
-
// *
|
|
11902
|
-
// * @method
|
|
11903
|
-
// * @param {Array<number> lineDashes - The line-dash array configuration.
|
|
11904
|
-
// * @returns {void}
|
|
11905
|
-
// */
|
|
11906
|
-
// setLineDash(lineDashes: Array<number>) {
|
|
11907
|
-
// this.lineDash = lineDashes;
|
|
11908
|
-
// }
|
|
11909
12089
|
/**
|
|
11910
12090
|
* This method shouled be called each time the currently drawn `Drawable` changes.
|
|
11911
12091
|
* It is used by some libraries for identifying elemente on re-renders.
|
|
@@ -11965,6 +12145,7 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11965
12145
|
* @instance
|
|
11966
12146
|
**/
|
|
11967
12147
|
drawutilssvg.prototype.endDrawCycle = function (renderTime) {
|
|
12148
|
+
this.rebuildStyleDefs(this.drawConfig);
|
|
11968
12149
|
if (!this.isSecondary) {
|
|
11969
12150
|
// All elements are drawn into the buffer; they are NOT yet visible, not did the browser perform any
|
|
11970
12151
|
// layout updates.
|
|
@@ -11997,7 +12178,7 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
11997
12178
|
})
|
|
11998
12179
|
.join(" "));
|
|
11999
12180
|
if (strokeOptions.dashOffset) {
|
|
12000
|
-
node.setAttribute("stroke-dashoffset", ""
|
|
12181
|
+
node.setAttribute("stroke-dashoffset", "".concat(strokeOptions.dashOffset * this.scale.x));
|
|
12001
12182
|
}
|
|
12002
12183
|
}
|
|
12003
12184
|
};
|
|
@@ -12133,13 +12314,13 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12133
12314
|
if (image.naturalWidth) {
|
|
12134
12315
|
var ratioX = size.x / image.naturalWidth;
|
|
12135
12316
|
var ratioY = size.y / image.naturalHeight;
|
|
12136
|
-
node.setAttribute("width", ""
|
|
12137
|
-
node.setAttribute("height", ""
|
|
12317
|
+
node.setAttribute("width", "".concat(image.naturalWidth * _this.scale.x));
|
|
12318
|
+
node.setAttribute("height", "".concat(image.naturalHeight * _this.scale.y));
|
|
12138
12319
|
node.setAttribute("display", null); // Dislay when loaded
|
|
12139
12320
|
// if (alpha) {
|
|
12140
|
-
node.setAttribute("opacity", ""
|
|
12321
|
+
node.setAttribute("opacity", "".concat(alpha));
|
|
12141
12322
|
// }
|
|
12142
|
-
node.setAttribute("transform", "translate("
|
|
12323
|
+
node.setAttribute("transform", "translate(".concat(_this._x(position.x), " ").concat(_this._y(position.y), ") scale(").concat(ratioX, " ").concat(ratioY, ")"));
|
|
12143
12324
|
}
|
|
12144
12325
|
};
|
|
12145
12326
|
image.addEventListener("load", function (event) {
|
|
@@ -12147,8 +12328,8 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12147
12328
|
});
|
|
12148
12329
|
// Safari has a transform-origin bug.
|
|
12149
12330
|
// Use x=0, y=0 and translate/scale instead (see above)
|
|
12150
|
-
node.setAttribute("x", ""
|
|
12151
|
-
node.setAttribute("y", ""
|
|
12331
|
+
node.setAttribute("x", "".concat(0));
|
|
12332
|
+
node.setAttribute("y", "".concat(0));
|
|
12152
12333
|
node.setAttribute("display", "none"); // Hide before loaded
|
|
12153
12334
|
setImageSize(image);
|
|
12154
12335
|
node.setAttribute("href", image.src);
|
|
@@ -12189,36 +12370,36 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12189
12370
|
// </image>
|
|
12190
12371
|
// ...
|
|
12191
12372
|
var clipPathNode = this.makeNode("clipPath");
|
|
12192
|
-
var clipPathId = "clippath_"
|
|
12373
|
+
var clipPathId = "clippath_".concat(UIDGenerator_1.UIDGenerator.next()); // TODO: use a better UUID generator here?
|
|
12193
12374
|
clipPathNode.setAttribute("id", clipPathId);
|
|
12194
12375
|
var gNode = this.makeNode("g");
|
|
12195
12376
|
var imageNode = this.makeNode("image");
|
|
12196
|
-
imageNode.setAttribute("x", ""
|
|
12197
|
-
imageNode.setAttribute("y", ""
|
|
12198
|
-
imageNode.setAttribute("width", ""
|
|
12199
|
-
imageNode.setAttribute("height", ""
|
|
12377
|
+
imageNode.setAttribute("x", "".concat(this._x(rotatedScalingOrigin.x)));
|
|
12378
|
+
imageNode.setAttribute("y", "".concat(this._y(rotatedScalingOrigin.y)));
|
|
12379
|
+
imageNode.setAttribute("width", "".concat(textureSize.width));
|
|
12380
|
+
imageNode.setAttribute("height", "".concat(textureSize.height));
|
|
12200
12381
|
imageNode.setAttribute("href", textureImage.src);
|
|
12201
12382
|
// imageNode.setAttribute("opacity", "0.5");
|
|
12202
12383
|
// SVG rotations in degrees
|
|
12203
|
-
imageNode.setAttribute("transform", "rotate("
|
|
12384
|
+
imageNode.setAttribute("transform", "rotate(".concat(rotation * RAD_TO_DEG, ", ").concat(this._x(rotatedScalingOrigin.x), ", ").concat(this._y(rotatedScalingOrigin.y), ")"));
|
|
12204
12385
|
var pathNode = this.makeNode("path");
|
|
12205
12386
|
var pathData = [];
|
|
12206
12387
|
if (polygon.vertices.length > 0) {
|
|
12207
12388
|
var self_1 = this;
|
|
12208
|
-
pathData.push("M", ""
|
|
12389
|
+
pathData.push("M", "".concat(this._x(polygon.vertices[0].x)), "".concat(this._y(polygon.vertices[0].y)));
|
|
12209
12390
|
for (var i = 1; i < polygon.vertices.length; i++) {
|
|
12210
|
-
pathData.push("L", ""
|
|
12391
|
+
pathData.push("L", "".concat(this._x(polygon.vertices[i].x)), "".concat(this._y(polygon.vertices[i].y)));
|
|
12211
12392
|
}
|
|
12212
12393
|
}
|
|
12213
12394
|
pathNode.setAttribute("d", pathData.join(" "));
|
|
12214
12395
|
clipPathNode.appendChild(pathNode);
|
|
12215
12396
|
this.bufferedNodeDefs.appendChild(clipPathNode);
|
|
12216
12397
|
gNode.appendChild(imageNode);
|
|
12217
|
-
gNode.setAttribute("transform-origin", this._x(rotatedScalingOrigin.x)
|
|
12218
|
-
gNode.setAttribute("transform", "scale("
|
|
12398
|
+
gNode.setAttribute("transform-origin", "".concat(this._x(rotatedScalingOrigin.x), " ").concat(this._y(rotatedScalingOrigin.y)));
|
|
12399
|
+
gNode.setAttribute("transform", "scale(".concat(this.scale.x, ", ").concat(this.scale.y, ")"));
|
|
12219
12400
|
var clipNode = this.makeNode("g");
|
|
12220
12401
|
clipNode.appendChild(gNode);
|
|
12221
|
-
clipNode.setAttribute("clip-path", "url(#"
|
|
12402
|
+
clipNode.setAttribute("clip-path", "url(#".concat(clipPathId, ")"));
|
|
12222
12403
|
// TODO: check if the image class is correct here or if we should use a 'clippedImage' class here
|
|
12223
12404
|
this._bindFillDraw(clipNode, "image", null, null); // No color, no lineWidth
|
|
12224
12405
|
return clipNode;
|
|
@@ -12323,10 +12504,10 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12323
12504
|
*/
|
|
12324
12505
|
drawutilssvg.prototype.dot = function (p, color) {
|
|
12325
12506
|
var node = this.makeNode("line");
|
|
12326
|
-
node.setAttribute("x1", ""
|
|
12327
|
-
node.setAttribute("y1", ""
|
|
12328
|
-
node.setAttribute("x2", ""
|
|
12329
|
-
node.setAttribute("y2", ""
|
|
12507
|
+
node.setAttribute("x1", "".concat(this._x(p.x)));
|
|
12508
|
+
node.setAttribute("y1", "".concat(this._y(p.y)));
|
|
12509
|
+
node.setAttribute("x2", "".concat(this._x(p.x)));
|
|
12510
|
+
node.setAttribute("y2", "".concat(this._y(p.y)));
|
|
12330
12511
|
return this._bindFillDraw(node, "dot", color, 1);
|
|
12331
12512
|
};
|
|
12332
12513
|
/**
|
|
@@ -12342,9 +12523,9 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12342
12523
|
drawutilssvg.prototype.point = function (p, color) {
|
|
12343
12524
|
var radius = 3;
|
|
12344
12525
|
var node = this.makeNode("circle");
|
|
12345
|
-
node.setAttribute("cx", ""
|
|
12346
|
-
node.setAttribute("cy", ""
|
|
12347
|
-
node.setAttribute("r", ""
|
|
12526
|
+
node.setAttribute("cx", "".concat(this._x(p.x)));
|
|
12527
|
+
node.setAttribute("cy", "".concat(this._y(p.y)));
|
|
12528
|
+
node.setAttribute("r", "".concat(radius));
|
|
12348
12529
|
return this._bindFillDraw(node, "point", color, 1);
|
|
12349
12530
|
};
|
|
12350
12531
|
/**
|
|
@@ -12367,9 +12548,9 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12367
12548
|
// Todo: draw ellipse when scalex!=scaley
|
|
12368
12549
|
var node = this.makeNode("circle");
|
|
12369
12550
|
this.applyStrokeOpts(node, strokeOptions);
|
|
12370
|
-
node.setAttribute("cx", ""
|
|
12371
|
-
node.setAttribute("cy", ""
|
|
12372
|
-
node.setAttribute("r", ""
|
|
12551
|
+
node.setAttribute("cx", "".concat(this._x(center.x)));
|
|
12552
|
+
node.setAttribute("cy", "".concat(this._y(center.y)));
|
|
12553
|
+
node.setAttribute("r", "".concat(radius * this.scale.x)); // y?
|
|
12373
12554
|
return this._bindFillDraw(node, "circle", color, lineWidth || 1);
|
|
12374
12555
|
};
|
|
12375
12556
|
/**
|
|
@@ -12417,12 +12598,12 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12417
12598
|
}
|
|
12418
12599
|
var node = this.makeNode("ellipse");
|
|
12419
12600
|
this.applyStrokeOpts(node, strokeOptions);
|
|
12420
|
-
node.setAttribute("cx", ""
|
|
12421
|
-
node.setAttribute("cy", ""
|
|
12422
|
-
node.setAttribute("rx", ""
|
|
12423
|
-
node.setAttribute("ry", ""
|
|
12601
|
+
node.setAttribute("cx", "".concat(this._x(center.x)));
|
|
12602
|
+
node.setAttribute("cy", "".concat(this._y(center.y)));
|
|
12603
|
+
node.setAttribute("rx", "".concat(radiusX * this.scale.x));
|
|
12604
|
+
node.setAttribute("ry", "".concat(radiusY * this.scale.y));
|
|
12424
12605
|
// node.setAttribute( 'style', `transform: rotate(${rotation} ${center.x} ${center.y})` );
|
|
12425
|
-
node.setAttribute("transform", "rotate("
|
|
12606
|
+
node.setAttribute("transform", "rotate(".concat((rotation * 180) / Math.PI, " ").concat(this._x(center.x), " ").concat(this._y(center.y), ")"));
|
|
12426
12607
|
return this._bindFillDraw(node, "ellipse", color, lineWidth || 1);
|
|
12427
12608
|
};
|
|
12428
12609
|
/**
|
|
@@ -12444,10 +12625,10 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12444
12625
|
drawutilssvg.prototype.square = function (center, size, color, lineWidth, strokeOptions) {
|
|
12445
12626
|
var node = this.makeNode("rectangle");
|
|
12446
12627
|
this.applyStrokeOpts(node, strokeOptions);
|
|
12447
|
-
node.setAttribute("x", ""
|
|
12448
|
-
node.setAttribute("y", ""
|
|
12449
|
-
node.setAttribute("width", ""
|
|
12450
|
-
node.setAttribute("height", ""
|
|
12628
|
+
node.setAttribute("x", "".concat(this._x(center.x - size / 2.0)));
|
|
12629
|
+
node.setAttribute("y", "".concat(this._y(center.y - size / 2.0)));
|
|
12630
|
+
node.setAttribute("width", "".concat(size * this.scale.x));
|
|
12631
|
+
node.setAttribute("height", "".concat(size * this.scale.y));
|
|
12451
12632
|
return this._bindFillDraw(node, "square", color, lineWidth || 1);
|
|
12452
12633
|
};
|
|
12453
12634
|
/**
|
|
@@ -12467,10 +12648,10 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12467
12648
|
drawutilssvg.prototype.rect = function (position, width, height, color, lineWidth, strokeOptions) {
|
|
12468
12649
|
var node = this.makeNode("rect");
|
|
12469
12650
|
this.applyStrokeOpts(node, strokeOptions);
|
|
12470
|
-
node.setAttribute("x", ""
|
|
12471
|
-
node.setAttribute("y", ""
|
|
12472
|
-
node.setAttribute("width", ""
|
|
12473
|
-
node.setAttribute("height", ""
|
|
12651
|
+
node.setAttribute("x", "".concat(this._x(position.x)));
|
|
12652
|
+
node.setAttribute("y", "".concat(this._y(position.y)));
|
|
12653
|
+
node.setAttribute("width", "".concat(width * this.scale.x));
|
|
12654
|
+
node.setAttribute("height", "".concat(height * this.scale.y));
|
|
12474
12655
|
return this._bindFillDraw(node, "rect", color, lineWidth || 1);
|
|
12475
12656
|
};
|
|
12476
12657
|
/**
|
|
@@ -12588,10 +12769,10 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12588
12769
|
*/
|
|
12589
12770
|
drawutilssvg.prototype.squareHandle = function (center, size, color) {
|
|
12590
12771
|
var node = this.makeNode("rect");
|
|
12591
|
-
node.setAttribute("x", ""
|
|
12592
|
-
node.setAttribute("y", ""
|
|
12593
|
-
node.setAttribute("width", ""
|
|
12594
|
-
node.setAttribute("height", ""
|
|
12772
|
+
node.setAttribute("x", "".concat(this._x(center.x) - size / 2.0));
|
|
12773
|
+
node.setAttribute("y", "".concat(this._y(center.y) - size / 2.0));
|
|
12774
|
+
node.setAttribute("width", "".concat(size));
|
|
12775
|
+
node.setAttribute("height", "".concat(size));
|
|
12595
12776
|
return this._bindFillDraw(node, "squareHandle", color, 1);
|
|
12596
12777
|
};
|
|
12597
12778
|
/**
|
|
@@ -12612,9 +12793,9 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12612
12793
|
drawutilssvg.prototype.circleHandle = function (center, radius, color) {
|
|
12613
12794
|
radius = radius || 3;
|
|
12614
12795
|
var node = this.makeNode("circle");
|
|
12615
|
-
node.setAttribute("cx", ""
|
|
12616
|
-
node.setAttribute("cy", ""
|
|
12617
|
-
node.setAttribute("r", ""
|
|
12796
|
+
node.setAttribute("cx", "".concat(this._x(center.x)));
|
|
12797
|
+
node.setAttribute("cy", "".concat(this._y(center.y)));
|
|
12798
|
+
node.setAttribute("r", "".concat(radius));
|
|
12618
12799
|
return this._bindFillDraw(node, "circleHandle", color, 1);
|
|
12619
12800
|
};
|
|
12620
12801
|
/**
|
|
@@ -12761,22 +12942,22 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12761
12942
|
: options.textAlign === "right" || options.textAlign === "end"
|
|
12762
12943
|
? "end"
|
|
12763
12944
|
: "start";
|
|
12764
|
-
var transformOrigin = this._x(x)
|
|
12765
|
-
var translate = "translate("
|
|
12945
|
+
var transformOrigin = "".concat(this._x(x), "px ").concat(this._y(y), "px");
|
|
12946
|
+
var translate = "translate(".concat(this._x(x), " ").concat(this._y(y) + lineHeight / 2, ")");
|
|
12766
12947
|
// Safari has a transform-origin/rotation bug.
|
|
12767
12948
|
// It's essential to use rotate(r,x,y) here. "rotate(r)"" with transform-origin(x,y) won't do the job.
|
|
12768
12949
|
// And rotate and translate cannot be used is combination on a text object.
|
|
12769
12950
|
// So wrap the text inside a <g>, translate the <g>, and rotate the text inside.
|
|
12770
|
-
var rotate = options.rotation ? "rotate("
|
|
12951
|
+
var rotate = options.rotation ? "rotate(".concat(options.rotation * RAD_TO_DEG, " 0 0)") : "";
|
|
12771
12952
|
var node = this.makeNode("g");
|
|
12772
12953
|
var curId = this.curId;
|
|
12773
12954
|
this.curId = curId + "_text";
|
|
12774
12955
|
var textNode = this.makeNode("text");
|
|
12775
12956
|
node.appendChild(textNode);
|
|
12776
12957
|
textNode.setAttribute("font-family", (_c = options.fontFamily) !== null && _c !== void 0 ? _c : ""); // May be undefined
|
|
12777
|
-
textNode.setAttribute("font-size", options.fontSize ? ""
|
|
12778
|
-
textNode.setAttribute("font-style", options.fontStyle ? ""
|
|
12779
|
-
textNode.setAttribute("font-weight", options.fontWeight ? ""
|
|
12958
|
+
textNode.setAttribute("font-size", options.fontSize ? "".concat(options.fontSize * this.scale.x) : "");
|
|
12959
|
+
textNode.setAttribute("font-style", options.fontStyle ? "".concat(options.fontStyle) : "");
|
|
12960
|
+
textNode.setAttribute("font-weight", options.fontWeight ? "".concat(options.fontWeight) : "");
|
|
12780
12961
|
textNode.setAttribute("text-anchor", textAlign);
|
|
12781
12962
|
textNode.setAttribute("transform-origin", "0 0");
|
|
12782
12963
|
textNode.setAttribute("transform", rotate);
|
|
@@ -12803,7 +12984,7 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12803
12984
|
drawutilssvg.prototype.label = function (text, x, y, rotation, color) {
|
|
12804
12985
|
var node = this.makeNode("text");
|
|
12805
12986
|
// For some strange reason SVG rotation transforms use degrees instead of radians
|
|
12806
|
-
node.setAttribute("transform", "translate("
|
|
12987
|
+
node.setAttribute("transform", "translate(".concat(x, ",").concat(y, "), rotate(").concat(((rotation || 0) / Math.PI) * 180, ")"));
|
|
12807
12988
|
node.setAttribute("font-family", "Arial");
|
|
12808
12989
|
node.setAttribute("font-size", "9pt");
|
|
12809
12990
|
node.setAttribute("font-style", "normal");
|
|
@@ -12860,8 +13041,8 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
12860
13041
|
// Note that the background does not scale with the zoom level (always covers full element)
|
|
12861
13042
|
node.setAttribute("x", "0");
|
|
12862
13043
|
node.setAttribute("y", "0");
|
|
12863
|
-
node.setAttribute("width", ""
|
|
12864
|
-
node.setAttribute("height", ""
|
|
13044
|
+
node.setAttribute("width", "".concat(this.canvasSize.width));
|
|
13045
|
+
node.setAttribute("height", "".concat(this.canvasSize.height));
|
|
12865
13046
|
// Bind this special element into the document
|
|
12866
13047
|
this._bindFillDraw(node, this.curId, null, null);
|
|
12867
13048
|
node.setAttribute("fill", typeof color === "undefined" ? "none" : color);
|
|
@@ -13092,10 +13273,10 @@ var drawutilssvg = /** @class */ (function () {
|
|
|
13092
13273
|
*/
|
|
13093
13274
|
drawutilssvg.prototype.makeLineNode = function (zA, zB, color, lineWidth, strokeOptions, classNameOverride) {
|
|
13094
13275
|
var line = this.makeNode("line");
|
|
13095
|
-
line.setAttribute("x1", ""
|
|
13096
|
-
line.setAttribute("y1", ""
|
|
13097
|
-
line.setAttribute("x2", ""
|
|
13098
|
-
line.setAttribute("y2", ""
|
|
13276
|
+
line.setAttribute("x1", "".concat(this._x(zA.x)));
|
|
13277
|
+
line.setAttribute("y1", "".concat(this._y(zA.y)));
|
|
13278
|
+
line.setAttribute("x2", "".concat(this._x(zB.x)));
|
|
13279
|
+
line.setAttribute("y2", "".concat(this._y(zB.y)));
|
|
13099
13280
|
this._configureNode(line, classNameOverride !== null && classNameOverride !== void 0 ? classNameOverride : "line", this.fillShapes, color, lineWidth || 1, strokeOptions);
|
|
13100
13281
|
return line;
|
|
13101
13282
|
};
|
|
@@ -13205,7 +13386,7 @@ exports.drawutilssvg = drawutilssvg;
|
|
|
13205
13386
|
|
|
13206
13387
|
/***/ }),
|
|
13207
13388
|
|
|
13208
|
-
/***/
|
|
13389
|
+
/***/ 328:
|
|
13209
13390
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13210
13391
|
|
|
13211
13392
|
|
|
@@ -13217,8 +13398,8 @@ exports.drawutilssvg = drawutilssvg;
|
|
|
13217
13398
|
**/
|
|
13218
13399
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13219
13400
|
exports.geomutils = void 0;
|
|
13220
|
-
var Line_1 = __webpack_require__(
|
|
13221
|
-
var Triangle_1 = __webpack_require__(
|
|
13401
|
+
var Line_1 = __webpack_require__(939);
|
|
13402
|
+
var Triangle_1 = __webpack_require__(737);
|
|
13222
13403
|
/**
|
|
13223
13404
|
* A collection of usefull geometry utilities.
|
|
13224
13405
|
*
|
|
@@ -13249,14 +13430,14 @@ exports.geomutils = {
|
|
|
13249
13430
|
if (insideAngle < 0)
|
|
13250
13431
|
insideAngle = 2 * Math.PI + insideAngle;
|
|
13251
13432
|
if (!clockwise)
|
|
13252
|
-
insideAngle = (2 * Math.PI - insideAngle) *
|
|
13433
|
+
insideAngle = (2 * Math.PI - insideAngle) * -1;
|
|
13253
13434
|
// Scale the rotated lines to the max leg length (looks better)
|
|
13254
13435
|
var lineLength = Math.max(lineAB.length(), lineAC.length());
|
|
13255
13436
|
var scaleFactor = lineLength / lineAB.length();
|
|
13256
13437
|
var result = [];
|
|
13257
13438
|
for (var i = 1; i < n; i++) {
|
|
13258
13439
|
// Compute the i-th inner sector line
|
|
13259
|
-
result.push(new Line_1.Line(pA, pB.clone().rotate(
|
|
13440
|
+
result.push(new Line_1.Line(pA, pB.clone().rotate(-i * (insideAngle / n), pA)).scale(scaleFactor));
|
|
13260
13441
|
}
|
|
13261
13442
|
return result;
|
|
13262
13443
|
},
|
|
@@ -13299,8 +13480,9 @@ exports.geomutils = {
|
|
|
13299
13480
|
/******/ // The require function
|
|
13300
13481
|
/******/ function __webpack_require__(moduleId) {
|
|
13301
13482
|
/******/ // Check if module is in cache
|
|
13302
|
-
/******/
|
|
13303
|
-
/******/
|
|
13483
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
13484
|
+
/******/ if (cachedModule !== undefined) {
|
|
13485
|
+
/******/ return cachedModule.exports;
|
|
13304
13486
|
/******/ }
|
|
13305
13487
|
/******/ // Create a new module (and put it into the cache)
|
|
13306
13488
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
@@ -13331,7 +13513,7 @@ exports.geomutils = {
|
|
|
13331
13513
|
/******/
|
|
13332
13514
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
13333
13515
|
/******/ (() => {
|
|
13334
|
-
/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)
|
|
13516
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
13335
13517
|
/******/ })();
|
|
13336
13518
|
/******/
|
|
13337
13519
|
/******/ /* webpack/runtime/make namespace object */
|
|
@@ -13346,36 +13528,38 @@ exports.geomutils = {
|
|
|
13346
13528
|
/******/ })();
|
|
13347
13529
|
/******/
|
|
13348
13530
|
/************************************************************************/
|
|
13531
|
+
var __webpack_exports__ = {};
|
|
13532
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
13349
13533
|
(() => {
|
|
13350
13534
|
|
|
13351
13535
|
/* Imports for webpack */
|
|
13352
13536
|
|
|
13353
|
-
globalThis.UIDGenerator = __webpack_require__(
|
|
13354
|
-
globalThis.VertexAttr = __webpack_require__(
|
|
13355
|
-
globalThis.VertexListeners = __webpack_require__(
|
|
13356
|
-
globalThis.Vertex = __webpack_require__(
|
|
13537
|
+
globalThis.UIDGenerator = (__webpack_require__(938).UIDGenerator);
|
|
13538
|
+
globalThis.VertexAttr = (__webpack_require__(476).VertexAttr);
|
|
13539
|
+
globalThis.VertexListeners = (__webpack_require__(934).VertexListeners);
|
|
13540
|
+
globalThis.Vertex = (__webpack_require__(787).Vertex);
|
|
13357
13541
|
|
|
13358
|
-
globalThis.Bounds = __webpack_require__(
|
|
13359
|
-
globalThis.Grid = __webpack_require__(
|
|
13360
|
-
globalThis.Line = __webpack_require__(
|
|
13361
|
-
globalThis.Vector = __webpack_require__(
|
|
13362
|
-
globalThis.CubicBezierCurve = __webpack_require__(
|
|
13363
|
-
globalThis.BezierPath = __webpack_require__(
|
|
13364
|
-
globalThis.Polygon = __webpack_require__(
|
|
13365
|
-
globalThis.Triangle = __webpack_require__(
|
|
13366
|
-
globalThis.VEllipse = __webpack_require__(
|
|
13367
|
-
globalThis.VEllipseSector = __webpack_require__(
|
|
13368
|
-
globalThis.Circle = __webpack_require__(
|
|
13369
|
-
globalThis.CircleSector = __webpack_require__(
|
|
13370
|
-
globalThis.PBImage = __webpack_require__(
|
|
13371
|
-
globalThis.PBText = __webpack_require__(
|
|
13372
|
-
globalThis.MouseHandler = __webpack_require__(
|
|
13373
|
-
globalThis.KeyHandler = __webpack_require__(
|
|
13374
|
-
globalThis.drawutils = __webpack_require__(
|
|
13542
|
+
globalThis.Bounds = (__webpack_require__(76).Bounds);
|
|
13543
|
+
globalThis.Grid = (__webpack_require__(289).Grid);
|
|
13544
|
+
globalThis.Line = (__webpack_require__(939).Line);
|
|
13545
|
+
globalThis.Vector = (__webpack_require__(30).Vector);
|
|
13546
|
+
globalThis.CubicBezierCurve = (__webpack_require__(973).CubicBezierCurve);
|
|
13547
|
+
globalThis.BezierPath = (__webpack_require__(733).BezierPath);
|
|
13548
|
+
globalThis.Polygon = (__webpack_require__(687).Polygon);
|
|
13549
|
+
globalThis.Triangle = (__webpack_require__(737).Triangle);
|
|
13550
|
+
globalThis.VEllipse = (__webpack_require__(881).VEllipse);
|
|
13551
|
+
globalThis.VEllipseSector = (__webpack_require__(719).VEllipseSector);
|
|
13552
|
+
globalThis.Circle = (__webpack_require__(118).Circle);
|
|
13553
|
+
globalThis.CircleSector = (__webpack_require__(135).CircleSector);
|
|
13554
|
+
globalThis.PBImage = (__webpack_require__(862).PBImage);
|
|
13555
|
+
globalThis.PBText = (__webpack_require__(628).PBText);
|
|
13556
|
+
globalThis.MouseHandler = (__webpack_require__(912).MouseHandler);
|
|
13557
|
+
globalThis.KeyHandler = (__webpack_require__(531).KeyHandler);
|
|
13558
|
+
globalThis.drawutils = (__webpack_require__(39).drawutils);
|
|
13375
13559
|
// globalThis.drawutilsgl = require("./drawgl.js").drawutilsgl; // Unfinished
|
|
13376
|
-
globalThis.drawutilssvg = __webpack_require__(
|
|
13377
|
-
globalThis.geomutils = __webpack_require__(
|
|
13378
|
-
globalThis.PlotBoilerplate = __webpack_require__(
|
|
13560
|
+
globalThis.drawutilssvg = (__webpack_require__(378).drawutilssvg);
|
|
13561
|
+
globalThis.geomutils = (__webpack_require__(328).geomutils);
|
|
13562
|
+
globalThis.PlotBoilerplate = (__webpack_require__(559).PlotBoilerplate);
|
|
13379
13563
|
|
|
13380
13564
|
})();
|
|
13381
13565
|
|