Closed Anton-4 closed 3 years ago
I'm going to add a tooltip on hover for the scatterchart.
Implementing a proper tooltip does require some complexity, see implementation in terezka/line-charts. Because it is a common use case I think it would be valuable if we could include it in the library and not just in examples. Let me know what you think.
PS: For my scatter chart I could not use the css hover trick used in the barchart because the hover text appeared behind other circles.
A hover trick could work, although I would go a bit more sophisticated for a scatter chart and use a Voronoi overlay for getting nice mouse interaction.
The tricky bit with tooltips and the reason that I haven't added them to the library is:
Also, I see no reason why elm-visualization charts shouldn't work with an external tooltip lib.
Those are good arguments. I will check out the voronoi overlay, thanks for the tip :slightly_smiling_face:!
I did not end up using the voronoi overlay, when the scatter points were close together the voronoi polygons got screwed up. The hover div appears when the mouse hovers over a point's circle or over the rectangle of the then "invisible" tooltip. I will resolve merge conflicts later today probably.
Hi @Anton-4, we're getting pretty close to the next release and I'm wondering if you happen to have some time to tidy this up? If not I can take this over... Thanks a lot!
Hi Jakub, I'm busy with a deadline for the next 2 weeks. I have time after that, would that delay be acceptable?
Thanks for getting in touch @Anton-4. Ideally I'd like to make some progress quickly (I have some time for working on elm-visualization, which doesn't happen very often). If you don't mind, I'll do the changes suggested above?
Go ahead :) my apologies for forgetting about this PR.
No worries, I think I caused by not reviewing it promptly. Thanks again for getting this started!
I found the examples did not yet have a scatter plot example so I made one :slightly_smiling_face:. I also wanted to make a candlestick chart so I figured I'd get started with a box plot.