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

refactor: getPluginInstance allow match by type secondary #6215

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

Aarebecca
Copy link
Contributor

In a generic situation, it should pass a exact key to getPluginInstance, but sometimes it may be a little bit verbose when setting the plugin in options. Now getPluginInstance will try to find the instance after finding by the key.

Graph options:

plugins: ['fullscreen']

Get instance:

graph.getPluginInstance('fullscreen');

⚠️ Note: this is just a fallback plan, and if a plugin is configured multiple times, it only returns the first instance.

@Aarebecca Aarebecca merged commit b0ce104 into v5 Aug 22, 2024
5 checks passed
@Aarebecca Aarebecca deleted the refactor/get-plugin-instance branch August 22, 2024 12:25
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

Successfully merging this pull request may close these issues.

2 participants