Skip to content

Commit

Permalink
Merge 12b895e into 3d07924
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Aug 19, 2020
2 parents 3d07924 + 12b895e commit 13ee3fc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions holoviews/operation/datashader.py
Expand Up @@ -1511,10 +1511,11 @@ class SpreadingOperation(LinkableOperation):
to make sparse plots more visible.
"""

how = param.ObjectSelector(default='source',
objects=['source', 'over', 'saturate', 'add'], doc="""
how = param.ObjectSelector(default=None,
objects=[None, 'source', 'over', 'saturate', 'add', 'max', 'min'], doc="""
The name of the compositing operator to use when combining
pixels.""")
pixels. Default of None uses 'over' operator for RGB elements
and 'add' operator for aggregate arrays.""")

shape = param.ObjectSelector(default='circle', objects=['circle', 'square'],
doc="""
Expand Down Expand Up @@ -1584,7 +1585,9 @@ class spread(SpreadingOperation):
Number of pixels to spread on all sides.""")

def _apply_spreading(self, array):
return tf.spread(array, px=self.p.px, how=self.p.how, shape=self.p.shape)
replace_none_how = ds_version <= '0.11.1' and (self.p.how is None)
how = 'source' if replace_none_how else self.p.how
return tf.spread(array, px=self.p.px, how=how, shape=self.p.shape)


class dynspread(SpreadingOperation):
Expand All @@ -1611,9 +1614,11 @@ class dynspread(SpreadingOperation):
allowed.""")

def _apply_spreading(self, array):
replace_none_how = ds_version <= '0.11.1' and (self.p.how is None)
how = 'source' if replace_none_how else self.p.how
return tf.dynspread(
array, max_px=self.p.max_px, threshold=self.p.threshold,
how=self.p.how, shape=self.p.shape
how=how, shape=self.p.shape
)


Expand Down

0 comments on commit 13ee3fc

Please sign in to comment.