D3.js 仅显示分划的线交点
我试图只显示分划中的线交点,而不是D3地图中的整条线 是否支持使用d3.geo.gracile实现此功能 非常感谢你的帮助!D3.js 仅显示分划的线交点,d3.js,svg,D3.js,Svg,我试图只显示分划中的线交点,而不是D3地图中的整条线 是否支持使用d3.geo.gracile实现此功能 非常感谢你的帮助! Thierry对您的问题的简短回答是:不,没有办法只渲染与d3.geo.gracile的交点 但是,通过将要绘制的交点放入一个辅助数组中,并将其传递给路径生成器进行渲染,可以轻松实现所需的结果。我用我的一个例子来演示解决方案: 设置包含要传递给对象的几何体对象的辅助对象数组 使用嵌套选择绑定二维(横向/纵向)阵列,并使用enter选择附加交点。实际绘图是通过将几何体对象
Thierry对您的问题的简短回答是:不,没有办法只渲染与
d3.geo.gracile
的交点
但是,通过将要绘制的交点放入一个辅助数组中,并将其传递给路径生成器进行渲染,可以轻松实现所需的结果。我用我的一个例子来演示解决方案:
// Do a nested selection to bind the two-dimensional data.
map.selectAll("g.lat")
.data(lonLatIntersections)
.enter().append("g") // Create groups per latitude.
.classed("lat", true)
.selectAll("circle")
.data(function(d) { return d; }) // Data binding for longitudes
.enter().append("path")
.attr({
"d": path, // Use the path generator to draw points
"class": "confluence"
});
// Do a nested selection to bind the two-dimensional data.
map.selectAll("g.lat")
.data(lonLatIntersections)
.enter().append("g") // Create groups per latitude.
.classed("lat", true)
.selectAll("circle")
.data(function(d) { return d; }) // Data binding for longitudes
.enter().append("path")
.attr({
"d": path, // Use the path generator to draw points
"class": "confluence"
});