如何用d3.js在世界地图上绘制一个3d条形图?
问题描述:
d3.js可以处理 3d地图投影
d3.js can deal with 3d map projections
有没有办法在给定的坐标上投射一个bar来获得类似于kartograph的结果?
Is there a way to project a bar on a given coordinate to get a result similar to kartograph ?
答
D3中的任何投影数据都可以在其上放置条,其中rect的xy是在一个延长点。以下是D3的卫星投影示例:
Any projected data in D3 can have bars placed on them with the xy of the rect being at a latlong point. Here's an example with D3's satellite projection:
要匹配Kartograph示例的样式,您需要旋转相对于点与它相关联,以及使用不透明度。
To match the style of the Kartograph example, you'd need to rotate the rect in relation to the projection of the point it's associated with, as well as playing with opacity.