svg-path-simplify 0.4.2 → 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.
Files changed (44) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +6 -4
  3. package/dist/svg-path-simplify.esm.js +2139 -940
  4. package/dist/svg-path-simplify.esm.min.js +2 -2
  5. package/dist/svg-path-simplify.js +2139 -940
  6. package/dist/svg-path-simplify.min.js +2 -2
  7. package/dist/svg-path-simplify.pathdata.esm.js +127 -85
  8. package/dist/svg-path-simplify.pathdata.esm.min.js +2 -2
  9. package/docs/privacy-webapp.md +24 -0
  10. package/index.html +290 -152
  11. package/package.json +1 -1
  12. package/src/css_parse.js +317 -0
  13. package/src/detect_input.js +34 -4
  14. package/src/pathData_simplify_harmonize_cpts.js +77 -1
  15. package/src/pathSimplify-main.js +242 -269
  16. package/src/pathSimplify-presets.js +243 -0
  17. package/src/poly-fit-curve-schneider.js +14 -7
  18. package/src/simplify_poly_RC.js +102 -0
  19. package/src/simplify_poly_RDP.js +109 -1
  20. package/src/simplify_poly_radial_distance.js +3 -3
  21. package/src/string_helpers.js +130 -4
  22. package/src/svgii/geometry.js +182 -3
  23. package/src/svgii/geometry_length.js +237 -0
  24. package/src/svgii/pathData_convert.js +5 -1
  25. package/src/svgii/pathData_fix_directions.js +6 -0
  26. package/src/svgii/pathData_fromPoly.js +3 -3
  27. package/src/svgii/pathData_getLength.js +86 -0
  28. package/src/svgii/pathData_parse.js +2 -0
  29. package/src/svgii/pathData_parse_els.js +66 -68
  30. package/src/svgii/pathData_split_to_groups.js +168 -0
  31. package/src/svgii/pathData_stringify.js +26 -64
  32. package/src/svgii/pathData_toPolygon.js +3 -4
  33. package/src/svgii/poly_analyze.js +61 -0
  34. package/src/svgii/poly_normalize.js +11 -2
  35. package/src/svgii/poly_to_pathdata.js +85 -24
  36. package/src/svgii/rounding.js +8 -7
  37. package/src/svgii/svg_cleanup.js +374 -620
  38. package/src/svgii/svg_cleanup_convertPathLength.js +32 -0
  39. package/src/svgii/svg_cleanup_general_svg_atts.js +97 -0
  40. package/src/svgii/svg_cleanup_normalize_transforms.js +83 -0
  41. package/src/svgii/svg_cleanup_remove_els_and_atts.js +72 -0
  42. package/src/svgii/svg_cleanup_ungroup.js +36 -0
  43. package/src/svgii/svg_el_parse_style_props.js +65 -43
  44. package/src/svgii/svg_getElementLength.js +67 -0
package/index.html CHANGED
@@ -75,23 +75,22 @@
75
75
 
76
76
  <!-- UI helpers -->
77
77
 
78
- <link rel="preload" href="https://cdn.jsdelivr.net/npm/enhance-inputs@0.3.9/dist/enhanceInputs.min.css"
79
- as="style" />
80
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/enhance-inputs@0.3.9/dist/enhanceInputs.min.css">
81
- <script src="https://cdn.jsdelivr.net/npm/enhance-inputs@0.3.9/dist/enhanceInputs.min.js" defer></script>
82
78
 
79
+ <link rel="preload" href="https://cdn.jsdelivr.net/npm/enhance-inputs@0.4.1/dist/enhanceInputs.min.css"
80
+ as="style" />
81
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/enhance-inputs@0.4.1/dist/enhanceInputs.min.css">
82
+ <script src="https://cdn.jsdelivr.net/npm/enhance-inputs@0.4.1/dist/enhanceInputs.min.js" defer></script>
83
83
  <!--
84
+
84
85
  <link rel="stylesheet" href="//localhost/___git/enhance-inputs/enhance-inputs/dist/enhanceInputs.css">
85
86
  <script src="//localhost/___git/enhance-inputs/enhance-inputs/dist/enhanceInputs.js" defer></script>
86
-
87
87
  -->
88
88
 
89
-
90
89
  <!--
91
90
  <script src="https://cdn.jsdelivr.net/npm/svg-path-simplify@0.1.2/dist/svg-path-simplify.min.js" defer></script>
