Update Plotly to 3.3.1 and add heatmap click event - #8255
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
mscolnick
approved these changes
Feb 10, 2026
|
Hello, I've opened an upstream PR on Plotly.js that natively solves the missing heatmap event payload issue at the core library level: #7920 - fix(heatmap): add eventData handler for proper click event data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
Add support for click events on plotly heatmaps and upgrade plotly.js to v3.
🔍 Description of Changes
This PR has two parts:
Step 1: Upgrade plotly.js from v2 to v3
Updated
plotly.jsfrom^2.35.3to^3.3.1. This builds on top of #8238 which replacedreact-plotly.jswith a vendoredPlotcomponent. The v3 upgrade results in a smaller bundle (plotly chunk went from ~11 MB to ~4.8 MB) and no longer produces anybuffer-related build warnings.Step 2: Add heatmap click support
Heatmaps don't support box/lasso selection (
onSelected), so clicking a cell previously did nothing. This adds:plotly_clickevent listener in the vendoredPlotcomponent (Plot.tsx).onClickhandler inPlotlyPlugin.tsx, guarded to only process heatmap traces so it doesn't interfere with the existingonSelectedflow for scatter/bar/line charts.extractPointsthat picks standard point keys (x,y,z, etc.) directly from the point data for heatmaps, instead of relying on the hovertemplate parser. The parser doesn't work for heatmaps because they either have no hovertemplate or use a format (e.g.Day: %{x}) that the parser'skey=%{selector}regex doesn't match.A heatmap section was added to the existing
plotly_example.pysmoke test for manual QA.📋 Checklist
//cc @mscolnick