简体   繁体   中英

d3 geo.path Transition

I have a maps of different countries. I want to transition every countries to another path (typically a rectangle or a circle).

If I do a classic transition, the transition is akward, as the SVG does not have the same number of nodes. I use a library (polymorph.js). This library ensures that the destination path has the same number of nodes. Sadly there are some artfacts ( circles are not really circle, and rectangles are a bit weird).

Example : http://bl.ocks.org/ufenegga/7302cdde0fd2b6814dda

I am looking for an algorithm that allows to transition nicely between the country path and a circle/rect

Can anybody help ?

Thanks

I find a working solution here : https://gist.github.com/ge045/2e7de433f1d1d5948bbd/revisions

If somebody can explains what is going on, so i'll be sure to understand how it works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM