How to use ipywidgets - 10 common examples

To help you get started, we’ve selected a few ipywidgets 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 rheiland / xml2jupyter / tests / user_params_baseline_cancer_immune.py View on Github external
desc_button16.style.button_color = 'tan'
        desc_button17 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button17.style.button_color = 'lightgreen'
        desc_button18 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button18.style.button_color = 'tan'
        desc_button19 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button19.style.button_color = 'lightgreen'
        desc_button20 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button20.style.button_color = 'tan'
        desc_button21 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button21.style.button_color = 'lightgreen'
        desc_button22 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button22.style.button_color = 'tan'
        desc_button23 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button23.style.button_color = 'lightgreen'
        desc_button24 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button24.style.button_color = 'tan'

        row1 = [param_name1, self.random_seed, units_button1, desc_button1] 
        row2 = [param_name2, self.immune_activation_time, units_button2, desc_button2] 
        row3 = [param_name3, self.save_interval_after_therapy_start, units_button3, desc_button3] 
        row4 = [param_name4, self.immune_o2_relative_uptake, units_button4, desc_button4] 
        row5 = [param_name5, self.immune_apoptosis_rate, units_button5, desc_button5] 
        row6 = [param_name6, self.immune_motility_persistence_time, units_button6, desc_button6] 
        row7 = [param_name7, self.immune_migration_speed, units_button7, desc_button7] 
        row8 = [param_name8, self.immune_migration_bias, units_button8, desc_button8] 
        row9 = [param_name9, self.immune_relative_adhesion, units_button9, desc_button9] 
        row10 = [param_name10, self.immune_relative_repulsion, units_button10, desc_button10] 
        row11 = [param_name11, self.immune_kill_rate, units_button11, desc_button11] 
        row12 = [param_name12, self.immune_attachment_lifetime, units_button12, desc_button12] 
        row13 = [param_name13, self.immune_attachment_rate, units_button13, desc_button13] 
        row14 = [param_name14, self.elastic_coefficient, units_button14, desc_button14]
github rheiland / xml2jupyter / tests / user_params.py View on Github external
desc_button3.style.button_color = 'lightgreen'
        desc_button4 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button4.style.button_color = 'tan'
        desc_button5 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button5.style.button_color = 'lightgreen'
        desc_button6 = Button(description='', disabled=True, layout=desc_button_layout) 
        desc_button6.style.button_color = 'tan'

        row1 = [param_name1, self.tumor_radius, units_button1, desc_button1] 
        row2 = [param_name2, self.oncoprotein_mean, units_button2, desc_button2] 
        row3 = [param_name3, self.oncoprotein_sd, units_button3, desc_button3] 
        row4 = [param_name4, self.oncoprotein_min, units_button4, desc_button4] 
        row5 = [param_name5, self.oncoprotein_max, units_button5, desc_button5] 
        row6 = [param_name6, self.random_seed, units_button6, desc_button6] 

        box_layout = Layout(display='flex', flex_flow='row', align_items='stretch', width='100%')
        box1 = Box(children=row1, layout=box_layout)
        box2 = Box(children=row2, layout=box_layout)
        box3 = Box(children=row3, layout=box_layout)
        box4 = Box(children=row4, layout=box_layout)
        box5 = Box(children=row5, layout=box_layout)
        box6 = Box(children=row6, layout=box_layout)

        self.tab = VBox([
          box1,
          box2,
          box3,
          box4,
          box5,
          box6,
        ])
