@emasoft/svg-matrix 1.0.10 → 1.0.12
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/bin/svg-matrix.js +222 -123
- package/package.json +1 -1
- package/scripts/test-postinstall.js +93 -0
- package/src/flatten-pipeline.js +992 -0
- package/src/index.js +15 -4
- package/src/svg-parser.js +730 -0
package/src/index.js
CHANGED
|
@@ -5,15 +5,16 @@
|
|
|
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.12
|
|
9
9
|
* @license MIT
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* // ES Module import
|
|
13
13
|
* import { Decimal, Matrix, Vector, Transforms2D, GeometryToPath } from '@emasoft/svg-matrix';
|
|
14
14
|
*
|
|
15
|
-
* //
|
|
16
|
-
*
|
|
15
|
+
* // Precision is already set to 80 by default (max is 1e9)
|
|
16
|
+
* // You can increase it further if needed:
|
|
17
|
+
* // Decimal.set({ precision: 200 });
|
|
17
18
|
*
|
|
18
19
|
* // Create and compose 2D transforms
|
|
19
20
|
* const M = Transforms2D.translation(2, 3)
|
|
@@ -43,13 +44,20 @@ import * as UseSymbolResolver from './use-symbol-resolver.js';
|
|
|
43
44
|
import * as MarkerResolver from './marker-resolver.js';
|
|
44
45
|
import * as MeshGradient from './mesh-gradient.js';
|
|
45
46
|
import * as TextToPath from './text-to-path.js';
|
|
47
|
+
import * as SVGParser from './svg-parser.js';
|
|
48
|
+
import * as FlattenPipeline from './flatten-pipeline.js';
|
|
46
49
|
import { Logger, LogLevel, setLogLevel, getLogLevel as getLoggerLevel, enableFileLogging, disableFileLogging } from './logger.js';
|
|
47
50
|
|
|
51
|
+
// Set high-precision default (80 significant digits) on module load
|
|
52
|
+
// This is the same precision used internally by all svg-matrix modules
|
|
53
|
+
// Users can increase further with setPrecision() or Decimal.set() - max is 1e9
|
|
54
|
+
Decimal.set({ precision: 80 });
|
|
55
|
+
|
|
48
56
|
/**
|
|
49
57
|
* Library version
|
|
50
58
|
* @constant {string}
|
|
51
59
|
*/
|
|
52
|
-
export const VERSION = '1.0.
|
|
60
|
+
export const VERSION = '1.0.12';
|
|
53
61
|
|
|
54
62
|
/**
|
|
55
63
|
* Default precision for path output (decimal places)
|
|
@@ -83,6 +91,7 @@ export { SVGFlatten, BrowserVerify };
|
|
|
83
91
|
export { ClipPathResolver, MaskResolver, PatternResolver };
|
|
84
92
|
export { UseSymbolResolver, MarkerResolver };
|
|
85
93
|
export { MeshGradient, TextToPath };
|
|
94
|
+
export { SVGParser, FlattenPipeline };
|
|
86
95
|
|
|
87
96
|
// ============================================================================
|
|
88
97
|
// LOGGING: Configurable logging control
|
|
@@ -415,6 +424,8 @@ export default {
|
|
|
415
424
|
MarkerResolver,
|
|
416
425
|
MeshGradient,
|
|
417
426
|
TextToPath,
|
|
427
|
+
SVGParser,
|
|
428
|
+
FlattenPipeline,
|
|
418
429
|
|
|
419
430
|
// Logging
|
|
420
431
|
Logger,
|