Skip to content

Toggle exact notation in Line vis tooltip with wheel button#1755

Closed
axelboc wants to merge 2 commits intomainfrom
poc-tooltip-exact-notation
Closed

Toggle exact notation in Line vis tooltip with wheel button#1755
axelboc wants to merge 2 commits intomainfrom
poc-tooltip-exact-notation

Conversation

@axelboc
Copy link
Contributor

@axelboc axelboc commented Feb 5, 2025

Proof of concept for #1646.

While the new Exact notation introduced in #1753 makes sense for the Matrix vis (especially since the Auto notation remains the default), the tooltips of the WebGL-based visualizations are another matter. Showing exact values can quickly add clutter:

image

There's no easy way to know what precision the user expects to see. Finding the smallest difference between two values is of course not an option, so we're basically left with... providing a good default behaviour and letting the user opt in to see more precise values.

In this spirit, here's my attempt at an interaction that consists in clicking the wheel button to toggle "exact" precision on or off for the tooltip:

Screencast.from.2025-02-05.14-40-53.webm

This is just a draft to request feedback on the interaction — please ignore the implementation for now.

@axelboc axelboc requested review from loichuder and t20100 February 5, 2025 13:43
@axelboc axelboc changed the title Toggle exact notation in Live vis tooltip with wheel button Toggle exact notation in Line vis tooltip with wheel button Feb 5, 2025
@loichuder
Copy link
Member

The interaction is fine for me, just not very discoverable. We will have to document it somehow.

Anyway, nobody raised the issue about the exact value in the tooltip (except me) so another sensible alternative is to do nothing.

But since we have to possibility to do something, even not ideal, that is better than nothing 😉

@t20100
Copy link
Member

t20100 commented Apr 3, 2025

+1 even if the interaction is not discoverable.

@axelboc axelboc force-pushed the poc-tooltip-exact-notation branch from e142352 to 41ed5f9 Compare April 7, 2025 13:22
@axelboc
Copy link
Contributor Author

axelboc commented Apr 7, 2025

Okay, so I've had another look at the implementation, and I have concerns with:

  • the arbitrary middle-click interaction interfering with other interactions (we don't currently allow panning with middle click in @h5web/lib, but we might in the future, for instance, or consumers might choose to develop their own custom middle-click interaction)
  • the tight coupling with TooltipMesh, which makes customising the interaction (button, modifier key, etc.) and persisting the setting between dataset/visualisation challenging.

Here is another approach that consists in simply adding a toggle to the line and heatmap toolbars (and their equivalents for complex numbers):

Screencast.from.2025-04-07.16-34-52.webm

I'm not super psyched about adding a control to the toolbar, but at least we get persistence and discoverability out of the box, and no risk of conflicting interactions.

@axelboc axelboc force-pushed the poc-tooltip-exact-notation branch from 8d4e1be to 7ec8b02 Compare April 7, 2025 14:46
@t20100
Copy link
Member

t20100 commented Apr 8, 2025

Not sure it's easy to grasp what the "exact" button does since there is no immediate visible feedback.

What about showing the exact value after a delay without mouse move (like for help tooltips)?
No need for an extra button nor to use a mouse interaction.

@axelboc
Copy link
Contributor Author

axelboc commented Apr 9, 2025

That's a nice idea as well, though it might be a bit tricky to find a timing that feels reasonable while not being too distracting. There's also the idea of showing the exact value in a status bar of sorts, but this would reduce the space available for the visualization.

As discussed offline, it appears that none of the ideas explored so far are 100% conclusive, so the decision is to remain with the status quo for the time being. I'm going to close this PR, as well as #1646, since we did implement exact notation in the Matrix vis, which was the core request of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants