當前位置: 首頁>>代碼示例>>Python>>正文


Python dash_html_components.Label方法代碼示例

本文整理匯總了Python中dash_html_components.Label方法的典型用法代碼示例。如果您正苦於以下問題:Python dash_html_components.Label方法的具體用法?Python dash_html_components.Label怎麽用?Python dash_html_components.Label使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dash_html_components的用法示例。


在下文中一共展示了dash_html_components.Label方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: compute_stats

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def compute_stats(questions: List[Question], db_path):
    n_total = len(questions)
    n_guesser_train = sum(1 for q in questions if q.fold == 'guesstrain')
    n_guesser_dev = sum(1 for q in questions if q.fold == 'guessdev')
    n_buzzer_train = sum(1 for q in questions if q.fold == 'buzzertrain')
    n_buzzer_dev = sum(1 for q in questions if q.fold == 'buzzerdev')
    n_dev = sum(1 for q in questions if q.fold == 'dev')
    n_test = sum(1 for q in questions if q.fold == 'test')
    columns = ['N Total', 'N Guesser Train', 'N Guesser Dev', 'N Buzzer Train', 'N Buzzer Dev', 'N Dev', 'N Test']
    data = np.array([n_total, n_guesser_train, n_guesser_dev, n_buzzer_train, n_buzzer_dev, n_dev, n_test])
    norm_data = 100 * data / n_total

    return html.Div([
        html.Label('Database Path'), html.Div(db_path),
        html.H2('Fold Distribution'),
        html.Table(
            [
                html.Tr([html.Th(c) for c in columns]),
                html.Tr([html.Td(c) for c in data]),
                html.Tr([html.Td(f'{c:.2f}%') for c in norm_data])
            ]
        )
    ]) 
開發者ID:Pinafore,項目名稱:qb,代碼行數:25,代碼來源:qb_stats.py