92
91
  -->
93
92
 
94
- <script src="dist/svg-path-simplify.min.js" defer></script>
93
+ <script src="dist/svg-path-simplify.js" defer></script>
95
94
  <link rel="stylesheet" href="demo/css/app.css">
96
95
 
97
96
  <script src="demo/lib/elzoomo/elzoomo.js" defer></script>
@@ -125,53 +124,20 @@
125
124
  </p>
126
125
 
127
126
  <h1 class="txt-cnt h1">Simplify SVG files and path data</h1>
128
- <h2 class="p txt-cnt">Optimizes SVG data by removing excessive commands and applying markup
127
+ <h2 class="p txt-cnt">Optimize and sanitize SVG data by removing excessive commands and applying markup
129
128
  minifications such as coordinate rounding, relative and applicable shorthand commands</h2>
130
129
 
131
- <p class="--btn-neg" data-ui="reset"></p>
132
-
133
- <details>
134
- <summary class="h3">Privacy</summary>
135
-
136
- <h3>Simplification</h3>
137
- <p>Enter your SVG pathData or complete file markup or upload SVG files.</p>
138
- <p class="fnt-wgh-700">All data is processed 100% client-side – no data is transferred or analyzed
139
- by any third-party service during simplification.</p>
140
-
141
- <h3>Sharing and editing</h3>
142
- <ul>
143
- <li>Codepen – sends your current data to <a href="https://codepen.io">codepen.io</a> and creates
144
- a new pen
145
- for testing purposes</li>
146
- <li>Edit – sends data to <a href="https://yqnn.github.io/svg-path-editor">svg-path-editor</a>
147
- for further
148
- path node editing</li>
149
- </ul>
150
-
151
- <h3>External scripts</h3>
152
- <p>The webapp loads these external scripts from jsdelivr</p>
153
- <ul>
154
- <li><a href="https://github.com/WebReflection/linkedom">linkedom</a>
155
- – used for web worker based multi file
156
- processing</li>
157
- <li><a href="https://github.com/photopea/UZIP.js">UZIP</a>
158
- – for multifile zip exports</li>
159
- <li><a href="https://github.com/herrstrietzel/enhance-inputs">enhance-inputs</a>
160
- – used for GUI input
161
- styling and updating logic</li>
162
- </ul>
163
-
164
- <h3>Local Storage</h3>
165
- <p>Your current settings as well as your input SVG data is stored in local Storage. This provides to
166
- apply the same settings to multiple files after reloads. You can delete this settings cache via
167
- the reset settings button.</p>
168
- <p>You image data is never transferred to the github server.</p>
169
-
170
- </details>
130
+ <p>Use the usual shortcuts for copying, pasting or saving output: <kbd>Ctrl</kbd>/<kbd>⌘</kbd> +
131
+ <kbd>C</kbd>, <kbd>Ctrl</kbd>/<kbd>⌘</kbd> + <kbd>V</kbd>,
132
+ <kbd>Ctrl</kbd>/<kbd>⌘</kbd> + <kbd>S</kbd>
133
+ </p>
171
134
 
135
+ <!--
136
+ <p class="--btn-neg" data-ui="reset"></p>
137
+ -->
172
138
 
173
139
  <p><input type="file" class="dsp-non --btn-neg" id="inputFile" name="svgFile" value="upload"
174
- data-label="Upload SVG file/s" accept=".svg" data-ignore="true" multiple></p>
140
+ data-label="Upload SVG file/s" accept=".svg" data-ignore multiple></p>
175
141
 
176
142
 
177
143
  <p>
@@ -185,114 +151,139 @@
185
151
  </textarea>
186
152
  </label>
187
153
 
188
- <details open>
189
- <summary class="h3">SVG cleanup</summary>
190
- <p>
191
- <!--
192
- <label><input type="checkbox" name="removePrologue" checked>removePrologue</label>
193
- -->
194
154
 
195
- <label><input type="checkbox" data-type="checkbox-switch" name="removeNameSpaced"
196
- aria-description="Graphic applications often add a lot of propriatary/custom attributes – not required for browser or exchange format usage"
197
- checked>removeNameSpaced</label>
155
+ <details open class="detailsRemoveElements">
156
+ <summary class="h3">SVG elements/nodes</summary>
198
157
 
199
- <label><input type="checkbox" data-type="checkbox-switch" name="removeComments"
200
- aria-description="Remove custom commentsdisable it if you placed explanatory comments yourself"
201
- checked>removeComments</label>
158
+ <label><input type="checkbox" data-type="checkbox-switch" name="removeNameSpaced"
159
+ aria-description="Graphic applications often add a lot of propriatary/custom elementsnot required for browser or exchange format usage"
160
+ checked>removeNameSpaced</label>
202
161
 
162
+ <label><input type="checkbox" data-type="checkbox-switch" name="cleanupDefs"
163
+ aria-description="Removes empty defs and moves all defs to the top of the SVG markup – many environments struggle with footer placements (figma problem)"
164
+ checked>cleanupDefs</label>
203
165
 
204
- <label><input type="checkbox" data-type="checkbox-switch" name="removeHidden"
205
- aria-description="Graphic applications usually don't exclude hidden layers enable it to remove them to remove undesired bloat"
206
- checked>removeHidden</label>
166
+ <label><input type="checkbox" data-type="checkbox-switch" name="cleanupClip" checked
167
+ aria-description="Removes unnecessary clip-pathsspanning the entire viewBox (e.g typical for figma)">cleanupClip</label>
207
168
 
208
- <label><input type="checkbox" data-type="checkbox-switch" name="cleanupDefs"
209
- aria-description="Removes empty defs and moves all defs to the top of the SVG markup – many environments struggle with footer placements (figma problem)"
210
- checked>cleanupDefs</label>
169
+ <label><input type="checkbox" data-type="checkbox-switch" name="removeOffCanvas"
170
+ aria-description="Removes elements beyond viewBox/outside viewport">removeOffCanvas</label>
211
171
 
212
- <label><input type="checkbox" data-type="checkbox-switch" name="cleanupClip" checked
213
- aria-description="Removes unnecessary clip-pathsspanning the entire viewBox (e.g typical for figma)">cleanupClip</label>
172
+ <label><input type="checkbox" data-type="checkbox-switch" name="removeComments"
173
+ aria-description="Remove custom commentsdisable it if you placed explanatory comments yourself"
174
+ checked>removeComments</label>
214
175
 
176
+ <label><input type="checkbox" data-type="checkbox-switch" name="removeHidden"
177
+ aria-description="Graphic applications usually don't exclude hidden layers – enable it to remove them to remove undesired bloat"
178
+ checked>removeHidden</label>
215
179
 
216
- <label><input type="checkbox" data-type="checkbox-switch" name="cleanupSVGAtts"
217
- aria-description="Remove SVG non-presentational attributes from the root SVG"
218
- checked>cleanupSVGAtts</label>
219
180
 
220
- <label><input type="checkbox" data-type="checkbox-switch" name="allowMeta"
221
- aria-description="Allows metadata elements as well as title and description elements">allowMeta</label>
181
+ <!-- elements in current svg-->
182
+ <div id="removeSvgElsWrp" class="enhancedInputsDynamic">
183
+ </div>
184
+ </details>
222
185
 
223
- <label><input type="checkbox" data-type="checkbox-switch" name="allowAriaAtts"
224
- aria-description="Allows accessibility related ARIA attributes – probably added on purpose"
225
- checked>allowAriaAtts</label>
226
186
 
227
- <label><input type="checkbox" data-type="checkbox-switch" name="allowDataAtts"
228
- aria-description="Allows custom data attributes – probably added on purpose"
229
- checked>allowDataAtts</label>
230
187
 
188
+ <details open class="detailsRemoveSvgAttributes">
189
+ <summary class="h3">SVG attributes</summary>
231
190
 
232
- <label><input type="checkbox" data-type="checkbox-switch" name="removeOffCanvas"
233
- aria-description="Removes elements beyond viewBox/outside viewport">removeOffCanvas</label>
191
+ <label><input type="checkbox" data-type="checkbox-switch" name="removeNameSpacedAtts"
192
+ aria-description="Graphic applications often add a lot of propriatary/custom attributes – not required for browser or exchange format usage"
193
+ checked>removeNameSpacedAtts</label>
234
194
 
235
- <label><input type="checkbox" data-type="checkbox-switch" name="unGroup"
236
- aria-description="Applications often add too many nest groups – removing also converts any styles to elements">unGroup</label>
237
195
 
196
+ <label><input type="checkbox" data-type="checkbox-switch" name="cleanupSVGAtts"
197
+ aria-description="Remove SVG non-presentational attributes from the root SVG"
198
+ checked>cleanupSVGAtts</label>
238
199
 
239
- <!--
240
- <label><input type="checkbox" class="dsp-debug" name="convertTransforms">convertTransforms</label>
241
- -->
242
- </p>
200
+ <label><input type="checkbox" data-type="checkbox-switch" name="allowMeta"
201
+ aria-description="Allows metadata elements as well as title and description elements">allowMeta</label>
202
+
203
+ <label><input type="checkbox" data-type="checkbox-switch" name="allowAriaAtts"
204
+ aria-description="Allows accessibility related ARIA attributes – probably added on purpose"
205
+ checked>allowAriaAtts</label>
206
+
207
+ <label><input type="checkbox" data-type="checkbox-switch" name="allowDataAtts"
208
+ aria-description="Allows custom data attributes – probably added on purpose"
209
+ checked>allowDataAtts</label>
210
+
211
+ <label><input type="checkbox" data-type="checkbox-switch" name="addViewBox" checked
212
+ aria-description="Adds a viewBox attribute if missing – counter-productive if your SVG layout is fluid">addViewBox</label>
213
+
214
+ <label><input type="checkbox" data-type="checkbox-switch" name="addDimensions"
215
+ aria-description="Many graphic applications won't translate viewBox correctly to artboard/document size">addDimensions</label>
216
+
217
+ <label><input type="checkbox" data-type="checkbox-switch"
218
+ name="removeDimensions">removeDimensions</label>
219
+ <label><input type="checkbox" data-type="checkbox-switch" name="removeIds"
220
+ aria-description="Graphic applications usually add unsemantic generic IDs for each layer – remove them unless you need them for JS selection (e.g event bindings)">removeIds</label>
221
+ <label><input type="checkbox" data-type="checkbox-switch"
222
+ aria-description="Graphic applications often add un semantic class names – remove these unless you have specified them on your own or these are required for CSS styling (e.g icon assets)"
223
+ name="removeClassNames">removeClassNames</label>
224
+
225
+ <label><input type="checkbox" data-type="checkbox-switch" name="omitNamespace"
226
+ aria-description="Removes xmlns attribute - only recommended when embedding svg in DOM">omitNamespace</label>
227
+
228
+ <div id="removeSVGAttsWrp" class="enhancedInputsDynamic">
229
+ </div>
243
230
  </details>
244
231
 
232
+
245
233
  <details open>
246
234
  <summary class="h3">SVG style optimization</summary>
247
235
  <p>
248
- <label><input type="checkbox" data-type="checkbox-switch" name="cleanUpStrokes" checked
249
- aria-description="removes stroke attributes when stroke color is missing">cleanUpStrokes</label>
250
-
236
+ <!--
237
+ <label><input type="checkbox" data-type="checkbox-switch" name="convertPathLength"
238
+ aria-description="Converts pathLength attribute to absolute dasharray values – many graphic apps han't handle pathLength">convertPathLength</label>
239
+
240
+ -->
251
241
  <label><input type="checkbox" data-type="checkbox-switch" name="stylesToAttributes"
252
242
  aria-description="replaces inline styles with SVG atributes and removes obsolete attributes and styles">stylesToAttributes</label>
253
243
 
244
+
245
+ <label><input type="checkbox" data-type="checkbox-switch" name="cleanUpStrokes" checked
246
+ aria-description="removes stroke attributes when stroke color is missing">cleanUpStrokes</label>
247
+
254
248
  <label><input type="checkbox" data-type="checkbox-switch" name="attributesToGroup"
255
249
  aria-description="Try to combine style attributes in group">attributesToGroup</label>
256
250
 
257
251
  <label><input type="checkbox" data-type="checkbox-switch" name="minifyRgbColors"
258
- aria-description="Minifies RGB colors e.g for fill, stroke or stop-color" checked>minifyRgbColors</label>
259
-
252
+ aria-description="Minifies RGB colors e.g for fill, stroke or stop-color"
253
+ checked>minifyRgbColors</label>
260
254
 
261
255
  </p>
262
256
 
263
257
  </details>
264
258
 
265
259
 
266
- <details open>
267
- <summary class="h3">SVG advanced conversions</summary>
260
+ <details open class="detailsRemoveElAttributes">
261
+ <summary class="h3">Child attributes</summary>
268
262
 
269
- <p>
270
- <label><input type="checkbox" data-type="checkbox-switch" name="addViewBox" checked
271
- aria-description="Adds a viewBox attribute if missing – counter-productive if your SVG layout is fluid">addViewBox</label>
263
+ <label><input type="checkbox" data-type="checkbox-switch" name="fixHref"
264
+ aria-description="Replaces xlink:href with href – many applications still rely on xlink:href notation!">fixHref</label>
272
265
 
273
- <label><input type="checkbox" data-type="checkbox-switch" name="addDimensions"
274
- aria-description="Many graphic applications won't translate viewBox correctly to artboard/document size">addDimensions</label>
266
+ <label><input type="checkbox" data-type="checkbox-switch" name="legacyHref"
267
+ aria-description="Since many (non-browser) applications still depend on xlink:href notation you may convert href to xlink:href">legacyHref</label>
268
+
269
+ <!--dynamically added -->
270
+ <div id="removeElAttsWrp" class="enhancedInputsDynamic ">
271
+ </div>
272
+ </details>
275
273
 
276
274
 
275
+ <details open>
276
+ <summary class="h3">SVG merging/splitting</summary>
277
+ <p>
277
278
  <label><input type="checkbox" data-type="checkbox-switch" name="mergePaths"
278
279
  aria-description="Merge adjacent paths – can minify file size but won't allow you to select individual paths">mergePaths</label>
279
280
 
280
- <label><input type="checkbox" data-type="checkbox-switch"
281
- name="removeDimensions">removeDimensions</label>
282
- <label><input type="checkbox" data-type="checkbox-switch" name="removeIds"
283
- aria-description="Graphic applications usually add unsemantic generic IDs for each layer – remove them unless you need them for JS selection (e.g event bindings)">removeIds</label>
284
- <label><input type="checkbox" data-type="checkbox-switch"
285
- aria-description="Graphic applications often add un semantic class names – remove these unless you have specified them on your own or these are required for CSS styling (e.g icon assets)"
286
- name="removeClassNames">removeClassNames</label>
287
-
288
- <label><input type="checkbox" data-type="checkbox-switch" name="omitNamespace"
289
- aria-description="Removes xmlns attribute - only recommended when embedding svg in DOM">omitNamespace</label>
281
+ <label><input type="checkbox" data-type="checkbox-switch" name="unGroup"
282
+ aria-description="Applications often add too many nest groups – removing also converts any styles to elements">unGroup</label>
290
283
 
291
- <label><input type="checkbox" data-type="checkbox-switch" name="fixHref"
292
- aria-description="Replaces xlink:href with href many applications still rely on xlink:href notation!">fixHref</label>
284
+ <label><input type="checkbox" data-type="checkbox-switch" name="splitCompound"
285
+ aria-description="Tries to split compound paths finding overlapping compound sub paths">splitCompound</label>
293
286
 
294
- <label><input type="checkbox" data-type="checkbox-switch" name="legacyHref"
295
- aria-description="Since many (non-browser) applications still depend on xlink:href notation you may convert href to xlink:href">legacyHref</label>
296
287
 
297
288
  </p>
298
289
 
@@ -336,17 +327,29 @@
336
327
  </p>
337
328
 
338
329
  <p>
339
- <label><input type="checkbox" data-type="checkbox-switch" name="convert_rects"
340
- aria-description="convert paths to rects if applicable">rects</label>
330
+ <label><input type="checkbox" data-type="checkbox-switch" name="convertShapes[]" value="rect"
331
+ checked aria-description="convert paths to rects if applicable">rects</label>
332
+
333
+ <label><input type="checkbox" data-type="checkbox-switch" name="convertShapes[]" value="circle"
334
+ checked
335
+ aria-description="convert paths to circles or ellipses if applicable – ellipses/circles are usually more compact than paths – unless you merge paths">circles</label>
336
+
337
+ <label><input type="checkbox" data-type="checkbox-switch" name="convertShapes[]" value="ellipse"
338
+ checked
339
+ aria-description="convert paths to circles or ellipses if applicable – ellipses/circles are usually more compact than paths – unless you merge paths">ellipse</label>
341
340
 
