径向链接
¥Radial links
径向链接生成器类似于笛卡尔 链接生成器,只是 x 和 y 访问器被 angle 和 radius 访问器取代。径向链接相对于原点定位;使用 transform 更改原点。
¥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()
源代码 · 返回一个带有径向切线的新 链接生成器。例如,要将 links 可视化为位于显示屏中心的 树形图,你可以这样写:
¥Source · Returns a new link generator with radial tangents. For example, to visualize links in a tree diagram rooted in the center of the display, you might say:
const link = d3.linkRadial()
.angle((d) => d.x)
.radius((d) => d.y);
linkRadial.angle(angle) {#linkRadial_angle}
源代码 · 等同于 link.x,但它的访问器返回以弧度表示的角度,0 度位于 -y 轴(12 点钟方向)。
¥Source · Equivalent to link.x, except the accessor returns the angle in radians, with 0 at -y (12 o’clock).
linkRadial.radius(radius) {#linkRadial_radius}
源代码 · 等同于 link.y,但它的访问器返回的是半径:与原点的距离。
¥Source · Equivalent to link.y, except the accessor returns the radius: the distance from the origin.