DEV Community

Dragging SVGs with React

Tom VanAntwerp on April 11, 2019

I've recently started a new version of a mapping tool at work that lets people create choropleths from CSV files. The tool combines React and some ...
Collapse
 
nickytonline profile image
Nick Taylor • Edited

Cool stuff Tom. You could even make a custom hook to wrap up all that logic. I made a simple demo here if you're interested. Sidenote, this is the first time I create a hook. 😉

Collapse
 
arunkumar413 profile image
Arun Kumar

Shouldn't we converr the co ordinates into SVG using getScreenCTM()?

Collapse
 
gmaclennan profile image
Gregor MacLennan

Thanks for this, really helpful. Also check polylabel, which gives better initial label positions: blog.mapbox.com/a-new-algorithm-fo...