github rheiland / xml2jupyter / tests / user_params_baseline_cancer_biobots.py View on Github external
value=0,
          step=0.01,
          style=style, layout=widget_layout)

        param_name7 = Button(description='cargo_relative_repulsion', disabled=True, layout=name_button_layout)
        param_name7.style.button_color = 'lightgreen'

        self.cargo_relative_repulsion = FloatText(
          value=5,
          step=0.1,
          style=style, layout=widget_layout)

        param_name8 = Button(description='worker_o2_relative_uptake', disabled=True, layout=name_button_layout)
        param_name8.style.button_color = 'tan'

        self.worker_o2_relative_uptake = FloatText(
          value=0.1,
          step=0.01,
          style=style, layout=widget_layout)

        param_name9 = Button(description='worker_apoptosis_rate', disabled=True, layout=name_button_layout)
        param_name9.style.button_color = 'lightgreen'

        self.worker_apoptosis_rate = FloatText(
          value=0,
          step=0.01,
          style=style, layout=widget_layout)

        param_name10 = Button(description='worker_motility_persistence_time', disabled=True, layout=name_button_layout)
        param_name10.style.button_color = 'tan'

        self.worker_motility_persistence_time = FloatText(
github rheiland / xml2jupyter / tests / user_params_baseline_default.py View on Github external
value=.1,
          step=0.01,
          style=style, layout=widget_layout)

        param_name5 = Button(description='elastic_coefficient', disabled=True, layout=name_button_layout)
        param_name5.style.button_color = 'lightgreen'

        self.elastic_coefficient = FloatText(
          value=0.05,
          step=0.01,
          style=style, layout=widget_layout)

        param_name6 = Button(description='worker_motility_persistence_time', disabled=True, layout=name_button_layout)
        param_name6.style.button_color = 'tan'

        self.worker_motility_persistence_time = FloatText(
          value=5.0,
          step=0.1,
          style=style, layout=widget_layout)

        param_name7 = Button(description='worker_migration_speed', disabled=True, layout=name_button_layout)
        param_name7.style.button_color = 'lightgreen'

        self.worker_migration_speed = FloatText(
          value=5.0,
          step=0.1,
          style=style, layout=widget_layout)

        param_name8 = Button(description='attached_worker_migration_bias', disabled=True, layout=name_button_layout)
        param_name8.style.button_color = 'tan'

        self.attached_worker_migration_bias = FloatText(
github rheiland / xml2jupyter / tests / user_params_baseline_cancer_immune.py View on Github external
value=0.25,
          step=0.01,
          style=style, layout=widget_layout)

        param_name21 = Button(description='oncoprotein_saturation', disabled=True, layout=name_button_layout)
        param_name21.style.button_color = 'lightgreen'

        self.oncoprotein_saturation = FloatText(
          value=2.0,
          step=0.1,
          style=style, layout=widget_layout)

        param_name22 = Button(description='oncoprotein_threshold', disabled=True, layout=name_button_layout)
        param_name22.style.button_color = 'tan'

        self.oncoprotein_threshold = FloatText(
          value=0.5,
          step=0.1,
          style=style, layout=widget_layout)

        param_name23 = Button(description='max_attachment_distance', disabled=True, layout=name_button_layout)
        param_name23.style.button_color = 'lightgreen'

        self.max_attachment_distance = FloatText(
          value=18.0,
          step=1,
          style=style, layout=widget_layout)

        param_name24 = Button(description='min_attachment_distance', disabled=True, layout=name_button_layout)
        param_name24.style.button_color = 'tan'

        self.min_attachment_distance = FloatText(
github rheiland / xml2jupyter / tests / user_params_baseline_cancer_biobots.py View on Github external
row25 = [param_name25, self.attachment_receptor_threshold, units_button25, desc_button25] 
        row26 = [param_name26, self.max_attachment_distance, units_button26, desc_button26] 
        row27 = [param_name27, self.min_attachment_distance, units_button27, desc_button27] 
        row28 = [param_name28, self.motility_shutdown_detection_threshold, units_button28, desc_button28] 
        row29 = [param_name29, self.attached_worker_migration_bias, units_button29, desc_button29] 
        row30 = [param_name30, self.unattached_worker_migration_bias, units_button30, desc_button30] 

        box_layout = Layout(display='flex', flex_flow='row', align_items='stretch', width='100%')
        box1 = Box(children=row1, layout=box_layout)
        box2 = Box(children=row2, layout=box_layout)
        box3 = Box(children=row3, layout=box_layout)
        box4 = Box(children=row4, layout=box_layout)
        box5 = Box(children=row5, layout=box_layout)
        box6 = Box(children=row6, layout=box_layout)
        box7 = Box(children=row7, layout=box_layout)
        box8 = Box(children=row8, layout=box_layout)
        box9 = Box(children=row9, layout=box_layout)
        box10 = Box(children=row10, layout=box_layout)
        box11 = Box(children=row11, layout=box_layout)
        box12 = Box(children=row12, layout=box_layout)
        box13 = Box(children=row13, layout=box_layout)
        box14 = Box(children=row14, layout=box_layout)
        box15 = Box(children=row15, layout=box_layout)
        box16 = Box(children=row16, layout=box_layout)
        box17 = Box(children=row17, layout=box_layout)
        box18 = Box(children=row18, layout=box_layout)
        box19 = Box(children=row19, layout=box_layout)
        box20 = Box(children=row20, layout=box_layout)
        box21 = Box(children=row21, layout=box_layout)
        box22 = Box(children=row22, layout=box_layout)
        box23 = Box(children=row23, layout=box_layout)
        box24 = Box(children=row24, layout=box_layout)
github rheiland / xml2jupyter / tests / user_params_baseline_cancer_biobots.py View on Github external
row27 = [param_name27, self.min_attachment_distance, units_button27, desc_button27] 
        row28 = [param_name28, self.motility_shutdown_detection_threshold, units_button28, desc_button28] 
        row29 = [param_name29, self.attached_worker_migration_bias, units_button29, desc_button29] 
        row30 = [param_name30, self.unattached_worker_migration_bias, units_button30, desc_button30] 

        box_layout = Layout(display='flex', flex_flow='row', align_items='stretch', width='100%')
        box1 = Box(children=row1, layout=box_layout)
        box2 = Box(children=row2, layout=box_layout)
        box3 = Box(children=row3, layout=box_layout)
        box4 = Box(children=row4, layout=box_layout)
        box5 = Box(children=row5, layout=box_layout)
        box6 = Box(children=row6, layout=box_layout)
        box7 = Box(children=row7, layout=box_layout)
        box8 = Box(children=row8, layout=box_layout)
        box9 = Box(children=row9, layout=box_layout)
        box10 = Box(children=row10, layout=box_layout)
        box11 = Box(children=row11, layout=box_layout)
        box12 = Box(children=row12, layout=box_layout)
        box13 = Box(children=row13, layout=box_layout)
        box14 = Box(children=row14, layout=box_layout)
        box15 = Box(children=row15, layout=box_layout)
        box16 = Box(children=row16, layout=box_layout)
        box17 = Box(children=row17, layout=box_layout)
        box18 = Box(children=row18, layout=box_layout)
        box19 = Box(children=row19, layout=box_layout)
        box20 = Box(children=row20, layout=box_layout)
        box21 = Box(children=row21, layout=box_layout)
        box22 = Box(children=row22, layout=box_layout)
        box23 = Box(children=row23, layout=box_layout)
        box24 = Box(children=row24, layout=box_layout)
        box25 = Box(children=row25, layout=box_layout)
        box26 = Box(children=row26, layout=box_layout)
github rheiland / xml2jupyter / tests / user_params_baseline_cancer_immune.py View on Github external
row20 = [param_name20, self.tumor_immunogenicity_standard_deviation, units_button20, desc_button20] 
        row21 = [param_name21, self.oncoprotein_saturation, units_button21, desc_button21] 
        row22 = [param_name22, self.oncoprotein_threshold, units_button22, desc_button22] 
        row23 = [param_name23, self.max_attachment_distance, units_button23, desc_button23] 
        row24 = [param_name24, self.min_attachment_distance, units_button24, desc_button24] 

        box_layout = Layout(display='flex', flex_flow='row', align_items='stretch', width='100%')
        box1 = Box(children=row1, layout=box_layout)
        box2 = Box(children=row2, layout=box_layout)
        box3 = Box(children=row3, layout=box_layout)
        box4 = Box(children=row4, layout=box_layout)
        box5 = Box(children=row5, layout=box_layout)
        box6 = Box(children=row6, layout=box_layout)
        box7 = Box(children=row7, layout=box_layout)
        box8 = Box(children=row8, layout=box_layout)
        box9 = Box(children=row9, layout=box_layout)
        box10 = Box(children=row10, layout=box_layout)
        box11 = Box(children=row11, layout=box_layout)
        box12 = Box(children=row12, layout=box_layout)
        box13 = Box(children=row13, layout=box_layout)
        box14 = Box(children=row14, layout=box_layout)
        box15 = Box(children=row15, layout=box_layout)
        box16 = Box(children=row16, layout=box_layout)
        box17 = Box(children=row17, layout=box_layout)
        box18 = Box(children=row18, layout=box_layout)
        box19 = Box(children=row19, layout=box_layout)
        box20 = Box(children=row20, layout=box_layout)
        box21 = Box(children=row21, layout=box_layout)
        box22 = Box(children=row22, layout=box_layout)
        box23 = Box(children=row23, layout=box_layout)
        box24 = Box(children=row24, layout=box_layout)
github rheiland / xml2jupyter / tests / user_params_baseline_cancer_immune.py View on Github external
box9 = Box(children=row9, layout=box_layout)
        box10 = Box(children=row10, layout=box_layout)
        box11 = Box(children=row11, layout=box_layout)
        box12 = Box(children=row12, layout=box_layout)
        box13 = Box(children=row13, layout=box_layout)
        box14 = Box(children=row14, layout=box_layout)
        box15 = Box(children=row15, layout=box_layout)
        box16 = Box(children=row16, layout=box_layout)
        box17 = Box(children=row17, layout=box_layout)
        box18 = Box(children=row18, layout=box_layout)
        box19 = Box(children=row19, layout=box_layout)
        box20 = Box(children=row20, layout=box_layout)
        box21 = Box(children=row21, layout=box_layout)
        box22 = Box(children=row22, layout=box_layout)
        box23 = Box(children=row23, layout=box_layout)
        box24 = Box(children=row24, layout=box_layout)

        self.tab = VBox([
          box1,
          box2,
          box3,
          box4,
          box5,
          box6,
          box7,
          box8,
          box9,
          box10,
          box11,
          box12,
          box13,
          box14,
github rheiland / xml2jupyter / tests / user_params_baseline_cancer_biobots.py View on Github external
tab_height = '500px'
        stepsize = 10

        #style = {'description_width': '250px'}
        style = {'description_width': '25%'}
        layout = {'width': '400px'}

        name_button_layout={'width':'25%'}
        widget_layout = {'width': '15%'}
        units_button_layout ={'width':'15%'}
        desc_button_layout={'width':'45%'}

        param_name1 = Button(description='random_seed', disabled=True, layout=name_button_layout)
        param_name1.style.button_color = 'lightgreen'

        self.random_seed = IntText(
          value=0,
          step=1,
          style=style, layout=widget_layout)

        param_name2 = Button(description='therapy_activation_time', disabled=True, layout=name_button_layout)
        param_name2.style.button_color = 'tan'

        self.therapy_activation_time = FloatText(
          value=10080,
          step=1000,
          style=style, layout=widget_layout)

        param_name3 = Button(description='save_interval_after_therapy_start', disabled=True, layout=name_button_layout)
        param_name3.style.button_color = 'lightgreen'

        self.save_interval_after_therapy_start = FloatText(