svg-path-commander 1.0.5 → 2.0.0-alpha2

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 (131) hide show
  1. package/README.md +26 -4
  2. package/dist/svg-path-commander.cjs +2 -0
  3. package/dist/svg-path-commander.cjs.map +1 -0
  4. package/dist/svg-path-commander.d.ts +454 -0
  5. package/dist/svg-path-commander.js +2 -3762
  6. package/dist/svg-path-commander.js.map +1 -0
  7. package/dist/svg-path-commander.mjs +1194 -0
  8. package/dist/svg-path-commander.mjs.map +1 -0
  9. package/package.json +39 -42
  10. package/src/convert/pathToAbsolute.ts +101 -0
  11. package/src/convert/{pathToCurve.js → pathToCurve.ts} +12 -14
  12. package/src/convert/pathToRelative.ts +92 -0
  13. package/src/convert/pathToString.ts +17 -0
  14. package/src/{svg-path-commander.js → index.ts} +143 -66
  15. package/src/interface.ts +129 -0
  16. package/src/math/distanceSquareRoot.ts +13 -0
  17. package/src/math/midPoint.ts +16 -0
  18. package/src/math/{polygonArea.js → polygonArea.ts} +6 -4
  19. package/src/math/{polygonLength.js → polygonLength.ts} +5 -3
  20. package/src/math/rotateVector.ts +16 -0
  21. package/src/options/options.ts +9 -0
  22. package/src/parser/error.ts +2 -0
  23. package/src/parser/finalizeSegment.ts +31 -0
  24. package/src/parser/{invalidPathValue.js → invalidPathValue.ts} +0 -0
  25. package/src/parser/{isArcCommand.js → isArcCommand.ts} +5 -4
  26. package/src/parser/isDigit.ts +12 -0
  27. package/src/parser/isDigitStart.ts +14 -0
  28. package/src/parser/isPathCommand.ts +28 -0
  29. package/src/parser/isSpace.ts +23 -0
  30. package/src/parser/paramsCount.ts +16 -0
  31. package/src/parser/paramsParser.ts +14 -0
  32. package/src/parser/{parsePathString.js → parsePathString.ts} +13 -7
  33. package/src/parser/pathParser.ts +29 -0
  34. package/src/parser/{scanFlag.js → scanFlag.ts} +8 -5
  35. package/src/parser/{scanParam.js → scanParam.ts} +12 -11
  36. package/src/parser/{scanSegment.js → scanSegment.ts} +9 -5
  37. package/src/parser/{skipSpaces.js → skipSpaces.ts} +5 -3
  38. package/src/process/{arcToCubic.js → arcToCubic.ts} +42 -28
  39. package/src/process/fixArc.ts +23 -0
  40. package/src/process/getSVGMatrix.ts +70 -0
  41. package/src/process/lineToCubic.ts +17 -0
  42. package/src/process/{normalizePath.js → normalizePath.ts} +10 -10
  43. package/src/process/normalizeSegment.ts +47 -0
  44. package/src/process/{optimizePath.js → optimizePath.ts} +18 -21
  45. package/src/process/{projection2d.js → projection2d.ts} +16 -15
  46. package/src/process/quadToCubic.ts +31 -0
  47. package/src/process/reverseCurve.ts +21 -0
  48. package/src/process/reversePath.ts +101 -0
  49. package/src/process/roundPath.ts +29 -0
  50. package/src/process/segmentToCubic.ts +46 -0
  51. package/src/process/shortenSegment.ts +79 -0
  52. package/src/process/splitCubic.ts +28 -0
  53. package/src/process/{splitPath.js → splitPath.ts} +9 -8
  54. package/src/process/{transformPath.js → transformPath.ts} +55 -48
  55. package/src/types.ts +193 -0
  56. package/src/util/getClosestPoint.ts +15 -0
  57. package/src/util/{getDrawDirection.js → getDrawDirection.ts} +7 -4
  58. package/src/util/getPathArea.ts +70 -0
  59. package/src/util/{getPathBBox.js → getPathBBox.ts} +16 -5
  60. package/src/util/getPointAtLength.ts +14 -0
  61. package/src/util/{getPropertiesAtLength.js → getPropertiesAtLength.ts} +28 -19
  62. package/src/util/{getPropertiesAtPoint.js → getPropertiesAtPoint.ts} +16 -12
  63. package/src/util/getSegmentAtLength.ts +15 -0
  64. package/src/util/getSegmentOfPoint.ts +18 -0
  65. package/src/util/{getTotalLength.js → getTotalLength.ts} +6 -4
  66. package/src/util/isAbsoluteArray.ts +18 -0
  67. package/src/util/{isCurveArray.js → isCurveArray.ts} +6 -4
  68. package/src/util/{isNormalizedArray.js → isNormalizedArray.ts} +4 -2
  69. package/src/util/isPathArray.ts +19 -0
  70. package/src/util/isPointInStroke.ts +15 -0
  71. package/src/util/isRelativeArray.ts +18 -0
  72. package/src/util/{isValidPath.js → isValidPath.ts} +5 -4
  73. package/src/util/{pathLengthFactory.js → pathLengthFactory.ts} +38 -31
  74. package/src/util/{segmentArcFactory.js → segmentArcFactory.ts} +71 -55
  75. package/src/util/segmentCubicFactory.ts +114 -0
  76. package/src/util/{segmentLineFactory.js → segmentLineFactory.ts} +10 -8
  77. package/src/util/{segmentQuadFactory.js → segmentQuadFactory.ts} +47 -32
  78. package/src/util/shapeToPath.ts +214 -0
  79. package/dist/svg-path-commander.es5.js +0 -3875
  80. package/dist/svg-path-commander.es5.min.js +0 -2
  81. package/dist/svg-path-commander.esm.js +0 -3754
  82. package/dist/svg-path-commander.esm.min.js +0 -2
  83. package/dist/svg-path-commander.min.js +0 -2
  84. package/src/convert/pathToAbsolute.js +0 -86
  85. package/src/convert/pathToRelative.js +0 -84
  86. package/src/convert/pathToString.js +0 -14
  87. package/src/index.js +0 -10
  88. package/src/math/distanceSquareRoot.js +0 -14
  89. package/src/math/epsilon.js +0 -8
  90. package/src/math/midPoint.js +0 -13
  91. package/src/math/rotateVector.js +0 -14
  92. package/src/options/options.js +0 -10
  93. package/src/parser/error.js +0 -2
  94. package/src/parser/finalizeSegment.js +0 -28
  95. package/src/parser/isDigit.js +0 -9
  96. package/src/parser/isDigitStart.js +0 -13
  97. package/src/parser/isPathCommand.js +0 -25
  98. package/src/parser/isSpace.js +0 -16
  99. package/src/parser/paramsCount.js +0 -9
  100. package/src/parser/paramsParser.js +0 -8
  101. package/src/parser/pathParser.js +0 -24
  102. package/src/process/clonePath.js +0 -9
  103. package/src/process/fixArc.js +0 -21
  104. package/src/process/fixPath.js +0 -31
  105. package/src/process/getSVGMatrix.js +0 -61
  106. package/src/process/lineToCubic.js +0 -30
  107. package/src/process/normalizeSegment.js +0 -45
  108. package/src/process/quadToCubic.js +0 -22
  109. package/src/process/reverseCurve.js +0 -18
  110. package/src/process/reversePath.js +0 -89
  111. package/src/process/roundPath.js +0 -26
  112. package/src/process/segmentToCubic.js +0 -46
  113. package/src/process/shortenSegment.js +0 -58
  114. package/src/process/splitCubic.js +0 -26
  115. package/src/util/getClosestPoint.js +0 -12
  116. package/src/util/getPathArea.js +0 -47
  117. package/src/util/getPointAtLength.js +0 -12
  118. package/src/util/getSegmentAtLength.js +0 -11
  119. package/src/util/getSegmentOfPoint.js +0 -12
  120. package/src/util/isAbsoluteArray.js +0 -14
  121. package/src/util/isPathArray.js +0 -14
  122. package/src/util/isPointInStroke.js +0 -13
  123. package/src/util/isRelativeArray.js +0 -14
  124. package/src/util/segmentCubicFactory.js +0 -97
  125. package/src/util/shapeToPath.js +0 -204
  126. package/src/util/util.js +0 -82
  127. package/src/version.js +0 -8
  128. package/types/index.d.ts +0 -120
  129. package/types/more/modules.ts +0 -82
  130. package/types/more/svg.d.ts +0 -211
  131. package/types/svg-path-commander.d.ts +0 -1089
@@ -1,97 +0,0 @@
1
- import distanceSquareRoot from '../math/distanceSquareRoot';
2
-
3
- /**
4
- * Returns a {x,y} point at a given length, the total length and
5
- * the minimum and maximum {x,y} coordinates of a C (cubic-bezier) segment.
6
- *
7
- * @param {number} x1 the starting point X
8
- * @param {number} y1 the starting point Y
9
- * @param {number} c1x the first control point X
10
- * @param {number} c1y the first control point Y
11
- * @param {number} c2x the second control point X
12
- * @param {number} c2y the second control point Y
13
- * @param {number} x2 the ending point X
14
- * @param {number} y2 the ending point Y
15
- * @param {number} t a [0-1] ratio
16
- * @returns {{x: number, y: number}} the cubic-bezier segment length
17
- */
18
- function getPointAtCubicSegmentLength(x1, y1, c1x, c1y, c2x, c2y, x2, y2, t) {
19
- const t1 = 1 - t;
20
- return {
21
- x: (t1 ** 3) * x1
22
- + 3 * (t1 ** 2) * t * c1x
23
- + 3 * t1 * (t ** 2) * c2x
24
- + (t ** 3) * x2,
25
- y: (t1 ** 3) * y1
26
- + 3 * (t1 ** 2) * t * c1y
27
- + 3 * t1 * (t ** 2) * c2y
28
- + (t ** 3) * y2,
29
- };
30
- }
31
-
32
- /**
33
- * Returns the length of a C (cubic-bezier) segment
34
- * or an {x,y} point at a given length.
35
- *
36
- * @param {number} x1 the starting point X
37
- * @param {number} y1 the starting point Y
38
- * @param {number} c1x the first control point X
39
- * @param {number} c1y the first control point Y
40
- * @param {number} c2x the second control point X
41
- * @param {number} c2y the second control point Y
42
- * @param {number} x2 the ending point X
43
- * @param {number} y2 the ending point Y
44
- * @param {number=} distance the point distance
45
- * @returns {SVGPath.lengthFactory} the segment length, point, min & max
46
- */
47
- export default function segmentCubicFactory(x1, y1, c1x, c1y, c2x, c2y, x2, y2, distance) {
48
- const distanceIsNumber = typeof distance === 'number';
49
- let x = x1; let y = y1;
50
- let LENGTH = 0;
51
- let prev = [x, y, LENGTH];
52
- let cur = [x, y];
53
- let t = 0;
54
- let POINT = { x: 0, y: 0 };
55
- let POINTS = [{ x, y }];
56
-
57
- if (distanceIsNumber && distance <= 0) {
58
- POINT = { x, y };
59
- }
60
-
61
- const sampleSize = 300;
62
- for (let j = 0; j <= sampleSize; j += 1) {
63
- t = j / sampleSize;
64
-
65
- ({ x, y } = getPointAtCubicSegmentLength(x1, y1, c1x, c1y, c2x, c2y, x2, y2, t));
66
- POINTS = [...POINTS, { x, y }];
67
- LENGTH += distanceSquareRoot(cur, [x, y]);
68
- cur = [x, y];
69
-
70
- if (distanceIsNumber && LENGTH > distance && distance > prev[2]) {
71
- const dv = (LENGTH - distance) / (LENGTH - prev[2]);
72
-
73
- POINT = {
74
- x: cur[0] * (1 - dv) + prev[0] * dv,
75
- y: cur[1] * (1 - dv) + prev[1] * dv,
76
- };
77
- }
78
- prev = [x, y, LENGTH];
79
- }
80
-
81
- if (distanceIsNumber && distance >= LENGTH) {
82
- POINT = { x: x2, y: y2 };
83
- }
84
-
85
- return {
86
- length: LENGTH,
87
- point: POINT,
88
- min: {
89
- x: Math.min(...POINTS.map((n) => n.x)),
90
- y: Math.min(...POINTS.map((n) => n.y)),
91
- },
92
- max: {
93
- x: Math.max(...POINTS.map((n) => n.x)),
94
- y: Math.max(...POINTS.map((n) => n.y)),
95
- },
96
- };
97
- }
@@ -1,204 +0,0 @@
1
- import pathToString from '../convert/pathToString';
2
- import defaultOptions from '../options/options';
3
- import error from '../parser/error';
4
- import isValidPath from './isValidPath';
5
-
6
- /**
7
- * Supported shapes and their specific parameters.
8
- * @type {Object.<string, string[]>}
9
- */
10
- const shapeParams = {
11
- line: ['x1', 'y1', 'x2', 'y2'],
12
- circle: ['cx', 'cy', 'r'],
13
- ellipse: ['cx', 'cy', 'rx', 'ry'],
14
- rect: ['width', 'height', 'x', 'y', 'rx', 'ry'],
15
- polygon: ['points'],
16
- polyline: ['points'],
17
- glyph: ['d'],
18
- };
19
-
20
- /**
21
- * Returns a new `pathArray` from line attributes.
22
- *
23
- * @param {SVGPath.lineAttr} attr shape configuration
24
- * @returns {SVGPath.pathArray} a new line `pathArray`
25
- */
26
- export function getLinePath(attr) {
27
- const {
28
- x1, y1, x2, y2,
29
- } = attr;
30
- return [['M', x1, y1], ['L', x2, y2]];
31
- }
32
-
33
- /**
34
- * Returns a new `pathArray` like from polyline/polygon attributes.
35
- *
36
- * @param {SVGPath.polyAttr} attr shape configuration
37
- * @return {SVGPath.pathArray} a new polygon/polyline `pathArray`
38
- */
39
- export function getPolyPath(attr) {
40
- /** @type {SVGPath.pathArray} */
41
- const pathArray = [];
42
- const points = (attr.points || '').trim().split(/[\s|,]/).map(Number);
43
-
44
- let index = 0;
45
- while (index < points.length) {
46
- pathArray.push([(index ? 'L' : 'M'), (points[index]), (points[index + 1])]);
47
- index += 2;
48
- }
49
-
50
- return attr.type === 'polygon' ? [...pathArray, ['z']] : pathArray;
51
- }
52
-
53
- /**
54
- * Returns a new `pathArray` from circle attributes.
55
- *
56
- * @param {SVGPath.circleAttr} attr shape configuration
57
- * @return {SVGPath.pathArray} a circle `pathArray`
58
- */
59
- export function getCirclePath(attr) {
60
- const {
61
- cx, cy, r,
62
- } = attr;
63
-
64
- return [
65
- ['M', (cx - r), cy],
66
- ['a', r, r, 0, 1, 0, (2 * r), 0],
67
- ['a', r, r, 0, 1, 0, (-2 * r), 0],
68
- ];
69
- }
70
-
71
- /**
72
- * Returns a new `pathArray` from ellipse attributes.
73
- *
74
- * @param {SVGPath.ellipseAttr} attr shape configuration
75
- * @return {SVGPath.pathArray} an ellipse `pathArray`
76
- */
77
- export function getEllipsePath(attr) {
78
- const {
79
- cx, cy, rx, ry,
80
- } = attr;
81
-
82
- return [
83
- ['M', (cx - rx), cy],
84
- ['a', rx, ry, 0, 1, 0, (2 * rx), 0],
85
- ['a', rx, ry, 0, 1, 0, (-2 * rx), 0],
86
- ];
87
- }
88
-
89
- /**
90
- * Returns a new `pathArray` like from rect attributes.
91
- *
92
- * @param {SVGPath.rectAttr} attr object with properties above
93
- * @return {SVGPath.pathArray} a new `pathArray` from `<rect>` attributes
94
- */
95
- export function getRectanglePath(attr) {
96
- const x = +attr.x || 0;
97
- const y = +attr.y || 0;
98
- const w = +attr.width;
99
- const h = +attr.height;
100
- let rx = +attr.rx;
101
- let ry = +attr.ry;
102
-
103
- // Validity checks from http://www.w3.org/TR/SVG/shapes.html#RectElement:
104
- if (rx || ry) {
105
- rx = !rx ? ry : rx;
106
- ry = !ry ? rx : ry;
107
-
108
- /* istanbul ignore else */
109
- if (rx * 2 > w) rx -= (rx * 2 - w) / 2;
110
- /* istanbul ignore else */
111
- if (ry * 2 > h) ry -= (ry * 2 - h) / 2;
112
-
113
- return [
114
- ['M', x + rx, y],
115
- ['h', w - rx * 2],
116
- ['s', rx, 0, rx, ry],
117
- ['v', h - ry * 2],
118
- ['s', 0, ry, -rx, ry],
119
- ['h', -w + rx * 2],
120
- ['s', -rx, 0, -rx, -ry],
121
- ['v', -h + ry * 2],
122
- ['s', 0, -ry, rx, -ry],
123
- ];
124
- }
125
-
126
- return [
127
- ['M', x, y],
128
- ['h', w],
129
- ['v', h],
130
- ['H', x],
131
- ['Z'],
132
- ];
133
- }
134
-
135
- /**
136
- * Returns a new `<path>` element created from attributes of a `<line>`, `<polyline>`,
137
- * `<polygon>`, `<rect>`, `<ellipse>`, `<circle>` or `<glyph>`. If `replace` parameter
138
- * is `true`, it will replace the target.
139
- *
140
- * It can also work with an options object,
141
- * @see SVGPath.shapeOps
142
- *
143
- * The newly created `<path>` element keeps all non-specific
144
- * attributes like `class`, `fill`, etc.
145
- *
146
- * @param {SVGPath.shapeTypes | SVGPath.shapeOps} element target shape
147
- * @param {boolean=} replace option to replace target
148
- * @return {SVGPathElement | boolean} the newly created `<path>` element
149
- */
150
- export default function shapeToPath(element, replace) {
151
- const supportedShapes = Object.keys(shapeParams);
152
- const { tagName } = element;
153
-
154
- if (tagName && !supportedShapes.some((s) => tagName === s)) {
155
- throw TypeError(`${error}: "${tagName}" is not SVGElement`);
156
- }
157
-
158
- const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
159
- /** @type {string} */
160
- const type = tagName || element.type;
161
- /** @type {any} disables TS checking for something that's specific to shape */
162
- const config = {};
163
- config.type = type;
164
- const shapeAttrs = shapeParams[type];
165
-
166
- if (tagName) {
167
- shapeAttrs.forEach((p) => { config[p] = element.getAttribute(p); });
168
- // set no-specific shape attributes: fill, stroke, etc
169
- Object.values(element.attributes).forEach(({ name, value }) => {
170
- if (!shapeAttrs.includes(name)) path.setAttribute(name, value);
171
- });
172
- } else {
173
- Object.assign(config, element);
174
- // set no-specific shape attributes: fill, stroke, etc
175
- Object.keys(config).forEach((k) => {
176
- if (!shapeAttrs.includes(k) && k !== 'type') {
177
- path.setAttribute(k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`), config[k]);
178
- }
179
- });
180
- }
181
-
182
- // set d
183
- let description;
184
- const { round } = defaultOptions;
185
-
186
- /* istanbul ignore else */
187
- if (type === 'circle') description = pathToString(getCirclePath(config), round);
188
- else if (type === 'ellipse') description = pathToString(getEllipsePath(config), round);
189
- else if (['polyline', 'polygon'].includes(type)) description = pathToString(getPolyPath(config), round);
190
- else if (type === 'rect') description = pathToString(getRectanglePath(config), round);
191
- else if (type === 'line') description = pathToString(getLinePath(config), round);
192
- else if (type === 'glyph') description = tagName ? element.getAttribute('d') : element.d;
193
-
194
- // replace target element
195
- if (isValidPath(description)) {
196
- path.setAttribute('d', description);
197
- if (replace && tagName) {
198
- element.before(path, element);
199
- element.remove();
200
- }
201
- return path;
202
- }
203
- return false;
204
- }
package/src/util/util.js DELETED
@@ -1,82 +0,0 @@
1
- import CSSMatrix from 'dommatrix';
2
- import defaultOptions from '../options/options';
3
- import getPathBBox from './getPathBBox';
4
- import getPathArea from './getPathArea';
5
- import getTotalLength from './getTotalLength';
6
- import getDrawDirection from './getDrawDirection';
7
- import getPointAtLength from './getPointAtLength';
8
- import pathLengthFactory from './pathLengthFactory';
9
-
10
- import getPropertiesAtLength from './getPropertiesAtLength';
11
- import getPropertiesAtPoint from './getPropertiesAtPoint';
12
- import getClosestPoint from './getClosestPoint';
13
- import getSegmentOfPoint from './getSegmentOfPoint';
14
- import getSegmentAtLength from './getSegmentAtLength';
15
- import isPointInStroke from './isPointInStroke';
16
-
17
- import isValidPath from './isValidPath';
18
- import isPathArray from './isPathArray';
19
- import isAbsoluteArray from './isAbsoluteArray';
20
- import isRelativeArray from './isRelativeArray';
21
- import isCurveArray from './isCurveArray';
22
- import isNormalizedArray from './isNormalizedArray';
23
- import shapeToPath from './shapeToPath';
24
-
25
- import parsePathString from '../parser/parsePathString';
26
- import clonePath from '../process/clonePath';
27
- import roundPath from '../process/roundPath';
28
- import splitPath from '../process/splitPath';
29
- import optimizePath from '../process/optimizePath';
30
- import reverseCurve from '../process/reverseCurve';
31
- import reversePath from '../process/reversePath';
32
- import normalizePath from '../process/normalizePath';
33
- import transformPath from '../process/transformPath';
34
- import fixPath from '../process/fixPath';
35
-
36
- import pathToAbsolute from '../convert/pathToAbsolute';
37
- import pathToRelative from '../convert/pathToRelative';
38
- import pathToCurve from '../convert/pathToCurve';
39
- import pathToString from '../convert/pathToString';
40
-
41
- /**
42
- * @interface
43
- */
44
- const Util = {
45
- CSSMatrix,
46
- parsePathString,
47
- isPathArray,
48
- isCurveArray,
49
- isAbsoluteArray,
50
- isRelativeArray,
51
- isNormalizedArray,
52
- isValidPath,
53
- pathToAbsolute,
54
- pathToRelative,
55
- pathToCurve,
56
- pathToString,
57
- getDrawDirection,
58
- getPathArea,
59
- getPathBBox,
60
- pathLengthFactory,
61
- getTotalLength,
62
- getPointAtLength,
63
- getClosestPoint,
64
- getSegmentOfPoint,
65
- getPropertiesAtPoint,
66
- getPropertiesAtLength,
67
- getSegmentAtLength,
68
- isPointInStroke,
69
- clonePath,
70
- splitPath,
71
- fixPath,
72
- roundPath,
73
- optimizePath,
74
- reverseCurve,
75
- reversePath,
76
- normalizePath,
77
- transformPath,
78
- shapeToPath,
79
- options: defaultOptions,
80
- };
81
-
82
- export default Util;
package/src/version.js DELETED
@@ -1,8 +0,0 @@
1
- import { version } from '../package.json';
2
-
3
- /**
4
- * A global namespace for library version.
5
- * @type {string}
6
- */
7
- const Version = version;
8
- export default Version;
package/types/index.d.ts DELETED
@@ -1,120 +0,0 @@
1
- export as namespace SVGPath;
2
- export default SVGPathCommander;
3
-
4
- // modules
5
- export { default as pathToAbsolute } from "svg-path-commander/src/convert/pathToAbsolute";
6
- export { default as pathToRelative } from "svg-path-commander/src/convert/pathToRelative";
7
- export { default as pathToCurve } from "svg-path-commander/src/convert/pathToCurve";
8
- export { default as pathToString } from "svg-path-commander/src/convert/pathToString";
9
- export { default as distanceSquareRoot } from "svg-path-commander/src/math/distanceSquareRoot";
10
- export { default as epsilon } from "svg-path-commander/src/math/epsilon";
11
- export { default as midPoint } from "svg-path-commander/src/math/midPoint";
12
- export { default as polygonArea } from "svg-path-commander/src/math/polygonArea";
13
- export { default as polygonLength } from "svg-path-commander/src/math/polygonLength";
14
- export { default as rotateVector } from "svg-path-commander/src/math/rotateVector";
15
- export { default as defaultOptions } from "svg-path-commander/src/options/options";
16
- export { default as finalizeSegment } from "svg-path-commander/src/parser/finalizeSegment";
17
- export { default as invalidPathValue } from "svg-path-commander/src/parser/invalidPathValue";
18
- export { default as isArcCommand } from "svg-path-commander/src/parser/isArcCommand";
19
- export { default as isDigit } from "svg-path-commander/src/parser/isDigit";
20
- export { default as isDigitStart } from "svg-path-commander/src/parser/isDigitStart";
21
- export { default as isPathCommand } from "svg-path-commander/src/parser/isPathCommand";
22
- export { default as isSpace } from "svg-path-commander/src/parser/isSpace";
23
- export { default as paramsCount } from "svg-path-commander/src/parser/paramsCount";
24
- export { default as paramsParser } from "svg-path-commander/src/parser/paramsParser";
25
- export { default as parsePathString } from "svg-path-commander/src/parser/parsePathString";
26
- export { default as PathParser } from "svg-path-commander/src/parser/pathParser";
27
- export { default as scanFlag } from "svg-path-commander/src/parser/scanFlag";
28
- export { default as scanParam } from "svg-path-commander/src/parser/scanParam";
29
- export { default as scanSegment } from "svg-path-commander/src/parser/scanSegment";
30
- export { default as skipSpaces } from "svg-path-commander/src/parser/skipSpaces";
31
- export { default as arcToCubic } from "svg-path-commander/src/process/arcToCubic";
32
- export { default as clonePath } from "svg-path-commander/src/process/clonePath";
33
- export { default as fixArc } from "svg-path-commander/src/process/fixArc";
34
- export { default as fixPath } from "svg-path-commander/src/process/fixPath";
35
- export { default as getSVGMatrix } from "svg-path-commander/src/process/getSVGMatrix";
36
- export { default as lineToCubic } from "svg-path-commander/src/process/lineToCubic";
37
- export { default as normalizePath } from "svg-path-commander/src/process/normalizePath";
38
- export { default as normalizeSegment } from "svg-path-commander/src/process/normalizeSegment";
39
- export { default as optimizePath } from "svg-path-commander/src/process/optimizePath";
40
- export { default as projection2d } from "svg-path-commander/src/process/projection2d";
41
- export { default as quadToCubic } from "svg-path-commander/src/process/quadToCubic";
42
- export { default as reverseCurve } from "svg-path-commander/src/process/reverseCurve";
43
- export { default as reversePath } from "svg-path-commander/src/process/reversePath";
44
- export { default as roundPath } from "svg-path-commander/src/process/roundPath";
45
- export { default as segmentToCubic } from "svg-path-commander/src/process/segmentToCubic";
46
- export { default as shortenSegment } from "svg-path-commander/src/process/shortenSegment";
47
- export { default as shorthandToCubic } from "svg-path-commander/src/process/shorthandToCubic";
48
- export { default as shorthandToQuad } from "svg-path-commander/src/process/shorthandToQuad";
49
- export { default as splitCubic } from "svg-path-commander/src/process/splitCubic";
50
- export { default as splitPath } from "svg-path-commander/src/process/splitPath";
51
- export { default as transformEllipse } from "svg-path-commander/src/process/transformEllipse";
52
- export { default as transformPath } from "svg-path-commander/src/process/transformPath";
53
- export { default as getDrawDirection } from "svg-path-commander/src/util/getDrawDirection";
54
- export { default as getPathArea } from "svg-path-commander/src/util/getPathArea";
55
- export { default as getPathBBox } from "svg-path-commander/src/util/getPathBBox";
56
- export { default as pathLengthFactory } from "svg-path-commander/src/util/pathLengthFactory";
57
- export { default as getTotalLength } from "svg-path-commander/src/util/getTotalLength";
58
- export { default as segmentLineFactory } from "svg-path-commander/src/util/segmentLineFactory";
59
- export { default as segmentArcFactory } from "svg-path-commander/src/util/segmentArcFactory";
60
- export { default as segmentCubicFactory } from "svg-path-commander/src/util/segmentCubicFactory";
61
- export { default as segmentQuadFactory } from "svg-path-commander/src/util/segmentQuadFactory";
62
- export { default as getPointAtLength } from "svg-path-commander/src/util/getPointAtLength";
63
- export { default as getPropertiesAtPoint } from "svg-path-commander/src/util/getPropertiesAtPoint";
64
- export { default as getPropertiesAtLength } from "svg-path-commander/src/util/getPropertiesAtLength";
65
- export { default as getClosestPoint } from "svg-path-commander/src/util/getClosestPoint";
66
- export { default as getSegmentAtLength } from "svg-path-commander/src/util/getSegmentAtLength";
67
- export { default as getSegmentOfPoint } from "svg-path-commander/src/util/getSegmentOfPoint";
68
- export { default as isPointInStroke } from "svg-path-commander/src/util/isPointInStroke";
69
- export { default as isAbsoluteArray } from "svg-path-commander/src/util/isAbsoluteArray";
70
- export { default as isCurveArray } from "svg-path-commander/src/util/isCurveArray";
71
- export { default as isNormalizedArray } from "svg-path-commander/src/util/isNormalizedArray";
72
- export { default as isPathArray } from "svg-path-commander/src/util/isPathArray";
73
- export { default as isRelativeArray } from "svg-path-commander/src/util/isRelativeArray";
74
- export { default as isValidPath } from "svg-path-commander/src/util/isValidPath";
75
- export { default as shapeToPath } from "svg-path-commander/src/util/shapeToPath";
76
- export { default as Version } from "svg-path-commander/src/version";
77
-
78
- // main
79
- import { default as SVGPathCommander } from 'svg-path-commander/src/svg-path-commander';
80
-
81
- // dependency
82
- export { default as CSSMatrix } from "dommatrix";
83
-
84
- // custom types
85
- export {
86
- MCommand, mCommand, LCommand, lCommand,
87
- VCommand, vCommand, HCommand, hCommand,
88
- ZCommand, zCommand, CCommand, cCommand,
89
- SCommand, sCommand, QCommand, qCommand,
90
- TCommand, tCommand, ACommand, aCommand,
91
- pathCommand, absoluteCommand, relativeCommand,
92
- MSegment, mSegment, moveSegment,
93
- LSegment, lSegment, lineSegment,
94
- VSegment, vSegment, vertLineSegment,
95
- HSegment, hSegment, horLineSegment,
96
- CSegment, cSegment, cubicSegment,
97
- SSegment, sSegment, shortCubicSegment,
98
- QSegment, qSegment, quadSegment,
99
- TSegment, tSegment, shortQuadSegment,
100
- ZSegment, zSegment, closeSegment,
101
- segmentProperties,
102
-
103
- shortSegment, absoluteSegment, relativeSegment, normalSegment, pathSegment,
104
- pathArray, absoluteArray, relativeArray, normalArray,
105
- curveArray, polygonArray, polylineArray,
106
-
107
- pathTransformList, transformObject,
108
-
109
- shapeTypes, shapeOps,
110
- lineAttr, polyAttr, circleAttr,
111
- ellipseAttr, rectAttr, glyphAttr,
112
-
113
- pathBBox,
114
- segmentLimits,
115
-
116
- options,
117
- parserParams,
118
- pointProperties,
119
- lengthFactory
120
- } from './more/svg';
@@ -1,82 +0,0 @@
1
- export { default as pathToAbsolute } from '../../src/convert/pathToAbsolute';
2
- export { default as pathToRelative } from '../../src/convert/pathToRelative';
3
- export { default as pathToCurve } from '../../src/convert/pathToCurve';
4
- export { default as pathToString } from '../../src/convert/pathToString';
5
-
6
- export { default as distanceSquareRoot } from '../../src/math/distanceSquareRoot';
7
- export { default as epsilon } from '../../src/math/epsilon';
8
- export { default as midPoint } from '../../src/math/midPoint';
9
- export { default as polygonArea } from '../../src/math/polygonArea';
10
- export { default as polygonLength } from '../../src/math/polygonLength';
11
- export { default as rotateVector } from '../../src/math/rotateVector';
12
-
13
- export { default as defaultOptions } from '../../src/options/options';
14
-
15
- export { default as finalizeSegment } from '../../src/parser/finalizeSegment';
16
- export { default as invalidPathValue } from '../../src/parser/invalidPathValue';
17
- export { default as isArcCommand } from '../../src/parser/isArcCommand';
18
- export { default as isDigit } from '../../src/parser/isDigit';
19
- export { default as isDigitStart } from '../../src/parser/isDigitStart';
20
- export { default as isPathCommand } from '../../src/parser/isPathCommand';
21
- export { default as isSpace } from '../../src/parser/isSpace';
22
- export { default as paramsCount } from '../../src/parser/paramsCount';
23
- export { default as paramsParser } from '../../src/parser/paramsParser';
24
- export { default as parsePathString } from '../../src/parser/parsePathString';
25
- export { default as PathParser } from '../../src/parser/pathParser';
26
- export { default as scanFlag } from '../../src/parser/scanFlag';
27
- export { default as scanParam } from '../../src/parser/scanParam';
28
- export { default as scanSegment } from '../../src/parser/scanSegment';
29
- export { default as skipSpaces } from '../../src/parser/skipSpaces';
30
-
31
- export { default as arcToCubic } from '../../src/process/arcToCubic';
32
- export { default as clonePath } from '../../src/process/clonePath';
33
- export { default as fixArc } from '../../src/process/fixArc';
34
- export { default as fixPath } from '../../src/process/fixPath';
35
- export { default as getSVGMatrix } from '../../src/process/getSVGMatrix';
36
- export { default as lineToCubic } from '../../src/process/lineToCubic';
37
- export { default as normalizePath } from '../../src/process/normalizePath';
38
- export { default as normalizeSegment } from '../../src/process/normalizeSegment';
39
- export { default as optimizePath } from '../../src/process/optimizePath';
40
- export { default as projection2d } from '../../src/process/projection2d';
41
- export { default as quadToCubic } from '../../src/process/quadToCubic';
42
- export { default as reverseCurve } from '../../src/process/reverseCurve';
43
- export { default as reversePath } from '../../src/process/reversePath';
44
- export { default as roundPath } from '../../src/process/roundPath';
45
- export { default as segmentToCubic } from '../../src/process/segmentToCubic';
46
- export { default as shortenSegment } from '../../src/process/shortenSegment';
47
- export { default as shorthandToCubic } from '../../src/process/shorthandToCubic';
48
- export { default as shorthandToQuad } from '../../src/process/shorthandToQuad';
49
- export { default as splitCubic } from '../../src/process/splitCubic';
50
- export { default as splitPath } from '../../src/process/splitPath';
51
- export { default as transformEllipse } from '../../src/process/transformEllipse';
52
- export { default as transformPath } from '../../src/process/transformPath';
53
-
54
- export { default as getDrawDirection } from '../../src/util/getDrawDirection';
55
- export { default as getPathArea } from '../../src/util/getPathArea';
56
- export { default as getPathBBox } from '../../src/util/getPathBBox';
57
- export { default as pathLengthFactory } from '../../src/util/pathLengthFactory';
58
- export { default as getTotalLength } from '../../src/util/getTotalLength';
59
-
60
- export { default as segmentLineFactory } from '../../src/util/segmentLineFactory';
61
- export { default as segmentArcFactory } from '../../src/util/segmentArcFactory';
62
- export { default as segmentCubicFactory } from '../../src/util/segmentCubicFactory';
63
- export { default as segmentQuadFactory } from '../../src/util/segmentQuadFactory';
64
-
65
- export { default as getPointAtLength } from '../../src/util/getPointAtLength';
66
- export { default as getPropertiesAtPoint } from '../../src/util/getPropertiesAtPoint';
67
- export { default as getPropertiesAtLength } from '../../src/util/getPropertiesAtLength';
68
- export { default as getClosestPoint } from '../../src/util/getClosestPoint';
69
- export { default as getSegmentAtLength } from '../../src/util/getSegmentAtLength';
70
- export { default as getSegmentOfPoint } from '../../src/util/getSegmentOfPoint';
71
- export { default as isPointInStroke } from '../../src/util/isPointInStroke';
72
-
73
- export { default as isAbsoluteArray } from '../../src/util/isAbsoluteArray';
74
- export { default as isCurveArray } from '../../src/util/isCurveArray';
75
- export { default as isNormalizedArray } from '../../src/util/isNormalizedArray';
76
- export { default as isPathArray } from '../../src/util/isPathArray';
77
- export { default as isRelativeArray } from '../../src/util/isRelativeArray';
78
- export { default as isValidPath } from '../../src/util/isValidPath';
79
- export { default as shapeToPath } from '../../src/util/shapeToPath';
80
- export { default as Version } from '../../src/version';
81
-
82
- export { default as SVGPathCommander } from '../../src/svg-path-commander';