-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 V5 Use React #5700
Comments
I noticed that the Demo you provided is not using G6 5.0 (but rather ^4.5.5). If you want to use the 4.x version in React, you can refer to g6-in-react (please note that the code might be outdated). If you want to use the 5.x version in React, you can visit the latest Demo. Please note that the relevant documentation is expected to be updated on the official website by the end of this weekend. |
Yes, that's what I was looking for, it worked, thank you. |
https://g6-next.antv.antgroup.com/en/examples/feature/features/#moreDataWebGL I'm getting the error. You said above that the examples will be updated. Do I have to wait a bit or is it my fault? Package.Json: |
The current official website provides incorrect examples, so please do not refer to the sample code provided there. We will prioritize updating the documentation and examples as soon as possible within this week. Thank you for your understanding and patience. After the beta.28 version, G6 underwent a significant change. You can now use it in the following way: import { Graph } from '@antv/g6';
const graph = new Graph({
container: 'container',
width: 400,
height: 400,
data: {
nodes: [{ id: 'node-1' }, { id: 'node-2' }],
edges: [{ source: 'node-1', target: 'node-2' }],
},
behaviors: ['zoom-canvas', 'drag-canvas', 'drag-element'],
layout: {
type: 'grid',
},
});
graph.render(); The use of extend to add extensions has been deprecated, and instead, a register method similar to that in version 4.x is now adopted. Currently, all plugins are registered by default, but after future adjustments, you may need to register them in the following way: import { register, ExtensionCategory, Donut } from '@antv/g6';
register(ExtensionCategory.NODE, 'donut', Donut); |
You can use G6 in react with this package. https://www.npmjs.com/package/react-g6 |
@hustcc the repository was missed. Is there a page where we can follow the process of the documentation updates? |
问题描述
I'm trying to use React 18 and G6 V5 together. I found an old example.
https://stackblitz.com/edit/react-ts-b4iajh?file=index.tsx
I wrote my own codes similar to this. But I couldn't get it to work. I would be glad if you could help me.
重现链接
https://stackblitz.com/edit/react-ts-b4iajh?file=index.tsx
重现步骤
.
预期行为
I'm getting graph null error
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: