From 53a00a8acc4dd43d4a54f6308ad3a100e091b0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dtalo=20Epif=C3=A2nio?= Date: Sun, 2 Mar 2025 12:10:36 -0300 Subject: [PATCH 1/2] Bugfix drag and drop --- plotly/basedatatypes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plotly/basedatatypes.py b/plotly/basedatatypes.py index a3044f6763a..290615cc644 100644 --- a/plotly/basedatatypes.py +++ b/plotly/basedatatypes.py @@ -4682,6 +4682,7 @@ def __getitem__(self, prop): CompoundArrayValidator, BaseDataValidator, ) + from .validators.layout._shapes import ShapesValidator # Normalize prop # -------------- @@ -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 @@ -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 From 400ba7c5767382323e08966cff7d97ecb591e865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dtalo=20Epif=C3=A2nio?= Date: Sun, 2 Mar 2025 12:58:12 -0300 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e9a68fd8de..faaafa39b32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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