You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "juliepagano (via GitHub)" <gi...@apache.org> on 2023/04/18 00:00:35 UTC
[GitHub] [echarts] juliepagano opened a new pull request, #18524: feat(axisPointer): add option to disable emphasis. close #18495
juliepagano opened a new pull request, #18524:
URL: https://github.com/apache/echarts/pull/18524
<!-- Please fill in the following information to help us review your PR more efficiently. -->
## Brief Information
This pull request is in the type of:
- [ ] bug fixing
- [X] new feature
- [ ] others
### What does this PR do?
This PR adds a `triggerEmphasis` option to the `axisPointer` that enables the user to disable the emphasis/highlight behavior associated with the axis pointer.
### Fixed issues
- #18495
## Details
### Before: What was the problem?
Prior to this PR, the axis pointer would always trigger highlight behavior. When you have a line chart with multiple series, the axis trigger tends to highlight all the series, which is often unhelpful and can be really confusing to users.

There is not a good way to work around this currently. You can see an example of some issues related to this in https://github.com/perses/perses/pull/1112.
### After: How does it behave after the fixing?
After this PR, the user has the option to disable this behavior on a given axis by setting `axisPointer.triggerEmphasis` to `false`. When set to `false`, the highlight/emphasis behavior will not trigger with the axis pointer. Other highlight/emphasis (e.g. on mouseover a specific line) is retained.
The default value for `axisPointer.triggerEmphasis` is `true` when not set, retaining the prior behavior.
Below is a screenshot of the `axisPointer.triggerEmphasis: false` visual test. You can see the diff is whether or not all the lines are highlighted. Note that it still retains highlight behavior on mousing over a particular line.
<img width="1079" alt="image" src="https://user-images.githubusercontent.com/396962/232633047-581179b1-93a1-48fe-94eb-557ef0b45a37.png">
## Document Info
One of the following should be checked.
- [ ] This PR doesn't relate to document changes
- [X] The document should be updated later
- [ ] The document changes have been made in apache/echarts-doc#xxx
I'm happy to take a stab at making a PR to the docs once we're sure about the naming of the new option. I may need some help with the zh-based language bits. Let me know if you'd prefer I help with this or leave it to the maintainers.
## Misc
### ZRender Changes
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
### Related test cases or examples to use the new APIs
I added two test cases to `test/tooltip-axisPointer2.html`. One for the `false` case and one for the `true` case. Let me know if you think I should break this out into a separate test case, and if so, what you think the best name is for it.
I added visual tests for each test case that take screenshots at the following points:
- When mousing over a section of the chart without a line. This validates the axis pointer's configuration is behaving as expected.
- When mousing over an individual line. This validates non-axis-pointer highlight behavior is not impacted.
## Others
### Merging options
- [ ] Please squash the commits into a single one when merging.
### Other information
I was unsure of the best name for this configuration option. This behavior is referred to as `emphasis` in the configuration of the styling, but is referred to as `highlight` when triggering the event. I started with `triggerEmphasis` because I thought users might be more familiar with the styling configuration, but I can see arguments for `triggerHighlight`. I used the `trigger*` naming to match the similar-ish `triggerTooltip` option. I'm happy to rename it to whatever the maintainers think is best.
--
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] juliepagano commented on pull request #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "juliepagano (via GitHub)" <gi...@apache.org>.
juliepagano commented on PR #18524:
URL: https://github.com/apache/echarts/pull/18524#issuecomment-1513506707
I'm working with one of my teammates to get help with the Chinese translation, so I can put up a docs PR to go with this. Hoping I'll have that up some time today.
--
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 #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia merged PR #18524:
URL: https://github.com/apache/echarts/pull/18524
--
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 commented on pull request #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #18524:
URL: https://github.com/apache/echarts/pull/18524#issuecomment-1514033251
We ususally release a new version every two months. If you want to use this feature ASAP, you can use the [nightly](npm install echarts@npm:echarts-nightly) version in your development environment.
--
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] juliepagano commented on pull request #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "juliepagano (via GitHub)" <gi...@apache.org>.
juliepagano commented on PR #18524:
URL: https://github.com/apache/echarts/pull/18524#issuecomment-1513431933
> The code looks good to me but it seems some of the tooltip-related test cases fail in the visual test.
>
> <img alt="image" width="327" src="https://user-images.githubusercontent.com/779050/232745101-76ca3a72-532e-47e5-9f0e-ccdeaf5e8348.png">
>
> @juliepagano Can you have a look?
Sure thing! The diff from "tooltip-axisPointer2" is from the case where `triggerEmphasis` is `false`, so that's expected (screenshot below). I'll take a closer look at the other failing tests to see what's going on there.
<img width="1079" alt="image" src="https://user-images.githubusercontent.com/396962/232836620-f68e80b7-5f20-4f51-bbee-bb3a3ad72375.png">
--
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 #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #18524:
URL: https://github.com/apache/echarts/pull/18524#issuecomment-1514029221
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
[GitHub] [echarts] echarts-bot[bot] commented on pull request #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #18524:
URL: https://github.com/apache/echarts/pull/18524#issuecomment-1512253206
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).
Document changes are required in this PR. Please also make a PR to [apache/echarts-doc](https://github.com/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 `PR: awaiting doc` label.
--
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] juliepagano commented on pull request #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "juliepagano (via GitHub)" <gi...@apache.org>.
juliepagano commented on PR #18524:
URL: https://github.com/apache/echarts/pull/18524#issuecomment-1513478883
The visual tests look much better after the commit I made to remove `triggerEmphasis` from the conditional for `involveSeries`. The only failing tooltip test is now the expected one for `triggerEmphasis: false`.
Screenshot of the expected visual diff and showing all the other tooltip tests passing.
<img width="1478" alt="image" src="https://user-images.githubusercontent.com/396962/232844905-4420088f-50c3-4812-8e7d-4c2c60dd1c9e.png">
Scrolling down to screenshot the other tests.
<img width="348" alt="image" src="https://user-images.githubusercontent.com/396962/232845023-bd4d659c-6c16-40b4-9031-a1feba4b5f62.png">
--
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] juliepagano commented on a diff in pull request #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "juliepagano (via GitHub)" <gi...@apache.org>.
juliepagano commented on code in PR #18524:
URL: https://github.com/apache/echarts/pull/18524#discussion_r1170288997
##########
src/component/axisPointer/modelHelper.ts:
##########
@@ -194,8 +196,9 @@ function collectAxesInfo(result: CollectionResult, ecModel: GlobalModel, api: Ex
: axisPointerModel;
const snap = axisPointerModel.get('snap');
+ const triggerEmphasis = axisPointerModel.get('triggerEmphasis');
const axisKey = makeKey(axis.model);
- const involveSeries = triggerTooltip || snap || axis.type === 'category';
+ const involveSeries = triggerTooltip || triggerEmphasis || snap || axis.type === 'category';
Review Comment:
I _think_ the addition of `triggerEmphasis` here might be causing the unexpected visual diffs. Removing it and testing it out locally to validate.
--
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 commented on pull request #18524: feat(axisPointer): add option to disable emphasis. close #18495
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #18524:
URL: https://github.com/apache/echarts/pull/18524#issuecomment-1514029045
Thank you for this high-quality 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