antvis/G6

edge,combo,node层级 #5706

theDoinb posted onGitHub

问题描述

我想要edge在最底层,但如链接所示,groupByTypes: false时,对edge isBack似乎无效果。combo内的连线在node底下,而外边的又在上边,这个怎么弄?

重现链接

codesandbox

重现步骤

如上

预期行为

正常

平台

  • 操作系统: Windows
  • 网页浏览器: Google Chrome
  • G6 版本: 最新

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


再问个 v5 animate怎么使用?用v4方法似乎无效

class CustomEdge extends LineEdge {

  afterDraw(model, shapeMap, diffData, diffState) {
        // get the first shape in the group, it is the edge's path here=
        const shape = shapeMap.keyShape;
   console.log(shape)
        let index = 0;
        // Define the animation
        shape.animate(
          () => {
            index++;
            if (index > 9) {
              index = 0;
            }
            console.log(index)
            const res = {
              keyShape: {
                 lineDash,
              lineDashOffset: -index,
               stroke: 'rgba(94,205,162,.7)',
          lineWidth: 3
              }

            };
            // returns the modified configurations here, lineDash and lineDashOffset here
            return res;
          },
          {
            repeat: true, // whether executes the animation repeatly
            duration: 3000, // the duration for executing once
          },
        );
      }
}

const Graph = extend(BaseGraph, {
  edges: {
    'custom-edge': CustomEdge,
  },
});
posted by theDoinb 12 months ago

目前 5.0 重新设计了开发方式,可以参考最新的代码处理该问题

posted by Aarebecca 10 months ago

Fund this Issue

$0.00
Funded

Pull requests