径向链接
🌐 Radial links
径向链接生成器类似于笛卡尔链接生成器,只是将x和y访问器替换为角度和半径访问器。径向链接是相对于原点定位的;使用变换来更改原点。
🌐 A radial link generator is like the Cartesian link generator except the x and y accessors are replaced with angle and radius accessors. Radial links are positioned relative to the origin; use a transform to change the origin.
linkRadial()
源 · 返回一个带有径向切线的新的 链接生成器。例如,要在显示中心为根的 树状图 中可视化 链接,你可以这样说:
js
const link = d3.linkRadial()
.angle((d) => d.x)
.radius((d) => d.y);linkRadial.angle(angle)
来源 · 等同于 link.x,只是访问器返回的角度为弧度,0 在 -y(12 点钟方向)。