当前位置: 首页>>代码示例>>Python>>正文


Python widgets.Select类代码示例

本文整理汇总了Python中bokeh.models.widgets.Select的典型用法代码示例。如果您正苦于以下问题:Python Select类的具体用法?Python Select怎么用?Python Select使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Select类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: set_input_selector

    def set_input_selector(self):
        # print ("set_input_selector")
        """Creates and configures each selector (drop-down menu)."""
        col_names = [x['name'] for x in self.columns]
        col_names.append('None')

        self.plot_selector = Select.create(
            title="PlotType",
            name="plot_type",
            value=self.plot_type,
            options=["line", "scatter", "bar"],
        )

        self.x_selector = Select.create(
            name="x",
            value=self.x,
            options=col_names,
        )

        self.y_selector = Select.create(
            name="y",
            value=self.y,
            options=col_names,
        )

        self.agg_selector = Select.create(
            name='agg',
            value=self.agg,
            options=['sum', 'mean', 'last', 'count', 'percent'],
        )
开发者ID:usnistgov,项目名称:dft-crossfilter,代码行数:30,代码来源:models.py

示例2: layout

def layout():

    date_select = DateRangeSlider(
        name="period",
        title="Period:",
        value=(start, end),
        bounds=(bounds_start, bounds_end),
        value_labels='show',
        range=(dict(days=1), None))
    date_select.on_change('value', on_date_change)

    country_select = Select(title="Host Site Country:", value="World",
                            options=country_choices)
    country_select.on_change('value', on_country_change)

    controls = VBoxModelForm(_children=[Paragraph(text="Date Range"),
                                        Paragraph(text=""),  # spacing hack
                                        Paragraph(text=""),
                                        date_select, country_select])

    vboxsmall = VBoxModelForm(_children=[controls, source_par])
    #hbox1 = HBox(children=[job_loc_plot_builder(), vboxsmall])
    #hbox2 = HBox(children=[weekday_builder(), jobtype_builder()])
    #layout = VBox(children=[hbox1, hbox2])
    layout = VBox(children=[vboxsmall])

    return layout
开发者ID:rebeccabilbro,项目名称:demo,代码行数:27,代码来源:new_demo.py

示例3: createControls

    def createControls(self):
        # Setup Select Panes and Input Widgets

        #Obr - Overburden rock  #ResR - Reservoir rock
        #Obf - Oberburden fluid #Resf - Reservoir fluid
        self.selectObr = Select(value=self.odict_rocks.keyslist()[0], options=self.odict_rocks.keyslist(),
                                title="Rock  Model")
        self.selectResR = Select(value=self.odict_rocks.keyslist()[0], options=self.odict_rocks.keyslist(),
                                 title="Rock  Model")
        self.selectObf = Select(value=self.odict_fluids.keyslist()[0], options=self.odict_fluids.keyslist(),
                                title="Fluid Model")
        self.selectResf = Select(value=self.odict_fluids.keyslist()[0], options=self.odict_fluids.keyslist(),
                                 title="Fluid Model")
        self.selectPres = Select(value=self.odict_pres.keyslist()[0], options=self.odict_pres.keyslist(),
                                 title="Pressure Scenario")

        self.slideDepth = Slider(start=0, end=10000, value=self.init_depth, step=10, title='Depth (TVDSS)',
                                 callback_policy='mouseup')

        self.selectObr.on_change('value', self.on_selection_change)
        self.selectResR.on_change('value', self.on_selection_change)
        self.selectObf.on_change('value', self.on_selection_change)
        self.selectResf.on_change('value', self.on_selection_change)
        self.selectPres.on_change('value', self.on_selection_change)
        self.slideDepth.on_change('value', self.on_selection_change)
开发者ID:trhallam,项目名称:geoPy,代码行数:25,代码来源:dims.py

示例4: make_sidebar

def make_sidebar():
    global sidebar, master_selector
    master_selector = Select(title="MASTOR SELECTOR:", value="test", options=["test", 'sandbox', 'template', "timeseries", "mdr_history"])
    def selector_func(attrname, old, new):
        new_master_plot( master_selector.value )
    master_selector.on_change('value', selector_func )
    sidebar = vform(master_selector)
开发者ID:ssb109,项目名称:WHOI_OOI_Glider_Repo,代码行数:7,代码来源:plotman.py

示例5: make_inputs

    def make_inputs(self):

        self.ticker1_select = Select(
            name='ticker1',
            title='Portfolio:',
            value='MSFT',
            options = ['INTC', 'Tech Basket', 'IBB', 'IGOV']
        )
        self.ticker2_select = Select(
            name='ticker2',
            title='Risk/Performance Metric:',
            value='Price',
            options=['Daily Prices', 'Daily Returns', 'Daily Cum Returns', 'Max DD Percentage', 'Percentage Up Days', 'Rolling 95% VaR', 'Rolling Ann. Volatility', 'Rolling Worst Dly. Loss', 'Ann. Sharpe Ratio']
        )
        self.ticker3_select = TextInput(
            name='ticker3',
            title='Window Size:',
            value='63'
        )
        self.ticker4_select = TextInput(
            name='ticker4',
            title='Start Date:',
            value='2010-01-01'
        )
        self.ticker5_select = TextInput(
            name='ticker5',
            title='End Date:',
            value='2015-08-01'
        )
开发者ID:steve98654,项目名称:bokeh-demos,代码行数:29,代码来源:risk_app.py

示例6: create_layout

    def create_layout(self):

        # create figure
        self.x_range = Range1d(start=self.model.map_extent[0],
                               end=self.model.map_extent[2], bounds=None)
        self.y_range = Range1d(start=self.model.map_extent[1],
                               end=self.model.map_extent[3], bounds=None)

        self.fig = Figure(tools='wheel_zoom,pan', x_range=self.x_range,
                          y_range=self.y_range)
        self.fig.plot_height = 660
        self.fig.plot_width = 990
        self.fig.axis.visible = False

        # add tiled basemap
        self.tile_source = WMTSTileSource(url=self.model.basemap)
        self.tile_renderer = TileRenderer(tile_source=self.tile_source)
        self.fig.renderers.append(self.tile_renderer)

        # add datashader layer
        self.image_source = ImageSource(url=self.model.service_url,
                                        extra_url_vars=self.model.shader_url_vars)
        self.image_renderer = DynamicImageRenderer(image_source=self.image_source)
        self.fig.renderers.append(self.image_renderer)

        # add ui components
        axes_select = Select.create(name='Axes',
                                        options=self.model.axes)
        axes_select.on_change('value', self.on_axes_change)

        field_select = Select.create(name='Field', options=self.model.fields)
        field_select.on_change('value', self.on_field_change)

        aggregate_select = Select.create(name='Aggregate',
                                         options=self.model.aggregate_functions)
        aggregate_select.on_change('value', self.on_aggregate_change)

        transfer_select = Select.create(name='Transfer Function',
                                        options=self.model.transfer_functions)
        transfer_select.on_change('value', self.on_transfer_function_change)

        basemap_select = Select.create(name='Basemap', value='Toner',
                                       options=self.model.basemaps)
        basemap_select.on_change('value', self.on_basemap_change)

        opacity_slider = Slider(title="Opacity", value=100, start=0,
                                end=100, step=1)
        opacity_slider.on_change('value', self.on_opacity_slider_change)

        controls = [axes_select, field_select, aggregate_select,
                    transfer_select, basemap_select, opacity_slider]
        self.controls = HBox(width=self.fig.plot_width, children=controls)
        self.layout = VBox(width=self.fig.plot_width,
                           height=self.fig.plot_height,
                           children=[self.controls, self.fig])
开发者ID:WilfR,项目名称:datashader,代码行数:55,代码来源:dashboard.py

示例7: make_inputs

 def make_inputs(self):
     self.ticker1_select = Select(
         name='ticker1',
         value='AAPL',
         options=['AAPL', 'GOOG', 'INTC', 'BRCM', 'YHOO']
     )
     self.ticker2_select = Select(
         name='ticker2',
         value='GOOG',
         options=['AAPL', 'GOOG', 'INTC', 'BRCM', 'YHOO']
     )
开发者ID:RamonMF,项目名称:bokeh,代码行数:11,代码来源:stock_app.py

示例8: update_station_list

def update_station_list(attrname, old, new):
    year_value= select_years.value
    partition_value= select_partition.value
    #
    key= station_partition_key_format.format(year_value, partition_value)
    stations_list= station_partitions[key]
    #
    new_select_station= Select(title='Station', value=stations_list[0], options=stations_list)
    new_select_station.options=stations_list
    #
    new_children= [select_years, select_partition, new_select_station]
    inputs.children= new_children
开发者ID:conwaywong,项目名称:dse_capstone,代码行数:12,代码来源:vis.py

示例9: make_inputs

    def make_inputs(self):
#
#please add any other stocks you have downloaded using stock_data.py 
#
        self.ticker1_select = Select(
            name='ticker1',
            value='Stock',
            options=['A','AES','AN','BAX','BRCM','CCL','CMS', 'CTSH', 'DISCA', 'ECL', 'EW'])
        self.ticker2_select = Select(
            name='ticker2',
            value='Algorithm',
            options=['Arima','Arma','Anfis']
        )
开发者ID:elishaROBINSON,项目名称:stock_Prediction_Neural_net,代码行数:13,代码来源:stock_app.py

示例10: read_file_tab

    def read_file_tab(self):

        """Lets the user choose a data file to read"""

        # Drop down list
        self.file_select = Select(name='Data files',
                                  value='',
                                  options=[],
                                  title='Data files')
        # Status text
        self.file_status = Div(text='', width=self.page_width)

        # Update the file_select and file_status controls with scan data
        self.scan_folder()

        # This line is here deliberately. The scan_folder would trigger
        # the on-change function and we don't want that first time around.
        self.file_select.on_change('value', self.file_changed)

        # Re-scan button
        file_rescan = Button(label="Rescan folder", button_type="success")
        file_rescan.on_click(self.scan_folder)

        # Layout
        c = column(self.file_select,
                   self.file_status,
                   file_rescan)

        return Panel(child=c, title="Read from file")
开发者ID:MikeWoodward,项目名称:UT330B,代码行数:29,代码来源:UI.py

示例11: init_input

    def init_input(self):
        # create input widgets only once
        self.min_excitation = Slider(
                title="Min Excitation", name="min_excitation",
                value=min_excitation,
                start=min_excitation,
                end=max_excitation,
                )
        self.max_excitation = Slider(
                title="Max Excitation", name="max_excitation",
                value=max_excitation,
                start=min_excitation,
                end=max_excitation,
                )
        self.min_emission = Slider(
                title="Min Emission", name="min_emission",
                value=min_emission,
                start=min_emission,
                end=max_emission,
                )
        self.max_emission = Slider(
                title="Max Emission", name="max_emission",
                value=max_emission,
                start=min_emission,
                end=max_emission,
                )

        self.chrom_class_select = Select(
                title="Chromophore",
                value='All',
                options=['All'] + CHROMOPHORES,
                )
开发者ID:cdmbi,项目名称:FPD,代码行数:32,代码来源:fpdapp.py

示例12: make_star_input

 def make_star_input(self):
     starnames = sorted(self._ccf_interface.list_stars())
     self.star_select = Select(
         name='Star identifier',
         value=self.star,
         options=starnames
     )
开发者ID:kgullikson88,项目名称:General,代码行数:7,代码来源:CCF_Widget.py

示例13: make_inputs

    def make_inputs(self):
        with open("states.csv") as f:
            states = [line.strip().split(',') for line in f.readlines()]

        self.selectr = Select(
            name='states',
            value='Choose A State',
            options=[s[1] for s in states] + ['Choose A State'],
        )
        labels = ["County Averages", "Hotels"]
        self.check_group = CheckboxGroup(labels=labels, active=[0,1], inline=True)
        ##Filler plot
        x_range = Range1d(0, 300)
        y_range = Range1d(0, 12)
        self.filler = Plot(
            x_range=x_range, y_range=y_range, title="", 
            plot_width=300, plot_height=12, min_border=0, 
            **PLOT_FORMATS
        )  
        x_range = Range1d(0, 300)
        y_range = Range1d(0, 18)
        self.filler2 = Plot(
            x_range=x_range, y_range=y_range, title="", 
            plot_width=300, plot_height=14, min_border=0, 
            **PLOT_FORMATS
        )  
开发者ID:rebeccabilbro,项目名称:demo,代码行数:26,代码来源:combo_app.py

示例14: make_inputs

    def make_inputs(self):

        self.ticker1_select = TextInput(
            name='ticker1',
            title='Drift Function:',
            value='1.2*(1.1-x)',
        )
        self.ticker1p_select = TextInput(
            name='ticker1p',
            title='Drift Derivative:',
            value='-1.2',
        )
        self.ticker2_select = TextInput(
            name='ticker2',
            title='Volatility Function:',
            value='4.0',
        )
        self.ticker2p_select = TextInput(
            name='ticker2p',
            title='Volatility Derivative:',
            value='0.0',
        )
        self.ticker3_select = TextInput(
            name='ticker3',
            title='Number of Paths:',
            value='500'
        )
        self.ticker3_1_select = TextInput(
            name='ticker3_1',
            title='Number of Points:',
            value='252'
        )
        self.ticker3_2_select = TextInput(
            name='ticker3_2',
            title='Time Step:',
            value='0.01'
        )
        self.ticker4_select = TextInput(
            name='ticker4',
            title='Histogram Line:',
            value='100'
        )
        self.ticker4_1_select = TextInput(
            name='ticker4_1',
            title='Initial Value:',
            value='1.01'
        )
        self.ticker4_2_select = Select(
            name='ticker4_2',
            title='MC Scheme:',
            value='Milstein',
            options=['Euler','Milstein', 'Pred/Corr']
        )
        self.button_select = TextInput(
            name='button',
            title='Type any word containing "run" to run Simulation ',
            value = ''
        )
开发者ID:steve98654,项目名称:bokeh-demos,代码行数:58,代码来源:mc_bokeh.py

示例15: make_inputs

    def make_inputs(self):
        columns = [
            TableColumn(field='x', title='x'),
            TableColumn(field='y', title='y'),
            TableColumn(field='device', title='device'),
            TableColumn(field='platform', title='platform')
        ]

#        obj.data_display0 = DataTable(source=obj.source2, columns=columns)
#        obj.data_display1 = DataTable(source=obj.source3, columns=columns)

        # setup user input
        self.x_axis_options = Select(title="X:", value='size', options=axis_options)
        self.y_axis_options = Select(title="Y:", value='throughput [1/sec]', options=axis_options)
        self.benchmarks = Select(title="Benchmark:", value=benchmark_names[0],
            options=benchmark_names)
        self.device_names = CheckboxGroup(labels=device_names, active=[0])
        self.platform_names = CheckboxButtonGroup(labels=platform_names, active=[0])
开发者ID:bkloppenborg,项目名称:arrayfire-benchmark,代码行数:18,代码来源:benchmark_server.py


注:本文中的bokeh.models.widgets.Select类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。