Do you want to work on this issue?
You can request for a bounty in order to promote it!
[Bug]: 展开收起变形了 #7026
The-Lion-King posted onGitHub
Describe the bug / 问题描述
当边用这个配置的时候,展开收起边的动画变形了
当收起的时候线段会乱飞
edge: { type: 'polyline', style: { router: { type: 'orth', }, }, },
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
import { Graph, treeToGraphData } from '@antv/g6';
/**
- If the node is a leaf node
- @param {*} d - node data
- @returns {boolean} - whether the node is a leaf node
- / function isLeafNode(d) { return !d.children || d.children.length === 0; }
fetch('https://gw.alipayobjects.com/os/antvdemo/assets/data/algorithm-category.json') .then((res) => res.json()) .then((data) => { const graph = new Graph({ container: 'container', autoFit: 'view', data: treeToGraphData(data), behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element', 'collapse-expand'], node: { style: (d) => { const style = { labelText: d.id, labelPlacement: 'right', labelOffsetX: 2, labelBackground: true, ports: [{ placement: 'top' }, { placement: 'bottom' }], }; if (isLeafNode(d)) { Object.assign(style, { labelTransform: [ ['rotate', 90], ['translate', 18], ], labelBaseline: 'center', labelTextAlign: 'left', }); } return style; }, animation: { enter: false, }, }, edge: { type: 'polyline', style: { router: { type: 'orth', }, }, }, layout: { type: 'compact-box', direction: 'TB', getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 80; }, getHGap: function getHGap() { return 20; }, }, });
graph.render();
});
Version / 版本
Please select / 请选择
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他