Skip to content

Commit

Permalink
Apply Labels offset using bokeh transform (#3445)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Feb 5, 2019
1 parent cf2fc33 commit ee503cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions holoviews/plotting/bokeh/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
arrow_start = {'<->': NormalHead, '<|-|>': NormalHead}
arrow_end = {'->': NormalHead, '-[': OpenHead, '-|>': NormalHead,
'-': None}
from bokeh.transform import dodge

from ...core.util import datetime_types, dimension_sanitizer, basestring
from ...element import HLine
Expand Down Expand Up @@ -103,9 +104,9 @@ def get_data(self, element, ranges, style):
mapping = dict(x=xdim, y=ydim, text=tdim)
data = {d: element.dimension_values(d) for d in (xdim, ydim)}
if self.xoffset is not None:
data[xdim] = data[xdim] + self.xoffset
mapping['x'] = dodge(xdim, self.xoffset)
if self.yoffset is not None:
data[ydim] = data[ydim] + self.yoffset
mapping['y'] = dodge(ydim, self.yoffset)
data[tdim] = [dims[2].pprint_value(v) for v in element.dimension_values(2)]
self._categorize_data(data, (xdim, ydim), element.dimensions())

Expand Down

0 comments on commit ee503cd

Please sign in to comment.