using cartogram.js for visualizing information in a global map

 ̄綄美尐妖づ 提交于 2019-12-24 01:44:55

问题


I'm trying to adapt this example http://prag.ma/code/d3-cartogram/ to show information about obesity in 2002, 2005 and 2010 around the world. This the visualization: http://datauy.github.io/obesity-cartogram with a link to the code in the same page.

The problem I'm trying to resolve is that the shapes are not being distorted like in the original example with the alberusa projection. The colors seems to be mapped just fine but for some reason I can't distort the map. I tried changing the scale and looking into the cartogram.js code but I don't see anything that could be the problem. If I change the data to have a larger difference then I see the color difference but nothing on shape.

Any clue what is happening? Thanks!


回答1:


The problem is due to Fiji and Russia having project extents which cross the edge and return to the left border. When the cartogram.js calculations complete, the path has a negative value in it which is causing the problem. I'm trying to resolve it myself and will update asap.



来源:https://stackoverflow.com/questions/18707178/using-cartogram-js-for-visualizing-information-in-a-global-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!