You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在https://g6.antv.antgroup.com/examples/item/customNode/#card这里添加聚焦的逻辑:
function handleNodeClick(event) {
const item = event.item;
// animately move the graph to focus on the item.
// the second parameter controlls whether move with animation, the third parameter is the animate configuration
graph.focusItem(item, true, {
easing: 'easeCubic',
duration: 500,
});
}
// listen to the node click event
graph.on('node:click', handleNodeClick);
Steps to Reproduce the Bug or Issue
点击一个节点
聚焦到该节点,上下左右间距不一样
Expected behavior
期望该节点在中心,即上下左右间距一样,实际上左右间距不一样
Screenshots or Videos
No response
Platform
OS: [e.g. macOS, Windows, Linux]
Browser: [e.g. Chrome, Safari, Firefox]
Version: [e.g. 91.1]
Additional context
No response
The text was updated successfully, but these errors were encountered:
wuzengduo
changed the title
自定义矩形形状的节点,聚焦节点focusItem的时候没有定位到中心(左右间距不一样)
自定义矩形形状的节点,聚焦节点focusItem的时候没有定位到中心(上下左右间距不一样)
May 13, 2024
Describe the bug
自定义矩形形状的节点,聚焦节点focusItem的时候没有定位到中心(左右间距不一样)
Your Example Website or App
https://g6.antv.antgroup.com/examples/item/customNode/#card
在https://g6.antv.antgroup.com/examples/item/customNode/#card这里添加聚焦的逻辑:
function handleNodeClick(event) {
const item = event.item;
// animately move the graph to focus on the item.
// the second parameter controlls whether move with animation, the third parameter is the animate configuration
graph.focusItem(item, true, {
easing: 'easeCubic',
duration: 500,
});
}
// listen to the node click event
graph.on('node:click', handleNodeClick);
Steps to Reproduce the Bug or Issue
Expected behavior
期望该节点在中心,即上下左右间距一样,实际上左右间距不一样
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: