You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "jonoshearman (via GitHub)" <gi...@apache.org> on 2024/09/05 18:17:01 UTC
[PR] feat(boxplot) correctly handle series.encode with category axis [echarts]
jonoshearman opened a new pull request, #20324:
URL: https://github.com/apache/echarts/pull/20324
## Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
### What does this PR do?
Fixes issue with series.encode for boxplot when category axis is used.
### Fixed issues
#20319
## Details
### Before: What was the problem?
When a category axis is used for a boxplot series, an ordinalValue is always inserted to the series.data which breaks any encoding rules. if the category axis does not set it's own data then the axis labels will be the integer ordinalValue.
### After: How does it behave after the fixing?
Now if an encode rule is applied for the associated axis (x/y) then the ordinalValue is not inserted and the encoding rules work as expected.
## 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
test/boxplot-category.html added to show visual example.
## 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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia merged PR #20324:
URL: https://github.com/apache/echarts/pull/20324
--
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #20324:
URL: https://github.com/apache/echarts/pull/20324#issuecomment-2373393481
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "jonoshearman (via GitHub)" <gi...@apache.org>.
jonoshearman commented on code in PR #20324:
URL: https://github.com/apache/echarts/pull/20324#discussion_r1768201612
##########
src/chart/helper/whiskerBoxCommon.ts:
##########
@@ -52,6 +52,16 @@ class WhiskerBoxCommonMixin<Opts extends CommonOption> {
defaultValueDimensions: CoordDimensionDefinition['dimsDef'];
+ /**
+ * @private
+ */
+ _hasEncodeRule(key: string) {
+ const encodeRules = this.getEncode();
+ if(encodeRules?.data?.has(key))
Review Comment:
Thanks for the review @Ovilia
Changes pushed.
--
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #20324:
URL: https://github.com/apache/echarts/pull/20324#issuecomment-2367316213
Please don't use forced push because it would be hard to track the changes of previous reviews.
--
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #20324:
URL: https://github.com/apache/echarts/pull/20324#issuecomment-2373393558
We sincerely appreciate your valuable contributions! We are currently running a special promotion for users who submit a Pull Request between September 25, 2024, and December 31, 2024. Eligible participants will receive a two-year enterprise membership to Baidu Comate, valued at 2000 RMB (approximately 285 USD).
To learn more about this product, please visit https://comate.baidu.com/. If you are interested in this offer, kindly send an email with the link to your Pull Request along with your Comate username and email address to ovilia@apache.org to claim your membership.
Thank you once again for your support!
--
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20324:
URL: https://github.com/apache/echarts/pull/20324#issuecomment-2362925588
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20324@bc5c888
<!-- ECHARTS_PR_PREVIEW -->
--
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
Re: [PR] feat(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #20324:
URL: https://github.com/apache/echarts/pull/20324#issuecomment-2332366388
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on code in PR #20324:
URL: https://github.com/apache/echarts/pull/20324#discussion_r1770816865
##########
src/chart/helper/whiskerBoxCommon.ts:
##########
@@ -52,6 +52,17 @@ class WhiskerBoxCommonMixin<Opts extends CommonOption> {
defaultValueDimensions: CoordDimensionDefinition['dimsDef'];
+ /**
+ * @private
+ */
+ _hasEncodeRule(key: string) {
+ const encodeRules = this.getEncode();
+ if (encodeRules && encodeRules.data && encodeRules.data.has(key)) {
+ return encodeRules.data.get(key) !== null;
Review Comment:
Using `!=` instead of `!==` please.
--
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "jonoshearman (via GitHub)" <gi...@apache.org>.
jonoshearman commented on code in PR #20324:
URL: https://github.com/apache/echarts/pull/20324#discussion_r1773268442
##########
src/chart/helper/whiskerBoxCommon.ts:
##########
@@ -52,6 +52,17 @@ class WhiskerBoxCommonMixin<Opts extends CommonOption> {
defaultValueDimensions: CoordDimensionDefinition['dimsDef'];
+ /**
+ * @private
+ */
+ _hasEncodeRule(key: string) {
+ const encodeRules = this.getEncode();
+ if (encodeRules && encodeRules.data && encodeRules.data.has(key)) {
+ return encodeRules.data.get(key) !== null;
Review Comment:
Thanks, changes pushed
--
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
Re: [PR] fix(boxplot) correctly handle series.encode with category axis [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on code in PR #20324:
URL: https://github.com/apache/echarts/pull/20324#discussion_r1768057639
##########
src/chart/helper/whiskerBoxCommon.ts:
##########
@@ -52,6 +52,16 @@ class WhiskerBoxCommonMixin<Opts extends CommonOption> {
defaultValueDimensions: CoordDimensionDefinition['dimsDef'];
+ /**
+ * @private
+ */
+ _hasEncodeRule(key: string) {
+ const encodeRules = this.getEncode();
+ if(encodeRules?.data?.has(key))
Review Comment:
We avoid using `?.` under compatible considerations. Please use `encodeRules && encodeRules.data && encodeRules.data.has(key)` instead.
--
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