antvis/G6

全局边设置的polyline没有生效 #5493

1577100475 posted onGitHub

问题描述

图设置为compactBox,边设置是polyline, 下载 但是没有生效

重现链接

重现步骤

预期行为

我希望实现这种效果 下载 (1)

平台

  • 操作系统: [Windows]
  • 网页浏览器: [Google Chrome]
  • G6 版本: [4.8.22]

屏幕截图或视频(可选)

No response

补充说明(可选)

这是设置tree的代码 useEffect(() => { if (!graphData) return; if (!container.current) { return; } const width = container.current.scrollWidth; const height = container.current.scrollHeight

tree = new TreeGraph({
  container: container.current,
  width,
  height,
  fitView: true,
  fitViewPadding: [10, 20],
  layout: {
    type: "compactBox",
    direction: "H",
    // nodeSep: 16,
    getHeight: () => {
      return 16;
    },
    getWidth: (node: { level: number; label: any }) => {
      return node.level === 0
        ? Util.getTextSize(node.label, 16)[0] + 12
        : Util.getTextSize(node.label, 12)[0];
    },
    getVGap: () => {
      return 20;
    },
    getHGap: () => {
      return 60;
    },
  },
  defaultEdge: {
    type: 'polyline',
    style: {
      stroke: "rgb(205, 97, 255)",
      lineWidth: 3,
    },
  },
  minZoom: 0.5,
  modes: {
    default: ["drag-canvas", "zoom-canvas", "dice-mindmap"],
  },
});
treeRef.current = tree;

tree.data(dataTransform(graphData));


tree.render();

}, [graphData])


This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 6 months ago

Fund this Issue

$0.00
Funded

Pull requests