def filter_layout(self, tab):
     """Layout for shared filters"""
     return [
         html.Label(
             style={"font-weight": "bold"},
             children=["Ensembles"],
         ),
         wcc.Select(
             size=min(4, len(self.ensembles)),
             id=self.uuid(f"ensemble-{tab}"),
             options=[{
                 "label": name,
                 "value": name
             } for name in self.ensembles],
             value=self.ensembles,
             multi=True,
         ),
         html.Label(
             style={"font-weight": "bold"},
             children=["Wells"],
         ),
         wcc.Select(
             size=min(20, len(self.well_names)),
             id=self.uuid(f"well-{tab}"),
             options=[{
                 "label": name,
                 "value": name
             } for name in self.well_names],
             value=self.well_names,
             multi=True,
         ),
         html.Label(
             style={"font-weight": "bold"},
             children=["Zones"],
         ),
         wcc.Select(
             size=min(10, len(self.zone_names)),
             id=self.uuid(f"zone-{tab}"),
             options=[{
                 "label": name,
                 "value": name
             } for name in self.zone_names],
             value=self.zone_names,
             multi=True,
         ),
         html.Label(
             style={"font-weight": "bold"},
             children=["Dates"],
         ),
         wcc.Select(
             size=min(10, len(self.dates)),
             id=self.uuid(f"date-{tab}"),
             options=[{
                 "label": name,
                 "value": name
             } for name in self.dates],
             value=self.dates,
             multi=True,
         ),
     ]
示例#2
0
 def filter_layout(
     self, tab: str
 ) -> List[dash.development.base_component.Component]:
     """Layout for shared filters"""
     return [
         html.Label(
             style={"font-weight": "bold"},
             children=["Ensembles"],
         ),
         wcc.Select(
             size=min(4, len(self.ensembles)),
             id=self.uuid(f"ensemble-{tab}"),
             options=[{"label": name, "value": name} for name in self.ensembles],
             value=self.ensembles,
             multi=True,
             persistence=True,
             persistence_type="session",
         ),
         html.Label(
             style={"font-weight": "bold"},
             children=["Wells"],
         ),
         wcc.Select(
             size=min(20, len(self.well_names)),
             id=self.uuid(f"well-{tab}"),
             options=[{"label": name, "value": name} for name in self.well_names],
             value=self.well_names,
             multi=True,
             persistence=True,
             persistence_type="session",
         ),
         html.Label(
             style={"font-weight": "bold"},
             children=["Zones"],
         ),
         wcc.Select(
             size=min(10, len(self.zone_names)),
             id=self.uuid(f"zone-{tab}"),
             options=[{"label": name, "value": name} for name in self.zone_names],
             value=self.zone_names,
             multi=True,
             persistence=True,
             persistence_type="session",
         ),
         html.Label(
             style={"font-weight": "bold"},
             children=["Dates"],
         ),
         wcc.Select(
             size=min(10, len(self.dates)),
             id=self.uuid(f"date-{tab}"),
             options=[{"label": name, "value": name} for name in self.dates],
             value=self.dates,
             multi=True,
             persistence=True,
             persistence_type="session",
         ),
     ]
示例#3
0
    def filter_layout(self):
        """Layout to display selectors for response filters"""
        children = []
        for col_name, col_type in self.response_filters.items():
            domid = self.ids(f"filter-{col_name}")
            values = list(self.responsedf[col_name].unique())
            if col_type == "multi":
                selector = wcc.Select(
                    id=domid,
                    options=[{"label": val, "value": val} for val in values],
                    value=values,
                    multi=True,
                    size=min(20, len(values)),
                )
            elif col_type == "single":
                selector = dcc.Dropdown(
                    id=domid,
                    options=[{"label": val, "value": val} for val in values],
                    value=values[0],
                    multi=False,
                    clearable=False,
                )
            elif col_type == "range":
                selector = make_range_slider(domid, self.responsedf[col_name], col_name)
            else:
                return children
            children.append(html.Div(children=[html.Label(col_name), selector,]))

        return children
示例#4
0
def make_filter(
    parent,
    tab: str,
    vtype: str,
    column_values: list,
    multi: bool = True,
    value: Union[str, float] = None,
    open_details: bool = False,
) -> html.Div:
    return html.Div(children=html.Details(
        open=open_details,
        children=[
            html.Summary(vtype),
            wcc.Select(
                id={
                    "id": parent.uuid("vitem-filter"),
                    "tab": tab,
                    "vtype": vtype,
                },
                options=[{
                    "label": i,
                    "value": i
                } for i in column_values],
                value=[value] if value is not None else column_values,
                multi=multi,
                size=min(15, len(column_values)),
                persistence=True,
                persistence_type="session",
            ),
        ],
    ), )
 def selector_dropdowns(self):
     """Makes dropdowns for each selector.
     Args:
         dframe - Volumetrics Dataframe
         selectors - List of selector columns
     Return:
         dcc.Dropdown objects
     """
     dropdowns = []
     for selector in self.selectors:
         elements = list(self.volumes[selector].unique())
         if selector in ["ENSEMBLE", "SOURCE"]:
             value = elements[0]
         else:
             value = elements
         dropdowns.append(
             html.Div(children=[
                 html.Details(
                     open=True,
                     children=[
                         html.Summary(selector.lower().capitalize()),
                         wcc.Select(
                             id=self.selectors_id[selector],
                             options=[{
                                 "label": i,
                                 "value": i
                             } for i in elements],
                             value=value,
                             multi=True,
                             size=min(20, len(elements)),
                         ),
                     ],
                 )
             ]))
     return dropdowns
 def filter_selectors(self) -> List[html.Div]:
     """Dropdowns for dataframe columns that can be filtered on (Zone, Region, etc)"""
     return [
         html.Div(
             children=[
                 html.Details(
                     open=True,
                     children=[
                         html.Summary(selector.lower().capitalize()),
                         wcc.Select(
                             id=self.selectors_id[selector],
                             options=[
                                 {"label": i, "value": i}
                                 for i in list(self.volumes[selector].unique())
                             ],
                             value=list(self.volumes[selector].unique()),
                             multi=True,
                             size=min(20, len(self.volumes[selector].unique())),
                             persistence=True,
                             persistence_type="session",
                         ),
                     ],
                 )
             ]
         )
         for selector in self.selectors
     ]
示例#7
0
def make_filter(
    get_uuid: Callable,
    tab: str,
    vtype: str,
    column_values: list,
    multi: bool = True,
    value: Union[str, float] = None,
    open_details: bool = False,
) -> wcc.Selectors:
    return html.Details(
        open=open_details,
        children=[
            html.Summary(vtype),
            wcc.Select(
                id={
                    "id": get_uuid("vitem-filter"),
                    "tab": tab,
                    "vtype": vtype,
                },
                options=[{"label": i, "value": i} for i in column_values],
                value=[value] if value is not None else column_values,
                multi=multi,
                size=min(15, len(column_values)),
            ),
        ],
    )
def make_filter(
    parent: "PropertyStatistics",
    tab: str,
    df_column: str,
    column_values: list,
    multi: bool = True,
    value: Union[str, float] = None,
    open_details: bool = False,
) -> html.Div:
    return html.Div(children=html.Details(
        open=open_details,
        children=[
            html.Summary(df_column.lower().capitalize()),
            wcc.Select(
                id={
                    "id": parent.uuid("filter-selector"),
                    "tab": tab,
                    "selector": df_column,
                },
                options=[{
                    "label": i,
                    "value": i
                } for i in column_values],
                value=[value] if value is not None else column_values,
                multi=multi,
                size=min(20, len(column_values)),
                persistence=True,
                persistence_type="session",
            ),
        ],
    ), )
示例#9
0
def filter_parameter(
    parent,
    tab: str,
    multi: bool = True,
    value: Union[str, float] = None,
) -> html.Div:
    return html.Div(
        style={
            "margin-top": "10px",
            "width": "90%"
        },
        children=[
            html.Span("Parameters:", style={"font-weight": "bold"}),
            html.Div(children=[
                wcc.Select(
                    id={
                        "id": parent.uuid("filter-parameter"),
                        "tab": tab,
                    },
                    options=[{
                        "label": i,
                        "value": i
                    } for i in parent.pmodel.parameters],
                    value=value,
                    multi=multi,
                    size=min(40, len(parent.pmodel.parameters)),
                    persistence=True,
                    persistence_type="session",
                ),
            ], ),
        ],
    )
示例#10
0
def parameter_selector_view(
    parent: WebvizPluginABC, data_type: str = "parameter", suffix: str = ""
) -> Component:
    return html.Div(
        [
            dbc.Row(
                [
                    dbc.Col(
                        html.Label(
                            "Search (Press ENTER to select all matches):",
                            className="ert-label",
                        ),
                        align="left",
                        width="auto",
                    ),
                    dbc.Col(
                        dcc.Input(
                            id=parent.uuid(f"parameter-selector-filter-{suffix}"),
                            type="search",
                            placeholder="Substring...",
                            persistence="session",
                        ),
                        align="left",
                    ),
                    dbc.Col(
                        html.Button(
                            id=parent.uuid(f"parameter-selector-button-{suffix}"),
                            children=("Toggle selector visibility"),
                        ),
                        align="right",
                    ),
                ],
            ),
            html.Div(
                wcc.Select(
                    id=parent.uuid(f"parameter-selector-multi-{suffix}"),
                    multi=True,
                    size=10,
                    persistence="session",
                ),
                id=parent.uuid(f"container-parameter-selector-multi-{suffix}"),
                className="ert-parameter-selector-container-show",
            ),
            dcc.Dropdown(
                id=parent.uuid(f"parameter-deactivator-{suffix}"),
                multi=True,
                persistence="session",
            ),
            dcc.Store(
                id=parent.uuid(f"parameter-selection-store-{suffix}"),
                storage_type="session",
            ),
            dcc.Store(
                id=parent.uuid(f"parameter-type-store-{suffix}"),
                storage_type="session",
                data=data_type,
            ),
        ],
    )
示例#11
0
 def filter_layout(self) -> Optional[list]:
     """Makes dropdowns for each dataframe column used for filtering."""
     if not self.use_filter:
         return None
     df = self.data
     dropdowns = [html.H4("Set filters")]
     for col in self.filter_cols:
         if df[col].dtype == np.float64 or df[col].dtype == np.int64:
             min_val = df[col].min()
             max_val = df[col].max()
             mean_val = df[col].mean()
             dropdowns.append(
                 html.Div(children=[
                     html.Details(
                         open=True,
                         children=[
                             html.Summary(col.lower().capitalize()),
                             dcc.RangeSlider(
                                 id=self.uuid(f"filter-{col}"),
                                 min=min_val,
                                 max=max_val,
                                 step=(max_val - min_val) / 10,
                                 marks={
                                     min_val: f"{min_val:.2f}",
                                     mean_val: f"{mean_val:.2f}",
                                     max_val: f"{max_val:.2f}",
                                 },
                                 value=[min_val, max_val],
                             ),
                         ],
                     )
                 ]))
         else:
             elements = list(self.data[col].unique())
             dropdowns.append(
                 html.Div(children=[
                     html.Details(
                         open=True,
                         children=[
                             html.Summary(col.lower().capitalize()),
                             wcc.Select(
                                 id=self.uuid(f"filter-{col}"),
                                 options=[{
                                     "label": i,
                                     "value": i
                                 } for i in elements],
                                 value=elements
                                 if self.filter_defaults is None else [
                                     element for element in self.
                                     filter_defaults.get(col, elements)
                                     if element in elements
                                 ],
                                 size=min(15, len(elements)),
                             ),
                         ],
                     )
                 ]))
     return dropdowns
    def response_layout(self):
        """Layout to display selectors for response filters"""

        if self.no_responses:
            return []
        children = [
            html.Span("Response:", style={"font-weight": "bold"}),
            dcc.Dropdown(
                id=self.uuid("responses"),
                options=[{"label": ens, "value": ens} for ens in self.responses],
                clearable=False,
                value=self.responses[0],
                style={"marginBottom": "20px"},
                persistence=True,
                persistence_type="session",
            ),
        ]

        if self.response_filters is not None:
            for col_name, col_type in self.response_filters.items():
                values = list(self.responsedf[col_name].unique())
                if col_type == "multi":
                    selector = wcc.Select(
                        id=self.uuid(f"filter-{col_name}"),
                        options=[{"label": val, "value": val} for val in values],
                        value=values,
                        multi=True,
                        size=min(20, len(values)),
                        persistence=True,
                        persistence_type="session",
                    )
                elif col_type == "single":
                    selector = dcc.Dropdown(
                        id=self.uuid(f"filter-{col_name}"),
                        options=[{"label": val, "value": val} for val in values],
                        value=values[0],
                        multi=False,
                        clearable=False,
                        persistence=True,
                        persistence_type="session",
                    )
                children.append(
                    html.Div(
                        children=[
                            html.Label(col_name),
                            selector,
                        ]
                    )
                )
        return [
            html.Div(
                id=self.uuid("view_response"),
                style={"display": "none"},
                children=children,
            ),
        ]
示例#13
0
def realization_filters(
    uuid: str, tab: str, volumemodel: InplaceVolumesModel
) -> html.Div:
    reals = volumemodel.realizations
    return html.Div(
        style={"margin-top": "15px"},
        children=[
            html.Div(
                style={"display": "inline-flex"},
                children=[
                    html.Span(
                        "Realizations: ",
                        style={"font-weight": "bold"},
                    ),
                    html.Span(
                        id={"id": uuid, "tab": tab, "element": "real_text"},
                        style={"margin-left": "10px"},
                        children=f"{min(reals)}-{max(reals)}",
                    ),
                ],
            ),
            wcc.RadioItems(
                id={"id": uuid, "tab": tab, "element": "real-selector-option"},
                options=[
                    {"label": "Range", "value": "range"},
                    {"label": "Select", "value": "select"},
                ],
                value="range",
                vertical=False,
            ),
            wcc.RangeSlider(
                wrapper_id={"id": uuid, "tab": tab, "element": "real-slider-wrapper"},
                id={
                    "id": uuid,
                    "tab": tab,
                    "component_type": "range",
                },
                value=[min(reals), max(reals)],
                min=min(reals),
                max=max(reals),
                marks={str(i): {"label": str(i)} for i in [min(reals), max(reals)]},
            ),
            html.Div(
                style={"display": "none"},
                children=wcc.Select(
                    id={"id": uuid, "tab": tab, "selector": "REAL", "type": "REAL"},
                    options=[{"label": i, "value": i} for i in reals],
                    value=reals,
                ),
            ),
        ],
    )
 def control_layout(self):
     """Layout to select ensembles and parameters"""
     return html.Div(children=[
         html.Div([
             html.Span("Selected ensembles:", style={"font-weight":
                                                     "bold"}),
             wcc.Select(
                 id=self.uuid("ensembles"),
                 options=[{
                     "label": ens,
                     "value": ens
                 } for ens in self.ensembles],
                 multi=True,
                 value=self.ensembles,
                 size=len(self.ensembles),
             ),
         ]),
         html.Div([
             html.Span("Selected parameters:",
                       style={"font-weight": "bold"}),
             wcc.Select(
                 id=self.uuid("parameters"),
                 style={
                     "overflowX": "auto",
                     "fontSize": "0.97rem"
                 },
                 options=[{
                     "label": param,
                     "value": param
                 } for param in self.parameters],
                 multi=True,
                 value=self.visual_parameters,
                 size=min(50, len(self.visual_parameters)),
             ),
         ]),
     ], )
示例#15
0
def __realization_filters(get_uuid: Callable, realizations: List[int]) -> html.Div:
    return html.Div(
        children=[
            html.Div(
                style={"display": "inline-flex"},
                children=[
                    html.Label(
                        "Realizations: ",
                        style={"font-weight": "bold"},
                    ),
                    html.Label(
                        id=get_uuid(LayoutElements.REALIZATIONS_FILTER_SPAN),
                        style={
                            "margin-left": "10px",
                            "margin-bottom": "5px",
                        },
                        children=f"{min(realizations)}-{max(realizations)}",
                    ),
                ],
            ),
            wcc.RadioItems(
                label="Statistics calculated from:",
                id=get_uuid(LayoutElements.STATISTICS_FROM_RADIO_ITEMS),
                style={"margin-bottom": "10px"},
                options=[
                    {
                        "label": "All",
                        "value": StatisticsFromOptions.ALL_REALIZATIONS.value,
                    },
                    {
                        "label": "Selected",
                        "value": StatisticsFromOptions.SELECTED_REALIZATIONS.value,
                    },
                ],
                value=StatisticsFromOptions.ALL_REALIZATIONS.value,
                vertical=False,
            ),
            html.Div(
                children=wcc.Select(
                    id=get_uuid(LayoutElements.REALIZATIONS_FILTER_SELECTOR),
                    options=[{"label": i, "value": i} for i in realizations],
                    value=realizations,
                    size=min(10, len(realizations)),
                ),
            ),
        ],
    )
示例#16
0
def highlight_realizations_view(get_uuid: Callable,
                                realizations: List[int]) -> html.Div:

    return wcc.Selectors(
        label="Highlight realizations",
        children=[
            wcc.Select(
                id=get_uuid("highlight-realizations"),
                options=[{
                    "label": val,
                    "value": val
                } for val in realizations],
                value=None,
            ),
            html.Button(
                id=get_uuid("clear-highlight-realizations"),
                children="Clear",
            ),
        ],
    )
示例#17
0
def realization_layout(
    uuid: str, realizations: List[int], value: List[int]
) -> html.Div:
    """Layout for the realization filter modal"""
    return html.Div(
        style={"marginTop": "10px"},
        children=html.Label(
            children=[
                wcc.Select(
                    id={"id": uuid, "element": "realizations"},
                    options=[{"label": real, "value": real} for real in realizations],
                    value=[str(val) for val in value],
                    multi=True,
                    size=20,
                    persistence=True,
                    persistence_type="session",
                ),
            ]
        ),
    )
def tornado_selection(position: str, uuid: str, tab: str,
                      volumemodel: InplaceVolumesModel) -> html.Div:
    return html.Div(
        style={"margin-top": "10px"},
        children=[
            html.Label(
                children=f"Tornado ({position})",
                style={"display": "block"},
                className="webviz-underlined-label",
            ),
            wcc.Dropdown(
                id={
                    "id": uuid,
                    "tab": tab,
                    "selector": f"Response {position}"
                },
                clearable=False,
                value=volumemodel.responses[0],
            ),
            html.Details(
                open=False,
                children=[
                    html.Summary("Sensitivity filter"),
                    wcc.Select(
                        id={
                            "id": uuid,
                            "tab": tab,
                            "selector": f"Sensitivities {position}",
                        },
                        options=[{
                            "label": i,
                            "value": i
                        } for i in volumemodel.sensitivities],
                        value=volumemodel.sensitivities,
                        size=min(15, len(volumemodel.sensitivities)),
                    ),
                ],
            ),
        ],
    )
 def control_layout(self):
     """Layout to select e.g. iteration and response"""
     return [
         html.Div(
             [
                 html.Div("Ensemble:", style={"font-weight": "bold"}),
                 dcc.Dropdown(
                     id=self.uuid("ensemble"),
                     options=[{"label": ens, "value": ens} for ens in self.ensembles],
                     clearable=False,
                     value=self.ensembles[0],
                     style={"marginBottom": "20px"},
                 ),
             ]
         ),
         html.Div(
             [
                 html.Div("Response:", style={"font-weight": "bold"}),
                 dcc.Dropdown(
                     id=self.uuid("responses"),
                     options=[{"label": ens, "value": ens} for ens in self.responses],
                     clearable=False,
                     value=self.responses[0],
                     style={"marginBottom": "20px"},
                 ),
             ]
         ),
         html.Div(
             [
                 html.Div(
                     "Parameters:",
                     id=self.uuid("parameters"),
                     style={
                         "font-weight": "bold",
                         "display": "inline-block",
                         "margin-right": "10px",
                     },
                 ),
                 dcc.RadioItems(
                     id=self.uuid("exclude_include"),
                     options=[
                         {"label": "Exclusive mode", "value": "exc"},
                         {"label": "Subset mode", "value": "inc"},
                     ],
                     value="exc",
                     labelStyle={"display": "inline-block"},
                     style={"fontSize": ".80em"},
                 ),
             ]
         ),
         html.Div(
             [
                 wcc.Select(
                     id=self.uuid("parameter-list"),
                     options=[{"label": ens, "value": ens} for ens in self.parameters],
                     multi=True,
                     size=10,
                     value=[],
                     style={"marginBottom": "20px"},
                 ),
             ]
         ),
         html.Div("Filters:", style={"font-weight": "bold"}),
         html.Div(children=self.filter_layout),
     ]
 def control_div(self):
     return html.Div(
         style={
             "padding-right": 15,
         },
         children=[
             html.Label(children=[
                 html.Span("Mode:", style={"font-weight": "bold"}),
                 dcc.RadioItems(
                     id=self.uuid("mode"),
                     style={
                         "padding-bottom": 10,
                     },
                     options=[
                         {
                             "label": "Running time matrix",
                             "value": "running_time_matrix",
                         },
                         {
                             "label": "Parameter parallel coordinates",
                             "value": "parallel_coordinates",
                         },
                     ],
                     value="running_time_matrix",
                 ),
             ], ),
             html.Label(children=[
                 html.Span("Set ensemble:", style={"font-weight": "bold"}),
                 html.Div(
                     style={
                         "padding-bottom": 10,
                     },
                     children=[
                         dcc.Dropdown(
                             id=self.uuid("ensemble"),
                             options=[{
                                 "label": ens,
                                 "value": ens
                             } for ens in self.ensembles],
                             value=self.ensembles[0],
                             clearable=False,
                         ),
                     ],
                 ),
             ], ),
             html.Label(
                 id=self.uuid("matrix_color"),
                 style={"display": "block"},
                 children=[
                     html.Span(
                         "Color jobs relative to running time of:",
                         style={"font-weight": "bold"},
                     ),
                     html.Div(
                         style={
                             "padding-bottom": 10,
                         },
                         children=[
                             dcc.Dropdown(
                                 id=self.uuid("relative_runtime"),
                                 options=[{
                                     "label": rel,
                                     "value": rel
                                 } for rel in RunningTimeAnalysisFMU.
                                          COLOR_MATRIX_BY_LABELS],
                                 value=RunningTimeAnalysisFMU.
                                 COLOR_MATRIX_BY_LABELS[0],
                                 clearable=False,
                             ),
                         ],
                     ),
                 ],
             ),
             html.Label(
                 id=self.uuid("parcoords_color"),
                 style={"display": "none"},
                 children=[
                     html.Span(
                         "Color realizations relative to:",
                         style={"font-weight": "bold"},
                     ),
                     html.Div(
                         style={
                             "padding-bottom": 10,
                         },
                         children=[
                             dcc.Dropdown(
                                 id=self.uuid("relative_real"),
                                 options=[{
                                     "label": rel,
                                     "value": rel
                                 } for rel in RunningTimeAnalysisFMU.
                                          COLOR_PARCOORD_BY_LABELS],
                                 value=RunningTimeAnalysisFMU.
                                 COLOR_PARCOORD_BY_LABELS[0],
                                 clearable=False,
                             ),
                         ],
                     ),
                 ],
             ),
             html.Label(
                 id=self.uuid("parameter_dropdown"),
                 style={"display": "none"},
                 children=[
                     html.Span(
                         "Selected parameters:",
                         style={"font-weight": "bold"},
                     ),
                     wcc.Select(
                         id=self.uuid("parameters"),
                         style={
                             "overflowX": "auto",
                             "fontSize": "0.97rem"
                         },
                         options=[{
                             "label": param,
                             "value": param
                         } for param in self.parameters],
                         multi=True,
                         value=self.visual_parameters,
                         size=min(50, len(self.visual_parameters)),
                     ),
                 ],
             ),
             html.Label(
                 id=self.uuid("filter_short_checkbox"),
                 style={"display": "block"},
                 children=[
                     html.Span("Filter jobs:",
                               style={"font-weight": "bold"}),
                     dcc.Checklist(
                         id=self.uuid("filter_short"),
                         options=[
                             {
                                 "label":
                                 f"Slowest in ensemble less than {self.filter_shorter}"
                                 "s",
                                 "value":
                                 "filter_short",
                             },
                         ],
                         value=["filter_short"],
                     ),
                 ],
             ),
         ],
     )
    def control_layout(self):
        """Layout to select ensembles and parameters"""
        mode_select = (
            []
            if self.no_responses
            else [
                html.Label(
                    children=[
                        html.Span("Mode:", style={"font-weight": "bold"}),
                        dcc.RadioItems(
                            id=self.uuid("mode"),
                            options=[
                                {"label": "Ensemble", "value": "ensemble"},
                                {"label": "Response", "value": "response"},
                            ],
                            value="ensemble",
                            labelStyle={"display": "inline-block"},
                            persistence=True,
                            persistence_type="session",
                        ),
                    ]
                )
            ]
        )

        return mode_select + [
            html.Span("Ensemble:", style={"font-weight": "bold"}),
            wcc.Select(
                id=self.uuid("ensembles"),
                options=[{"label": ens, "value": ens} for ens in self.ensembles],
                multi=True,
                value=self.ensembles,
                size=min(len(self.ensembles), 10),
                persistence=True,
                persistence_type="session",
            ),
            html.Label(
                children=[
                    html.Span(
                        "Parameters:",
                        id=self.uuid("parameters"),
                        style={
                            "font-weight": "bold",
                        },
                    ),
                    dcc.RadioItems(
                        id=self.uuid("exclude_include"),
                        options=[
                            {"label": "Exclude", "value": "exc"},
                            {"label": "Include", "value": "inc"},
                        ],
                        value="exc",
                        labelStyle={"display": "inline-block"},
                        style={"fontSize": ".80em"},
                        persistence=True,
                        persistence_type="session",
                    ),
                ]
            ),
            wcc.Select(
                id=self.uuid("parameter-list"),
                options=[{"label": ens, "value": ens} for ens in self.parameters],
                multi=True,
                size=min(len(self.parameters), 15),
                value=[],
                style={
                    "marginBottom": "20px",
                    "fontSize": ".80em",
                    "overflowX": "auto",
                },
                persistence=True,
                persistence_type="session",
            ),
        ]
示例#22
0
 wcc.WebvizPluginPlaceholder(id="plugin",
                             children=["Hello world"],
                             screenshot_filename="hello.png"),
 wcc.WebvizPluginPlaceholder(children=[
     wcc.FlexBox(children=[
         html.Div(
             style={"width": "100%"},
             children=[
                 wcc.Select(
                     id="select-test",
                     size=2,
                     value=["el1"],
                     options=[
                         {
                             "value": "el1",
                             "label": "List element 1"
                         },
                         {
                             "value": "el2",
                             "label": "List element 2"
                         },
                     ],
                 )
             ],
         ),
         html.Div(
             "First element (before break)",
             style={"background-color": "rgba(0, 255, 255, 0.2)"},
         ),
         html.Div(style={
             "height": "0px",
示例#23
0
 def layout(self):
     return wcc.FlexBox(
         id=self.uuid("layout"),
         children=[
             html.Div(
                 style={"flex": 1},
                 children=[
                     html.Label(children=[
                         html.Span(
                             "Ensemble:",
                             style={"font-weight": "bold"},
                         ),
                         dcc.Dropdown(
                             id=self.uuid("ensemble"),
                             options=[{
                                 "label": i,
                                 "value": i
                             } for i in self.ensembles],
                             value=self.ensembles[0],
                             multi=False,
                         ),
                     ], ),
                     html.Label(children=[
                         html.Span("Plot type:",
                                   style={"font-weight": "bold"}),
                         dcc.Dropdown(
                             id=self.uuid("plot_type"),
                             options=[{
                                 "label": i,
                                 "value": i
                             } for i in [
                                 "Fan chart",
                                 "Bar chart",
                                 "Line chart",
                             ]],
                             clearable=False,
                             value="Fan chart",
                         ),
                     ], ),
                     html.Label(
                         id=self.uuid("select_stat"),
                         style={"display": "none"},
                         children=[
                             html.Span("Select statistics:",
                                       style={"font-weight": "bold"}),
                             wcc.Select(
                                 id=self.uuid("stat_bars"),
                                 options=[{
                                     "label": key,
                                     "value": value
                                 } for key, value in self.label_map.items()
                                          ],
                                 size=8,
                                 value=["count", "low_p90", "p50"],
                             ),
                         ],
                     ),
                     html.Label(children=[
                         html.Span("Sort by:",
                                   style={"font-weight": "bold"}),
                         dcc.Dropdown(
                             id=self.uuid("sort_by"),
                             options=[{
                                 "label": key,
                                 "value": value
                             } for key, value in self.label_map.items()],
                             clearable=False,
                             value="low_p90",
                         ),
                     ], ),
                     dcc.RadioItems(
                         id=self.uuid("ascending"),
                         options=[
                             {
                                 "label": "Ascending",
                                 "value": True
                             },
                             {
                                 "label": "Descending",
                                 "value": False
                             },
                         ],
                         value=True,
                         labelStyle={"display": "inline-block"},
                     ),
                     html.Label(children=[
                         html.Span(
                             "Max number of wells in plot:",
                             style={"font-weight": "bold"},
                         ),
                         dcc.Slider(
                             id=self.uuid("n_wells"),
                             min=1,
                             max=len(self.wells),
                             value=min(10, len(self.wells)),
                             marks={
                                 1: 1,
                                 len(self.wells): len(self.wells)
                             },
                         ),
                     ]),
                     html.Label(children=[
                         html.Span("Wells:", style={"font-weight": "bold"}),
                         wcc.Select(
                             id=self.uuid("wells"),
                             options=[{
                                 "label": i,
                                 "value": i
                             } for i in self.wells],
                             size=min([len(self.wells), 20]),
                             value=self.wells,
                         ),
                     ], ),
                 ],
             ),
             html.Div(
                 style={"flex": 3},
                 children=[
                     html.Div(
                         # style={"height": "300px"},
                         children=wcc.Graph(id=self.uuid("graph")), ),
                 ],
             ),
         ],
     )
示例#24
0
 def layout(self):
     return html.Div([
         html.Div(
             style={"marginLeft": "10px"},
             children=[
                 html.Label(
                     "Tornado Plot",
                     style={
                         "textAlign": "center",
                         "font-weight": "bold"
                     },
                 ),
                 html.Div(
                     style=self.set_grid_layout("1fr 1fr"),
                     children=[
                         html.Label("Reference:"),
                         html.Label("Scale:"),
                     ],
                 ),
                 html.Div(
                     style=self.set_grid_layout("1fr 1fr"),
                     children=[
                         dcc.Dropdown(
                             id=self.ids("reference"),
                             options=[{
                                 "label": r,
                                 "value": r
                             } for r in self.sensnames],
                             value=self.initial_reference,
                             clearable=False,
                             persistence=True,
                             persistence_type="session",
                         ),
                         dcc.Dropdown(
                             id=self.ids("scale"),
                             options=[{
                                 "label": r,
                                 "value": r
                             } for r in ["Percentage", "Absolute"]],
                             value="Percentage",
                             clearable=False,
                             persistence=True,
                             persistence_type="session",
                         ),
                     ],
                 ),
                 dcc.Checklist(
                     id=self.ids("cut-by-ref"),
                     options=[
                         {
                             "label": "Cut by reference",
                             "value": "Cut by reference",
                         },
                     ],
                     value=[],
                     persistence=True,
                     persistence_type="session",
                 ),
                 html.Details(
                     open=False,
                     children=[
                         html.Summary("Filter"),
                         wcc.Select(
                             id=self.ids("sens_filter"),
                             options=[{
                                 "label": i,
                                 "value": i
                             } for i in self.sensnames],
                             value=self.sensnames,
                             multi=True,
                             size=min(10, len(self.sensnames)),
                             persistence=True,
                             persistence_type="session",
                         ),
                     ],
                 ),
                 html.Button(
                     style={
                         "position": "relative",
                         "top": "-50%",
                         "fontSize": "10px",
                     },
                     id=self.ids("reset"),
                     children="Clear selected",
                 ),
                 wcc.Graph(
                     id=self.ids("tornado-graph"),
                     config={"displayModeBar": False},
                 ),
                 dcc.Store(id=self.ids("storage"), storage_type="session"),
                 dcc.Store(id=self.ids("click-store"),
                           storage_type="session"),
                 dcc.Store(id=self.ids("high-low-storage"),
                           storage_type="session"),
             ],
         )
     ])