-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
graph.getPluginInstance('fullscreen') return undefined ,the graph is a instance of Graph #6206
Comments
Did you config fullscreen plugin in graph options? Could you provide the codes. |
生效了。 |
Yes,this is my code
my dependencies version is "@antv/g6": "^5.0.16", |
The main reason is that once you do not assign a key for the plugin, G6 will generate one automatically. Hence, if you want to get the plugin instance, you'd better configure as follows: Graph options: plugins: [
'minimap',
{
type: 'fullscreen',
key: 'fullscreen'
}
] Use: import type { Fullscreen } from '@antv/g6';
const fullscreen = graph.getPluginInstance<Fullscreen>('fullscreen'); |
Describe the bug / 问题描述
const fullScreenPlugin: Fullscreen = graph.getPluginInstance('fullscreen');
console.log(fullScreenPlugin);//undefined
fullScreenPlugin.request();
Reproduction link / 重现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
No response
G6 Version / G6 版本
🆕 5.x
Operating System / 操作系统
macOS
Browser / 浏览器
Chrome
Additional context / 补充说明
No response
The text was updated successfully, but these errors were encountered: