svg-path-simplify 0.4.3 → 0.4.5
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/CHANGELOG.md +21 -0
- package/README.md +2 -1
- package/dist/svg-path-simplify.esm.js +1670 -509
- package/dist/svg-path-simplify.esm.min.js +2 -2
- package/dist/svg-path-simplify.js +1671 -508
- package/dist/svg-path-simplify.min.js +2 -2
- package/dist/svg-path-simplify.pathdata.esm.js +936 -463
- package/dist/svg-path-simplify.pathdata.esm.min.js +2 -2
- package/dist/svg-path-simplify.poly.cjs +9 -8
- package/index.html +60 -20
- package/package.json +1 -1
- package/src/constants.js +4 -0
- package/src/detect_input.js +47 -29
- package/src/index.js +8 -0
- package/src/pathData_simplify_cubic.js +46 -18
- package/src/pathData_simplify_revertToquadratics.js +0 -1
- package/src/pathSimplify-main.js +81 -20
- package/src/pathSimplify-only-pathdata.js +7 -2
- package/src/pathSimplify-presets.js +14 -4
- package/src/svg-getAttributes.js +5 -3
- package/src/svgii/convert_units.js +1 -1
- package/src/svgii/geometry.js +140 -2
- package/src/svgii/geometry_bbox_element.js +1 -1
- package/src/svgii/geometry_deduceRadius.js +116 -27
- package/src/svgii/geometry_length.js +18 -2
- package/src/svgii/pathData_analyze.js +18 -0
- package/src/svgii/pathData_convert.js +188 -88
- package/src/svgii/pathData_fix_directions.js +10 -18
- package/src/svgii/pathData_reorder.js +123 -16
- package/src/svgii/pathData_simplify_refineCorners.js +130 -35
- package/src/svgii/pathData_simplify_refine_round.js +420 -0
- package/src/svgii/poly_normalize.js +9 -8
- package/src/svgii/rounding.js +112 -80
- package/src/svgii/svg_cleanup.js +75 -22
- package/src/svgii/svg_cleanup_convertPathLength.js +27 -15
- package/src/svgii/svg_cleanup_normalize_transforms.js +1 -1
- package/src/svgii/svg_cleanup_remove_els_and_atts.js +6 -1
- package/src/svgii/svg_el_parse_style_props.js +13 -10
- package/src/svgii/svg_validate.js +220 -0
- package/tests/testSVG.js +14 -1
- package/src/svgii/pathData_refine_round.js +0 -222
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.4.5] - 2026-04-02
|
|
4
|
+
### Fixed
|
|
5
|
+
- stroke-dash conversion must disable reordering of commands
|
|
6
|
+
- stroke-dashoffset missing in attribute scaling
|
|
7
|
+
- removeOffCanvas - fixed bbox calculation
|
|
8
|
+
- rounding bug in command reordering
|
|
9
|
+
### Added
|
|
10
|
+
- better auto accuracy approximation
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [0.4.4] - 2026-04-01
|
|
14
|
+
### Fixed
|
|
15
|
+
- shape attribute retrieval in node.js
|
|
16
|
+
### Added
|
|
17
|
+
- convert relative dash lengths relying on `pathLength` attribute
|
|
18
|
+
- quantized rounding allowing for half decimal steps
|
|
19
|
+
- improved arc segment detection and simplification
|
|
20
|
+
- security warnings/sanitization e.g for billion laugh exploits
|
|
21
|
+
- webapp: recommendations for additional optimizations
|
|
22
|
+
|
|
2
23
|
## [0.4.3] - 2026-03-26
|
|
3
24
|
### Added
|
|
4
25
|
- presets: apply options from existing presets (allows custom overriding)
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ While this library reduces SVG markup sizes significantly by removing commands i
|
|
|
15
15
|
Unlike most existing approaches (e.g in graphic applications), it checks where simplifications are suitable and stops simplification at the right »point« (literally).
|
|
16
16
|
|
|
17
17
|

|
|
18
|
-
*Fira Sans (based on truetype/glyph quadratic commands) converted to cubic Béziers.
|
|
18
|
+
*Fira Sans (based on truetype/glyph quadratic commands) converted to cubic Béziers. Left:Original; Right:optimized*
|
|
19
19
|
|
|
20
20
|
## Features
|
|
21
21
|
### Path simplification
|
|
@@ -370,4 +370,5 @@ You can also post in the [discussions](https://github.com/herrstrietzel/svg-path
|
|
|
370
370
|
* obviously, [Dmitry Baranovskiy](https://github.com/dmitrybaranovskiy) – a lot of these helper functions originate either from Raphaël or snap.svg – or are at least heavily inspired by some helpers from these libraries
|
|
371
371
|
* [Andrea Giammarchi a.k.a WebReflection](https://github.com/WebReflection) for [linkedom](https://github.com/WebReflection/linkedom) which helped to make this lib run also in node or a web worker
|
|
372
372
|
* [Photopea](https://github.com/photopea) for the fast [UZIP](https://github.com/photopea/UZIP.js) which is deployed in the webapp for batch file downloads.
|
|
373
|
+
* [mdpjs](https://github.com/UmemotoCtrl/mdpjs) for the great JS markdown parser (used in the web app)
|
|
373
374
|
|