Skip to content

Commit

Permalink
DataInspector: fix an attribute extraction bug for heatmaps & images
Browse files Browse the repository at this point in the history
If the colorrange attribute is left at default it returns
MakieCore.Automatic; the method for `get` that was called at
show_imagelike does not check for this type so the ensuing call to
interpolated_getindex would fail.

This is fixed by calling `get_attribute` instead which calls to_value
and checks if it's an Automatic type which if it is then falls back to
the provided default.

Fixes #3101
  • Loading branch information
Sagnac committed Sep 27, 2023
1 parent 2b8b8a1 commit cee3b47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/interaction/inspector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ function show_imagelike(inspector, plot, name, edge_based)
a._color[] = if z isa AbstractFloat
interpolated_getindex(
to_colormap(plot.colormap[]), z,
to_value(get(plot.attributes, :colorrange, (0, 1)))
get_attribute(plot.attributes, :colorrange, (0, 1))
)
else
z
Expand Down

0 comments on commit cee3b47

Please sign in to comment.