Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bokeh TextPlot uses Text parameter settings #1157

merged 1 commit into from Feb 27, 2017
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+9 −1
Diff settings


Just for now

Bokeh TextPlot uses Text parameter settings

  • Loading branch information...
Philipp Rudiger Philipp Rudiger
Philipp Rudiger authored and Philipp Rudiger committed Feb 26, 2017
commit 3d3f2ed03602ca300a110ce8853d0ba673c05b8d
@@ -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:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.