How to use the bokeh.layouts.column function in bokeh

To help you get started, we’ve selected a few bokeh examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github informatics-lab / forest / forest / survey.py View on Github external
middlewares.append(DatabaseMiddleware(database))
        self.store = Store(
                reducer,
                initial_state={"page": WELCOME},
                middlewares=middlewares)
        self.store.subscribe(print)
        self.store.subscribe(self.render)
        self.welcome = Welcome()
        self.welcome.subscribe(self.store.dispatch)
        self.questions = Questions()
        self.questions.subscribe(self.store.dispatch)
        self.results = Results()
        self.results.subscribe(self.store.dispatch)
        self.confirm = Confirm()
        self.confirm.subscribe(self.store.dispatch)
        self.layout = bokeh.layouts.column(
                *self.welcome.children)
        super().__init__()
github informatics-lab / forest / forest / main.py View on Github external
def on_change(attr, old, new):
        if int(new) == 1:
            image_controls.labels = ["Show"]
        elif int(new) == 2:
            image_controls.labels = ["L", "R"]
        elif int(new) == 3:
            image_controls.labels = ["L", "C", "R"]

    figure_drop.on_change("value", on_change)

    image_controls.subscribe(artist.on_visible)

    div = bokeh.models.Div(text="", width=10)
    border_row = bokeh.layouts.row(
        bokeh.layouts.column(toggle),
        bokeh.layouts.column(div),
        bokeh.layouts.column(dropdown))

    # Pre-select first layer
    for name, _ in config.patterns:
        image_controls.select(name)
        break

    if len(args.files) > 0:
        navigator = navigate.FileSystem.file_type(
                args.files,
                args.file_type)
    elif args.database is not None:
        navigator = database
    else:
        navigator = navigate.Config(config)
github ANRGUSC / Jupiter / visualization / demo.py View on Github external
# p1.add_layout(fusion_center2)
# p1.add_layout(Arrow(end=NormalHead(line_color="black", line_width=1, size=10),x_start=5.5, y_start=1.83, x_end=3.7, y_end=1.18))


# #p1.ellipse(3.5, 1, size=40, color="#33148E") #global_fusion
# global_fusion = Label(x=2, y=0.9, text='global_fusion',text_color='black',background_fill_color='#33148E', background_fill_alpha=0.5)
# p1.add_layout(global_fusion)

# ellipse_source = p1.quad(top='top', bottom='bottom', left='left', right='right',color='color', source= source2)

###################################################################################################################################
p2 = layout([title1,widgetbox(data_table,width=400,height=280),title2,widgetbox(data_table2,width=400,height=280)],sizing_mode='fixed',width=400,height=600)
layout = row(p2,p,p1)
doc.add_root(layout)

p3 = column(title3,widgetbox(data_table3))
p4 = column(title4,widgetbox(data_table4))
doc.add_root(row(p3,p4))
doc.add_periodic_callback(update, 50)
github NervanaSystems / coach / rl_coach / dashboard_components / experiment_board.py View on Github external
color_selector.axis.visible = False
color_range = color_selector.rect(x='x', y='y', width=1, height=10,
                                  color='crcolor', source=crsource)
crsource.on_change('selected', select_color)
color_range.nonselection_glyph = color_range.glyph
color_selector.toolbar.logo = None
color_selector.toolbar_location = None

# main layout of the document
layout = row(file_selection_button, files_selector_spacer, group_selection_button, width=300)
layout = column(layout, files_selector)
layout = column(layout, row(update_files_button, Spacer(width=50), auto_update_toggle_button,
                            Spacer(width=50), unload_file_button))
layout = column(layout, row(refresh_info))
layout = column(layout, data_selector)
layout = column(layout, color_selector_title)
layout = column(layout, color_selector)
layout = column(layout, x_axis_selector_title)
layout = column(layout, x_axis_selector)
layout = column(layout, group_cb)
layout = column(layout, toggle_second_axis_button)
layout = column(layout, averaging_slider)
toolbox = ToolbarBox(toolbar=toolbar, toolbar_location='above')
panel = column(toolbox, plot)
layout = row(layout, panel)

experiment_board_layout = layout

layouts["experiment_board"] = experiment_board_layout
github informatics-lab / forest / forest / images.py View on Github external
self.menu = menu
        self.models = {}
        self.flags = {}
        self.default_flags = [False, False, False]

        self.state = {}
        self.previous_state = None
        self.renderers = []
        self._labels = ["Show"]

        self.groups = []
        self.dropdowns = []

        add = bokeh.models.Button(label="Add", width=50)
        remove = bokeh.models.Button(label="Remove", width=50)
        self.column = bokeh.layouts.column(
            bokeh.layouts.row(add, remove)
        )
        self.add_row()
        add.on_click(self.add_row)
        remove.on_click(self.remove_row)
        super().__init__()
