KoalaPlot / koalaplot-core

Koala Plot is a Compose Multiplatform based charting and plotting library written in Kotlin
https://koalaplot.github.io/
MIT License
315 stars 14 forks source link

Support "hoverable" for mobile targets as well #50

Open zoltish opened 3 months ago

zoltish commented 3 months ago

I really dig the hoverable functionality on desktop. It would be sweet if something similar was available for Android and iOS.

Im not sure which approach is most fitting for mobile, but I do love the tactile feeling of scrubbing through a graph and immediately seeing the closest value highlighted - either just above my finger, or at the TopCenter of the graph.

gsteckman commented 3 months ago

Yes, on Desktop the mouse cursor is always there so there is a hover concept. Any idea what would be the equivalent on Android or iOS - a press, a long press, or something else? Material3 has a TooltipBox, but last I checked it wasn't yet multiplatform. I expect it or a variant will eventually be made multiplatform at which time it might be possible to deprecate HoverableElementArea in favor of it.

I think the feature you are describing is a little different than what currently exists in Koala Plot, where no matter where you click or hover on the y-axis a tooltip will display the y-axis values for the current x-axis position of the cursor. The current implementation requires a hover over a symbol to display the hover element.

zoltish commented 3 months ago

Sweet, I was not aware of TooltipBox! Looks like its CMP compatible as well 👍🏾

Personal opinion obviously, but heres a video from how the redesigned Fitbit app does it on Android.

I think thats a great approach for a number of reasons, but perhaps most importantly - compared to clicking: I just need to tap the chart and I can kind of move through the points instead of having to specifically click a point (which Id say is problematic because theres no obvious surface that tells me that I can click it).

gsteckman commented 2 months ago

That video isn't available anymore. I think I know what you mean, but it would be great to see an example.

zoltish commented 2 months ago

That video isn't available anymore. I think I know what you mean, but it would be great to see an example.

https://streamable.com/yrv51e