Skip to content

Commit

Permalink
Fix palette
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 29, 2020
1 parent 875e951 commit 0881ef9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion holoviews/core/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def __getitem__(self, num):
def _get_values(self):
if self.values: return self.values
elif self.key:
return self.default_cycles[self.key]
return list(self.default_cycles[self.key])
else:
raise ValueError("Supply either a key or explicit values.")

Expand Down
12 changes: 5 additions & 7 deletions holoviews/plotting/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from ..core import (HoloMap, DynamicMap, CompositeOverlay, Layout,
Overlay, GridSpace, NdLayout, NdOverlay)
from ..core.options import Cycle
from ..core.options import CallbackError, Cycle
from ..core.ndmapping import item_check
from ..core.spaces import get_nested_streams
from ..core.util import (match_spec, wrap_tuple, basestring, get_overlay_spec,
Expand Down Expand Up @@ -273,7 +273,7 @@ def get_plot_frame(map_obj, key_map, cached=False):
return map_obj[key]
except KeyError:
return None
except StopIteration as e:
except (StopIteration, CallbackError) as e:
raise e
except Exception:
print(traceback.format_exc())
Expand Down Expand Up @@ -620,7 +620,7 @@ def bokeh_palette_to_palette(cmap, ncolors=None, categorical=False):
palette = palette(ncolors)
if reverse: palette = palette[::-1]

return resample_palette(palette, ncolors, categorical, cmap_categorical)
return list(resample_palette(palette, ncolors, categorical, cmap_categorical))


def linear_gradient(start_hex, finish_hex, n=10):
Expand Down Expand Up @@ -898,8 +898,6 @@ def process_cmap(cmap, ncolors=None, provider=None, categorical=False):
else:
raise ValueError("Supplied cmap %s not found among %s colormaps." %
(cmap,providers_checked))
if isinstance(palette, tuple):
palette = list(palette)
else:
try:
# Try processing as matplotlib colormap
Expand Down Expand Up @@ -1077,8 +1075,8 @@ def dim_range_key(eldim):
"""
if isinstance(eldim, dim):
dim_name = repr(eldim)
if dim_name.startswith("'") and dim_name.endswith("'"):
dim_name = dim_name[1:-1]
if dim_name.startswith("dim('") and dim_name.endswith("')"):
dim_name = dim_name[5:-2]
else:
dim_name = eldim.name
return dim_name
Expand Down

0 comments on commit 0881ef9

Please sign in to comment.