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

更新g6版本后(4.26),不能连线了 #68

Open
zhanghui-space opened this issue Apr 15, 2021 · 10 comments
Open

更新g6版本后(4.26),不能连线了 #68

zhanghui-space opened this issue Apr 15, 2021 · 10 comments

Comments

@zhanghui-space
Copy link

2021-04-15.4.50.36.mov

鼠标移到锚点时,此时触发了onNodeLeave事件,恰好把锚点remove了 active 状态不能作用了 求大佬指点

// hoverNodeActived.js
 onNodeLeave(e){
     if(!(e.target instanceof Marker) && !this.graph.get('edgeDragging')) {
       this.graph.setItemState(e.item, 'show-anchor', false);
     }
   }
// hoverAnchorActived.js
  onAnchorEnter(e){
     if(!this.graph.get('edgeDragging'))
       this.graph.setItemState(e.item, 'active-anchor', true);
   }
@guozhaolong
Copy link
Owner

e.target instanceof Marker不能用了,你换成别的判断

@zhanghui-space
Copy link
Author

感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave

@guanpenghui1993
Copy link

感谢大佬 ;暂时用setTimeout 异步解决了 先执行onAnchorEnter 里面代码 后执行onNodeLeave

大佬,修改哪个文件?怎么改的有代码吗?

@gotounix
Copy link

@gzhanghui 老哥,请教下,更新至4.1以上版本以后

shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js 中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢?

直接 import Item from '@antv/g6 不能用, shapeBase 也没有。

谢谢。

@guanpenghui1993
Copy link

guanpenghui1993 commented Apr 29, 2022 via email

@zhanghui-space
Copy link
Author

@gzhanghui老哥,请教下,更新至4.1以上版本以后

shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢?

直接import Item from '@antv/g6不能用,shapeBase 也没有。

谢谢。
可以稍微看一下g6的目录解构
import { shapeBase } from '@antv/g6-core/lib/element/shapeBase';
import Shape from '@antv/g6-core/lib/element/shape';

@gotounix
Copy link

gotounix commented May 9, 2022

@gzhanghui 感谢,已解决。

@guanpenghui1993
Copy link

guanpenghui1993 commented Aug 30, 2022 via email

@zhanghui-space
Copy link
Author

zhanghui-space commented Aug 30, 2022

shapeBase

@gzhanghui老哥,请教下,更新至4.1以上版本以后
shape\anchor.js中以下代码

import { shapeBase } from '@antv/g6/lib/shape/shapeBase';
import Shape from '@antv/g6/lib/shape/shape';

item\anchor.js中以下代码:

import editorStyle from '../util/defaultStyle';
import Item from '@antv/g6/lib/item/item';
import { deepMix } from '@antv/util';

export default class Anchor extends Item {
  ...

如何升级呢?
直接import Item from '@antv/g6不能用,shapeBase 也没有。
谢谢。
可以稍微看一下g6的目录解构
import { shapeBase } from '@antv/g6-core/lib/element/shapeBase';
import Shape from '@antv/g6-core/lib/element/shape';

 // package.json
 
   "dependencies": {

    "@antv/dom-util": "2.0.2",
    "@antv/g-canvas": "^0.4.12",
    "@antv/g6": "^4.2.6",
    "@antv/g6-core": "^0.2.6",
    "@antv/util": "~2.0.9",

    }
import { shapeBase } from '@antv/g6-core/lib/element/shapeBase';

@huangtangtang
Copy link

大佬好,请教个问题: 两个节点连线时,报如下错误信息
image

报错位置:dragEdge.js 下的 dragEdgeBeforeShowAnchor() 和 _clearAllAnchor() 该如何解决?

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

5 participants