Thanks Bryan for your response, here is the python fonction that I define, when I apply it, it gives me the error described before.
NB. I have imported all needed libraries.
data = pd.read_hdf(‘static_map_data.hdf’)
source = ColumnDataSource(data)
def construct_text_box(source, value_string=‘wat_value’, color_string=‘wat_color’):
Plot and axes
xdr = Range1d(0, 220)
ydr = Range1d(0, 120)
plot = Plot(
x_range=xdr,
y_range=ydr,
title=“”,
plot_width=250,
plot_height=120,
min_border=0,
**PLOT_FORMATS
)
Add the writing
country = Text(x=5, y=50, text=‘name’, **FONT_PROPS_MD)
percent = Text(x=15, y=10, text=value_string, text_color=color_string, **FONT_PROPS_LG) # nopep8
percent_sign = Text(x=69, y=10, text=[‘%’], text_color=color_string, **FONT_PROPS_LG) # nopep8
line_one = Text(x=90, y=28, text=[‘of people had’], **FONT_PROPS_SM)
line_two_p1 = Text(x=90, y=14, text=[‘access in’], **FONT_PROPS_SM)
line_two_p2 = Text(x=136, y=14, text=‘year’, **FONT_PROPS_SM)
plot.add_glyph(source, selection_glyph=country)
plot.add_glyph(source, Text(), selection_glyph=percent)
plot.add_glyph(source, Text(), selection_glyph=percent_sign)
plot.add_glyph(line_one)
plot.add_glyph(line_two_p1)
plot.add_glyph(source, Text(), selection_glyph=line_two_p2)
Add the orange box with year
shadow = Triangle(x=150, y=109, size=25, fill_color=ORANGE_SHADOW, line_color=None) # nopep8
plot.add_glyph(shadow)
Add the blue bar
rect = Rect(x=75, y=99, width=150, height=5, fill_color=BLUE, line_color=None) # nopep8
plot.add_glyph(rect)
box = Rect(x=200, y=100, width=100, height=40, fill_color=ORANGE, line_color=None) # nopep8
plot.add_glyph(box)
year = Text(x=160, y=85, text=‘year’, text_font_size=‘18pt’, text_color=“#FFFFF”, text_font_style=“bold”) # nopep8
plot.add_glyph(source, Text(), selection_glyph=year)
return plot
show(construct_text_box(source))
···
Le vendredi 28 octobre 2016 17:34:04 UTC+2, Bryan Van de ven a écrit :
It is impossible to speculate without much more information. Can you provide a complete example notebook, that is immediately runnable without any modifications, that deomonstrates your problem? Can you provide more informations about versions and platform?
Bryan
On Oct 28, 2016, at 4:38 AM, [email protected] wrote:
Hello,
I have a problem when executing a python script on jupyter using bokeh, but i have the messgae below, may I have your help?
Thanks
Javascript error adding output!
Error: attempted to retrieve property array for nonexistent field ‘text’
See your browser Javascript console for more details.
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/73494e8f-cc88-4b72-9315-cf3f7763df82%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.