342
- <label><input type="checkbox" data-type="checkbox-switch" name="convert_ellipses"
343
- aria-description="convert paths to circles or ellipses if applicable – ellipses/circles are usually more compact than paths – unless you merge paths">ellipses/circles</label>
344
341
 
345
- <label><input type="checkbox" data-type="checkbox-switch" name="convert_poly"
346
- aria-description="convert paths to polys if applicable – polylines are quite inefficient as they are all absolute">polygons/polylines</label>
342
+ <label><input type="checkbox" data-type="checkbox-switch" name="convertShapes[]" value="polygon"
343
+ checked
344
+ aria-description="convert paths to polys if applicable – polylines are quite inefficient as they are all absolute">polygon</label>
347
345
 
348
- <label><input type="checkbox" data-type="checkbox-switch" name="convert_lines"
349
- aria-description="convert paths to lines if applicable">lines</label>
346
+ <label><input type="checkbox" data-type="checkbox-switch" name="convertShapes[]"
347
+ value="polyline" checked
348
+ aria-description="convert paths to polys if applicable – polylines are quite inefficient as they are all absolute">polyline</label>
349
+
350
+
351
+ <label><input type="checkbox" data-type="checkbox-switch" name="convertShapes[]" value="line"
352
+ checked aria-description="convert paths to lines if applicable">line</label>
350
353
  </p>
351
354
 
352
355
 
@@ -407,7 +410,15 @@
407
410
  aria-description="Higher tolerance = sloppier approximations and more distortions – default 1"></label>
408
411
  </p>
409
412
 
413
+
414
+
410
415
  <p>
416
+
417
+ <label><input type="checkbox" data-type="checkbox-switch" name="keepSmaller"
418
+ aria-description="Ditches simplified output if original was more compact – useful for batch processing"
419
+ checked>keepSmaller</label>
420
+
421
+
411
422
  <label><input type="checkbox" data-type="checkbox-switch" name="simplifyBezier"
412
423
  aria-description="Tries to combine adjacent Bézier commands"
413
424
  checked>simplifyBezier</label>
@@ -545,6 +556,14 @@
545
556
  -->
546
557
  </p>
547
558
 
559
+ <p>
560
+ <label>Output Polygon
561
+ <textarea class="outputPoly code" name="polyOut" id="polyOut" data-tools="size copy"
562
+ data-ignore="true" readonly data-file="polygon.txt"></textarea>
563
+ </label>
564
+ </p>
565
+
566
+
548
567
  </details>
549
568
 
550
569
 
@@ -571,6 +590,7 @@
571
590
  <ul class="ul-bll">
572
591
  <li><strong>Minify</strong> = maximum string minification – my lead to problems in older
573
592
  applications!</li>
593
+ <li><strong>Safe</strong> = avoid floating point and arc param concatenation</li>
574
594
  <li><strong>Verbose</strong> = don't omit command type tokens</li>
575
595
  <li><strong>Beautify</strong>strong> = don't omit command type tokens and separate commands
576
596
  by new lines – handy for educational usage</li>
@@ -578,6 +598,7 @@
578
598
  </details>
579
599
 
580
600
  <p><label><input type="radio" name="minifyD" value="0" checked>minify</label>
601
+ <label><input type="radio" name="minifyD" value="0.5">safe</label>
581
602
  <label><input type="radio" name="minifyD" value="1">verbose</label>
582
603
  <label><input type="radio" name="minifyD" value="2">beautify</label>
583
604
  </p>
@@ -588,15 +609,14 @@
588
609
  </p>
589
610
 
590
611
  <p>
591
- <label class="wdt-100">decimals <input type="number" name="decimals" min="0" value="1"
592
- aria-description="Manual floating point rounding precision – overriden when autoAccuracy is enabled"></label>
612
+ <label class="wdt-100">decimals <input type="number" name="decimals" min="-1" value="1"
613
+ aria-description="Manual floating point rounding precision – overriden when autoAccuracy is enabled: -1 means no rounding"></label>
593
614
  </p>
594
615
  </details>
595
616
 
596
617
 
597
618
  <details open>
598
619
  <summary class="h3">Output</summary>
599
-
600
620
  <p>
601
621
  <label>Output SVG
602
622
  <textarea class="outputSvg code" name="dOutput" id="outputSvg" data-tools="size copy"
@@ -604,16 +624,12 @@
604
624
  </label>
605
625
  </p>
606
626
 
607
- <p>
608
- <label>Output Polygon
609
- <textarea class="outputPoly code" name="polyOut" id="polyOut" data-tools="size copy"
610
- data-ignore="true" readonly data-file="polygon.txt"></textarea>
611
- </label>
612
- </p>
613
627
  </details>
614
628
 
615
629
 
616
630
 
631
+ <!--
632
+
617
633
  <details>
618
634
  <summary class="h3">Settings</summary>
619
635
  <p>
@@ -627,6 +643,7 @@
627
643
 
628
644
  </p>
629
645
  </details>
646
+ -->
630
647
 
631
648
 
632
649
  </aside>
@@ -636,33 +653,31 @@
636
653
  <main class="main --spn-ld-2 --spn-ld-3 scrollbar scroll-content pst-rlt">
637
654
 
638
655
 
639
- <header class="pst-sticky --pdd-1em z-ind-1000 pdd-1em">
656
+ <header class="header-top pst-sticky --pdd-1em z-ind-1000 pdd-1em">
640
657
 
641
658
  <div class="header-nav">
659
+
660
+ <!-- reset -->
661
+ <button type="button" class="btn btnReset" title="Reset settings" data-icon="arrow-path"></button>
662
+
663
+
642
664
  <label class="navToggle"><input type="checkbox" name="showNav" class="showNav" id="showNav"
643
665
  data-icon="adjustments-vertical" checked title="show settings" data-sync="showNav0"></label>
644
666
 
667
+ <!-- load about -->
645
668
  <a href="#" class="a-dialog" data-dialog="#about" data-dialog-title="Options" data-icon="question"
646
669
  title="Available parameters"></a>
647
670
 
648
- <!-- reset -->
649
- <button type="button" class="btn btnReset" title="Reset settings" data-icon="arrow-path"></button>
671
+ <!-- load privacy -->
672
+ <a href="#" class="a-dialog" data-dialog="#privacy" data-dialog-title="privacy"
673
+ data-icon="finger-print" title="Privacy"></a>
674
+
675
+
676
+ <!-- presets -->
677
+ <button type="button" class="btn btn-presets" title="Presets" data-icon="gear"
678
+ data-menu-anchor="menu2"></button>
650
679
 
651
- <!--settings-->
652
- <!--
653
-
654
- <button type="button" class="btn btn-menu btnConfig" title="Edit settings" data-icon="gear"
655
- data-menu-anchor="menu1"></button>
656
-
657
- <div class="menu menu-right-top menu-active" data-menu="menu1">
658
- <p>
659
- <label>Marker size
660
- <input type="number" name="markerSize" value="0.3" min="0.05" max="1" step="0.05">
661
- </label>
662
- </p>
663
- </div>
664
680
 
665
- -->
666
681
 
667
682
  <button type="button" class="elzoomo-btn elzoomo-btn-zoomin" title="zoom in"
668
683
  data-icon="plus"></button>
@@ -670,6 +685,7 @@
670
685
  data-icon="minus"></button>
671
686
  </div>
672
687
 
688
+ <!-- github link -->
673
689
  <a class="lnk-github" href="https://github.com/herrstrietzel/svg-path-simplify"
674
690
  title="See github repository">
675
691
  <svg viewBox="0 0 24 24" class="icn-svg">
@@ -697,7 +713,7 @@
697
713
  <span>
698
714
  <label><input type="checkbox" data-type="checkbox-switch" name="showMarkers"
699
715
  data-secondary="true" checked>showMarkers</label>
700
- <button type="button" class="btn btn-inline btn-menu btnConfig"
716
+ <button type="button" class="btn btn-info btn-inline btn-menu btnConfig"
701
717
  title="Edit marker size" data-icon="gear" data-menu-anchor="menu1"></button>
702
718
 
703
719
  </span>
@@ -808,8 +824,6 @@
808
824
 
809
825
  </div>
810
826
 
811
-
812
-
813
827
  </main>
814
828
 
815
829
 
@@ -838,10 +852,129 @@
838
852
  </div>
839
853
  </dialog>
840
854
 
