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

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

Closed
huangtangtang opened this issue Aug 30, 2022 · 6 comments
Closed

Comments

@huangtangtang
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 也没有。

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

Originally posted by @gzhanghui in #68 (comment)

@huangtangtang
Copy link
Author

x

@zhanghui-space
Copy link

shapeBase

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",
 }

package

@huangtangtang
Copy link
Author

您好,我现在的问题是: 按照你给的配置改完以后,
同时我也修改了以下三个代码

const Node = require('@antv/g6-core/lib/item/node');
const Edge = require('@antv/g6-core/lib/item/edge');
import Item from '@antv/g6-core/lib/item/item';

项目才可以正常启动,但是页面报错:
image

好像是找不到G6 , 项目中 import G6 from '@antv/g6/lib'; 需要改吗?

@zhanghui-space
Copy link

您好,我现在的问题是: 按照你给的配置改完以后, 同时我也修改了以下三个代码

const Node = require('@antv/g6-core/lib/item/node');
const Edge = require('@antv/g6-core/lib/item/edge');
import Item from '@antv/g6-core/lib/item/item';

项目才可以正常启动,但是页面报错: image

好像是找不到G6 , 项目中 import G6 from '@antv/g6/lib'; 需要改吗?

需要添加util包 这个报错说的是没有util.deepMix这个方法

@huangtangtang
Copy link
Author

您好,我现在的问题是: 按照你给的配置改完以后, 同时我也修改了以下三个代码

const Node = require('@antv/g6-core/lib/item/node');
const Edge = require('@antv/g6-core/lib/item/edge');
import Item from '@antv/g6-core/lib/item/item';

项目才可以正常启动,但是页面报错: image
好像是找不到G6 , 项目中 import G6 from '@antv/g6/lib'; 需要改吗?

需要添加util包 这个报错说的是没有util.deepMix这个方法

大佬好,我确实也加了util包,可是页面就是报上面的错,
package.json

    "@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",
    "@antv/matrix-util": "2.0.7",

image
望指教,谢谢~

@zhanghui-space
Copy link

zhanghui-space commented Aug 30, 2022

需要找到使用这个方法的文件

 -   G6.Util.deepMix
 +   import Util from '@antv/util'
     Util.deepMin
  

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

2 participants