We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible for svgpath to have the pair of transformed segments returned in an array of objects? For example,
<path d="M650,300L650,150L640,150L640,300" fill="none" stroke="red"></path> const d = document.querySelector('path').getAttribute('d'); const path = svgpath(d) .matrix([0.707107, 0.707107, -0.707107, 0.707107, 402.513, 371.751]) .toString(); console.log(path);
The above would return M650.00045 300.00065000000006L756.0664999999999 193.93460000000005 748.9954299999999 186.86353000000008 642.92938 292.9295800000001.
M650.00045 300.00065000000006L756.0664999999999 193.93460000000005 748.9954299999999 186.86353000000008 642.92938 292.9295800000001
But I was wondering if there is a method that could return the transformed coordinates in an array of objects like
[{650.00045, 300.00065000000006},{756.0664999999999, 193.93460000000005},{748.9954299999999, 186.86353000000008},{642.92938, 292.9295800000001}]
The text was updated successfully, but these errors were encountered:
You can add your custom .toArray() method and process .segments property as you wish.
.toArray()
.segments
Sorry, something went wrong.
Sorry, I am having trouble implementing what you are suggesting. Can you kindly provide an example please?
The following returns the original coordinates and not the transformed coordinates.
const path = svgpath(d) .matrix([matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]]) .segments
No branches or pull requests
Is it possible for svgpath to have the pair of transformed segments returned in an array of objects? For example,
The above would return
M650.00045 300.00065000000006L756.0664999999999 193.93460000000005 748.9954299999999 186.86353000000008 642.92938 292.9295800000001
.But I was wondering if there is a method that could return the transformed coordinates in an array of objects like
[{650.00045, 300.00065000000006},{756.0664999999999, 193.93460000000005},{748.9954299999999, 186.86353000000008},{642.92938, 292.9295800000001}]
The text was updated successfully, but these errors were encountered: