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/10/21 10:41:25 UTC
[GitHub] [echarts] breizh24 opened a new pull request, #17808: fix(type): extend correct interface on AxisLabelBaseOption. close #17363
breizh24 opened a new pull request, #17808:
URL: https://github.com/apache/echarts/pull/17808
Co-authored-by: Giulio Mazzanti <gm...@protonmail.com>
<!-- Please fill in the following information to help us review your PR more efficiently. -->
## Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
### What does this PR do?
This PR sets the correct interface that AxisLabelBaseOption extends, changing it from TextCommonOption to LabelOption.
### Fixed issues
- #17363 : ...
## Details
### Before: What was the problem?
<!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
The overflow property on xAxis.axisLabel works fine as you can see from this demo: [Chart demo](https://echarts.apache.org/examples/en/editor.html?c=line-simple&lang=ts&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQDKYOIsAMhNDpUQL4A0RYwwWSCAKpiGAE4QA5lJziqAQ1IQAzu3TciuWdAAmIoul0KwCggG0adBrQXiwlLrCv1YAWQi7duR89quAUT1KAF1OHnQpSX1CMVwAMwpnAGYAUkdDWEkpAAskygAWdIjiACNgMD4AWyo0jLEAYxhTFkYFUpwsAjBxAFcccN5-LHLSAzF4nBNe8XxYsVgVBQA3HABBFQBJKoVZEQ5Mg40S0jXlFXHiMABPEDnKBpMcKWBxa_riY1MLSjcYX0oABV-jhQWDwRDIVDoQCAOo4XQAwE5XoAgBikgB1BMWN60FCJXQSlUbQ6XVECwA7p4wDkCMkAAyE4jAVbieJYYCUqg9PGPOgfMQsOjiZYKLqwBmHQboa5nVSXdA3O5UMVYfrqWCadAqOQQHAXWDmTIUsTQBRVe7-GymeyCq63e5YFhsZk66xUFS2hxu2BfMxGgCMACYmbBA8lg05AwzA9HkgUnABOMPBxlOYMxsJibXEU3Ec2WqjW9yebyuzJKx1UZ2se3u-hUKplny-_0WYOhjMADijsFDcf7CYzKacBXTsAKWcOzPz6ELVussCCiN9yqdLvriw9zhwwTbJgD5gKAFYw-O-wVY2OT4nYCfR_eJyfpzmiGEOABuIA)
The actual issue is with the type of `xAxis.axisLabel` (`AxisLabelBaseOption`) that is extending `TextCommonOption` insted of `LabelOption` which is already extending `TextCommonOption` . This is causing the `overflow` property to not be available at the type level resulting in a type error if We try to use that property in a typescript file.
If We look at the documentation We can see that the overflow property is available with all the others properties inside `LabelOption` https://echarts.apache.org/zh/option.html#xAxis.axisLabel.overflow
<!-- ADD SCREENSHOT HERE IF APPLICABLE. -->

### After: How does it behave after the fixing?
<!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
After setting the correct type We can use the `overflow` property on xAxis.axisLabel without getting a type error.
The issue was fixed by changing the interface that `AxisLabelBaseOption` was extending from `TextCommonOption` to `LabelOption`, as wrote before `LabelOption` is already extending `TextCommonOption`.
<!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
## 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
- [ ] Please squash the commits into a single one when merging.
### Other information
--
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
[GitHub] [echarts] Ovilia merged pull request #17808: fix(type): add overflow property to AxisLabelBaseOption interface. close #17363
Posted by GitBox <gi...@apache.org>.
Ovilia merged PR #17808:
URL: https://github.com/apache/echarts/pull/17808
--
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
[GitHub] [echarts] breizh24 commented on pull request #17808: fix(type): extend correct interface on AxisLabelBaseOption. close #17363
Posted by GitBox <gi...@apache.org>.
breizh24 commented on PR #17808:
URL: https://github.com/apache/echarts/pull/17808#issuecomment-1290424322
> It seems a lot of attributes of `LabelOption` should not be included in `AxisBaseOptionCommon`. So it's probably not a good idea to extend it. Add `overflow?: TextStyleProps['overflow']` to `AxisBaseOptionCommon` may be enough.
Agreed, I've done the required changes
--
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
[GitHub] [echarts] echarts-bot[bot] commented on pull request #17808: fix(type): extend correct interface on AxisLabelBaseOption. close #17363
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on PR #17808:
URL: https://github.com/apache/echarts/pull/17808#issuecomment-1286779667
Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
--
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
[GitHub] [echarts] echarts-bot[bot] commented on pull request #17808: fix(type): add overflow property to AxisLabelBaseOption interface. close #17363
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on PR #17808:
URL: https://github.com/apache/echarts/pull/17808#issuecomment-1292968585
Congratulations! Your PR has been merged. Thanks for your contribution! 👍
--
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