arbor.js z 顺序
我正在使用 arbor.js,具体来说,我正在使用最接近鼠标来检测鼠标位于哪个节点上并突出显示它,一切都很好。
我的问题是我想确保鼠标下的节点位于顶部,即最后绘制的节点,因此它不会被其他节点遮挡。有没有人有幸找到一种方法来改变节点的绘制顺序或 z 顺序?
干杯本
I am using arbor.js, specifically I am using nearest to mouse to detect which node the mouse is over and highlight it, all good.
My problem is I would like to ensure the node under mouse is on top, i.e. the last drawn, so it is not obscured by other nodes. Has anyone had any luck finding a way to alter the draw order, or z-order of a node?
Cheers Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎真正的 Z 顺序是不可能的,最好的办法是对节点进行排序,列表中的最后一个节点将最后渲染。
如果要保留顺序,则在加载数据时必须使用数组而不是 json。
D3 有一个内置的排序函数,可以通过某种方式解决这个问题,我认为 arbor 也可以使用相同的函数。
Seems true Z-order is not possible, best that can be done is to sort the nodes, the last node in the list will be rendered last.
Have to use an array rather than json when loading data if you want to preserve the order.
D3 has an inbuilt sort function which goes some way to address this, I think arbor could use the same.