本文介绍了使用cartogram.js在全局地图中可视化信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试修改此示例来显示世界各地2002年,2005年和2010年的肥胖信息。此可视化:,其中包含代码在同一页。

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.

我想解决的问题是,形状不会像在原始示例中那样被扭曲。颜色似乎映射只是很好,但由于某种原因,我不能扭曲地图。我试图改变规模,看着cartogram.js代码,但我没有看到任何可能是问题。如果我改变数据有更大的差异,那么我看到色差,但没有什么形状。

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!

推荐答案

问题是由于斐济和俄罗斯的项目范围跨越边缘并返回到左边框。当cartogram.js计算完成时,路径中有一个负值,这是导致问题的原因。我试图自己解决它,并会更新asap。

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.

这篇关于使用cartogram.js在全局地图中可视化信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 17:40
查看更多