svg-path-commander 0.1.24 → 0.2.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.
- package/README.md +5 -3
- package/dist/svg-path-commander.es5.js +3948 -0
- package/dist/svg-path-commander.es5.min.js +2 -0
- package/dist/svg-path-commander.esm.js +428 -407
- package/dist/svg-path-commander.esm.min.js +2 -2
- package/dist/svg-path-commander.js +1434 -1515
- package/dist/svg-path-commander.min.js +2 -2
- package/package.json +15 -2
- package/src/convert/pathToAbsolute.js +4 -4
- package/src/convert/pathToCurve.js +2 -2
- package/src/convert/pathToRelative.js +4 -4
- package/src/convert/pathToString.js +2 -2
- package/src/math/polygonLength.js +1 -2
- package/src/options/options.js +1 -1
- package/src/parser/error.js +2 -0
- package/src/parser/finalizeSegment.js +1 -1
- package/src/parser/isSpace.js +1 -1
- package/src/parser/paramsParser.js +1 -1
- package/src/parser/parsePathString.js +6 -11
- package/src/parser/pathParser.js +1 -1
- package/src/parser/scanFlag.js +3 -3
- package/src/parser/scanParam.js +7 -6
- package/src/parser/scanSegment.js +3 -2
- package/src/parser/skipSpaces.js +1 -1
- package/src/process/clonePath.js +1 -1
- package/src/process/fixArc.js +1 -1
- package/src/process/fixPath.js +2 -2
- package/src/process/getSVGMatrix.js +3 -2
- package/src/process/normalizePath.js +3 -3
- package/src/process/normalizeSegment.js +2 -2
- package/src/process/optimizePath.js +2 -2
- package/src/process/projection2d.js +2 -2
- package/src/process/reverseCurve.js +3 -3
- package/src/process/reversePath.js +4 -5
- package/src/process/roundPath.js +7 -6
- package/src/process/segmentToCubic.js +3 -3
- package/src/process/shortenSegment.js +3 -3
- package/src/process/splitCubic.js +1 -1
- package/src/process/splitPath.js +1 -1
- package/src/process/transformPath.js +8 -7
- package/src/svg-path-commander.js +60 -20
- package/src/util/getClosestPoint.js +1 -1
- package/src/util/getCubicSize.js +1 -1
- package/src/util/getDrawDirection.js +1 -1
- package/src/util/getPathArea.js +1 -1
- package/src/util/getPathBBox.js +2 -2
- package/src/util/getPathLength.js +1 -1
- package/src/util/getPointAtLength.js +1 -1
- package/src/util/getPropertiesAtLength.js +3 -3
- package/src/util/getPropertiesAtPoint.js +2 -2
- package/src/util/getSegmentAtLength.js +2 -2
- package/src/util/getSegmentOfPoint.js +2 -2
- package/src/util/getTotalLength.js +1 -1
- package/src/util/isAbsoluteArray.js +1 -1
- package/src/util/isCurveArray.js +1 -1
- package/src/util/isNormalizedArray.js +1 -1
- package/src/util/isPathArray.js +1 -1
- package/src/util/isPointInStroke.js +2 -2
- package/src/util/isRelativeArray.js +1 -1
- package/src/util/pathLengthFactory.js +3 -2
- package/src/util/segmentArcFactory.js +1 -1
- package/src/util/segmentCubicFactory.js +1 -1
- package/src/util/segmentLineFactory.js +1 -1
- package/src/util/segmentQuadFactory.js +1 -1
- package/src/util/shapeToPath.js +14 -14
- package/src/util/util.js +0 -2
- package/types/index.d.ts +1 -3
- package/types/more/modules.ts +0 -3
- package/types/more/svg.d.ts +11 -10
- package/types/svg-path-commander.d.ts +214 -226
- package/src/util/createPath.js +0 -17
- package/src/util/getPointAtPathLength.js +0 -15
package/src/util/createPath.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import shapeToPath from './shapeToPath';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns a new `<path>` from a `<glyph>` element, only using its `d` attribute,
|
|
5
|
-
* all other attributes are ignored.
|
|
6
|
-
*
|
|
7
|
-
* If `pathInput` is a valid path string, will create a `<path>` and return it.
|
|
8
|
-
*
|
|
9
|
-
* @deprecated
|
|
10
|
-
* @see shapeToPath a new and more flexible utility
|
|
11
|
-
*
|
|
12
|
-
* @param {SVGPathCommander.shapeTypes} pathInput a `<glyph>` element or path string
|
|
13
|
-
* @returns {SVGPathElement | boolean} a new `<path>` element
|
|
14
|
-
*/
|
|
15
|
-
export default function createPath(pathInput) {
|
|
16
|
-
return shapeToPath(pathInput, true);
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import getPointAtLength from './getPointAtLength';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns [x,y] coordinates of a point at a given length of a shape.
|
|
5
|
-
* `pathToCurve` version.
|
|
6
|
-
*
|
|
7
|
-
* @deprecated
|
|
8
|
-
*
|
|
9
|
-
* @param {string | SVGPathCommander.pathArray} pathInput the `pathArray` to look into
|
|
10
|
-
* @param {number} distance the length of the shape to look at
|
|
11
|
-
* @returns {{x: number, y: number}} the requested {x, y} point coordinates
|
|
12
|
-
*/
|
|
13
|
-
export default function getPointAtPathLength(pathInput, distance) {
|
|
14
|
-
return getPointAtLength(pathInput, distance);
|
|
15
|
-
}
|