Skip to content

Commit

Permalink
Merge pull request #1157 from ioam/text_alignment
Browse files Browse the repository at this point in the history
Bokeh TextPlot uses Text parameter settings
  • Loading branch information
jlstevens committed Feb 27, 2017
2 parents 1652e5b + 3d3f2ed commit e09d665
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion holoviews/plotting/bokeh/annotation.py
Expand Up @@ -9,9 +9,17 @@

class TextPlot(ElementPlot):

style_opts = text_properties
style_opts = text_properties+['color']
_plot_methods = dict(single='text', batched='text')

def _glyph_properties(self, plot, element, source, ranges):
props = super(TextPlot, self)._glyph_properties(plot, element, source, ranges)
props['text_align'] = element.halign
props['text_baseline'] = 'middle' if element.valign == 'center' else element.valign
if 'color' in props:
props['text_color'] = props.pop('color')
return props

def get_data(self, element, ranges=None, empty=False):
mapping = dict(x='x', y='y', text='text')
if empty:
Expand Down

0 comments on commit e09d665

Please sign in to comment.