How to use the ipywidgets.BoundedFloatText function in ipywidgets

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 hectornieto / pyTSEB / src / pyTSEB.py View on Github external
def SpectralProperties(self):
        '''Widgets for site spectral properties'''
        import ipywidgets as widgets
        self.w_rhovis=widgets.BoundedFloatText(value=self.rhovis,min=0,max=1,description='Leaf refl. PAR',width=80)
        self.w_tauvis=widgets.BoundedFloatText(value=self.tauvis,min=0,max=1,description='Leaf trans. PAR',width=80)
        self.w_rhonir=widgets.BoundedFloatText(value=self.rhonir,min=0,max=1,description='Leaf refl. NIR',width=80)
        self.w_taunir=widgets.BoundedFloatText(value=self.taunir,min=0,max=1,description='Leaf trans. NIR',width=80)
        
        self.w_rsoilv=widgets.BoundedFloatText(value=self.rsoilv,min=0,max=1,description='Soil refl. PAR',width=80)
        self.w_rsoiln=widgets.BoundedFloatText(value=self.rsoiln,min=0,max=1,description='Soil refl. NIR',width=80)
        self.w_emisVeg=widgets.BoundedFloatText(value=self.emisVeg,min=0,max=1,description='Leaf emissivity',width=80)
        self.w_emisSoil=widgets.BoundedFloatText(value=self.emisGrd,min=0,max=1,description='Soil emissivity',width=80)
        self.specPage=widgets.VBox([widgets.HBox([self.w_rhovis,self.w_tauvis,self.w_rhonir,self.w_taunir]),
                    widgets.HBox([self.w_rsoilv,self.w_rsoiln,self.w_emisVeg,self.w_emisSoil])], background_color='#EEE')
github hectornieto / pyTSEB / pyTSEB / TSEBIPythonInterface.py View on Github external
def calc_row_options(self):
        '''Widgets for canopy in rows'''

        self.w_row = widgets.Checkbox(
            description='Canopy in rows?', value=self.row)
        self.w_rowaz = widgets.BoundedFloatText(
            value=self.row_az,
            min=0,
            max=360,
            description='Row orientation',
            width=80)
        self.w_rowaz.visible = False
github UCLA-Plasma-Simulation-Group / pyVisOS / osh5visipy.py View on Github external
self.if_xrange_auto = widgets.Checkbox(value=True, description='Auto xrange', layout=_items_layout, style={'description_width': 'initial'})
        self.if_yrange_auto = widgets.Checkbox(value=True, description='Auto yrange', layout=_items_layout, style={'description_width': 'initial'})
        self.apply_range_btn = widgets.Button(description='Apply', disabled=False, \
                                              tooltip='set range. (* this will delete all overlaid plots *)', icon='refresh')
        self.axis_lim_wgt = widgets.HBox([self.if_xrange_auto, self.if_yrange_auto, self.apply_range_btn])
        # x axis
        xmin, xmax, xinc, ymin, ymax, yinc = self.__get_xy_minmax_delta()
        if convert_xaxis:
            self.xconv, xunit = data.axes[1].punit_convert_factor()
        else:
            self.xconv, xunit = 1.0, data.axes[1].units
        xmin *= self.xconv
        xmax *= self.xconv
        self.x_min_wgt = widgets.BoundedFloatText(value=xmin, min=xmin, max=xmax, step=xinc * self.xconv/2, description='xmin:',
                                                  disabled=True, layout=_items_layout, style={'description_width': 'initial'})
        self.x_max_wgt = widgets.BoundedFloatText(value=xmax, min=xmin, max=xmax, step=xinc * self.xconv/2, description='xmax:',
                                                  disabled=True, layout=_items_layout, style={'description_width': 'initial'})
        self.x_step_wgt = widgets.BoundedFloatText(value=xinc * self.xconv, step=xinc * self.xconv, disabled=True,
                                                   description='$\Delta x$:', layout=_items_layout, style={'description_width': 'initial'})
        widgets.jslink((self.x_min_wgt, 'max'), (self.x_max_wgt, 'value'))
        widgets.jslink((self.x_max_wgt, 'min'), (self.x_min_wgt, 'value'))
        widgets.jslink((self.x_min_wgt, 'disabled'), (self.if_xrange_auto, 'value'))
        widgets.jslink((self.x_max_wgt, 'disabled'), (self.if_xrange_auto, 'value'))
        widgets.jslink((self.x_step_wgt, 'disabled'), (self.if_xrange_auto, 'value'))
        # x label
        self.if_reset_xlabel = widgets.Checkbox(value=True, description='Auto', layout=_items_layout, style={'description_width': 'initial'})
        self.if_x_phys_unit = widgets.Checkbox(value=convert_xaxis, description='phys unit;  ', layout={'width': 'initial'}, style={'description_width': 'initial'})
        if xlabel is False:
            self._xlabel = None
            self.if_reset_xlabel.value = False
        elif isinstance(xlabel, str):
            self._xlabel = xlabel
github HCsoft-RD / shaolin / shaolin / core / css.py View on Github external
def update(self, _=None):
        sliders = (wid.FloatRangeSlider, wid.FloatSlider, wid.IntRangeSlider, wid.IntSlider)
        num_text = (wid.FloatText, wid.BoundedFloatText, wid.IntText, wid.BoundedIntText)
        if isinstance(self._data_widget.target,(wid.Button, wid.ToggleButton, wid.ToggleButtons)):
            if isinstance(self._data_widget,wid.Button):
                self.output = {'button_style':self.dd_style.value,
                          'icon': self.icon.value,
                          'visible':self.visible_chk.value,
                         }
            else:
                self.output = {'button_style':self.dd_style.value,
                         'visible':self.visible_chk.value}
            
        elif isinstance(self._data_widget.target, sliders):
            #BUG FIX FROM IPYWIEDGETS not allowing to set the readout format of a range slider
            if isinstance(self._data_widget.target, (wid.FloatRangeSlider,wid.IntRangeSlider)):
                self.output = {'orientation':self.orientation.value,
                               'readout':self.readout.visible,
                               'color':self.color.value,
github hectornieto / pyTSEB / pyTSEB / TSEBIPythonInterface.py View on Github external
def define_site_description_time_series(self):
        '''Widgets for site description parameters'''

        self.w_lat = widgets.BoundedFloatText(
            value=self.lat, min=-90, max=90, description='Lat.', width=100)
        self.w_lon = widgets.BoundedFloatText(
            value=self.lon, min=-180, max=180, description='Lon.', width=100)
        self.w_alt = widgets.FloatText(
            value=self.alt, description='Alt.', width=100)
        self.w_stdlon = widgets.BoundedFloatText(
            value=self.stdlon, min=-180, max=180, description='Std. Lon.', width=100)
        self.w_z_u = widgets.BoundedFloatText(
            value=self.zu,
            min=0.001,
            description='Wind meas. height',
            width=100)
        self.w_z_T = widgets.BoundedFloatText(
            value=self.zt, min=0.001, description='T meas. height', width=100)
        self.site_page = widgets.VBox([widgets.HBox([self.w_lat,
                                                    self.w_lon,
                                                    self.w_alt,
                                                    self.w_stdlon]),
                                      widgets.HBox([self.w_z_u,
                                                    self.w_z_T])],
                                      background_color='#EEE')
github UCLA-Plasma-Simulation-Group / pyVisOS / osh5visipy.py View on Github external
self.apply_range_btn = widgets.Button(description='Apply', disabled=False, \
                                              tooltip='set range. (* this will delete all overlaid plots *)', icon='refresh')
        self.axis_lim_wgt = widgets.HBox([self.if_xrange_auto, self.if_yrange_auto, self.apply_range_btn])
        # x axis
        xmin, xmax, xinc, ymin, ymax, yinc = self.__get_xy_minmax_delta()
        if convert_xaxis:
            self.xconv, xunit = data.axes[1].punit_convert_factor()
        else:
            self.xconv, xunit = 1.0, data.axes[1].units
        xmin *= self.xconv
        xmax *= self.xconv
        self.x_min_wgt = widgets.BoundedFloatText(value=xmin, min=xmin, max=xmax, step=xinc * self.xconv/2, description='xmin:',
                                                  disabled=True, layout=_items_layout, style={'description_width': 'initial'})
        self.x_max_wgt = widgets.BoundedFloatText(value=xmax, min=xmin, max=xmax, step=xinc * self.xconv/2, description='xmax:',
                                                  disabled=True, layout=_items_layout, style={'description_width': 'initial'})
        self.x_step_wgt = widgets.BoundedFloatText(value=xinc * self.xconv, step=xinc * self.xconv, disabled=True,
                                                   description='$\Delta x$:', layout=_items_layout, style={'description_width': 'initial'})
        widgets.jslink((self.x_min_wgt, 'max'), (self.x_max_wgt, 'value'))
        widgets.jslink((self.x_max_wgt, 'min'), (self.x_min_wgt, 'value'))
        widgets.jslink((self.x_min_wgt, 'disabled'), (self.if_xrange_auto, 'value'))
        widgets.jslink((self.x_max_wgt, 'disabled'), (self.if_xrange_auto, 'value'))
        widgets.jslink((self.x_step_wgt, 'disabled'), (self.if_xrange_auto, 'value'))
        # x label
        self.if_reset_xlabel = widgets.Checkbox(value=True, description='Auto', layout=_items_layout, style={'description_width': 'initial'})
        self.if_x_phys_unit = widgets.Checkbox(value=convert_xaxis, description='phys unit;  ', layout={'width': 'initial'}, style={'description_width': 'initial'})
        if xlabel is False:
            self._xlabel = None
            self.if_reset_xlabel.value = False
        elif isinstance(xlabel, str):
            self._xlabel = xlabel
        else:
            self._xlabel = osh5vis.axis_format(data.axes[1].long_name, xunit)
github flatironinstitute / CaImAn / nb_interface / cnmf_widgets.py View on Github external
######

is_patches_widget = widgets.ToggleButtons(
	value='Single FOV',
	options=['Patches', 'Single FOV'],
	description='Patches?:',
	disabled=False,
	button_style='', # 'success', 'info', 'warning', 'danger' or ''
	tooltips=['Run each frame in parallel by breaking into overlapping FOVs', 'The whole frame is analyed as a single FOV'],
#     icons=['check'] * 3
)
dslabel = widgets.Label(value="Downsample Percentage (spatial, temporal)")

ds_spatial_widget = widgets.BoundedFloatText(
	value=1.0,
	min=0.0,
	max=1.0,
	step=0.1,
	description='spatial:',
	disabled=False,
	layout=ds_layout
)
ds_temporal_widget = widgets.BoundedFloatText(
	value=1.0,
	min=0.0,
	max=1.0,
	step=0.1,
	description='temporal:',
	disabled=False,
	layout=ds_layout
github hectornieto / pyTSEB / pyTSEB / TSEBIPythonInterface.py View on Github external
def spectral_properties_time_series(self):
        '''Widgets for site spectral properties'''

        self.w_rho_vis_C = widgets.BoundedFloatText(
            value=self.rho_vis_C, min=0, max=1, description='Leaf refl. PAR', width=80)
        self.w_tau_vis_C = widgets.BoundedFloatText(
            value=self.tau_vis_C, min=0, max=1, description='Leaf trans. PAR', width=80)
        self.w_rho_nir_C = widgets.BoundedFloatText(
            value=self.rho_nir_C, min=0, max=1, description='Leaf refl. NIR', width=80)
        self.w_tau_nir_C = widgets.BoundedFloatText(
            value=self.tau_nir_C, min=0, max=1, description='Leaf trans. NIR', width=80)

        self.w_rho_vis_S = widgets.BoundedFloatText(
            value=self.rho_vis_S, min=0, max=1, description='Soil refl. PAR', width=80)
        self.w_rho_nir_S = widgets.BoundedFloatText(
            value=self.rho_nir_S, min=0, max=1, description='Soil refl. NIR', width=80)
        self.w_emis_C = widgets.BoundedFloatText(
            value=self.emis_C, min=0, max=1, description='Leaf emissivity', width=80)
        self.w_emis_S = widgets.BoundedFloatText(
            value=self.emis_S, min=0, max=1, description='Soil emissivity', width=80)
        self.spec_page = widgets.VBox([widgets.HBox([self.w_rho_vis_C, self.w_tau_vis_C, self.w_rho_nir_C, self.w_tau_nir_C]), widgets.HBox(
            [self.w_rho_vis_S, self.w_rho_nir_S, self.w_emis_C, self.w_emis_S])], background_color='#EEE')
github hectornieto / pyTSEB / pyTSEB / TSEBIPythonInterface.py View on Github external
'''Widgets for site description parameters'''

        self.w_lat = widgets.BoundedFloatText(
            value=self.lat, min=-90, max=90, description='Lat.', width=100)
        self.w_lon = widgets.BoundedFloatText(
            value=self.lon, min=-180, max=180, description='Lon.', width=100)
        self.w_alt = widgets.FloatText(
            value=self.alt, description='Alt.', width=100)
        self.w_stdlon = widgets.BoundedFloatText(
            value=self.stdlon, min=-180, max=180, description='Std. Lon.', width=100)
        self.w_z_u = widgets.BoundedFloatText(
            value=self.zu,
            min=0.001,
            description='Wind meas. height',
            width=100)
        self.w_z_T = widgets.BoundedFloatText(
            value=self.zt, min=0.001, description='T meas. height', width=100)
        self.site_page = widgets.VBox([widgets.HBox([self.w_lat,
                                                    self.w_lon,
                                                    self.w_alt,
                                                    self.w_stdlon]),
                                      widgets.HBox([self.w_z_u,
                                                    self.w_z_T])],
                                      background_color='#EEE')
github great-expectations / great_expectations / great_expectations / jupyter_ux / expectation_explorer.py View on Github external
description='min_value: ',
                    disabled=False
                )
        # float
        elif expectation_type in list(chain.from_iterable(self.min_max_subtypes['float'].values())):
            if expectation_type in self.min_max_subtypes['float']['unit_interval']:
                default_min_value = 0
                default_max_value = 1
            elif expectation_type in self.min_max_subtypes['float']['unbounded']:
                default_min_value = -int(9e300)
                default_max_value = int(9e300)
            
            if max_value_widget:
                max_value_widget.value = max_value if max_value else default_max_value
            else:
                max_value_widget = widgets.BoundedFloatText(
                    value=max_value or default_max_value,
                    max=default_max_value,
                    step=0.01,
                    description='max_value: ',
                    disabled=False
                )
            if not min_value_widget:
                min_value_widget = widgets.BoundedFloatText(
                    min=default_min_value,
                    step=0.01,
                    value=default_min_value,
                    description='min_value: ',
                    disabled=False
                )
        # number or string
        elif expectation_type in list(chain.from_iterable(self.min_max_subtypes['mixed'].values())):