github submission2019 / cnn-quantization / utils / log.py View on Github external
Parameters
        ----------
        title: string
            title of the HTML file
        """
        title = title or self.title
        if len(self.figures) > 0:
            if os.path.isfile(self.plot_path):
                os.remove(self.plot_path)
            if self.first_save:
                self.first_save = False
                logging.info('Plot file saved at: {}'.format(
                    os.path.abspath(self.plot_path)))

            output_file(self.plot_path, title=title)
            plot = column(
                Div(text='<h1 align="center">{}</h1>'.format(title)), *self.figures)
            save(plot)
            self.clear()

        if self.data_format == 'json':
            self.results.to_json(self.data_path, orient='records', lines=True)
        else:
            self.results.to_csv(self.data_path, index=False, index_label=False)
github bokeh / bokeh / examples / app / stocks / main.py View on Github external
def selection_change(attrname, old, new):
    t1, t2 = ticker1.value, ticker2.value
    data = get_data(t1, t2)
    selected = source.selected.indices
    if selected:
        data = data.iloc[selected, :]
    update_stats(data, t1, t2)

source.selected.on_change('indices', selection_change)

# set up layout
widgets = column(ticker1, ticker2, stats)
main_row = row(corr, widgets)
series = column(ts1, ts2)
layout = column(main_row, series)

# initialize
update()

curdoc().add_root(layout)
curdoc().title = "Stocks"
github cutright / DVH-Analytics-Bokeh / dvh / modules / main / query.py View on Github external
self.range_not_operator_checkbox = CheckboxGroup(labels=['Not'], active=[])
        self.range_not_operator_checkbox.on_change('active', self.range_not_operator_ticker)

        self.query_button = Button(label="Query", button_type="success", width=100)
        self.query_button.on_click(self.update_data)

        # define Download button and call download.js on click
        menu = [("All Data", "all"), ("Lite", "lite"), ("Only DVHs", "dvhs"), ("Anonymized DVHs", "anon_dvhs")]
        self.download_dropdown = Dropdown(label="Download", button_type="default", menu=menu, width=100)
        self.download_dropdown.callback = CustomJS(args=dict(source=sources.dvhs,
                                                             source_rxs=sources.rxs,
                                                             source_plans=sources.plans,
                                                             source_beams=sources.beams),
                                                   code=open(join(dirname(dirname(__file__)), "download.js")).read())

        self.layout = column(Div(text="<b>DVH Analytics v%s</b>" % '0.5.10'),
                             row(custom_title['1']['query'], Spacer(width=50), custom_title['2']['query'],
                                 Spacer(width=50), self.query_button, Spacer(width=50), self.download_dropdown),
                             Div(text="<b>Query by Categorical Data</b>", width=1000),
                             self.add_selector_row_button,
                             row(self.selector_row, Spacer(width=10), self.select_category1, self.select_category2,
                                 self.group_selector, self.delete_selector_row_button, Spacer(width=10),
                                 self.selector_not_operator_checkbox),
                             data_tables.selection_filter,
                             Div(text="<hr>", width=1050),
                             Div(text="<b>Query by Numerical Data</b>", width=1000),
                             self.add_range_row_button,
                             row(self.range_row, Spacer(width=10), self.select_category, self.text_min,
                                 Spacer(width=30),
                                 self.text_max, Spacer(width=30), self.group_range,
                                 self.delete_range_row_button, Spacer(width=10), self.range_not_operator_checkbox),
                             data_tables.range_filter)
github andrewcooke / choochoo / ch2 / bucket / page / activity_details.py View on Github external
filter(ActivityJournal.start &gt;= start,
               ActivityJournal.start &lt; finish,
               ActivityGroup.id == activity.activity_group_id
               ).all()
    st_ac = statistics(s, ACTIVE_TIME, ACTIVE_DISTANCE, source_ids=[aj.id for aj in ajs])

    activity_line = activities(HEALTH_PLT_LEN, HEALTH_PLOT_HGT, get(st_ff, DAILY_STEPS), st_ac[ACTIVE_TIME],
                               x_range=line_x_range)

    # ---- the final mosaic of plots

    return column(row(hr10_line, hr10_cumulative),
                  row(elvn_line, elvn_cumulative),
                  row(speed_line, speed_cumulative),
                  row(text, hrz_histogram),
                  row(column(health_line, activity_line), map)
                  )
github ChairOfStructuralMechanicsTUM / Mechanics_Apps / Buckling / Archive / main1 copy.py View on Github external
plot1.line(x='x', y='y', source = negplot, color='red',line_width=5)
plot1.line(x='x', y='y', source = conplot, color='red',line_width=5)
plot1.axis.visible = False
plot1.grid.visible = False
plot1.outline_line_width = 5
plot1.outline_line_alpha = 0.5
plot1.outline_line_color = "Black"
plot1.title.text_font_size = "10pt"




weight_slide.on_change('value', fun_update)

fun_update(None,None,None)
curdoc().add_root(row(column(weight_slide,plot1),plot))