855
+ <dialog class="sr-only" id="privacy">
856
+ <div class="md-cnt" data-md="./docs/privacy-webapp.md">
857
+ </div>
858
+ </dialog>
859
+
860
+
861
+ <!-- menu presets -->
862
+ <div class="menu menu-presets menu-right-top pdd-1em --menu-active" data-menu="menu2">
863
+ <h4 class="h4">Presets</h4>
864
+
865
+ <p>
866
+ <label>
867
+ <input data-secondary type="radio" name="preset" value="0" aria-description="Custom settings"
868
+ checked>Custom
869
+ </label>
870
+ </p>
871
+ <!--
872
+
873
+ -->
874
+
875
+ <p>
876
+ <label>
877
+ <input data-secondary type="radio" name="preset" value="null"
878
+ aria-description="Disable all – passthrough">null
879
+ </label>
880
+ </p>
881
+
882
+ <p>
883
+ <label>
884
+ <input data-secondary type="radio" name="preset" value="default"
885
+ aria-description="Back to default settings">default
886
+ </label>
887
+ </p>
888
+
889
+ <p>
890
+ <label>
891
+ <input data-secondary type="radio" name="preset" value="education"
892
+ aria-description="Prettified output - all absolute and longhand commands">
893
+ education
894
+ </label>
895
+ </p>
896
+
897
+ <p>
898
+ <label>
899
+ <input data-secondary type="radio" name="preset" value="editor"
900
+ aria-description="Maximum compatibility for graphic editors">
901
+ editor
902
+ </label>
903
+ </p>
904
+
905
+ <p>
906
+ <label>
907
+ <input data-secondary type="radio" name="preset" value="path"
908
+ aria-description="Convert all shapes to paths">
909
+ path
910
+ </label>
911
+ </p>
912
+
913
+ <p>
914
+ <label>
915
+ <input data-secondary type="radio" name="preset" value="detransform"
916
+ aria-description="Convert transforms to geometry">
917
+ detransform
918
+ </label>
919
+ </p>
920
+
921
+ <p>
922
+ <label>
923
+ <input data-secondary type="radio" name="preset" value="poly" aria-description="Convert Bézier to poly">
924
+ poly
925
+ </label>
926
+ </p>
927
+
928
+ <p>
929
+ <label>
930
+ <input data-secondary type="radio" name="preset" value="curvefit"
931
+ aria-description="Convert polygon to Bézier">
932
+ curvefit
933
+ </label>
934
+ </p>
935
+
936
+
937
+ <p>
938
+ <label>
939
+ <input data-secondary type="radio" name="preset" value="noSimplification"
940
+ aria-description="Retains original geometry but applies rounding, conversion to relative and shorthands">
941
+ noSimplification
942
+ </label>
943
+ </p>
944
+
945
+
946
+ <p>
947
+ <label>
948
+ <input data-secondary type="radio" name="preset" value="high"
949
+ aria-description="Prioritize filesize: Enables more optimizations: cubicToArcs, mixed value compression simplification">
950
+ high
951
+ </label>
952
+ </p>
953
+
954
+ <details class="mrg-0-5em mrg-top">
955
+ <summary class="h4">Current settings</summary>
956
+ <p>
957
+ <label>Current Settings
958
+ <textarea class="code" name="config" id="textConfig" data-tools="copy" data-secondary
959
+ readonly></textarea>
960
+ </label>
961
+ <label><input type="checkbox" data-type="checkbox-switch" name="omitDefaults" data-secondary
962
+ aria-description="only include settings that are not defaults" checked>omitDefaults</label>
963
+
964
+ </p>
965
+ </details>
966
+
967
+
968
+ </div>
969
+
970
+
971
+
972
+ <!-- menu marker size-->
841
973
  <div class="menu menu-marker-size menu-top-right --menu-active" data-menu="menu1">
842
974
  <p>
843
975
  <label>Marker size
844
- <input type="number" id="inpuMarkerSize" name="markerSize" value="0.3" min="0.05" max="1" step="0.05" data-ignore>
976
+ <input type="number" id="inpuMarkerSize" name="markerSize" value="0.3" min="0.05" max="1" step="0.05"
977
+ data-ignore>
845
978
  </label>
846
979
  </p>
847
980
  </div>
@@ -851,6 +984,11 @@
851
984
  <div id="spriteMap"></div>
852
985
  -->
853
986
 
987
+
988
+
989
+
990
+
991
+
854
992
  </body>
855
993
 
856
994
  </html>