pmaji / crypto-whale-watching-app

Python Dash app that tracks whale activity in cryptocurrency markets.
MIT License
609 stars 137 forks source link

Make hover state stay up until you mouseout #91

Closed ccampbell closed 6 years ago

ccampbell commented 6 years ago

Right now when you hover over a dot, the tooltip disappears before you have a chance to fully read what it says. It should stay up until you move the mouse off of it.

pmaji commented 6 years ago

Hi @ccampbell, I appreciate the feedback. It is actually a refresh question, and not a question of modifying the tool-tip. Every time the tool-tip disappears that is because we are refreshing the background data (so that gives you an idea of the speed of the refresh-rate). The entire reason we implemented a freeze button was to find a workaround for this, so if you want the tool-tips to not freeze, simple click the freeze button. Hope that helps :)

If for some reason that doesn't make sense, let me know, otherwise I'll close this issue shortly.

theimo1221 commented 6 years ago

@pmaji "Refreshing of background data" might be misleading. Yes, the disappearing of tolltip happens due to refresh of data, but just of data wich are on server. The serverside refreshing of data happens in a different interval and thread.

So as it can be seen in the time in graph title not every "refresh" really grants new data for that particular graph.

But still, as @pmaji said that´s why we have the freeze Button.

@ccampbell Hope I was able to clear this fopr you.

ccampbell commented 6 years ago

That is fine, but I think it is a pretty poor user experience that it doesn’t actually stay up long enough for you to read it. What you could do is render the tooltip in the body of the document instead of inside the content that is refreshed. That way it can be absolutely positioned and if a refresh happens and your mouse is still over the dot you can keep the tooltip up but update the contents to match the new dot.

In fact, you wouldn’t actually have to do anything. You could just render the tooltip in the body and if the content is refreshed, just keep the tooltip there. That way only when you mouse out and back over, you would get updated content. You could even store an identifier of which dot (identifier for seller/buyer + symbol + price + side perhaps?) triggered the tooltip, and after refresh, update or remove it, depending on if that dot still exists.

Obviously that would be more work to implement so I understand if you don’t have the time.

theimo1221 commented 6 years ago

We are using plotly with dash for rendering so we can't "just render it to body"

If we would prepare all those data on our own I would totally agree with you but this way it's not that easy.

ccampbell commented 6 years ago

Aha. That makes sense. Thanks.

One other idea. You could capture the data about the hover and then trigger it programmatically after the refresh. I found this

https://plot.ly/javascript/hover-events/#triggering-hover-events

Obviously, not super high priority. Thanks for your work on this :smile:

theimo1221 commented 6 years ago

@ccampbell Good idea but there is another misconception. We are using Plotly/ Dash in Python. And having a programmatic callback would result in e.g. you clicking and I get same tooltip.

So we have no single callback except data refresh. Cause I don´t want to interfere with your Website visit and you not with mine....

As @pmaji mentioned, just freeze/ unfreeze site