def checkboxes_settings(uuid: str, tab: str) -> html.Div: return html.Div( style={ "margin-top": "10px", "margin-bottom": "10px" }, children=[ wcc.Checklist( id={ "id": uuid, "tab": tab, "selector": selector }, options=[{ "label": label, "value": "selected" }], value=["selected"] if selected else [], ) for label, selector, selected in [ ("Color by sensitivity", "color_by_sens", True), ("Shared subplot X axis", "Shared axis", False), ("Show realization points", "real_scatter", False), ("Show reference on tornado", "torn_ref", True), ("Remove sensitivities with no impact", "Remove no impact", True), ] ], )
def plot_options(get_uuid: Callable, tab: str) -> html.Div: return html.Div(children=[ wcc.Checklist( id={ "id": get_uuid("checkbox-options"), "tab": tab }, options=[ { "label": "Dateline visible", "value": "DateLine" }, { "label": "Auto compute correlations", "value": "AutoCompute" }, ], value=["DateLine", "AutoCompute"], ), html.Div( id={ "id": get_uuid("plot-options"), "tab": tab }, style={"display": "none"}, ), ], )
def statistical_layout(uuid: str, value: List[str]) -> html.Div: return wcc.Checklist( label="Show surfaces", id={ "id": uuid, "element": "calculation" }, options=[ { "label": "Mean", "value": "Mean" }, { "label": "Min", "value": "Min" }, { "label": "Max", "value": "Max" }, { "label": "Realizations", "value": "Realizations" }, { "label": "Uncertainty envelope (slow)", "value": "Uncertainty envelope", }, ], value=value, )
def make_map_selectors( uuid: str, map_id: str, surface_attributes: List[str], surface_names: List[str], ensembles: List[str], realizations: List[int], use_wells: bool, ) -> html.Div: return html.Div( children=[ wcc.Dropdown( label="Surface attribute", id={"id": uuid, "map_id": map_id, "element": "surfaceattribute"}, options=[{"label": val, "value": val} for val in surface_attributes], value=surface_attributes[0], clearable=False, ), wcc.Dropdown( label="Surface name", id={"id": uuid, "map_id": map_id, "element": "surfacename"}, options=[{"label": val, "value": val} for val in surface_names], value=surface_names[0], clearable=False, ), html.Div( style={"display": ("inline" if len(ensembles) > 1 else "none")}, children=[ wcc.Dropdown( label="Ensemble", id={"id": uuid, "map_id": map_id, "element": "ensemble"}, options=[{"label": val, "value": val} for val in ensembles], value=ensembles[0], clearable=False, ), ], ), wcc.Dropdown( label="Calculation/Realization", id={"id": uuid, "map_id": map_id, "element": "calculation"}, options=[ {"label": val, "value": val} for val in ["Mean", "StdDev", "Max", "Min", "P90", "P10"] + [str(real) for real in realizations] ], value=realizations[0], clearable=False, ), wcc.Checklist( id={"id": uuid, "map_id": map_id, "element": "options"}, options=[ {"label": "Calculate well intersections", "value": "intersect_well"} ] if use_wells else [], value=[], ), ] )
def remove_non_highlighted_data(uuid: str, tab: str) -> html.Div: return wcc.Checklist( id={"id": uuid, "tab": tab, "selector": "Remove non-highlighted"}, options=[ {"label": "Display only highlighted data in table", "value": "remove"} ], value=[], )
def table_sync_option(uuid: str, tab: str) -> html.Div: return html.Div( style={"margin-bottom": "10px"}, children=wcc.Checklist( id={"id": uuid, "tab": tab, "selector": "sync_table"}, options=[{"label": "Sync table with plot", "value": "Sync"}], value=["Sync"], ), )
def plot_settings(get_uuid: Callable) -> wcc.Frame: settings_uuid = get_uuid(WellOverviewLayoutElements.CHARTTYPE_SETTINGS) checklist_uuid = get_uuid(WellOverviewLayoutElements.CHARTTYPE_CHECKLIST) return wcc.Selectors( label="Plot Settings", children=[ html.Div( id={"id": settings_uuid, "charttype": "bar"}, children=wcc.Checklist( id={"id": checklist_uuid, "charttype": "bar"}, options=[ {"label": "Show legend", "value": "legend"}, {"label": "Overlay bars", "value": "overlay_bars"}, {"label": "Show prod as text", "value": "show_prod_text"}, {"label": "White background", "value": "white_background"}, ], value=["legend"], ), ), html.Div( id={"id": settings_uuid, "charttype": "pie"}, children=wcc.Checklist( id={"id": checklist_uuid, "charttype": "pie"}, options=[ {"label": "Show legend", "value": "legend"}, {"label": "Show prod as text", "value": "show_prod_text"}, ], value=[], ), ), html.Div( id={"id": settings_uuid, "charttype": "area"}, children=wcc.Checklist( id={"id": checklist_uuid, "charttype": "area"}, options=[ {"label": "Show legend", "value": "legend"}, {"label": "White background", "value": "white_background"}, ], value=["legend"], ), ), ], )
def line_traces_view(get_uuid: Callable, ) -> html.Div: return wcc.Selectors( label="Plot data", children=[ wcc.RadioItems( id=get_uuid("mode"), options=[ { "value": "lines", "label": "Lines" }, { "value": "markers", "label": "Points" }, ], value="lines", ), wcc.Checklist( id=get_uuid("traces"), options=[{ "label": val, "value": val } for val in ["Realizations", "Mean", "P10/P90", "Low/High"]], value=["Realizations"], labelStyle={"display": "block"}, ), wcc.Checklist( id=get_uuid("observations"), options=[{ "label": val, "value": val } for val in ["Observations"]], value=["Observations"], labelStyle={"display": "block"}, ), wcc.Label(id=get_uuid("statistics_warning"), children=""), ], )
def color_range_selection_layout( tab: str, get_uuid: Callable, value: List[float], value_range: List[float], step: float, view_idx: int, ) -> html.Div: return html.Div(children=[ f"{LayoutLabels.COLORMAP_RANGE}", wcc.RangeSlider( id={ "view": view_idx, "id": get_uuid(LayoutElements.COLORSELECTIONS), "selector": ColorSelector.COLOR_RANGE, "tab": tab, }, tooltip={"placement": "bottomLeft"}, min=value_range[0], max=value_range[1], step=step, marks={ str(value): { "label": f"{value:.2f}" } for value in value_range }, value=value, ), wcc.Checklist( id={ "view": view_idx, "id": get_uuid(LayoutElements.COLORSELECTIONS), "selector": "colormap_keep_range", "tab": tab, }, options=[{ "label": LayoutLabels.COLORMAP_KEEP_RANGE, "value": LayoutLabels.COLORMAP_KEEP_RANGE, }], value=[], ), html.Button( children=LayoutLabels.RANGE_RESET, style=LayoutStyle.RESET_BUTTON, id={ "view": view_idx, "id": get_uuid(LayoutElements.RANGE_RESET), "tab": tab, }, ), ])
def __init__( self, get_uuid: Callable, show_fault_polygons: bool, well_names: List[str], realizations: List[int], ) -> None: checklist_options = [LayoutLabels.SHOW_HILLSHADING] if show_fault_polygons: checklist_options.append(LayoutLabels.SHOW_FAULTPOLYGONS) if well_names: checklist_options.append(LayoutLabels.SHOW_WELLS) super().__init__( title=LayoutLabels.COMMON_SELECTIONS, id=get_uuid(LayoutElements.OPTIONS_DIALOG), draggable=True, open=False, children=[ ViewsInRowSelector(get_uuid), wcc.Checklist( id=get_uuid(LayoutElements.OPTIONS), options=[{ "label": opt, "value": opt } for opt in checklist_options], value=checklist_options, ), wcc.FlexBox( children=[ html.Div( style={ "flex": 3, "minWidth": "20px", "display": "block" if well_names else "none", }, children=WellFilter(get_uuid, well_names), ), html.Div( RealizationFilter(get_uuid, realizations), style={ "flex": 2, "minWidth": "20px" }, ), ], style={"width": "20vw"}, ), ], )
def remove_fluid_annotation( volumemodel: InplaceVolumesModel, uuid: str, tab: str ) -> html.Div: return html.Div( style={ "margin-bottom": "10px", "display": "none" if volumemodel.volume_type == "dynamic" else "block", }, children=wcc.Checklist( id={"id": uuid, "tab": tab, "selector": "Fluid annotation"}, options=[{"label": "Show fluid annotation", "value": "Show"}], value=["Show"] if volumemodel.volume_type != "dynamic" else [], ), )
def settings_layout(uuid: str) -> html.Details: return wcc.Selectors( open_details=False, label="⚙️ Settings", children=[ wcc.Checklist( id={ "id": uuid, "settings": "compute_diff" }, options=[{ "label": "Auto compute difference map", "value": "compute_diffmap", }], value=["compute_diffmap"], ), html.Div(children=[ wcc.Label( "Color ranges:", style={"font-weight": "bold"}, ), color_range_layout(uuid=uuid, map_id="map1"), color_range_layout(uuid=uuid, map_id="map2"), wcc.Checklist( id={ "id": uuid, "colors": "sync_range" }, options=[{ "label": "Sync range on maps", "value": "sync_range", }], value=[], ), ], ), ], )
def cut_by_ref(uuid: str, tab: str) -> html.Div: return html.Div( style={"margin-bottom": "10px"}, children=wcc.Checklist( id={ "id": uuid, "tab": tab, "selector": "Remove no impact" }, options=[{ "label": "Remove sensitivities with no impact", "value": "Remove" }], value=["Remove"], ), )
def remove_fluid_annotation(uuid: str, tab: str) -> html.Div: return html.Div( style={"margin-bottom": "10px"}, children=wcc.Checklist( id={ "id": uuid, "tab": tab, "selector": "Fluid annotation" }, options=[{ "label": "Show fluid annotation", "value": "Show" }], value=["Show"], ), )
def subplot_xaxis_range(uuid: str, tab: str) -> html.Div: axis_matches_layout = [] for axis in ["X axis", "Y axis"]: axis_matches_layout.append( html.Div( children=wcc.Checklist( id={"id": uuid, "tab": tab, "selector": f"{axis} matches"}, options=[{"label": f"Equal {axis} range", "value": "Equal"}], value=["Equal"], ) ) ) return html.Div( children=[ html.Span("Subplot options:", style={"font-weight": "bold"}), html.Div(style={"margin-bottom": "10px"}, children=axis_matches_layout), ] )
def selector_view( get_uuid: Callable, property_model: PropertyStatisticsModel ) -> html.Div: return [ wcc.Selectors( label="Selectors", children=[ ensemble_selector( get_uuid=get_uuid, ensembles=property_model.ensembles, tab="qc", multi=True, ), source_selector( get_uuid=get_uuid, sources=property_model.sources, tab="qc" ), property_selector( get_uuid=get_uuid, properties=property_model.properties, tab="qc" ), ], ), wcc.Selectors( label="Plot options", children=wcc.Checklist( id=get_uuid("property-qc-axis-match"), options=[{"label": "Shared plot axis", "value": "shared_axis"}], value=[], ), ), wcc.Selectors( label="Filters", children=filter_selector( get_uuid=get_uuid, property_model=property_model, tab="qc", value="Total" if property_model.selectors_has_value("Total") else None, ), ), ]
def fipfile_qc_selections( uuid: str, tab: str, ) -> wcc.Selectors: return wcc.Selectors( label="TABLE COTROLS", open_details=True, children=wcc.Checklist( id={ "id": uuid, "tab": tab, "selector": "Group table" }, options=[ { "label": "Group table on set", "value": "grouped" }, ], value=["grouped"], ), )
def plot_options_view(get_uuid: Callable, initial_layout: Dict) -> html.Div: return wcc.Selectors( label="Plot options", children=[ wcc.Checklist( id=get_uuid("plotly_uirevision"), options=[{ "label": "Keep plot range and zoom", "value": "keep" }], ), dropdown_for_plotly_layout( uuid=get_uuid("plotly_layout"), layout_attribute="xaxis_type", title="X-axis type", options=[ { "value": None, "label": "Automatic" }, { "value": "linear", "label": "Linear" }, { "value": "log", "label": "Log" }, { "value": "date", "label": "Date" }, { "value": "category", "label": "Category" }, { "value": "multicategory", "label": "Multicategory" }, ], placeholder="automatic", value=initial_layout.get("xaxis", {}).get("type", None), ), dropdown_for_plotly_layout( uuid=get_uuid("plotly_layout"), layout_attribute="xaxis_autorange", title="X-axis direction", options=[ { "value": True, "label": "normal" }, { "value": "reversed", "label": "reversed" }, ], value=initial_layout.get("xaxis", {}).get("autorange", True), ), dropdown_for_plotly_layout( uuid=get_uuid("plotly_layout"), layout_attribute="yaxis_type", title="Y-axis type", options=[ { "value": None, "label": "Automatic" }, { "value": "linear", "label": "Linear" }, { "value": "log", "label": "Log" }, { "value": "date", "label": "Date" }, { "value": "category", "label": "Category" }, { "value": "multicategory", "label": "Multicategory" }, ], placeholder="automatic", value=initial_layout.get("yaxis", {}).get("type", None), ), dropdown_for_plotly_layout( uuid=get_uuid("plotly_layout"), layout_attribute="yaxis_autorange", title="Y-axis direction", options=[ { "value": True, "label": "normal" }, { "value": "reversed", "label": "reversed" }, ], value=initial_layout.get("yaxis", {}).get("autorange", True), ), ], )
def parameter_response_selector_layout( get_uuid: Callable, datamodel: RftPlotterDataModel) -> wcc.Frame: ensembles = datamodel.ensembles well_names = datamodel.well_names params = datamodel.parameters if not datamodel.parameters is None else [] return wcc.Frame( style={ "height": "87vh", "overflowY": "auto", "font-size": "15px", }, children=[ wcc.Selectors( label="Selections", children=[ wcc.Dropdown( label="Ensemble", id=get_uuid(LayoutElements.PARAMRESP_ENSEMBLE), options=[{ "label": ens, "value": ens } for ens in ensembles], value=ensembles[0], clearable=False, ), wcc.Dropdown( label="Well", id=get_uuid(LayoutElements.PARAMRESP_WELL), options=[{ "label": well, "value": well } for well in well_names], value=well_names[0] if well_names else "", clearable=False, ), html.Div( id=get_uuid(LayoutElements.PARAMRESP_DATE_DROPDOWN), children=wcc.Dropdown( label="Date", id=get_uuid(LayoutElements.PARAMRESP_DATE), options=None, value=None, clearable=False, ), ), html.Div( id=get_uuid(LayoutElements.PARAMRESP_ZONE_DROPDOWN), children=wcc.Dropdown( label="Zone", id=get_uuid(LayoutElements.PARAMRESP_ZONE), options=None, clearable=False, value=None, ), ), wcc.Dropdown( label="Parameter", id=get_uuid(LayoutElements.PARAMRESP_PARAM), options=[{ "label": param, "value": param } for param in params], clearable=False, value=None, ), ], ), wcc.Selectors( label="Options", children=[ wcc.Checklist( id=get_uuid(LayoutElements.DISPLAY_PARAM_FILTER), options=[{ "label": "Show parameter filter", "value": "Show" }], value=[], ), wcc.RadioItems( label="Correlation options", id=get_uuid(LayoutElements.PARAMRESP_CORRTYPE), options=[ { "label": "Simulated vs parameters", "value": "sim_vs_param", }, { "label": "Parameter vs simulated", "value": "param_vs_sim", }, ], value="sim_vs_param", ), wcc.RadioItems( label="Depth option", id=get_uuid(LayoutElements.PARAMRESP_DEPTHOPTION), options=[ { "label": "TVD", "value": "TVD", }, { "label": "MD", "value": "MD", }, ], value="TVD", ), ], ), ], )
def settings_layout(self) -> html.Div: return html.Div( children=[ html.Div( children=[ wcc.FlexBox( style={"fontSize": "15px"}, children=[ html.Div( style={ "minWidth": "100px", "flex": 2, "marginRight": "10px", }, children=[ wcc.Dropdown( label="Reference", id=self.ids("reference"), options=[ { "label": r, "value": r, } for r in self.sensnames ], value=self.initial_reference, clearable=False, ), wcc.Dropdown( label="Scale", id=self.ids("scale"), options=[ { "label": r, "value": r, } for r in [ "Relative value (%)", "Relative value", "True value", ] ], value="Relative value (%)", clearable=False, ), html.Button( style={ "fontSize": "10px", "marginTop": "10px", } if self.allow_click else {"display": "none"}, id=self.ids("reset"), children="Clear selected", ), ], ), html.Div( style={ "minWidth": "100px", "flex": 2, "marginRight": "10px", }, children=[ wcc.SelectWithLabel( label="Select sensitivities", id=self.ids("sens_filter"), options=[ { "label": i, "value": i, } for i in self.sensnames ], value=self.sensnames, multi=True, size=min( 8, len(self.sensnames), ), ), ], ), html.Div( style={ "minWidth": "100px", "flex": 3, }, children=[ wcc.Checklist( label="Plot options", id=self.ids("plot-options"), options=[ { "label": "Fit all bars in figure", "value": "Fit all bars in figure", }, { "label": "Remove sensitivites with no impact", "value": "Remove sensitivites with no impact", }, { "label": "Show realization points", "value": "Show realization points", }, { "label": "Color bars by sensitivity", "value": "Color bars by sensitivity", }, ], value=[], labelStyle={"display": "block"}, ), wcc.Dropdown( label="Label", id=self.ids("label"), options=[ {"label": "No label", "value": "hide"}, { "label": "Simple label", "value": "simple", }, { "label": "Detailed label", "value": "detailed", }, ], value="detailed", clearable=False, ), ], ), ], ), ] ), ], )
def selector_view( get_uuid: Callable, vectormodel: SimulationTimeSeriesModel, parametermodel: ParametersModel, theme: WebvizConfigTheme, ) -> html.Div: theme_colors = theme.plotly_theme.get("layout", {}).get("colorway", []) theme_colors = (theme_colors[1:12] if theme_colors and len(theme_colors) >= 12 else theme_colors) return wcc.Frame( style={ "height": "80vh", "overflowY": "auto", "font-size": "15px", }, children=[ wcc.Selectors( label="Selections", children=[ ensemble_selector( get_uuid=get_uuid, parametermodel=parametermodel, tab="response", id_string="ensemble-selector", heading="Ensemble:", value=parametermodel.ensembles[0], ), vector_selector(get_uuid=get_uuid, vectormodel=vectormodel), date_selector(get_uuid=get_uuid, vectormodel=vectormodel), parameter_selector(get_uuid=get_uuid, parametermodel=parametermodel, tab="response"), ], ), wcc.Selectors( label="Filters", children=[ wcc.Checklist( id=get_uuid("display-paramfilter"), options=[{ "label": "Show parameter filter", "value": "Show" }], value=[], ), filter_vector_selector(get_uuid=get_uuid, vectormodel=vectormodel, tab="response"), ], ), wcc.Selectors( label="Options", open_details=False, children=[ plot_options(get_uuid=get_uuid, tab="response"), color_selector( get_uuid=get_uuid, tab="response", colors=[theme_colors, "Greys", "BrBG"], bargap=0.2, height=50, ), color_opacity_selector(get_uuid=get_uuid, tab="response", value=0.5), ], ), ], )
def controls( get_uuid: Callable, data_models: Dict[str, EnsembleWellAnalysisData] ) -> wcc.Frame: ensembles = list(data_models.keys()) return wcc.Frame( style={"flex": 1, "height": "87vh"}, children=[ wcc.Selectors( label="Selections", children=[ wcc.Dropdown( label="Ensemble", id=get_uuid(WellControlLayoutElements.ENSEMBLE), options=[{"label": col, "value": col} for col in ensembles], value=ensembles[0], multi=False, ), wcc.Dropdown( label="Well", id=get_uuid(WellControlLayoutElements.WELL), options=[], value=None, multi=False, ), ], ), wcc.Selectors( label="Pressure Plot Options", children=[ wcc.Checklist( id=get_uuid(WellControlLayoutElements.INCLUDE_BHP), options=[{"label": "Include BHP", "value": "include_bhp"}], value=["include_bhp"], ), wcc.RadioItems( label="Mean or realization", id=get_uuid(WellControlLayoutElements.MEAN_OR_REAL), options=[ { "label": "Mean of producing real.", "value": "plot_mean", }, { "label": "Single realization", "value": "single_real", }, ], value="plot_mean", ), html.Div( id=get_uuid(WellControlLayoutElements.SINGLE_REAL_OPTIONS), children=[ wcc.Dropdown( id=get_uuid(WellControlLayoutElements.REAL), options=[], value=None, multi=False, ), wcc.Checklist( id=get_uuid(WellControlLayoutElements.CTRLMODE_BAR), options=[ { "label": "Display ctrl mode bar", "value": "ctrlmode_bar", } ], value=["ctrlmode_bar"], ), ], ), ], ), wcc.Selectors( label="⚙️ Settings", children=[ wcc.Checklist( id=get_uuid(WellControlLayoutElements.SHARED_XAXES), options=[{"label": "Shared x-axis", "value": "shared_xaxes"}], value=["shared_xaxes"], ), ], ), ], )
def remove_zero_responses(uuid: str, tab: str) -> html.Div: return wcc.Checklist( id={"id": uuid, "tab": tab, "selector": "Remove zeros"}, options=[{"label": "Remove data with no volume", "value": "remove"}], value=["remove"], )
def axis_focus_selector(uuid: str, tab: str) -> html.Div: return wcc.Checklist( id={"id": uuid, "tab": tab, "selector": "Axis focus"}, options=[{"label": "Focus diff plots on highlighted", "value": "focus"}], value=["focus"], )
def __plot_options_layout( get_uuid: Callable, selected_visualization: VisualizationOptions, ) -> html.Div: return html.Div( children=[ wcc.Checklist( id=get_uuid(LayoutElements.PLOT_TRACE_OPTIONS_CHECKLIST), style={"display": "block"}, options=[ {"label": "History", "value": TraceOptions.HISTORY.value}, { "label": "Observation", "value": TraceOptions.OBSERVATIONS.value, }, ], value=[TraceOptions.HISTORY.value, TraceOptions.OBSERVATIONS.value], ), wcc.Checklist( id=get_uuid(LayoutElements.PLOT_STATISTICS_OPTIONS_CHECKLIST), style={"display": "block"} if selected_visualization in [ VisualizationOptions.STATISTICS, VisualizationOptions.STATISTICS_AND_REALIZATIONS, ] else {"display": "none"}, options=[ {"label": "Mean", "value": StatisticsOptions.MEAN.value}, { "label": "P10 (high)", "value": StatisticsOptions.P10.value, }, { "label": "P50 (median)", "value": StatisticsOptions.P50.value, }, { "label": "P90 (low)", "value": StatisticsOptions.P90.value, }, {"label": "Maximum", "value": StatisticsOptions.MAX.value}, {"label": "Minimum", "value": StatisticsOptions.MIN.value}, ], value=[ StatisticsOptions.MEAN.value, StatisticsOptions.P10.value, StatisticsOptions.P90.value, ], ), wcc.Checklist( id=get_uuid(LayoutElements.PLOT_FANCHART_OPTIONS_CHECKLIST), style={"display": "block"} if VisualizationOptions.FANCHART == selected_visualization else {"display": "none"}, options=[ { "label": FanchartOptions.MEAN.value, "value": FanchartOptions.MEAN.value, }, { "label": FanchartOptions.P10_P90.value, "value": FanchartOptions.P10_P90.value, }, { "label": FanchartOptions.MIN_MAX.value, "value": FanchartOptions.MIN_MAX.value, }, ], value=[ FanchartOptions.MEAN.value, FanchartOptions.P10_P90.value, FanchartOptions.MIN_MAX.value, ], ), ], )
def layout(self): return wcc.FlexBox( id=self.uuid("layout"), children=[ wcc.Frame( id=self.uuid("filters"), style={ "flex": "1", "height": "90vh" }, children=[ wcc.Selectors( label="Selectors", children=[ wcc.Dropdown( label="Saturation axis", id=self.uuid("sataxis"), clearable=False, options=[{ "label": i.lower().capitalize(), "value": i, } for i in self.sat_axes], value=self.sat_axes[0], ), wcc.Dropdown( label="Color by", id=self.uuid("color_by"), clearable=False, options=[{ "label": i.lower().capitalize(), "value": i, } for i in self.color_options], value=self.color_options[0], ), dcc.Store( id=self.uuid("stored_ensemble"), storage_type="session", data={}, ), wcc.Dropdown( label="Ensembles", id=self.uuid("ensemble"), clearable=False, multi=True, options=[{ "label": i, "value": i } for i in self.ensembles], value=self.ensembles[0], ), wcc.Dropdown( label="Curves", id=self.uuid("curve"), clearable=False, multi=True, ), dcc.Store( id=self.uuid("stored_satnum"), storage_type="session", data={}, ), wcc.Dropdown( label="Satnum", id=self.uuid("satnum"), clearable=False, multi=True, options=[{ "label": i, "value": i } for i in self.satnums], value=self.satnums[0], ), ], ), wcc.Selectors( label="Visualization", children=[ wcc.RadioItems( label="Line traces", id=self.uuid("visualization"), className="block-options", options=[ { "label": "Individual realizations", "value": "realizations", }, { "label": "Statistical fanchart", "value": "statistics", }, ], value="statistics", ), wcc.RadioItems( label="Y-axis", id=self.uuid("linlog"), className="block-options", options=[ { "label": "Linear", "value": "linear", }, { "label": "Log", "value": "log", }, ], value="linear", ), ], ), wcc.Selectors( style={"display": "block"} if self.scal is not None else {"display": "none"}, id=self.uuid("scal_selector"), label="SCAL recommendation", children=[ wcc.Checklist( id=self.uuid("scal"), options=[ { "label": "Show SCAL", "value": "show_scal", }, ], value=["show_scal"] if self.scal is not None else [], ), ], ), ], ), wcc.Frame( color="white", highlight=False, style={ "flex": "4", "height": "90vh" }, children=wcc.Graph(style={"height": "88vh"}, id=self.uuid("graph")), ), ], )
def settings_layout(uuid: str, tab: str, volumemodel: InplaceVolumesModel) -> wcc.Selectors: return wcc.Selectors( label="⚙️ SETTINGS", open_details=True, children=[ wcc.Dropdown( label="Scale:", id={ "id": uuid, "tab": tab, "selector": "Scale" }, options=[ { "label": "Relative value (%)", "value": "Percentage" }, { "label": "Relative value", "value": "Absolute" }, { "label": "True value", "value": "True" }, ], value="Percentage", clearable=False, ), html.Div( style={"margin-top": "10px"}, children=wcc.Checklist( id={ "id": uuid, "tab": tab, "selector": "real_scatter" }, options=[{ "label": "Show realization points", "value": "Show" }], value=[], ), ), cut_by_ref(uuid, tab), labels_display(uuid, tab), wcc.Dropdown( label="Reference:", id={ "id": uuid, "tab": tab, "selector": "Reference" }, options=[{ "label": elm, "value": elm } for elm in volumemodel.sensitivities], value="rms_seed" if "rms_seed" in volumemodel.sensitivities else volumemodel.sensitivities[0], clearable=False, ), ], )
def options_layout( uuid: str, depth_truncations: Dict, resolution: float, extension: int, initial_layout: Dict, ) -> html.Div: return html.Div( children=[ html.Div( children=[ wcc.Label( "Resolution (m) ", ), dcc.Input( className="webviz-structunc-range-input", id={"id": uuid, "element": "resolution"}, type="number", required=True, value=resolution, persistence=True, persistence_type="session", ), ], ), html.Div( children=[ wcc.Label( "Extension (m) ", ), dcc.Input( className="webviz-structunc-range-input", id={"id": uuid, "element": "extension"}, type="number", step=25, required=True, value=extension, persistence=True, persistence_type="session", ), ], ), html.Div( style={"margin-top": "10px"}, children=[ wcc.Label("Depth range settings:"), wcc.FlexBox( style={"display": "flex"}, children=[ dcc.Input( id={ "id": uuid, "settings": "zrange_min", }, style={"flex": 1, "minWidth": "70px"}, type="number", value=depth_truncations.get("min", None), debounce=True, placeholder="Min", persistence=True, persistence_type="session", ), dcc.Input( id={ "id": uuid, "settings": "zrange_max", }, style={"flex": 1, "minWidth": "70px"}, type="number", value=depth_truncations.get("max", None), debounce=True, placeholder="Max", persistence=True, persistence_type="session", ), ], ), wcc.RadioItems( id={ "id": uuid, "settings": "zrange_locks", }, options=[ { "label": "Truncate range", "value": "truncate", }, { "label": "Lock range", "value": "lock", }, ], value="truncate", ), wcc.Checklist( id={ "id": uuid, "settings": "ui_options", }, options=[ {"label": "Keep zoom state", "value": "uirevision"}, ], value=["uirevision"] if "uirevision" in initial_layout else [], ), ], ), ], )
def layout(self) -> wcc.FlexBox: return wcc.FlexBox( id=self.uuid("layout"), children=[ wcc.Frame( style={ "flex": "1", "height": "90vh" }, children=[ wcc.Selectors( label="Selectors", children=[ wcc.Dropdown( label="Color by", id=self.uuid("color_by"), clearable=False, options=[{ "label": i.lower().capitalize(), "value": i, } for i in self.color_options], value=self.color_options[0], ), wcc.Dropdown( label="Ensembles", id=self.uuid("ensemble"), clearable=False, multi=True, options=[{ "label": i, "value": i } for i in self.ensembles], value=self.ensembles, ), wcc.Dropdown( label="Phase", id=self.uuid("phase"), clearable=False, options=[{ "label": f"{value.lower().capitalize()} ({info})", "value": value, } for value, info in self.phases.items()], multi=False, value=list(self.phases.keys())[0], ), wcc.Dropdown( label="Pvtnum", id=self.uuid("pvtnum"), clearable=False, multi=False, options=[{ "label": i, "value": i } for i in self.pvtnums], value=self.pvtnums[0], ), ], ), wcc.Selectors( label="Show plots", children=[ wcc.Checklist( id=self.uuid("plots_visibility"), options=[{ "label": l, "value": v } for v, l in self.plot_visibility_options( ).items()], value=[ "fvf", "viscosity", "density", "ratio", ], labelStyle={"display": "block"}, ), ], ), ], ), wcc.Frame( color="white", highlight=False, id=self.uuid("graphs"), style={ "flex": "6", "height": "90vh" }, children=[], ), dcc.Store(id=self.uuid("init_callback"), storage_type="session", data=True), ], )
def control_div(self) -> list: return [ wcc.Selectors( label="Distribution plot horizontal axis", children=[ wcc.Dropdown( id=self.ids("parameter1"), label="Parameter", options=[{ "label": p, "value": p } for p in self.p_cols], value=self.p_cols[0], clearable=False, ), wcc.Dropdown( label="Ensemble", id=self.ids("ensemble-1"), options=[{ "label": k, "value": v } for k, v in self.ensembles.items()], value=list(self.ensembles.values())[0], clearable=False, ), ], ), wcc.Selectors( label="Distribution plot vertical axis", children=[ wcc.Dropdown( id=self.ids("parameter2"), label="Parameter", options=[{ "label": p, "value": p } for p in self.p_cols], value=self.p_cols[0], clearable=False, ), wcc.Dropdown( label="Ensemble", id=self.ids("ensemble-2"), options=[{ "label": k, "value": v } for k, v in self.ensembles.items()], value=list(self.ensembles.values())[0], clearable=False, ), ], ), wcc.Selectors( label="Distribution plot options", children=[ wcc.Dropdown( label="Color by", id=self.ids("scatter-color"), options=[{ "label": p, "value": p } for p in self.p_cols], ), wcc.Checklist( id=self.ids("density"), style={"padding": "5px"}, options=[{ "label": "Show scatterplot density", "value": "density", }], ), ], ), ]