Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix drag and drop #5061

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [6.0.2] - 2025-03-02

### Fixed
- Fix `ValueError` when dragging and dropping a `FigureWidget` shape.

## [6.0.1] - 2025-02-16

### Fixed
Expand Down
8 changes: 7 additions & 1 deletion plotly/basedatatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4682,6 +4682,7 @@ def __getitem__(self, prop):
CompoundArrayValidator,
BaseDataValidator,
)
from .validators.layout._shapes import ShapesValidator

# Normalize prop
# --------------
Expand All @@ -4707,7 +4708,6 @@ def __getitem__(self, prop):
)

validator = self._get_validator(prop)

if isinstance(validator, CompoundValidator):
if self._compound_props.get(prop, None) is None:
# Init compound objects
Expand All @@ -4719,6 +4719,12 @@ def __getitem__(self, prop):
self._compound_props[prop]._plotly_name = prop

return validator.present(self._compound_props[prop])
elif isinstance(validator, ShapesValidator):
props = []
if self._props is not None and prop in self._props:
props = [validator.data_class() for _ in self._props.get(prop, [])]

return validator.present(props)
elif isinstance(validator, (CompoundArrayValidator, BaseDataValidator)):
if self._compound_array_props.get(prop, None) is None:
# Init list of compound objects
Expand Down