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.
   
   
![image](https://user-images.githubusercontent.com/396962/232632417-e75836e1-2743-4b7d-95c6-94663b22c17e.png)
   
   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-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to