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 @@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Fix concurrent first access to lazily initialized graph object properties, which could raise `ValueError("Invalid value")` [[#3441](https://github.com/plotly/plotly.py/issues/3441)], with thanks to @hb1915 for the contribution!
- Fix `px.sunburst`, `px.treemap` and `px.icicle` listing sectors in a different order on every run when `path` is used with a Polars DataFrame; sectors now follow their order of first appearance for all dataframe backends [[#5765](https://github.com/plotly/plotly.py/issues/5765)], with thanks to @Irahan2 for the contribution!

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

## [7.1.0] - 2026-09-15

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
1,256 changes: 624 additions & 632 deletions plotly/package_data/widgetbundle.js

Large diffs are not rendered by default.