plotboilerplate 1.12.9 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +5 -1
  2. package/changelog.md +34 -0
  3. package/dist/index.esm.js +435 -92
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.esm.min.js +1 -1
  6. package/dist/index.esm.min.js.map +1 -1
  7. package/dist/plotboilerplate.browser.min.js +1 -1
  8. package/dist/plotboilerplate.browser.min.js.map +1 -1
  9. package/dist/plotboilerplate.js +449 -91
  10. package/dist/plotboilerplate.min.js +1 -1
  11. package/package.json +1 -1
  12. package/src/cjs/BezierPath.d.ts +12 -1
  13. package/src/cjs/BezierPath.js +34 -5
  14. package/src/cjs/BezierPath.js.map +1 -1
  15. package/src/cjs/PBText.d.ts +116 -0
  16. package/src/cjs/PBText.js +66 -0
  17. package/src/cjs/PBText.js.map +1 -0
  18. package/src/cjs/PlotBoilerplate.d.ts +2 -1
  19. package/src/cjs/PlotBoilerplate.js +43 -15
  20. package/src/cjs/PlotBoilerplate.js.map +1 -1
  21. package/src/cjs/Polygon.d.ts +22 -1
  22. package/src/cjs/Polygon.js +102 -39
  23. package/src/cjs/Polygon.js.map +1 -1
  24. package/src/cjs/Vertex.d.ts +42 -4
  25. package/src/cjs/Vertex.js +62 -7
  26. package/src/cjs/Vertex.js.map +1 -1
  27. package/src/cjs/draw.d.ts +30 -2
  28. package/src/cjs/draw.js +51 -6
  29. package/src/cjs/draw.js.map +1 -1
  30. package/src/cjs/drawgl.d.ts +29 -2
  31. package/src/cjs/drawgl.js +21 -4
  32. package/src/cjs/drawgl.js.map +1 -1
  33. package/src/cjs/drawutilssvg.d.ts +25 -7
  34. package/src/cjs/drawutilssvg.js +62 -14
  35. package/src/cjs/drawutilssvg.js.map +1 -1
  36. package/src/cjs/entry.js +1 -0
  37. package/src/cjs/index.d.ts +1 -0
  38. package/src/cjs/index.js +1 -0
  39. package/src/cjs/index.js.map +1 -1
  40. package/src/cjs/interfaces/DrawLib.d.ts +27 -6
  41. package/src/cjs/interfaces/DrawLib.js +3 -0
  42. package/src/cjs/interfaces/DrawLib.js.map +1 -1
  43. package/src/cjs/interfaces/core.d.ts +9 -1
  44. package/src/cjs/interfaces/core.js +1 -0
  45. package/src/cjs/interfaces/core.js.map +1 -1
  46. package/src/cjs/utils/datastructures/Color.d.ts +28 -15
  47. package/src/cjs/utils/datastructures/Color.js +276 -88
  48. package/src/cjs/utils/datastructures/Color.js.map +1 -1
  49. package/src/cjs/utils/findInVertexArray.d.ts +19 -0
  50. package/src/cjs/utils/findInVertexArray.js +29 -0
  51. package/src/cjs/utils/findInVertexArray.js.map +1 -0
  52. package/src/esm/BezierPath.d.ts +12 -1
  53. package/src/esm/BezierPath.js +34 -5
  54. package/src/esm/BezierPath.js.map +1 -1
  55. package/src/esm/PBText.d.ts +116 -0
  56. package/src/esm/PBText.js +61 -0
  57. package/src/esm/PBText.js.map +1 -0
  58. package/src/esm/PlotBoilerplate.d.ts +2 -1
  59. package/src/esm/PlotBoilerplate.js +43 -15
  60. package/src/esm/PlotBoilerplate.js.map +1 -1
  61. package/src/esm/Polygon.d.ts +22 -1
  62. package/src/esm/Polygon.js +102 -39
  63. package/src/esm/Polygon.js.map +1 -1
  64. package/src/esm/Vertex.d.ts +42 -4
  65. package/src/esm/Vertex.js +62 -7
  66. package/src/esm/Vertex.js.map +1 -1
  67. package/src/esm/draw.d.ts +30 -2
  68. package/src/esm/draw.js +51 -6
  69. package/src/esm/draw.js.map +1 -1
  70. package/src/esm/drawgl.d.ts +29 -2
  71. package/src/esm/drawgl.js +21 -4
  72. package/src/esm/drawgl.js.map +1 -1
  73. package/src/esm/drawutilssvg.d.ts +25 -7
  74. package/src/esm/drawutilssvg.js +62 -14
  75. package/src/esm/drawutilssvg.js.map +1 -1
  76. package/src/esm/entry.js +1 -0
  77. package/src/esm/index.d.ts +1 -0
  78. package/src/esm/index.js +1 -0
  79. package/src/esm/index.js.map +1 -1
  80. package/src/esm/interfaces/DrawLib.d.ts +27 -6
  81. package/src/esm/interfaces/DrawLib.js +3 -0
  82. package/src/esm/interfaces/DrawLib.js.map +1 -1
  83. package/src/esm/interfaces/core.d.ts +9 -1
  84. package/src/esm/interfaces/core.js +1 -0
  85. package/src/esm/interfaces/core.js.map +1 -1
  86. package/src/esm/utils/datastructures/Color.d.ts +28 -15
  87. package/src/esm/utils/datastructures/Color.js +277 -89
  88. package/src/esm/utils/datastructures/Color.js.map +1 -1
  89. package/src/esm/utils/findInVertexArray.d.ts +19 -0
  90. package/src/esm/utils/findInVertexArray.js +25 -0
  91. package/src/esm/utils/findInVertexArray.js.map +1 -0
  92. package/src/ts/BezierPath.ts +37 -5
  93. package/src/ts/PBText.ts +147 -0
  94. package/src/ts/PlotBoilerplate.ts +47 -19
  95. package/src/ts/Polygon.ts +493 -451
  96. package/src/ts/Vertex.ts +66 -7
  97. package/src/ts/draw.ts +71 -8
  98. package/src/ts/drawgl.ts +48 -8
  99. package/src/ts/drawutilssvg.ts +94 -17
  100. package/src/ts/index.ts +1 -0
  101. package/src/ts/interfaces/DrawLib.ts +30 -4
  102. package/src/ts/interfaces/core.ts +9 -0
  103. package/src/ts/utils/datastructures/Color.ts +695 -508
  104. package/src/ts/utils/findInVertexArray.ts +28 -0
  105. package/dist/plotboilerplate.browser.min.js.LICENSE.txt +0 -8
  106. package/src/ts/utils/algorithms/clearPolygonDuplicateVertices.ts~ +0 -5
  107. package/src/ts/utils/algorithms/findPolygonSelfIntersections.ts~ +0 -45
  108. package/src/ts/utils/algorithms/sh-tmp.ts~ +0 -59
  109. package/src/ts/utils/algorithms/splitPolygonToNonIntersecting.ts~ +0 -113
  110. package/src/ts/utils/algorithms/sutherlandHodgman.ts~ +0 -88
  111. package/src/ts/utils/datastructures/Color.ts~ +0 -331
  112. package/src/ts/utils/datastructures/Girih.ts~ +0 -151
  113. package/src/ts/utils/datastructures/GirihTile.ts~ +0 -419
package/README.md CHANGED
@@ -44,12 +44,15 @@ often use for the visualization of 2D geometries. Basic features are
44
44
  - images
45
45
  ([docs](https://plotboilerplate.io/docs_typedoc/classes/pbimage.html "PBImage class"),
46
46
  [example](https://plotboilerplate.io/repo/demos/basic-PBImage "PBImage example"))
47
+ - text
48
+ ([docs](https://plotboilerplate.io/docs_typedoc/classes/pbtext.html "PBText class"),
49
+ [example](https://plotboilerplate.io/repo/demos/basic-PBText "PBText example"))
47
50
  - configuration of the canvas behavior (fullsize, interaction, raster)
48
51
  - mouse interaction (zoom, pan, drag elements)
49
52
  - keyboard interaction
50
53
  - touch interaction for dragging vertices (mobile devices: zoom, pan, drag elements)
51
54
 
52
- The compressed library has 123kb.
55
+ The compressed library has 128kb.
53
56
 
54
57
  ## Install the package via npm
55
58
 
@@ -480,6 +483,7 @@ vert.listeners.addDragListener(function (e) {
480
483
  - [Torben Jansen](https://twitter.com/torbenjansen_ "Torben Jansen") for the [SVG-Arc to elliptic-sector conversion](https://observablehq.com/@toja/ellipse-and-elliptical-arc-conversion "SVG-Arc to elliptic-sector conversion")
481
484
  - [3daddict](https://github.com/3daddict) for the [js-stl-parser inspiration](https://github.com/3daddict/js-stl-parser/blob/master/index.js "js-stl-parser inspiration")
482
485
  - [jburkardt](https://people.sc.fsu.edu/~jburkardt/data/obj/obj.html "jburkardt") for the obj test files.
486
+ - [@veltman](https://noahveltman.com/) for the awesome [geometric skeletonization article](https://observablehq.com/@veltman/centerline-labeling)
483
487
 
484
488
  ## Todos
485
489
 
package/changelog.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ - 2022-01-10
4
+ - Added utility function `findInVertexArray`.
5
+ - 2021-12-17
6
+ - Added the functions `Vertex.lerp` and `Vertex.lerpAbs` for linear interpolations.
7
+ - 2021-12-16
8
+ - Added the `Polygon.getEvenDistributionPolygon()` function.
9
+ - 2021-12-14
10
+ - Added the `Polygon.perimeter()` function.
11
+ - 2021-12-01
12
+ - Changed the type of param of `BezierPath.scale` to XYCoords.
13
+ - Added function `BezierPath.scaleXY` for non uniform scaling.
14
+ - Changed the type of param of `Vertex.scale` to XYCoords.
15
+ - Added function `Vertex.scaleXY` for non uniform scaling.
16
+ - 2021-11-24
17
+ - Speeding up the demo page with async script execution.
18
+ - Finalizing the demo page for the new `PBText` element (note: it has this name because `Text` already exists).
19
+ - 2021-11-19
20
+ - Fixing the `drawutilssvg.label(text,x,y)` position.
21
+ - Added the `color` param to the `label(...)` function.
22
+ - 2021-11-16
23
+ - Added `text` options to the `DrawConfig` interface.
24
+ - Added the `PBText` class.
25
+ - 2021-11-15
26
+ - Adding more parameters tot the `drawutilssvg.text()` function: fontSize, textAlign, fontFamily, lineHeight.
27
+ - 2021-11-12
28
+ - Adding more parameters tot the `draw.text()` function: fontSize, textAlign, fontFamily, lineHeight.
29
+ - 2021-11.07
30
+ - Changed the behavior of `darken` and `lighten`: the passed value is handled relative now which makes values much easier predictable and makes the change feel more 'natural'.
31
+ - Added tests for the Color class. There were some strange things happening the the `ligthen` and `darken` function.
32
+ - Did the same with `saturate` and `desaturate`.
33
+ - Did the same with the `fadein` and `fadeout` functions.
34
+ - Added setR, setG, setB, setH, setS, setL functions to the Color class.
35
+ - 2021-11-05
36
+ - Fixing the regex in the Color.parse() function for parsing rgba-strings.
3
37
  - 2021-10-12
4
38
  - Added `DrawConfig.bezier.pathVertex` and `DrawConfig.bezier.controlVertex` attributes, both `DrawSettigs`.
5
39
  - Added optional `fill:boolean` to `DrawSettings`. This is useful to give more control over the rendering of Bézier paths.