只是调整getVGap,出现残影。 #5112
fanghuayong posted onGitHub
问题描述
`import G6 from "@antv/g6";
const data2 = { id: "sss", label: "root", children: [ { id: "Consensus", label: "一级", children: [ { id: "Methods", label: "有残影", children: [{ id: "Classifierselection",label: "三级" }, { id: "Classifierfusion",label: "三级" }], }, ], }, ], }; const graph = new G6.TreeGraph({ container: "container", width: 500, height: 500, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.getModel(); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: [100, 50], type: "rect", anchorPoints: [ [0, 0.5], [1, 0.5], ], labelCfg: { style: { fill: "#9254de", stroke: '#fff', fontSize: 18, lineWidth: 4 }, position: "bottom", position:"center" },
}, // defaultEdge: { // type: "cubic-horizontal", // }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 30; }, getHGap: function getHGap() { return 100; }, }, });
graph.node(function (node) { return { label: node.id,
}; }); graph.data(data2); graph.render(); graph.fitView(); `
只是调整了getVGap,为什么会出现残影呢,在其他issue上说设置stroke为白色,也设置了,但是不起作用。
重现链接
CodeSandbox
重现步骤
1、打开CodeSandbox; 2、把代码复制进去; 3、展开后收起节点出现节点的残影。
预期行为
不出现残影。
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]
- G6 版本: [4.5.1 ... ]
屏幕截图或视频(可选)
补充说明(可选)
No response