-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always overlap modebar with hoverlabels #3471
Comments
Thanks for the report! What's the best solution here in your mind? Show the hover labels above the mode bar (but then the modebar wouldn't be accessible). Show the hover labels on the other side of the data points (on your graph, that's to the left)? In the meantime, I suggest increasing the right margin |
But that's only when the mouse is over the data anyway, right? Hover labels will disappear when you mouse off the plot and onto the modebar, won't they? Seems like this may require a third top-level |
What happens if one hovers over a hover label that sits outside the subplot domain? I think the hover labels stays, but I'd have to check. |
Pretty sure hover labels themselves don't interact with the mouse at all... hovering over the label, whether it's on or off the subplot, does nothing to keep it from disappearing if the mouse isn't in range of the associated data point/object. |
There's this block: plotly.js/src/plots/cartesian/graph_interact.js Lines 139 to 142 in 1aa6c85
but yeah I'm not sure it actually does anything. |
If anything that block is what ensures we pass the event on to the subplot rather than the hover label keeping it. But yeah, in principle if the hover labels are created correctly this shouldn't be necessary. |
Thank you guys for your quick and considerable replies. I'd prefer having an almighty everything-overlapping hoverlabel. Adding left or right margins is a no-go because I need the full width that I can get for 360px wide displays. 😭 |
|
Hmm, right. This is annoying. Maybe we should start thinking seriously about moving the modebar buttons into aka |
@etpinard Another solution is to remove that |
A related Dash issue, if relevant here as well: To reproduce: import dash
import dash_html_components as html
import dash_core_components as dcc
app = dash.Dash(__name__)
app.layout = html.Div([
dcc.Dropdown(
id='my-dropdown',
options=[
{'label': 'New York City', 'value': 'NYC'},
{'label': 'Montreal', 'value': 'MTL'},
{'label': 'San Francisco', 'value': 'SF'}
],
value='NYC'
),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': [1, 2, 3], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'bar', 'name': u'Montréal'},
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
])
if __name__ == '__main__':
app.run_server(debug=True) |
Thank you @anders-kiaer for reporting this issue! I think your issue and the one originally described here are related. In your Dash app, the mode bar appears over the selection menu because its |
Hi there, it would be awesome if we could avoid this:

No matter if I put the modebar to orientation = v or h hoverlabels on the right side will land behind the modebar and thus be hard to read. Especially bad for narrow displays.
I tried to make the modebar only appear on hover as demonstrated in some issues/PRs but I couldn't find such an option.
Other than that I can't think of a situation where you'd not want hoverlabels to always overlap the modebar.
The text was updated successfully, but these errors were encountered: