Skip to content

Commit

Permalink
Fix issue with deletable annotations in Signal/Image View
Browse files Browse the repository at this point in the history
(fix #69)
  • Loading branch information
PierreRaybaut committed May 3, 2024
1 parent 78db74d commit 4882da8
Show file tree
Hide file tree
Showing 3 changed files with 488 additions and 414 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ for future and past milestones.
is when it is really needed (i.e. for long operations)
* Thanks to [@marcel-goldschen-ohm](https://github.com/marcel-goldschen-ohm) for the
very thorough feedback and the help in testing the fix
* Fixed [Issue #69](https://github.com/DataLab-Platform/DataLab/issues/69) - Annotations should be read-only in Signal/Image View
* Regarding the annotations, DataLab's current behavior is the following:
* Annotations are created only when showing the signal/image in a separate window
(double-click on the object, or "View" > "View in a new window")
* When displaying the objects in either the "Signal View" or the "Image View", the
annotations should be read-only (i.e. not movable, nor resizable or deletable)
* However, some annotations were still deletable in the "Signal View" and the
"Image View": this is now fixed
* Note that the fact that annotations can't be created in the "Signal View" or the
"Image View" is a limitation of the current implementation, and may be improved in
future versions

## DataLab Version 0.15.0 ##

Expand Down
2 changes: 1 addition & 1 deletion cdl/core/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,9 @@ def iterate_shape_items(self, editable: bool = False):
if self.annotations:
try:
for item in load_items(JSONReader(self.annotations)):
set_plot_item_editable(item, editable)
if isinstance(item, AnnotatedShape):
config_annotated_shape(item, fmt, lbl, "shape/annotation")
set_plot_item_editable(item, editable)
yield item
except json.decoder.JSONDecodeError:
pass
Expand Down
Loading

0 comments on commit 4882da8

Please sign in to comment.