Hi Sarah,
Here is a minimal code to outline the problem that I am facing. The first code block outputs a figure, the second code blocks adds a figure to the output. This works fine if you use the output_notebook() and push_notebook(). However when you use the server, the second instance does not produce plots. Any help would be appreciated.
########## CODE BLOCK 1 #############
def make_plot(x,y):
source = ColumnDataSource(data=dict(x=x, y=y))
p = figure(tools=“save, resize”,
background_fill_color=“#E8DDCB”, height=200, width=200)
p.circle(x=‘x’, y=‘y’, size=20, color=“navy”, alpha=0.5, source=source)
return p, source
from bokeh.models import ColumnDataSource, Range1d
from bokeh.plotting import figure, curdoc
from bokeh.layouts import Row
from bokeh.io import push_notebook
from bokeh.client import push_session, pull_session
import IPython.display
#output_notebook()
session = push_session(curdoc())
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
p1, source = make_plot(x,y)
session.show(Row(p1))
#push_notebook()
############### CODE BLOCK 2 ###################
x = [4, 2, 3, 3, 6]
y = [3, 7, 1, 3, 4]
p2, source2 = make_plot(x,y)
IPython.display.clear_output(True)
session.show(Row(p1,p2))
#push_notebook()
···
On Monday, August 8, 2016 at 5:57:57 PM UTC-4, Charith Peris wrote:
Okay got it. I did maintain a reference to the original Column and I still have the issue. I guess I am running into the bug. I will work on getting runnable code to show outline the issue I am I facing. Thanks!
On Mon, Aug 8, 2016 at 5:50 PM, Sarah Bird - Continuum [email protected] wrote:
I’m not following you.
I’m trying to say that:
1) I’d be surprised if changing the children of your column worked
- due to I bug
2) redoing mysession.show(Column(*new_ histogram_rows))
is not
the correct way to update your column of plots. The correct way is
to maintain a reference to the original column and update the
children…but see point 1.
Can you provide runnable code if you want more help?
Sincerely,
Sarah Bird
On 8/8/16 2:45 PM, Charith Peris wrote:
Yes this is. Sorry about that.
"However, I believe there's
a bug where you can’t update nested children. So in your
case of a column of rows, you may have a problem."
My nested children plots get
updated okay. The issue is when I try to add/remove new
histograms (i.e. new figures) into the plot, as I’ve more
clearly stated in this version of my issue. If I redo the
mysession.show(Column(*new_histogram_rows))
command with my new
histogram I thought it should work. Is my thinking in
correct by any chance?
On Mon, Aug 8, 2016 at 5:40 PM, Sarah > > > Bird - Continuum <[email protected]> wrote:
Is this a duplicate posting?
On 8/8/16 2:36 PM, Charith Peris wrote:
Hi,
I am writing a program which has a set of
variables which keep changing and I plot their
values as histograms. I have a command
mysession = push_session(curdoc())
in order to set the session document and the
command
mysession.show(Column(*histogram_rows))
(where histogram rows is a list of Row
widgets which consist of histograms) to output
the figure on the server. When I run my program
the figure updates as expected. I want to be
able to add/remove histograms.
The way I tried to do that is to clear the
output, take the new set of histograms and plot
again as
mysession.show(Column(*new_histogram_rows))
somehow, this does not work. (Note: This
works inline on ipython notebook when I use
output_notebook() and push_notebook() instead of
the server option.) Can anyone help me identify
what I am doing wrong or suggest a better method
to get this done?
Thanks!
–
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/15b3ef7e-aec8-4156-b33f-034df0f6fa22%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/15b3ef7e-aec8-4156-b33f-034df0f6fa22%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
–
Sarah Bird
Developer, Bokeh
[ <img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" style="width:150px;min-height:30px" height="30px" width="150px"> ](http://continuum.io)
--
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/164bb6f3-5574-fd04-4f8b-cbc75f82f909%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/164bb6f3-5574-fd04-4f8b-cbc75f82f909%40continuum.io?utm_medium=email&utm_source=footer).
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
–
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/CADRy0ULHOqf%3DHQEF2A7vd9Pk96dR0zW5E7CxFmwbp4EQSBFXsQ%40mail.gmail.com.
For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).
–
Sarah Bird
Developer, Bokeh
[
<img alt="Continuum Analytics" src="https://lh6.googleusercontent.com/proxy/VYgVjggTk1hCXSN9wFkffE3I6kxTvJ51tT4KvDXOuKbs1WyFG66k7kt2-vkDimbyxfWtP-d1paJmstMYhPPnDYSUF4rLPoYM2GM2QFM=w5000-h5000" style="width:150px;min-height:30px" height="30px" width="150px">
](http://continuum.io)
–
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/3c384102-3437-4029-f69a-a35b181c17cc%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.