brunorosilva / plotly-calplot

The easiest and best looking Calendar Heatmap you'll find, made with Plotly.
https://pypi.org/project/plotly-calplot/
104 stars 10 forks source link

Disable hovering on NaN cells #32

Open mmarfat opened 6 months ago

mmarfat commented 6 months ago

It would be great if hovering was disabled on unassigned (empty) cells. For example, when showing a heatmap with data for just one month (2024-03-01 to 2024-03-31):

image

With the current implementation the empty cells show the raw hovertemplate value. Can this somehow be disabled (or perhaps replaced with an empty value based on condition)?

JustinAimiable commented 6 months ago

I haven't figured out excluding the NaN values piece yet, but since it does export a plotly plot, I was able to iterate over the traces and update the hovertemplate:


for trace in fig.data:
    trace.update(
        hovertemplate=some_template_string
    )