示例2: attribute_selector

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def attribute_selector(self):
        return html.Div(
            style={"display": "grid"},
            children=[
                html.Label("Surface attribute"),
                html.Div(
                    style=self.set_grid_layout("6fr 1fr"),
                    children=[
                        dcc.Dropdown(
                            id=self.attr_id,
                            options=[
                                {"label": attr, "value": attr} for attr in self.attrs
                            ],
                            value=self.attrs[0],
                            clearable=False,
                        ),
                        self._make_buttons(
                            self.attr_id_btn_prev, self.attr_id_btn_next
                        ),
                    ],
                ),
            ],
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:25,代碼來源:surface_selector.py

示例3: well_layout

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def well_layout(self):
        return html.Div(
            children=html.Label(
                children=[
                    html.Span("Well:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.ids("wells"),
                        options=[
                            {"label": Path(well).stem, "value": well}
                            for well in self.wellfiles
                        ],
                        value=self.wellfiles[0],
                        clearable=False,
                    ),
                ]
            )
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:19,代碼來源:_well_cross_section_fmu.py

示例4: surface_names_layout

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def surface_names_layout(self):
        return html.Div(
            style=self.set_style(marginTop="20px"),
            children=html.Label(
                children=[
                    html.Span("Surface:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.ids("surfacenames"),
                        options=[
                            {"label": name, "value": name} for name in self.surfacenames
                        ],
                        value=self.surfacenames,
                        clearable=True,
                        multi=True,
                    ),
                ]
            ),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:20,代碼來源:_well_cross_section_fmu.py

示例5: ensemble_layout

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def ensemble_layout(self):
        return html.Div(
            style=self.set_style(marginTop="20px"),
            children=html.Label(
                children=[
                    html.Span("Ensemble:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.ids("ensembles"),
                        options=[
                            {"label": ens, "value": ens}
                            for ens in self.ensembles.keys()
                        ],
                        value=list(self.ensembles.keys())[0],
                        clearable=False,
                        multi=False,
                    ),
                ]
            ),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:21,代碼來源:_well_cross_section_fmu.py

示例6: marginal_log_layout

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def marginal_log_layout(self):
        if self.marginal_logs is not None:
            return html.Div(
                children=html.Label(
                    children=[
                        html.Span("Marginal log:", style={"font-weight": "bold"}),
                        dcc.Dropdown(
                            id=self.ids("marginal-log"),
                            options=[
                                {"label": log, "value": log}
                                for log in self.marginal_logs
                            ],
                            placeholder="Display log",
                            clearable=True,
                        ),
                    ]
                ),
            )
        return html.Div(
            style={"visibility": "hidden"},
            children=dcc.Dropdown(id=self.ids("marginal-log")),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:24,代碼來源:_well_cross_section_fmu.py

示例7: selector

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def selector(self, label, id_name, column):
        return html.Div(
            children=html.Label(
                children=[
                    html.Span(f"{label}:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.uuid(id_name),
                        options=[
                            {"label": i, "value": i}
                            for i in list(self.volumes[column].unique())
                        ],
                        clearable=False,
                        value=list(self.volumes[column])[0],
                    ),
                ]
            ),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:19,代碼來源:_inplace_volumes_onebyone.py

示例8: response_selector

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def response_selector(self):
        """Dropdown to select volumetric response"""
        return html.Div(
            children=html.Label(
                children=[
                    html.Span("Volumetric calculation:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.uuid("response"),
                        options=[
                            {"label": volume_description(i), "value": i}
                            for i in self.responses
                        ],
                        clearable=False,
                        value=self.initial_response
                        if self.initial_response in self.responses
                        else self.responses[0],
                    ),
                ]
            ),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:22,代碼來源:_inplace_volumes_onebyone.py

示例9: ensemble_selector

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def ensemble_selector(self):
        """Dropdown to select ensemble"""
        return html.Div(
            style={"paddingBottom": "30px"},
            children=html.Label(
                children=[
                    html.Span("Ensemble:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.ids("ensemble"),
                        options=[
                            {"label": i, "value": i}
                            for i in list(self.data["ENSEMBLE"].unique())
                        ],
                        clearable=False,
                        value=list(self.data["ENSEMBLE"].unique())[0],
                    ),
                ]
            ),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:21,代碼來源:_reservoir_simulation_timeseries_onebyone.py

示例10: smry_selector

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def smry_selector(self):
        """Dropdown to select ensemble"""
        return html.Div(
            style={"paddingBottom": "30px"},
            children=html.Label(
                children=[
                    html.Span("Time series:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.ids("vector"),
                        options=[
                            {
                                "label": f"{simulation_vector_description(vec)} ({vec})",
                                "value": vec,
                            }
                            for vec in self.smry_cols
                        ],
                        clearable=False,
                        value=self.initial_vector,
                    ),
                ]
            ),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:24,代碼來源:_reservoir_simulation_timeseries_onebyone.py

示例11: well_layout

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def well_layout(self):
        return html.Div(
            children=html.Label(
                children=[
                    html.Span("Well:", style={"font-weight": "bold"}),
                    dcc.Dropdown(
                        id=self.ids("wells"),
                        options=[
                            {"label": Path(well).stem, "value": well}
                            for well in self.wellfiles
                        ],
                        value=self.wellfiles[0],
                        clearable=False,
                    ),
                ]
            ),
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:19,代碼來源:_well_cross_section.py

示例12: selector

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def selector(title, trace, varname, include_transformed_chooser=True):
    children = [
        html.Label("Variable"),
        dcc.Dropdown(
            id='{}-selector'.format(title),
            options=get_varname_options(trace),
            value=varname
        )
    ]

    if include_transformed_chooser: 
        children.append(
            dcc.Checklist(
                id='{}-selector-include-transformed'.format(title),
                options=[{
                    'label': "Include transformed variables",
                    'value': 'include_transformed'
                }],
                values=[]
            )
        )

    return html.Div(children, style={'width': '20%'}) 
開發者ID:AustinRochford,項目名稱:webmc3,代碼行數:25,代碼來源:components.py

示例13: display_question

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def display_question(question: Question):
    return html.Div([
        html.Label('ID'), html.Span(question.qnum)
    ]) 
開發者ID:Pinafore,項目名稱:qb,代碼行數:6,代碼來源:qb_stats.py

示例14: generate_layout

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def generate_layout(url):
    return html.Div([
        html.Label('Multi-Select Dropdown'),
        dcc.Dropdown(
            options=[
                {'label': 'New York City', 'value': 'NYC'},
                {'label': u'Montréal', 'value': 'MTL'},
                {'label': 'San Francisco', 'value': 'SF'}
            ],
            value=['MTL', 'SF'],
            multi=True,
            id='input'
        ),
        html.Div(id='output')
    ]) 
開發者ID:plotly,項目名稱:dash-recipes,代碼行數:17,代碼來源:dynamic-autocomplete-dropdown.py

示例15: selector

# 需要導入模塊: import dash_html_components [as 別名]
# 或者: from dash_html_components import Label [as 別名]
def selector(self, wrapper_id, dropdown_id, title, btn_prev, btn_next):
        return html.Div(
            id=wrapper_id,
            style={"display": "none"},
            children=[
                html.Label(title),
                html.Div(
                    style=self.set_grid_layout("6fr 1fr"),
                    children=[
                        dcc.Dropdown(id=dropdown_id, clearable=False),
                        self._make_buttons(btn_prev, btn_next),
                    ],
                ),
            ],
        ) 
開發者ID:equinor,項目名稱:webviz-subsurface,代碼行數:17,代碼來源:surface_selector.py


注:本文中的dash_html_components.Label方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。