Python dash_core_components.RadioItems() Examples

The following are 7 code examples of dash_core_components.RadioItems(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module dash_core_components , or try the search function .
Example #1
Source File: main.py    From deep_architect with MIT License 6 votes vote down vote up
def __init__(self, parent_name, local_name, option_lst, is_inline):
        Component.__init__(self, parent_name, local_name)
        self._register(
            dcc.RadioItems(
                id=self.full_name,
                options=[{
                    'label': v,
                    'value': v
                } for v in option_lst],
                # value=option_lst[0],
                labelStyle={'display': 'inline-block'} if is_inline else None)) 
Example #2
Source File: _disk_usage.py    From webviz-subsurface with GNU General Public License v3.0 6 votes vote down vote up
def layout(self):
        return html.Div(
            [
                html.P(
                    f"This is the disk usage on \
                        {self.scratch_dir} per user, \
                        as of {self.date}."
                ),
                dcc.RadioItems(
                    id=self.plot_type_id,
                    options=[
                        {"label": i, "value": i} for i in ["Pie chart", "Bar chart"]
                    ],
                    value="Pie chart",
                ),
                wcc.Graph(id=self.chart_id),
            ]
        ) 
Example #3
Source File: main.py    From deep_architect with MIT License 5 votes vote down vote up
def __init__(self, parent_name, local_name,
                 dimension_selector_placeholder_text):
        Component.__init__(self, parent_name, local_name)
        self.dropdown = Dropdown(self.full_name, 'selector', list(ds[0].keys()),
                                 dimension_selector_placeholder_text, False)
        self.radio = RadioItems(self.full_name, 'scale', ['linear', 'log'],
                                True)
        self._register(
            two_thirds_one_third_column([self.dropdown.get_layout()],
                                        [self.radio.get_layout()])) 
Example #4
Source File: dash-cache-layout.py    From dash-recipes with MIT License 5 votes vote down vote up
def generate_layout():
    expensive_data = compute_expensive_data()
    return html.Div([
        html.H3('Last updated at: ' + expensive_data),
        html.Div(id='flask-cache-memoized-children'),
        dcc.RadioItems(
            id='flask-cache-memoized-dropdown',
            options=[
                {'label': 'Option {}'.format(i), 'value': 'Option {}'.format(i)}
                for i in range(1, 4)
            ],
            value='Option 1'
        ),
        html.Div('Results are cached for {} seconds'.format(timeout))
    ]) 
Example #5
Source File: dash_reusable_components.py    From dash-image-processing with MIT License 5 votes vote down vote up
def NamedInlineRadioItems(name, short, options, val, **kwargs):
    return html.Div(
        id=f'div-{short}',
        style=_merge({
            'display': 'block',
            'margin-bottom': '5px',
            'margin-top': '5px'
        }, kwargs.get('style', {})),
        children=[
            f'{name}:',
            dcc.RadioItems(
                id=f'radio-{short}',
                options=options,
                value=val,
                labelStyle={
                    'display': 'inline-block',
                    'margin-right': '7px',
                    'font-weight': 300
                },
                style={
                    'display': 'inline-block',
                    'margin-left': '7px'
                }
            )
        ],
        **_omit(['style'], kwargs)
    )


# Custom Image Components 
Example #6
Source File: dash_reusable_components.py    From dash-svm with MIT License 5 votes vote down vote up
def NamedRadioItems(name, **kwargs):
    return html.Div(
        style={'padding': '20px 10px 25px 4px'},
        children=[
            html.P(children=f'{name}:'),
            dcc.RadioItems(**kwargs)
        ]
    )


# Non-generic 
Example #7
Source File: dash_reusable_components.py    From dash-cytoscape with MIT License 5 votes vote down vote up
def NamedRadioItems(name, **kwargs):
    return html.Div(
        style={'padding': '20px 10px 25px 4px'},
        children=[
            html.P(children=f'{name}:'),
            dcc.RadioItems(**kwargs)
        ]
    )