Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1577100475 opened this issue Mar 5, 2024 · 0 comments
Open

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

1577100475 opened this issue Mar 5, 2024 · 0 comments

Comments

@1577100475
Copy link

问题描述

图设置为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])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant