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
In the g6 mind diagram layout, I want to realize the drag node crying to change the order of the node, so I want to insert a temporary node to show the current insertion position, and when the collision node is detected during the dragging process, and then the method of inserting the node is called, the page will be stuck, and the temporary node will be inserted into the diagram after being released
#6535
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
g6脑图布局里面想要实现拖拽节点哭改变节点的顺序,所以就想着去插入一个临时节点来显示当前插入的位置,在拖拽的过程的时候检测到碰撞节点然后调用插入节点的方法页面就会卡住,无法继续拖拽,放开后临时节点插入到了图中
In the g6 mind diagram layout, I want to realize the drag node crying to change the order of the node, so I want to insert a temporary node to show the current insertion position, and when the collision node is detected during the dragging process, and then the method of inserting the node is called, the page will be stuck, and the temporary node will be inserted into the diagram after being released
Nov 18, 2024
Describe the bug / 问题描述
g6脑图布局里面想要实现拖拽节点哭改变节点的顺序,所以就想着去插入一个临时节点来显示当前插入的位置,在拖拽的过程的时候检测到碰撞节点然后调用插入节点的方法页面就会卡住,无法继续拖拽,放开后临时节点插入到了图中
Reproduction link / 重现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
G6 Version / G6 版本
4.x
Operating System / 操作系统
macOS
Browser / 浏览器
Chrome
Additional context / 补充说明
`let dragNodeOriPos,
minDisNode,
minDisNodeId,
dragRect,
insertPos,
insertIndex,
lastInsertPostion,
lastMinDisNode,
lastMinDisNodeId,
targetIndex,
newParentId,
newParentNode,
targetInsertIndex,
targetParentID;
/**
*/
const collide = (node, rect, x, y) => {
// 如果节点不存在,直接返回false
if (!node) return false;
};
/**
*/
const traversNodes = (item, callback) => {
// 初始化新节点和新索引变量
let newNode,
newIndex = 0;
};
const traversRootNodes = e => {
var found = false,
nodeId = e.getID();
// 遍历树的根节点以判断是否为根节点
G6.Util.traverseTree(mindMapTree.save(), function(node, isRoot) {
if (!isRoot || node.id !== nodeId) {
found = true;
return false;
}
});
return found;
};
const registerBehavior = () => {
G6.registerBehavior('dice-mindmap-drag', {
getEvents() {
return {
'node:dragstart': 'handleItemDragStart',
'node:drag': 'handleItemDrag',
'node:dragend': 'handleItemDragEnd',
};
},
};`
The text was updated successfully, but these errors were encountered: