terezka/elm-charts

Scatter point hint accuracy

chancyk opened this issue · 1 comments

It can be difficult or impossible to display hints for a particular scatter plot point by default, which may be an artifact of how the mouse pixel position resolves to plot coordinates.

Some kind of tolerance may need to be applied to capture points near the mouse position, though this could be confusing if the X coordinate of the hint is not the same as the actual X coordinate location of the mouse, for instance if the hint for a line is also being display. Since it's up to the user code to display to the hint anyway maybe it's more appropriate for the user code to handle this situation, which should be possible since HintInfo provides the xValue.

The relevant code is here: https://github.com/terezka/elm-plot/blob/master/src/Plot.elm#L700

I'm working on something to solve this in the next version! Thanks for the inspiration!