feat(toolbox): expose toolbox feature extension API - #21709
Open
DaZuiZui wants to merge 1 commit into
Open
Conversation
|
Thanks for your contribution! Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only. Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief Information
This pull request is in the type of:
What does this PR do?
Exposes a stable toolbox-feature registration API for independently packaged ECharts extensions.
Fixed issues
export-toolboxpackage; the exporter package itself remains outside ECharts core.Details
Before: What was the problem?
Toolbox features are stored in an internal registry. ECharts extensions installed with
echarts.use()cannot access that registry, and the public custom-feature path only recognizes option keys prefixed withmy. As a result, an independent package cannot register a first-class feature such astoolbox.feature.exportDatawithout importing internal modules.After: How does it behave after the fixing?
The extension installer now exposes
registerToolboxFeature(name, ctor).ToolboxFeatureand its option/model/constructor types, together with the extension installer types, are exported fromecharts/core.An external package can now register a feature through the normal extension lifecycle:
The change adds no exporter implementation or third-party dependency to ECharts core. CSV/PDF/XLSX implementations can remain independently packaged and tree-shakeable.
Document Info
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
echarts.use().ToolboxFeatureand callingregisterToolboxFeaturefromecharts/core.npm run checktypeMerging options
Other information
The matching independent exporter prototype uses explicit
table/getTable(chart)data sources and shares one exporter registry between its toolbox and programmatic APIs, as described in #21693.