-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deprecations and api changes notes
- Loading branch information
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
[#6102](https://github.com/napari/napari/pull/6102) added the ability to set | ||
linear colormaps from black to a named color by using `colormap="color-name"` | ||
syntax. It turns out that "orange" is both the name of a | ||
white-to-orange colormap in VisPy, and one of the color names in the color | ||
dictionary, therefore implicitly a *black-to-orange* colormap! We decided to use | ||
the new, color-name behavior in this update. So if you are wondering why your | ||
`imshow(data, colormap='orange')` calls look different — this is why. | ||
|
||
In [#6178](https://github.com/napari/napari/pull/6178), the "action" type of | ||
events emitted when editing Shapes or Points was changed to be more granular. | ||
The types are no longer "add", "remove", and "change", but "adding", "added", | ||
"removing", "removed", "changing", and "changed". This gives listeners more | ||
control over when to take action in response to an event. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[#6542](https://github.com/napari/napari/pull/6542) made a number of | ||
deprecations to the Labels API to simplify it. Rather than having color-related | ||
properties strewn all over the layer, color control is moved strictly to the | ||
layer's `colormap`. Here is the full list of deprecated attributes and their | ||
replacements: | ||
|
||
- num_colors: `layer.num_colors` becomes `len(layer.colormap)`. | ||
`layer.num_colors = n` becomes `layer.colormap = label_colormap(n)`. | ||
- `napari.utils.colormaps.LabelColormap` is deprecated and has been renamed to | ||
`napari.utils.colormaps.CyclicLabelColormap`. | ||
- color: `layer.color` becomes `layer.colormap.color_dict`. | ||
`layer.color = color_dict` becomes | ||
`layer.colormap = DirectLabelColormap(color_dict)`. | ||
- _background_label: `layer._background_label` is now at | ||
`layer.colormap.background_value`. | ||
- color_mode: `layer.color_mode` is set by setting the colormap using the | ||
corresponding colormap type (`CyclicLabelColormap` or `DirectLabelColormap`; | ||
these classes can be imported from `napari.utils.colormaps`.). | ||
- `seed`: was only used for shifting labels around in [0, 1]. It is | ||
superseded by `layer.new_colormap()` which was implemented in | ||
[#6460](https://github.com/napari/napari/pull/6460). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters