plotly / plotly/plotly.js

[FEATURE]: Add `plotly_heatmapclick` event (similar to `plotly_treemapclick` / `plotly_sunburstclick`)

Ouverte
#7,685 3 commentaires 1 réaction 1 personne assignée Voir sur GitHub

@nojaf y travaille déjà.

Depuis le 14/1/2026.

feature
Langage dominant
JavaScript
Étoiles
18.3k
Forks
2k
Merge moyen
2 j 12 h
PR mergées (30 j)
28

Description

Description

When using dragmode: "select", heatmaps do not fire plotly_click events for single clicks. This makes it impossible to handle both cell selection (drag) and single cell clicks in the same chart.

Treemap and Sunburst charts have dedicated click events (plotly_treemapclick, plotly_sunburstclick) that fire regardless of dragmode, but heatmaps have no equivalent.

Current Behavior
// With dragmode: "select"
graphDiv.on('plotly_click', (data) => {
  // Never fires for heatmaps
});

graphDiv.on('plotly_selected', (data) => {
  // Fires with undefined data on single clicks
});
Requested Behavior

Add a plotly_heatmapclick event (similar to how plotly_treemapclick works) that fires when clicking on a heatmap cell, regardless of dragmode setting.

graphDiv.on('plotly_heatmapclick', (data) => {
  // data.points[0] contains { x, y, z, pointIndex, curveNumber, ... }
});
Why should this feature be added?

We're building reactive heatmap charts in marimo where users can:

  1. Drag to select a range of cells → works via plotly_selected
  2. Click a single cell to select it → does not work with dragmode: "select"

Currently, users must drag even for single-cell selections, which is unintuitive.

Notes

If this feature is something the team would accept, I'm happy to submit a PR implementing it. Any pointers on where to start in the codebase would be appreciated (e.g., how plotly_treemapclick is implemented).

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.