def main_view( get_uuid: Callable, vectormodel: SimulationTimeSeriesModel, parametermodel: ParametersModel, parameterfilter_layout: html.Div, theme: WebvizConfigTheme, ) -> wcc.Tabs: tabs = [ wcc.Tab( label="Parameter distributions", value="tab-1", children=parameter_qc_view(get_uuid=get_uuid, parametermodel=parametermodel), ) ] if vectormodel is not None: tabs.append( wcc.Tab( label="Parameters impact on simulation profiles", value="tab-2", children=parameter_response_view( get_uuid=get_uuid, parametermodel=parametermodel, parameterfilter_layout=parameterfilter_layout, vectormodel=vectormodel, theme=theme, ), )) return wcc.Tabs( value="tab-1" if vectormodel is None else "tab-2", style={"width": "100%"}, children=tabs, )
def main_layout(get_uuid: Callable, data_models: Dict[str, EnsembleWellAnalysisData]) -> wcc.Tabs: """Main layout""" tabs = [ wcc.Tab(label="Well Overview", children=well_overview_tab(get_uuid, data_models)), wcc.Tab(label="Well Control", children=well_control_tab(get_uuid, data_models)), ] return wcc.Tabs(children=tabs)
def main_view( get_uuid: Callable, property_model: PropertyStatisticsModel, vector_model: Optional[Union[SimulationTimeSeriesModel, ProviderTimeSeriesDataModel]], surface_folders: Optional[Dict] = None, ) -> wcc.Tabs: tabs = [ wcc.Tab( label="Property QC", children=property_qc_view(get_uuid=get_uuid, property_model=property_model), ) ] if len(property_model.ensembles) > 1: tabs.append( wcc.Tab( label="AHM impact on property", children=property_delta_view( get_uuid=get_uuid, property_model=property_model, surface_folders=surface_folders, ), )) if vector_model is not None: tabs.append( wcc.Tab( label="Property impact on simulation profiles", children=property_response_view( get_uuid=get_uuid, property_model=property_model, vector_model=vector_model, surface_folders=surface_folders, ), ), ) return wcc.Tabs(style={"width": "100%"}, children=tabs)
def main_layout( get_uuid: Callable, well_names: List[str], realizations: List[int], show_fault_polygons: bool = True, ) -> html.Div: return html.Div(children=[ wcc.Tabs( id=get_uuid("tabs"), style={"width": "100%"}, value=Tabs.CUSTOM, children=[ wcc.Tab( label=TabsLabels[tab.name], value=tab, children=wcc.FlexBox(children=[ wcc.Frame( style=LayoutStyle.SIDEBAR, children=[ DataStores(tab, get_uuid), OpenDialogButton(tab, get_uuid), NumberOfViewsSelector(tab, get_uuid), MultiSelectorSelector(tab, get_uuid), html.Div([ MapSelectorLayout( tab=tab, get_uuid=get_uuid, selector=selector, label=LayoutLabels[selector.name], ) for selector in MapSelector ]), SurfaceColorSelector(tab, get_uuid), ], ), wcc.Frame( id=get_uuid(LayoutElements.MAINVIEW), style=LayoutStyle.MAINVIEW, color="white", highlight=False, children=MapViewLayout(tab, get_uuid), ), ]), ) for tab in Tabs ], ), DialogLayout(get_uuid, show_fault_polygons, well_names, realizations), ])
def main_layout(get_uuid: Callable, datamodel: RftPlotterDataModel) -> wcc.Tabs: tabs = [ wcc.Tab( label="RFT Map", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=[ map_plot_selectors(get_uuid, datamodel), formation_plot_selectors(get_uuid, datamodel), ], ), wcc.Frame( style={ "flex": 3, "height": "87vh" }, color="white", highlight=False, id=get_uuid(LayoutElements.MAP), children=[], ), wcc.Frame( style={ "flex": 3, "height": "87vh" }, color="white", highlight=False, id=get_uuid(LayoutElements.FORMATIONS_GRAPH), children=[], ), ]) ], ), wcc.Tab( label="RFT misfit per real", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=filter_layout(get_uuid, datamodel, "misfitplot"), ), wcc.Frame( style={ "flex": 6, "height": "87vh" }, color="white", highlight=False, id=get_uuid(LayoutElements.MISFITPLOT_GRAPH), children=[], ), ]) ], ), wcc.Tab( label="RFT crossplot - sim vs obs", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=[ filter_layout(get_uuid, datamodel, "crossplot"), size_color_layout(get_uuid), ], ), wcc.Frame( style={ "flex": 6, "height": "87vh" }, color="white", highlight=False, children=[ html.Div( id=get_uuid(LayoutElements.CROSSPLOT_GRAPH)), ], ), ], ), ], ), wcc.Tab( label="RFT misfit per observation", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=filter_layout(get_uuid, datamodel, "errorplot"), ), wcc.Frame( color="white", highlight=False, style={ "flex": 6, "height": "87vh" }, id=get_uuid(LayoutElements.ERRORPLOT_GRAPH), children=[], ), ], ), ], ), ] # It this is not a sensitivity run, add the parameter response tab if not datamodel.param_model.sensrun: tabs.append( wcc.Tab( label="RFT parameter response", children=parameter_response_layout(get_uuid=get_uuid, datamodel=datamodel), )) return wcc.Tabs(children=tabs)
def main_view( get_uuid: Callable, volumemodel: InplaceVolumesModel, theme: WebvizConfigTheme, disjoint_set_df: Optional[pd.DataFrame] = None, ) -> dcc.Tabs: tabs = [] tabs.append( wcc.Tab( label="Inplace distributions", value="voldist", children=tab_view_layout( main_layout=distributions_main_layout( uuid=get_uuid("main-voldist")), sidebar_layout=[ selections_layout( uuid=get_uuid("selections"), tab="voldist", volumemodel=volumemodel, theme=theme, ), filter_layout(uuid=get_uuid("filters"), tab="voldist", volumemodel=volumemodel), ], ), )) tabs.append( wcc.Tab( label="Tables", value="table", children=tab_view_layout( main_layout=table_main_layout(uuid=get_uuid("main-table"), ), sidebar_layout=[ table_selections_layout( uuid=get_uuid("selections"), tab="table", volumemodel=volumemodel, ), filter_layout(uuid=get_uuid("filters"), tab="table", volumemodel=volumemodel), ], ), )) if volumemodel.sensrun and volumemodel.volume_type != "mixed": tabs.append( wcc.Tab( label="Tornadoplots", value="tornado", children=tab_view_layout( main_layout=tornado_main_layout( uuid=get_uuid("main-tornado"), ), sidebar_layout=[ tornado_selections_layout( uuid=get_uuid("selections"), tab="tornado", volumemodel=volumemodel, ), filter_layout( uuid=get_uuid("filters"), tab="tornado", volumemodel=volumemodel, hide_selectors=["SENSNAME_CASE"], ), ], ), )) if len(volumemodel.sources) > 1: tabs.append( wcc.Tab( label="Source comparison", value="src-comp", children=tab_view_layout( main_layout=comparison_main_layout( get_uuid("main-src-comp")), sidebar_layout=[ comparison_selections( uuid=get_uuid("selections"), tab="src-comp", volumemodel=volumemodel, compare_on="Source", ), filter_layout( uuid=get_uuid("filters"), tab="src-comp", volumemodel=volumemodel, hide_selectors=["SOURCE", "FLUID_ZONE"], ), ], ), )) if len(volumemodel.ensembles) > 1 or volumemodel.sensrun: compare_on = "Ensemble" if len( volumemodel.ensembles) > 1 else "Sensitivity" tabs.append( wcc.Tab( label=f"{compare_on} comparison", value="ens-comp", children=tab_view_layout( main_layout=comparison_main_layout( get_uuid("main-ens-comp")), sidebar_layout=[ comparison_selections( uuid=get_uuid("selections"), tab="ens-comp", volumemodel=volumemodel, compare_on=compare_on, ), filter_layout( uuid=get_uuid("filters"), tab="ens-comp", volumemodel=volumemodel, hide_selectors=[ "ENSEMBLE", "FLUID_ZONE", "SENSNAME_CASE" ], ), ], ), )) if disjoint_set_df is not None: tabs.append( wcc.Tab( label="Fipfile QC", value="fipqc", children=tab_view_layout( main_layout=fipfile_qc_main_layout(get_uuid("main-fipqc")), sidebar_layout=[ fipfile_qc_selections(uuid=get_uuid("selections"), tab="fipqc"), fipfile_qc_filters( uuid=get_uuid("filters"), tab="fipqc", disjoint_set_df=disjoint_set_df, ), ], ), )) initial_tab = "voldist" if volumemodel.volume_type == "mixed": initial_tab = "src-comp" elif volumemodel.sensrun: initial_tab = "tornado" return wcc.Tabs( id=get_uuid("tabs"), value=initial_tab, style={"width": "100%"}, persistence=True, children=tabs, )
def make_tab(label: str, children: wcc.FlexBox) -> dcc.Tab: return wcc.Tab( label=label, children=children, )
def main_layout( get_uuid: Callable, ensemble_names: List[str], dates: Dict[str, List[datetime]], phases: Dict[str, List[str]], wells: Dict[str, List[str]], realizations: Dict[str, List[int]], well_collections: Dict[str, List[str]], ) -> wcc.Tabs: all_dates, all_phases, all_wells, all_realizations = [], [], [], [] for ens_name in ensemble_names: all_dates.extend(dates[ens_name]) all_phases.extend(phases[ens_name]) all_wells.extend(wells[ens_name]) all_realizations.extend(realizations[ens_name]) all_dates = list(sorted(set(all_dates))) all_phases = list(sorted(set(all_phases))) all_wells = list(sorted(set(all_wells))) all_realizations = list(sorted(set(all_realizations))) all_well_collection_names = [] for collection_name in well_collections.keys(): all_well_collection_names.append(collection_name) return wcc.Tabs( style=LayoutElements.TABS_STYLES, children=[ wcc.Tab( label="Production misfit per real", style=LayoutElements.TAB_STYLE, selected_style=LayoutElements.TAB_SELECTED_STYLE, children=_misfit_per_real_layout( get_uuid, ensemble_names, all_dates, all_phases, all_wells, all_well_collection_names, all_realizations, ), ), wcc.Tab( label="Well production coverage", style=LayoutElements.TAB_STYLE, selected_style=LayoutElements.TAB_SELECTED_STYLE, children=_well_prod_coverage_layout( get_uuid, ensemble_names, all_dates, all_phases, all_wells, all_well_collection_names, all_realizations, ), ), wcc.Tab( label="Well production heatmap", style=LayoutElements.TAB_STYLE, selected_style=LayoutElements.TAB_SELECTED_STYLE, children=_heatmap_layout( get_uuid, ensemble_names, all_dates, all_phases, all_wells, all_well_collection_names, all_realizations, ), ), ], )
def layout(self) -> wcc.Tabs: return wcc.Tabs(children=[ wcc.Tab( label="RFT Map", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=[ self.map_plot_selectors, self.formation_plot_selectors, ], ), wcc.Frame( style={ "flex": 3, "height": "87vh" }, color="white", highlight=False, children=wcc.Graph(id=self.uuid("map"), ), ), wcc.Frame( style={ "flex": 3, "height": "87vh" }, color="white", highlight=False, children=wcc.Graph( id=self.uuid("graph"), figure={ "layout": { "height": 800, "margin": { "t": 50 }, "xaxis": { "showgrid": False }, "yaxis": { "showgrid": False }, } }, ), ), ]) ], ), wcc.Tab( label="RFT misfit per real", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=self.filter_layout("misfitplot"), ), wcc.Frame( style={ "flex": 6, "height": "87vh" }, color="white", highlight=False, id=self.uuid("misfit-graph-wrapper"), children=[], ), ]) ], ), wcc.Tab( label="RFT crossplot - sim vs obs", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=[ self.filter_layout("crossplot"), self.size_color_layout(), ], ), wcc.Frame( style={ "flex": 6, "height": "87vh" }, color="white", highlight=False, children=[ html.Div( id=self.uuid("crossplot-graph-wrapper")), ], ), ], ), ], ), wcc.Tab( label="RFT misfit per observation", children=[ wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=self.filter_layout("errorplot"), ), wcc.Frame( color="white", highlight=False, style={ "flex": 6, "height": "87vh" }, children=wcc.Graph( style={"height": "84vh"}, id=self.uuid("errorplot-graph"), ), ), ], ), ], ), ], )