def _set_button(self, specs): button = Button() button.label = specs.text button.width = specs.width button.height = specs.height button.on_click(self.widget_callback) return button
def _set_button(self, specs): button = Button() button.label = specs['text'] button.width = specs['width'] button.height = specs['height'] button.on_click(self.widget_callback) return button
def beforeClicked(self, event, button: Button, graphId: int, metadata: Metadata): button.disabled = True button.label = 'Working!' UnlockedDocumentProxy(button.document).add_next_tick_callback( partial(self.calculate_datapoints, graphId=graphId, button=button, metadata=metadata))
def _set_button(self, specs): button = Button() # button = figure() # button = figure(plot_width=400, plot_height=400, # tools="tap", title="Click the Dots") # # source = ColumnDataSource(data=dict( # x=[1, 2, 3, 4, 5], # y=[2, 5, 8, 2, 7], # color=["navy", "orange", "olive", "firebrick", "gold"] # )) # # button.circle('x', 'y', color='color', size=20, source=source) # # url = _convert_url_to_bokeh("mast_folder/mast.html") # taptool = button.select(type=TapTool) # taptool.callback = OpenURL(url=url) button.label = specs.text button.width = specs.width button.height = specs.height button.name = _convert_url_to_bokeh("mast_folder/mast.html") button.callback = self.widget_callback() return button
def progressReport(self, button: Button, progressValue): button.label = str(progressValue) return
def calculate_datapoints(self, graphId: int, button: Button, metadata: Metadata): # Thread(target=lambda: UnlockedDocumentProxy(button.document).add_next_tick_callback()).start() self.threadCorelate(graphId, button, metadata) button.label = 'Find Similarities' button.disabled = False
def uploadFile(self, file_source, button: Button): button.label = "Upload" button.disabled = False
def disableButton(self, event, button: Button): button.label = "Uploading" button.disabled = True UnlockedDocumentProxy(button.document)\ .add_next_tick_callback(partial(self.uploadFile, file_source=self.file_source, button=button))
end=12, step=1, title='Particle Size (microns)', value=n_particle_size) sample_flow_rate_slider = Slider(start=1, end=6, step=0.5, title='Sample Flow Rate (CFM)', value=n_flow_rate) shrouded_probe_select = Select( options=['RF-2-111', 'RF-2-112', 'Straight Tube', 'Bend', 'Contraction'], value='RF-2-111', title='Shrouded Probe Model') add_component = Button() add_component.label = 'Add Component' tube_diameter_text_box = InputWidget() tube_diameter_text_box.title = 'enter tube dia' probe = shrouded_probe_select.value free_velocity_vector = np.arange(1, 30, 1, dtype=float) source = ColumnDataSource( data={ 'x': free_velocity_vector, 'y': shrouded_probe(n_flow_rate * 28.316 * 0.001 / 60, n_particle_size * 1e-6, free_velocity_vector, probe)
chart_wheel_zoom = WheelZoomTool() chart_pan_tool = PanTool() chart.add_tools(chart_wheel_zoom, chart_pan_tool) chart.toolbar.active_scroll = chart_wheel_zoom chart.xaxis.visible = False chart_lines = None chart_hover = None chart.toolbar.logo = None chart.toolbar_location = None ##create widgets update_button = Button() update_button.label = "Update" update_button.on_click(update) central_bus_toggle = Toggle(label="Ignore Central Business District", active=False) select_rbg_div = Div(text="Display by: ") select_type_radios = RadioButtonGroup( labels=["Count", "Due", "Paid", "Penalties", "Initial Amnt"], active=0) chart_res_div = Div(text="Chart resolution: ") chart_res_labels = ["Yearly", "Monthly", "Weekly", "Daily (Slow)"] chart_res_radios = RadioButtonGroup(labels=chart_res_labels, active=1) chart_rbg_div = Div(text="Chart type: ") chart_rbg_labels = ["Non-Cummulative", "Cummulative"]