feat(devInfo): set devInfo into axis component
Brief Information
This pull request is in the type of:
- [ ] bug fixing
- [x] new feature
- [ ] others
What does this PR do?
- set devInfo into axis component
Fixed issues
https://github.com/apache/echarts/issues/17697
Details
Before: What was the problem?
After: How does it behave after the fixing?
Document Info
One of the following should be checked.
- [x] This PR doesn't relate to document changes
- [ ] The document should be updated later
- [ ] The document changes have been made in apache/echarts-doc#xxx
Misc
ZRender Changes
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
- [x] Please squash the commits into a single one when merging.
Other information
Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.
⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.
@sz-p Hi, thanks for your contribution! I marked this PR as a draft as it needs further discussion to determine the necessity, design, and implementation.
Thanks for the work! This information are very useful in the visual editor of ECharts.
Some suggestions or questions:
- The component level and sub-component level should be separated. For example:
eCompName: 'barBackground'
Is better to be
component: 'series.bar',
element: 'background' // Other name better than element will be appreciated.
- Naming should be consistent so it can be easily guessed by the developers. The naming rule should not expose the inside naming on the variables. For example:
eCompName: 'candlestickEl'
Is better to be
component: 'series.candlestick'
element: 'main' // Perhaps it can be optional if there is only one type of elements in the series. Which is the most common case
And
eCompName: 'barRect'
is better to be
component: 'series.bar'
element: 'main' // Perhaps it can be optional if there is only one type of elements in the series. Which is the most common case
- Should these information only available in the
__DEV__mode so we can ship less code in the final productions. And we can provide a utility method to add this__devInfo
if (__DEV__) {
// The second parameters can be optional in most of series.
addDevInfo(el, 'series.bar', 'main');
}
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-17698@b16e6be