children is an attribute that carries a list of objects contained within a Layout object. The orientation of the elements in the children attribute depends on the kind of Layout object they are in. In the example you provided, mainLayout is the layout being modified.
mainLayout = column(row(toggle,name='Widgets'),p1,name='mainLayout')
from this line, we can see that mainLayout is a Column object that contains a Row object and an Figure object (p1). Currently
mainLayout.children looks something like this
[Row(...), Figure(...)]. Since mainLayout is a Column object, objects contained within are arranged vertically and any objects added to
mainLayout.children will be added to this vertical arrangement. If we wanted arrange these elements horizontally we can define the layout as a Row object:
mainLayout = row(row(toggle,name='Widgets'),p1,name='mainLayout')
This version of mainLayout will be oriented horizontally and appending new items to it’s children attribute will grow this layout horizontally.
Nested layouts can also be accessed using the same methods. If I wanted to replace the first element of the nested row, I could do something like this:
mainLayout.children.children = my_new_widget
Hope this helps,
On Mon, Mar 27, 2017 at 10:20 AM, Christopher Olekas [email protected] wrote:
Following http://stackoverflow.com/questions/38548442/dynamically-add-remove-plot-using-bokeh-serve-bokeh-0-12-0 example whenever I append a new plot the plot is always appended downwards.
Is there any way to make it grow in a row? Can someone share some example code where they’ve successfully did this?
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/0c87ba38-a4e6-4caf-8573-dce9f2405252%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.