You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/11/08 10:29:52 UTC
[GitHub] [echarts] pissang commented on pull request #17698: feat(devInfo): set devInfo into axis component
pissang commented on PR #17698:
URL: https://github.com/apache/echarts/pull/17698#issuecomment-1306985014
Thanks for the work! This information are very useful in the visual editor of ECharts.
Some suggestions or questions:
1. The component level and sub-component level should be separated. For example:
```ts
eCompName: 'barBackground'
```
Is better to be
```ts
component: 'series.bar',
element: 'background' // Other name better than element will be appreciated.
```
2. 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:
```ts
eCompName: 'candlestickEl'
```
Is better to be
```ts
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
```
```ts
eCompName: 'barRect'
```
is better to be
```ts
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
```
3. 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`
```ts
if (__DEV__) {
// The second parameters can be optional in most of series.
addDevInfo(el, 'series.bar', 'main');
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org