예제 #1
0
def make_layout():
    plot, source = make_plot()
    columns = [
        TableColumn(field="dates", type="date", header="Date"),
        TableColumn(field="downloads", type="numeric", header="Downloads"),
    ]
    data_table = HandsonTable(source=source, columns=columns)
    button = Button(label="Randomize data", type="success")
    button.on_click(click_handler)
    buttons = VBox(children=[button])
    vbox = VBox(children=[buttons, plot, data_table])
    return vbox
예제 #2
0
def make_layout():
    plot, source = make_plot()
    columns = [
        TableColumn(field="dates", type="date", header="Date"),
        TableColumn(field="downloads", type="numeric", header="Downloads"),
    ]
    data_table = HandsonTable(source=source, columns=columns)
    button = Button(label="Randomize data", type="success")
    button.on_click(click_handler)
    buttons = VBox(children=[button])
    vbox = VBox(children=[buttons, plot, data_table])
    return vbox
예제 #3
0
def radio_group_handler(active):
    print("radio_group_handler: %s" % active)
    session.store_document(document)


def checkbox_button_group_handler(active):
    print("checkbox_button_group_handler: %s" % active)
    session.store_document(document)


def radio_button_group_handler(active):
    print("radio_button_group_handler: %s" % active)
    session.store_document(document)


button = Button(label="Push button", icon=Icon(name="check"), type="primary")
button.on_click(button_handler)

toggle = Toggle(label="Toggle button", type="success")
toggle.on_click(toggle_handler)

menu = [("Item 1", "item_1"), ("Item 2", "item_2"), None, ("Item 3", "item_3")]
dropdown = Dropdown(label="Dropdown button", type="warning", menu=menu)
dropdown.on_click(dropdown_handler)

menu = [("Item 1", "foo"), ("Item 2", "bar"), None, ("Item 3", "baz")]
split = Dropdown(label="Split button",
                 type="danger",
                 menu=menu,
                 default_action="baz")
split.on_click(split_handler)
예제 #4
0
    print("checkbox_group_handler: %s" % active)
    session.store_document(document)

def radio_group_handler(active):
    print("radio_group_handler: %s" % active)
    session.store_document(document)

def checkbox_button_group_handler(active):
    print("checkbox_button_group_handler: %s" % active)
    session.store_document(document)

def radio_button_group_handler(active):
    print("radio_button_group_handler: %s" % active)
    session.store_document(document)

button = Button(label="Push button", icon=Icon(name="check"), type="primary")
button.on_click(button_handler)

toggle = Toggle(label="Toggle button", type="success")
toggle.on_click(toggle_handler)

menu = [("Item 1", "item_1"), ("Item 2", "item_2"), None, ("Item 3", "item_3")]
dropdown = Dropdown(label="Dropdown button", type="warning", menu=menu)
dropdown.on_click(dropdown_handler)

menu = [("Item 1", "foo"), ("Item 2", "bar"), None, ("Item 3", "baz")]
split = Dropdown(label="Split button", type="danger", menu=menu, default_action="baz")
split.on_click(split_handler)

checkbox_group = CheckboxGroup(labels=["Option 1", "Option 2", "Option 3"], active=[0, 1])
checkbox_group.on_click(checkbox_group_handler)