@emasoft/svg-matrix 1.0.17 → 1.0.19
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 +29 -3
- package/package.json +1 -1
- package/scripts/postinstall.js +7 -10
- package/src/index.js +2 -2
package/README.md
CHANGED
|
@@ -68,6 +68,26 @@ npm install @emasoft/svg-matrix
|
|
|
68
68
|
|
|
69
69
|
This downloads the library into a folder called `node_modules` in your project.
|
|
70
70
|
|
|
71
|
+
#### Upgrading to the Latest Version
|
|
72
|
+
|
|
73
|
+
To update to the latest version:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm update @emasoft/svg-matrix
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Or to install a specific version:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm install @emasoft/svg-matrix@latest
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
To check your current version:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm list @emasoft/svg-matrix
|
|
89
|
+
```
|
|
90
|
+
|
|
71
91
|
#### Step 2: Create a JavaScript file
|
|
72
92
|
|
|
73
93
|
Create a new file called `example.js` in your project folder.
|
|
@@ -408,6 +428,15 @@ This library requires ES modules (modern browsers). For IE11 or very old browser
|
|
|
408
428
|
The library includes a command-line interface for batch processing SVG files.
|
|
409
429
|
|
|
410
430
|
```bash
|
|
431
|
+
# Show help
|
|
432
|
+
svg-matrix --help
|
|
433
|
+
|
|
434
|
+
# Show command-specific help
|
|
435
|
+
svg-matrix flatten --help
|
|
436
|
+
|
|
437
|
+
# Show version
|
|
438
|
+
svg-matrix --version
|
|
439
|
+
|
|
411
440
|
# Process single file
|
|
412
441
|
svg-matrix flatten input.svg -o output.svg
|
|
413
442
|
|
|
@@ -425,9 +454,6 @@ svg-matrix normalize input.svg -o output.svg
|
|
|
425
454
|
|
|
426
455
|
# Show SVG file info
|
|
427
456
|
svg-matrix info input.svg
|
|
428
|
-
|
|
429
|
-
# Show help
|
|
430
|
-
svg-matrix help
|
|
431
457
|
```
|
|
432
458
|
|
|
433
459
|
### CLI Options
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -98,7 +98,7 @@ function showWelcome() {
|
|
|
98
98
|
? { tl: '╭', tr: '╮', bl: '╰', br: '╯', h: '─', v: '│', dot: '•' }
|
|
99
99
|
: { tl: '+', tr: '+', bl: '+', br: '+', h: '-', v: '|', dot: '*' };
|
|
100
100
|
|
|
101
|
-
const W =
|
|
101
|
+
const W = 70;
|
|
102
102
|
const hr = B.h.repeat(W);
|
|
103
103
|
const R = (s) => pad(s, W);
|
|
104
104
|
|
|
@@ -114,15 +114,12 @@ ${c.cyan}${B.v}${hr}${B.v}${c.reset}
|
|
|
114
114
|
${c.cyan}${B.v}${c.reset}${R('')}${c.cyan}${B.v}${c.reset}
|
|
115
115
|
${c.cyan}${B.v}${c.reset}${R(` ${c.yellow}CLI Commands:${c.reset}`)}${c.cyan}${B.v}${c.reset}
|
|
116
116
|
${c.cyan}${B.v}${c.reset}${R('')}${c.cyan}${B.v}${c.reset}
|
|
117
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.green}svg-matrix flatten${c.reset}
|
|
118
|
-
${c.cyan}${B.v}${c.reset}${R(`
|
|
117
|
+
${c.cyan}${B.v}${c.reset}${R(` ${c.green}svg-matrix flatten${c.reset} ${c.dim}Bake transforms into path coordinates${c.reset}`)}${c.cyan}${B.v}${c.reset}
|
|
118
|
+
${c.cyan}${B.v}${c.reset}${R(` ${c.green}svg-matrix convert${c.reset} ${c.dim}Convert shapes to <path> elements${c.reset}`)}${c.cyan}${B.v}${c.reset}
|
|
119
|
+
${c.cyan}${B.v}${c.reset}${R(` ${c.green}svg-matrix normalize${c.reset} ${c.dim}Convert paths to cubic Beziers${c.reset}`)}${c.cyan}${B.v}${c.reset}
|
|
120
|
+
${c.cyan}${B.v}${c.reset}${R(` ${c.green}svg-matrix info${c.reset} ${c.dim}Show SVG file information${c.reset}`)}${c.cyan}${B.v}${c.reset}
|
|
119
121
|
${c.cyan}${B.v}${c.reset}${R('')}${c.cyan}${B.v}${c.reset}
|
|
120
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.
|
|
121
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.dim}--precision N${c.reset} Output decimal places (default: 6)`)}${c.cyan}${B.v}${c.reset}
|
|
122
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.dim}--clip-segments N${c.reset} Polygon sampling for clips (default: 64)`)}${c.cyan}${B.v}${c.reset}
|
|
123
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.dim}--bezier-arcs N${c.reset} Bezier arcs for curves (default: 8)`)}${c.cyan}${B.v}${c.reset}
|
|
124
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.dim}--e2e-tolerance N${c.reset} Verification tolerance (default: 1e-10)`)}${c.cyan}${B.v}${c.reset}
|
|
125
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.dim}--verbose${c.reset} Show processing details`)}${c.cyan}${B.v}${c.reset}
|
|
122
|
+
${c.cyan}${B.v}${c.reset}${R(` ${c.dim}Run${c.reset} svg-matrix --help ${c.dim}or${c.reset} svg-matrix <cmd> --help`)}${c.cyan}${B.v}${c.reset}
|
|
126
123
|
${c.cyan}${B.v}${c.reset}${R('')}${c.cyan}${B.v}${c.reset}
|
|
127
124
|
${c.cyan}${B.v}${hr}${B.v}${c.reset}
|
|
128
125
|
${c.cyan}${B.v}${c.reset}${R('')}${c.cyan}${B.v}${c.reset}
|
|
@@ -137,7 +134,7 @@ ${c.cyan}${B.v}${c.reset}${R(` ${c.green}${B.dot} Transforms3D${c.reset} 3D af
|
|
|
137
134
|
${c.cyan}${B.v}${c.reset}${R('')}${c.cyan}${B.v}${c.reset}
|
|
138
135
|
${c.cyan}${B.v}${hr}${B.v}${c.reset}
|
|
139
136
|
${c.cyan}${B.v}${c.reset}${R('')}${c.cyan}${B.v}${c.reset}
|
|
140
|
-
${c.cyan}${B.v}${c.reset}${R(` ${c.yellow}New in v1.0.
|
|
137
|
+
${c.cyan}${B.v}${c.reset}${R(` ${c.yellow}New in v1.0.19:${c.reset}`)}${c.cyan}${B.v}${c.reset}
|
|
141
138
|
${c.cyan}${B.v}${c.reset}${R(` ${c.green}${B.dot}${c.reset} Enhanced CLI help: svg-matrix <command> --help`)}${c.cyan}${B.v}${c.reset}
|
|
142
139
|
${c.cyan}${B.v}${c.reset}${R(` ${c.green}${B.dot}${c.reset} High-precision Bezier circle/ellipse approximation`)}${c.cyan}${B.v}${c.reset}
|
|
143
140
|
${c.cyan}${B.v}${c.reset}${R(` ${c.green}${B.dot}${c.reset} E2E verification always enabled for precision`)}${c.cyan}${B.v}${c.reset}
|
package/src/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* SVG path conversion, and 2D/3D affine transformations using Decimal.js.
|
|
6
6
|
*
|
|
7
7
|
* @module @emasoft/svg-matrix
|
|
8
|
-
* @version 1.0.
|
|
8
|
+
* @version 1.0.19
|
|
9
9
|
* @license MIT
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
@@ -58,7 +58,7 @@ Decimal.set({ precision: 80 });
|
|
|
58
58
|
* Library version
|
|
59
59
|
* @constant {string}
|
|
60
60
|
*/
|
|
61
|
-
export const VERSION = '1.0.
|
|
61
|
+
export const VERSION = '1.0.19';
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Default precision for path output (decimal places)
|