antvis / G6

♾ A Graph Visualization Framework in JavaScript.
https://g6.antv.antgroup.com/
MIT License
11.16k stars 1.33k forks source link

fix: fix incorrect edge zindex when ends has hight zindex #6500

Closed Aarebecca closed 1 week ago

Aarebecca commented 1 week ago

当添加边时,如果其端点具有更高的 zIndex,可能导致边被其他元素遮挡,这个 PR 将在添加边时动态计算默认 zIndex 值,规则如下:

  1. 当两端点都为节点时,边的 zIndex 为节点 zIndex 取较小者减 1
  2. 当两端点都为组合时,边的 zIndex 为组合 zIndex 取较大者加 1
  3. 当一端点为节点,一端点为组合时,分别基于上述规则计算 zIndex 然后取较大值

related issue: https://github.com/antvis/G6/issues/6492