svg-path-simplify 0.4.1 → 0.4.3
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 +19 -0
- package/README.md +6 -4
- package/dist/svg-path-simplify.esm.js +2450 -888
- package/dist/svg-path-simplify.esm.min.js +2 -2
- package/dist/svg-path-simplify.js +2450 -888
- package/dist/svg-path-simplify.min.js +2 -2
- package/dist/svg-path-simplify.pathdata.esm.js +167 -85
- package/dist/svg-path-simplify.pathdata.esm.min.js +2 -2
- package/docs/privacy-webapp.md +24 -0
- package/index.html +333 -132
- package/package.json +5 -2
- package/src/css_parse.js +317 -0
- package/src/detect_input.js +34 -4
- package/src/pathData_simplify_harmonize_cpts.js +77 -1
- package/src/pathSimplify-main.js +246 -262
- package/src/pathSimplify-presets.js +243 -0
- package/src/poly-fit-curve-schneider.js +14 -7
- package/src/simplify_poly_RC.js +102 -0
- package/src/simplify_poly_RDP.js +109 -1
- package/src/simplify_poly_radial_distance.js +3 -3
- package/src/string_helpers.js +144 -0
- package/src/svgii/convert_units.js +8 -2
- package/src/svgii/geometry.js +182 -3
- package/src/svgii/geometry_length.js +237 -0
- package/src/svgii/pathData_convert.js +43 -1
- package/src/svgii/pathData_fix_directions.js +6 -0
- package/src/svgii/pathData_fromPoly.js +3 -3
- package/src/svgii/pathData_getLength.js +86 -0
- package/src/svgii/pathData_parse.js +2 -0
- package/src/svgii/pathData_parse_els.js +189 -189
- package/src/svgii/pathData_split_to_groups.js +168 -0
- package/src/svgii/pathData_stringify.js +26 -64
- package/src/svgii/pathData_toPolygon.js +3 -4
- package/src/svgii/poly_analyze.js +61 -0
- package/src/svgii/poly_normalize.js +11 -2
- package/src/svgii/poly_to_pathdata.js +85 -24
- package/src/svgii/rounding.js +8 -7
- package/src/svgii/svg-styles-to-attributes-const.js +1 -0
- package/src/svgii/svg_cleanup.js +467 -421
- package/src/svgii/svg_cleanup_convertPathLength.js +32 -0
- package/src/svgii/svg_cleanup_general_svg_atts.js +97 -0
- package/src/svgii/svg_cleanup_normalize_transforms.js +83 -0
- package/src/svgii/svg_cleanup_remove_els_and_atts.js +72 -0
- package/src/svgii/svg_cleanup_ungroup.js +36 -0
- package/src/svgii/svg_el_parse_style_props.js +76 -28
- package/src/svgii/svg_getElementLength.js +67 -0
- package/tests/testSVG_shape.js +59 -0
- package/tests/testSVG_transform.js +61 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [0.4.3] - 2026-03-26
|
|
3
|
+
### Added
|
|
4
|
+
- presets: apply options from existing presets (allows custom overriding)
|
|
5
|
+
- addititional input formats: `<symbol>` (handy for sprite editing), stringified (polygon) point arrays
|
|
6
|
+
- compound path splitting: creates separate `<path>` elements from overlapping sub paths
|
|
7
|
+
- custom element and attribute removal
|
|
8
|
+
- "safe" mode for path data stringification – for better legacy application support
|
|
9
|
+
- webapp responds to keyboard shortcuts for saving, copying and pasting
|
|
10
|
+
- "keepSmaller" option: takes the original input if simplification failed – useful for batch processing
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [0.4.2] - 2026-03-18
|
|
14
|
+
### Fixed
|
|
15
|
+
- attribute retrieval and conversion in node
|
|
16
|
+
- transform conversions
|
|
17
|
+
### Added
|
|
18
|
+
- mixed SVG path data: chooses between most compact commands – relative or absolute
|
|
19
|
+
- web UI features (e.g marker resizing, toggle original and optimized)
|
|
20
|
+
|
|
2
21
|
|
|
3
22
|
## [0.4.1] - 2026-03-16
|
|
4
23
|
### Fixed
|
package/README.md
CHANGED
|
@@ -294,7 +294,7 @@ let pathDataOpt = simplifyPathData(pathDataString);
|
|
|
294
294
|
### Web app
|
|
295
295
|
You can easily test this library via the [**webapp**](https://herrstrietzel.github.io/svg-path-simplify/) or by checking the demo folder.
|
|
296
296
|
|
|
297
|
-

|
|
298
298
|
|
|
299
299
|
#### Features
|
|
300
300
|
* test all provided simplification option - export settings as JS object
|
|
@@ -311,6 +311,9 @@ You can easily test this library via the [**webapp**](https://herrstrietzel.gith
|
|
|
311
311
|
* [simple setup esm](./demo/simple-esm.html)
|
|
312
312
|
* [codepen](https://codepen.io/herrstrietzel/pen/PwzxpoE)
|
|
313
313
|
|
|
314
|
+
### Webapp examples
|
|
315
|
+
* [font/glyph simplification](https://herrstrietzel.github.io/svg-path-simplify/?samples=fira_alegreya_opensans)
|
|
316
|
+
|
|
314
317
|
|
|
315
318
|
|
|
316
319
|
## Limitations
|
|
@@ -333,9 +336,8 @@ SVGs > 1 MB are most of the time not salvagable. At least if they contain 10K+ o
|
|
|
333
336
|
|
|
334
337
|
## Changelog, Updates and rollback
|
|
335
338
|
### Changelog
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
* 0.1.0 fixed node support for complete svg files
|
|
339
|
+
See [changelog.md](https://github.com/herrstrietzel/svg-path-simplify/blob/main/CHANGELOG.md)
|
|
340
|
+
|
|
339
341
|
|
|
340
342
|
### Rollback
|
|
341
343
|
If you encounter any issues with the recent versions you can rollback to a previous version.
|