Skip to content

Commit

Permalink
removed deprecated color/size_index params
Browse files Browse the repository at this point in the history
  • Loading branch information
poplarShift committed Feb 27, 2019
1 parent d6d7df7 commit f665354
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 55 deletions.
1 change: 0 additions & 1 deletion holoviews/element/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class Scatter(Chart):
location along the x-axis while the first value dimension
represents the location of the point along the y-axis.
"""

group = param.String(default='Scatter', constant=True)


Expand Down
22 changes: 0 additions & 22 deletions holoviews/plotting/bokeh/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,17 +1061,6 @@ class SegmentPlot(ColorbarPlot):
Segments are lines in 2D space where each two each dimensions specify a
(x, y) node of the line.
"""
# Deprecated parameters

color_index = param.ClassSelector(default=None, class_=(basestring, int),
allow_None=True, doc="""
Deprecated in favor of color style mapping, e.g. `color=dim('color')`""")

size_index = param.ClassSelector(default=None, class_=(basestring, int),
allow_None=True, doc="""
Deprecated in favor of size style mapping, e.g. `size=dim('size')`""")


style_opts = line_properties + ['cmap']

_nonvectorized_styles = ['cmap']
Expand All @@ -1083,9 +1072,6 @@ def get_data(self, element, ranges, style):
x0idx, y0idx, x1idx, y1idx = (
(1, 0, 3, 2) if self.invert_axes else (0, 1, 2, 3)
)
cdim = element.get_dimension(self.color_index)
cdata, cmapping = self._get_color_data(element, ranges, style,
name='line_color')

# Compute segments
x0s, y0s, x1s, y1s = (
Expand All @@ -1095,14 +1081,6 @@ def get_data(self, element, ranges, style):
element.dimension_values(y1idx)
)

color = None
if cdim:
color = cdata.get(cdim.name)

data = {'x0': x0s, 'x1': x1s, 'y0': y0s, 'y1': y1s}
mapping = dict(x0='x0', x1='x1', y0='y0', y1='y1')
if cdim and color is not None:
data[cdim.name] = color
mapping.update(cmapping)

return (data, mapping, style)
33 changes: 1 addition & 32 deletions holoviews/plotting/mpl/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,20 +1262,9 @@ class SideSpikesPlot(AdjoinedPlot, SpikesPlot):

class SegmentPlot(ColorbarPlot):
"""
Segments are lines in 2D space where each two each dimensions specify a
Segments are lines in 2D space where each two key dimensions specify a
(x, y) node of the line.
"""
# Deprecated parameters

color_index = param.ClassSelector(default=None, class_=(basestring, int),
allow_None=True, doc="""
Deprecated in favor of color style mapping, e.g. `color=dim('color')`""")

size_index = param.ClassSelector(default=None, class_=(basestring, int),
allow_None=True, doc="""
Deprecated in favor of size style mapping, e.g. `size=dim('size')`""")


style_opts = PathPlot.style_opts + ['cmap']

_nonvectorized_styles = ['cmap']
Expand All @@ -1300,26 +1289,6 @@ def get_data(self, element, ranges, style):
dims = element.dimensions()
data = [[(x0, y0), (x1, y1)] for x0, y0, x1, y1
in element.array([x0idx, y0idx, x1idx, y1idx])]
stacked_data = []
for segment in data:
xs, ys = zip(*segment)
cols = []
for vs in (xs, ys):
vs = np.array(vs)
cols.append(vs)
stacked_data.append(np.column_stack(cols))


cdim = element.get_dimension(self.color_index)
color = style.get('color', None)
if cdim and ((isinstance(color, basestring) and color in element) or isinstance(color, dim)):
self.param.warning(
"Cannot declare style mapping for 'color' option and "
"declare a color_index; ignoring the color_index.")
cdim = None
if cdim:
style['array'] = element.dimension_values(cdim)
self._norm_kwargs(element, ranges, style, cdim)

with abbreviated_exception():
style = self._apply_transforms(element, ranges, style)
Expand Down

0 comments on commit f665354

Please sign in to comment.