Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Fix `hex_to_rgb` parsing of 3-digit shorthand hexadecimal colors such as `#FFF` [[#5662](https://github.com/plotly/plotly.py/pull/5662)], with thanks to @genrichez for the contribution!
- Add `<!doctype html>` to the `to_html()` template to comply with modern web standards [[#5693](https://github.com/plotly/plotly.py/pull/5693)], with thanks to @mishrakushal for the contribution!
- Fix `mpl_to_plotly` silently dropping matplotlib path collections in data coordinates (such as violin plots, pcolor, event plots, stack plots, fill_between, and stem plots) by rendering them as filled polygons or lines [[#5702](https://github.com/plotly/plotly.py/pull/5702)], with thanks to @robertoffmoura for the contribution!

- Fix serialization of box/lasso select data for multiple subplots

## [6.9.0] - 2026-07-09

Expand Down
32 changes: 19 additions & 13 deletions js/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ type Py2JsUpdateMsg = Py2JsMsg & {

type Selector = {
type: "box" | "lasso";
selector_state:
| { xrange: number[]; yrange: number[] }
| { xs: number[]; ys: number[] };
selector_state: Record<string, any>;
};

// Model
Expand Down Expand Up @@ -1149,22 +1147,30 @@ export class FigureView {
var selectorObject: Selector;

if (data.hasOwnProperty("range")) {
// Box selection
// Box selection - preserve all subplot-specific axis keys (x, x2, x3, ... and y, y2, y3, ...)
var rangeData = data["range"];
// Verify we have at least an x and y range (in any subplot)
var hasXRange = Object.keys(rangeData || {}).some((key: string) => /^x\d*$/.test(key));
var hasYRange = Object.keys(rangeData || {}).some((key: string) => /^y\d*$/.test(key));
if (!hasXRange || !hasYRange) {
return null;
}
selectorObject = {
type: "box",
selector_state: {
xrange: data["range"]["x"],
yrange: data["range"]["y"],
},
selector_state: rangeData,
};
} else if (data.hasOwnProperty("lassoPoints")) {
// Lasso selection
// Lasso selection - preserve all subplot-specific axis keys
var lassoData = data["lassoPoints"];
// Verify we have at least an x and y coordinate array (in any subplot)
var hasXCoords = Object.keys(lassoData || {}).some((key: string) => /^x\d*$/.test(key));
var hasYCoords = Object.keys(lassoData || {}).some((key: string) => /^y\d*$/.test(key));
if (!hasXCoords || !hasYCoords) {
return null;
}
selectorObject = {
type: "lasso",
selector_state: {
xs: data["lassoPoints"]["x"],
ys: data["lassoPoints"]["y"],
},
selector_state: lassoData,
};
} else {
selectorObject = null;
Expand Down
46 changes: 23 additions & 23 deletions plotly/package_data/widgetbundle.js

Large diffs are not rendered by default.