Centering bokeh plot and widgets

Hello.

I’m trying to find a way to center both the widgets and the plot, but I can’t find any information.

I already looked at gridplot and layout, but that just wraps the plot and the widgets.

Maybe I overlooked something. Any help would be appreciated.

Hi @xertz please describe your use-case much more in more detail. Are you embedding in a flask or other webapp? In a jupyter notebook? Is this just standalone HTML output? Center within the page? within a div? Widgets and plots centered individually? Together as a group? Screenshots or drawings would be very helpful.

@Bryan It’s just a standalone HTML output using the bokeh server

I would like to center it within the page as a group.

# row 1
file_upload = column(score, video, upload_btn)
data_table = column(table)
# row 2
plot.add_layout(mean)
graph = column(plot, plot_preview)

l = gridplot([
    [file_upload, data_table],
    [graph]], sizing_mode='fixed'
)

curdoc().add_root(l)

These two things seem in conflict:

It’s just a standalone HTML

curdoc().add_root(l)

Is this a Bokeh server application that you run with bokeh serve ? If so, that is not standalone HTML (it requires and depends on the Bokeh server being running). Regardless you will have to use a custom Jinja template. As soon as I know if this is standalone HTML or a Bokeh server application, I can point you more directly to the relevant documentation.

I misunderstood. Sorry. It’s a Bokeh server application. I run it, using this command;

bokeh serve --show myapp

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.