コード例 #1
0
 def create_viewer(self):
     runs = []
     for f_name, run_info in self.data_sources.items():
         # Construct button and apply callback to them.
         run_button = Button(label=f_name,
                             name=f_name,
                             button_type='primary')
         run_button.on_click(self._show_tags(f_name))
         runs.append(run_button)
         # Generate check boxes for tags.
         tag_names = list(run_info["tags"].keys())
         tags = CheckboxButtonGroup(labels=tag_names)
         tags.visible = False
         # tags.on_click(self._plot_tag(f_name, tag_names))
         tags.on_change('active', self._plot_tag(f_name, tag_names))
         runs.append(tags)
         # Captrue both button and tag models for later modificaiton.
         self.data_sources[f_name]["run_button"] = run_button
         self.data_sources[f_name]["tag_boxes"] = tags
         self.data_sources[f_name]["loaded"] = False
     return column(runs)
コード例 #2
0
             dlist[1],
             dlist[2],
             dlist[3],
             dlist[4],
             dlist[5],
             dlist[6],
             dlist[7],
             dlist[8],
             dlist[9]]
LABELS = ["Passengers", "Crew"]

d1 = CheckboxButtonGroup(labels=passengerlist)
d2 = CheckboxButtonGroup(labels=crewlist)
d3 = CheckboxButtonGroup(labels=totallist)
c = CheckboxButtonGroup(labels=LABELS, active=[0, 1])
d1.visible = False
d2.visible = False


def checkbox_changed(attr, old, new):
    if new == [0]:
        d1.visible = True
        d2.visible = False
        d3.visible = False
    elif new == [1]:
        d2.visible = True
        d1.visible = False
        d3.visible = False
    elif new == [0, 1]:
        d1.visible = False
        d2.visible = False