Repository navigation
Heatmap suppress hovers on missing data #4226
Description
Activity
We'll need a new attribute for this - exposed in all 2d-z trace types (heatmap, contour, contourcarpet, histogram2d*, surface).
Anyone want to take a shot at naming this new attribute? e.g.
hovernanvalueorhovernan?
In relation to #3035 and #975, maybe this new attribute could be a
valType: 'string'. For example,hovernan: 'blank' // would show `z: blank` in the hover label hovernan: '' // or maybe handle hovernan: null // to omit the `z: ` line in the hover label.
Moveover, should this new attribute only affect hover labels generated via
hoverinfoor should it also affect the%{z}values inhovertemplatestrings. For example,// should hovernan: '', hovertemplate: 'f(%{x},%{y}) = %{z}' // show: `f(1,1) = NaN` // OR: `f(1,1) = ''` ?
Or wait, looks like this ticket actually wants to suppress the entire hover label (not just the
z:line) when hovering over a NaNzvalue.Perhaps, in this case a boolean makes more sense: For example:
hoveronnan, but maybe that's a little too hard to make up in smashtogethercase.What about
hovermissing?Or
hoverignore?nicolaskruchten commented
on Oct 11, 2019 ContributorAuthorMore actionscan we reuse
hoveron?nicolaskruchten commented
on Oct 11, 2019 ContributorAuthorMore actionslike
hoveron = "all" | "nonnan"I like it. And I see
hoveronis used at least withbox,parcats,scatter,scattergl,scattercarpet,scatterternaryandviolin.
Is there any conflict with the traces mentioned in #4226 (comment)?@emmanuelle would you mind testing the hover behaviour on missing points using this codepen?
Updated the demo link.

A trace-by-trace flag to disable hovers on heatmaps when the z value is null/NaN