I
I
Igor2016-08-26 21:37:30
JavaScript
Igor, 2016-08-26 21:37:30

How to get array of px line coordinates from SVG path?

array of the kind [{x:100,y110},{x:120,y120}]
That is, the coordinates of the trajectory of this line..
L21XDOvTJekemX.jpg

<svg version="1.1" id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="80%" height="440px" viewBox="0 0 282.7 53.8" style="enable-background:new 0 0 282.7 53.8;" xml:space="preserve">
  


  
  
    <path fill="none" stroke="gray" marker-start="url(#start)" id="p" d="M0.4,21.1C2.1,18,7.5,8.9,18.7,4c3.2-1.4,14.6-6.4,26.2-1.2c11.1,5,15.4,16.1,16.7,19.4	c0.9,2.3,0.5,2.1,3.6,15.5c2.3,9.9,3.4,14.9,4,16.3c5.7,13.1,21.8,17.9,24.2,18.7c3.5,1,23.9,7.1,37.7-6.3
  c10.8-10.6,9.7-25.7,9.5-28.2"></path>
           
  
  
   
    
</svg>

Only native code!!!!!!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question