On Nov 3, 2016, at 3:40 PM, ehsan.kamalinejad@gmail.com wrote:
When I run the code it gives me the following error:
ValueError: expected an element of Dict(String, Seq(Any)), got {'y': [10], 'sz': 5}
And I can fix the error by changing
cir_size=5
to
cir_size=[5]
But the slider does not change the radius of the circle. Could you please help me? Thanks
On Thursday, April 28, 2016 at 1:01:25 PM UTC-7, Jn Rdh wrote:
Worked like a charm! I had some variation of it but in vain!
On Thursday, April 28, 2016 at 3:55:20 PM UTC-4, Sarah Bird wrote:
Have you tried
a = [sz_slide.value]
as opposed to
a = sz_slide.value
On 4/28/16 6:57 AM, jpr.m...@gmail.com wrote:
I am trying to use the slider widget to get user-provided value to set the size of the circle. I am using bokeh server to do this. But i am running into issues with setting up the columndatasource.
Another related question is there a way to create circle glyphs of different size using the same statement?
This is the code I have thus far for working with the slider:
----------------------------------------------------------------
from bokeh.plotting import Figure
from bokeh.models import HBox, ColumnDataSource
from bokeh.models.widgets import Slider
from bokeh.io import curdoc
cir_x=[2]
cir_y=[10]
cir_size=5
cir_source = ColumnDataSource(data=dict(
x=cir_x,
y=cir_y,
sz=cir_size
))
plot = Figure(plot_width=400, plot_height=400, title='Changing the size of circle',
x_range=[0,20], y_range=[0,20])
plot.circle('x', 'y', size='sz', source=cir_source)
sz_slide = Slider(start=0, end=20, step=1, value=5, title="Circle Size")
def update_radius(attrname, old, new):
a = sz_slide.value
x=[2]
y=[10]
cir_source.data = dict(x=x,y=y,sz=a)
for w in [sz_slide]:
w.on_change('value', update_radius)
h_layout = HBox(children=[plot,sz_slide])
curdoc().add_root(h_layout)
--
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 bokeh+un...@continuum.io.
To post to this group, send email to bo...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/90d9dcb7-8827-47a8-b701-44a4c3c4573f%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
Sarah Bird
Developer, Bokeh
--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e0b3ed18-4b96-400f-ac8e-c395788a521a%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.