Skip to content

hoverinfo: name field not included for HeatMap #1600

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

Closed
jsundram opened this issue Apr 17, 2017 · 2 comments
Closed

hoverinfo: name field not included for HeatMap #1600

jsundram opened this issue Apr 17, 2017 · 2 comments
Assignees
Labels
bug something broken

Comments

@jsundram
Copy link

Code

run inside of a jupyter notebook cell...

import numpy as np
import plotly  # plotly.__version__ == '2.0.6'
plotly.offline.init_notebook_mode()
import plotly.graph_objs as go

rows, cols = 3, 3 
data = np.random.rand(rows, cols)
py.iplot(go.Figure(
    data=[go.Heatmap(
        name="CUSTOM NAME",  # This SHOULD show up in the hoverinfo?
        x=range(rows + 1), 
        y=range(cols + 1), 
        z=data, 
        text=np.where(data < .5, '<.5', '>.5'),
        hoverinfo="name+text",  # Want to see "CUSTOM NAME"
        colorscale='Greens', reversescale=True, showscale=False
    )], 
    layout=go.Layout(
        title="Test", 
        xaxis=dict(title='X-Axis'),
        yaxis=dict(title='Y-Axis'),
    )
))

Result

it's a bit small, but you can see that the hovertext lacks the CUSTOM NAME text.

screenshot of result, showing tooltip without Name

@etpinard
Copy link
Contributor

In JS: https://codepen.io/etpinard/pen/xdwYmL

Thanks for report.

You're hoverinfo: 'name' doesn't work currently for heatmap.

@etpinard etpinard added the bug something broken label Apr 18, 2017
@alexcjohnson
Copy link
Collaborator

@etpinard if you want to include this fix in your hover labels PR, it's as simple as removing:
&& d.zLabelVal === undefined
from https://github.com/plotly/plotly.js/pull/1582/files#diff-53eaf7f3ac3274b40206f89f8f87a5d6R689

I don't really recall why that condition was put in there - maybe on the idea that you're already showing lots of info about heatmap points and you don't want to show more? Probably some long-obsolete rationale. 🔪

@etpinard etpinard self-assigned this Apr 21, 2017
etpinard added a commit that referenced this issue May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

3 participants