Skip to content

hoverinfo: name field not included for HeatMap #1600

Description

@jsundram

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

Activity

  1. etpinard commented on Apr 18, 2017

    @etpinard
    Contributor

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

    Thanks for report.

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

  2. alexcjohnson commented on Apr 21, 2017

    @alexcjohnson
    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. 🔪

  3. self-assigned this
    on Apr 21, 2017
  4. added a commit that references this issue on Apr 26, 2017
    cf61dc2
  5. added a commit that references this issue on May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions