def parameter_response_layout(get_uuid: Callable, datamodel: RftPlotterDataModel) -> wcc.FlexBox: df = datamodel.param_model.dataframe parameter_filter = ParameterFilter( uuid=get_uuid(LayoutElements.PARAM_FILTER), dframe=df[df["ENSEMBLE"].isin( datamodel.param_model.mc_ensembles)].copy(), reset_on_ensemble_update=True, ) return wcc.FlexBox(children=[ wcc.FlexColumn(flex=1, children=parameter_response_selector_layout( get_uuid, datamodel)), wcc.FlexColumn( flex=4, children=wcc.FlexBox(children=[ wcc.FlexColumn( flex=2, children=[ wcc.Frame( style={"height": "41.5vh"}, id=get_uuid( LayoutElements.PARAMRESP_CORR_BARCHART), color="white", highlight=False, children=[], ), wcc.Frame( style={"height": "41.5vh"}, id=get_uuid(LayoutElements.PARAMRESP_SCATTERPLOT), color="white", highlight=False, children=[], ), ], ), wcc.FlexColumn( flex=2, children=[ wcc.Frame( id=get_uuid(LayoutElements.PARAMRESP_FORMATIONS), color="white", highlight=False, style={"height": "87vh"}, children=[], ) ], ), ], ), ), wcc.FlexColumn( id=get_uuid(LayoutElements.PARAM_FILTER_WRAPPER), style={"display": "none"}, flex=1, children=wcc.Frame( style={"height": "87vh"}, children=parameter_filter.layout, ), ), ])
def property_qc_view( get_uuid: Callable, property_model: PropertyStatisticsModel ) -> wcc.FlexBox: return wcc.FlexBox( style={"margin": "20px"}, children=[ wcc.FlexColumn( children=wcc.Frame( style={"height": "80vh", "overflowY": "auto"}, children=selector_view( get_uuid=get_uuid, property_model=property_model ), ) ), wcc.FlexColumn( flex=8, children=wcc.Frame( color="white", highlight=False, style={"height": "80vh"}, children=[ wcc.FlexBox( children=[ wcc.RadioItems( vertical=False, id=get_uuid("property-qc-plot-type"), options=[ { "label": "Distributions", "value": "distribution", }, { "label": "Point per realization", "value": "scatter", }, { "label": "Point per realization (single plot)", "value": "scatter_ensemble", }, {"label": "Statistics table", "value": "table"}, ], value="distribution", labelStyle={ "display": "inline-block", "margin": "5px", }, ), ] ), html.Div( style={"height": "75vh"}, id=get_uuid("property-qc-wrapper"), ), ], ), ), ], )
def layout(self) -> html.Div: return html.Div(children=[ wcc.FlexBox( id=self.ids("layout"), children=[ html.Div( style={"flex": 2}, children=[ wcc.FlexBox(children=[ self.ensemble_selector, self.smry_selector, dcc.Store( id=self.ids("date-store"), storage_type="session", ), ], ), wcc.FlexBox(children=[ html.Div( id=self.ids("graph-wrapper"), style={"height": "450px"}, children=wcc.Graph( id=self.ids("graph"), clickData={ "points": [{ "x": self.initial_date }] }, ), ), ]), html.Div(children=[ html.Div( id=self.ids("table_title"), style={"textAlign": "center"}, children="", ), DataTable( id=self.ids("table"), sort_action="native", filter_action="native", page_action="native", page_size=10, ), ], ), ], ), html.Div( style={"flex": 1}, id=self.ids("tornado-wrapper"), children=self.tornadoplot.layout, ), ], ), ])
def property_qc_view(parent) -> wcc.FlexBox: return wcc.FlexBox( style={"margin": "20px"}, children=[ html.Div(style={"flex": 1}, children=selector_view(parent=parent)), html.Div( style={ "flex": 4, "height": "80vh" }, className="framed", children=[ wcc.FlexBox(children=[ dcc.RadioItems( id=parent.uuid("property-qc-plot-type"), options=[ { "label": "Histograms", "value": "histogram" }, { "label": "Bar per realization", "value": "bar" }, { "label": "Point per realization", "value": "scatter", }, { "label": "Point per realization (single plot)", "value": "scatter_ensemble", }, { "label": "Statistics table", "value": "table" }, ], value="histogram", labelStyle={ "display": "inline-block", "margin": "5px", }, ), ]), html.Div(style={"height": "75vh"}, id=parent.uuid("property-qc-wrapper")), ], ), ], )
def parameter_response_layout( get_uuid: Callable, datamodel: RftPlotterDataModel ) -> wcc.FlexBox: return wcc.FlexBox( children=[ wcc.FlexColumn( flex=1, children=parameter_response_selector_layout(get_uuid, datamodel) ), wcc.FlexColumn( flex=4, children=wcc.FlexBox( children=[ wcc.FlexColumn( flex=2, children=[ wcc.Frame( style={"height": "41.5vh"}, id=get_uuid(LayoutElements.PARAMRESP_CORR_BARCHART), color="white", highlight=False, children=[], ), wcc.Frame( style={"height": "41.5vh"}, id=get_uuid(LayoutElements.PARAMRESP_SCATTERPLOT), color="white", highlight=False, children=[], ), ], ), wcc.FlexColumn( flex=2, children=[ wcc.Frame( id=get_uuid(LayoutElements.PARAMRESP_FORMATIONS), color="white", highlight=False, style={"height": "87vh"}, children=[], ) ], ), ], ), ), ] )
def main_layout(get_uuid: Callable, ensembles: list) -> wcc.FlexBox: """Main layout""" return wcc.FlexBox( id=get_uuid("layout"), children=[ wcc.FlexColumn( flex=1, children=[ wcc.Frame( style={"height": "82vh"}, children=[ selections_layout(get_uuid, ensembles), options_layout(get_uuid), filters_layout(get_uuid), ], ) ], ), wcc.FlexColumn( flex=5, children=[ wcc.Frame( style={"height": "82vh"}, highlight=False, color="white", children=html.Div(id=get_uuid("grouptree_wrapper"), ), ) ], ), ], )
def left_flexbox_layout(self) -> html.Div: return html.Div(children=[ wcc.FlexBox( children=[ dcc.RadioItems( labelStyle={"display": "inline-block"}, options=[ { "label": "Map view", "value": "map-view" }, { "label": "Surface picks table", "value": "table-view" }, ], id=self.ids("map-table-radioitems"), value="map-view", persistence=True, persistence_type="session", ) ], style={"padding": "5px"}, ), html.Div( id=self.ids("hidden-div-map-view"), children=[self.map_view_layout] ), # Hidden div to store polyline points when in table view html.Div( id=self.ids("hidden-div-table-view"), children=[self.table_view_layout], ), ])
def tornado_plots_layout(figures: list, bottom_display: list) -> html.Div: matrix = create_figure_matrix(figures) max_height = 45 if bottom_display else 86 return html.Div(children=[ html.Div(children=[ wcc.FlexBox(children=[ html.Div( style={"flex": 1}, children=wcc.Graph( config={"displayModeBar": False}, style={"height": f"{max_height/len(matrix)}vh"}, figure=fig, ) if fig is not None else [], ) for fig in row ]) for row in matrix ], ), html.Div( bottom_display, style={ "height": "40vh", "display": "block" if bottom_display else "none", "margin-top": "20px", }, ), ])
def main_layout(get_uuid: Callable[[str], str], ensembles: List[str]) -> wcc.FlexBox: """Main layout""" return wcc.FlexBox( children=[ wcc.FlexColumn( flex=1, children=[ wcc.Frame( style={"height": "82vh"}, children=[ selections_layout(get_uuid, ensembles), options_layout(get_uuid), filters_layout(get_uuid), ], ) ], ), wcc.FlexColumn( flex=5, children=[ wcc.Frame( style={"height": "82vh"}, highlight=False, color="white", children=html.Div( id=get_uuid(LayoutElements.GRAPH), ), ) ], ), ], )
def layout(self) -> html.Div: return html.Div( id=self.uuid("layout"), children=[ wcc.FlexBox(children=[ wcc.Selectors( label="Ensemble", children=[ wcc.Dropdown( id=self.uuid("ensemble_dropdown"), options=[{ "label": ens, "value": ens } for ens in self.ensembles], clearable=False, value=self.ensembles[0], persistence=True, persistence_type="session", ), ], ), html.Div(style={"flex": 4}), ], ), html.Div(id=self.uuid("well_completions_wrapper"), ), ], )
def layout(self): """Main layout""" return wcc.FlexBox( id=self.uuid("layout"), style={"height": "90vh"}, children=[ wcc.Frame( style={ "flex": 1, "height": "90vh" }, children=(self.control_layout + self.response_layout), ), wcc.Frame( style={ "flex": 4, "height": "90vh", "marginRight": "2vw" }, color="white", highlight=False, children=wcc.Graph(id=self.uuid("parcoords"), ), ), ], )
def main_layout(get_uuid: Callable, ensembles: list) -> html.Div: return html.Div( id=get_uuid(LayoutElements.LAYOUT), children=[ dcc.Store(id=get_uuid(LayoutElements.ENSEMBLE_DROPDOWN), storage_type="session"), wcc.FlexBox(children=[ wcc.Selectors( label="Ensemble", children=[ wcc.Dropdown( id=get_uuid(LayoutElements.ENSEMBLE_DROPDOWN), options=[{ "label": ens, "value": ens } for ens in ensembles], clearable=False, value=ensembles[0], persistence=True, persistence_type="session", ), ], ), html.Div(style={"flex": 4}), ], ), html.Div(id=get_uuid(LayoutElements.WELL_COMPLETIONS_COMPONENT), ), ], )
def well_overview_tab( get_uuid: Callable, data_models: Dict[str, EnsembleWellAnalysisData]) -> wcc.FlexBox: """Well overview tab""" return wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "87vh" }, children=[ buttons(get_uuid), controls(get_uuid, data_models), filters(get_uuid, data_models), plot_settings(get_uuid), ], ), wcc.Frame( style={ "flex": 4, "height": "87vh" }, color="white", highlight=False, id=get_uuid(WellOverviewLayoutElements.GRAPH_FRAME), children=[ wcc.Graph(id=get_uuid(WellOverviewLayoutElements.GRAPH), ) ], ), ])
def layout(self) -> dcc.Tabs: return dcc.Tabs(children=[ dcc.Tab( label="Cross section & map view", children=[ wcc.FlexBox( id=self.ids("layout"), children=[ html.Div(style={"flex": 1}, children=self.left_flexbox_layout), html.Div( style={"flex": 1.5}, children=self.cross_section_widgets_layout, ), ], ) ], ), dcc.Tab( label="Target Points", children=[html.Div(children=self.target_points_tab_layout)], ), dcc.Tab(label="Well Points", children=[self.well_points_tab_layout]), ])
def __init__(self, tab_label: str, selections_layout: Optional[list], main_layout: list) -> None: flex_children = [] if selections_layout is not None: flex_children.append( wcc.Frame( style={ "flex": 1, "height": LayoutStyle.MAIN_HEIGHT, "overflowY": "auto", }, children=selections_layout, )) flex_children.append( wcc.Frame( style={ "flex": 5, "height": LayoutStyle.MAIN_HEIGHT }, color="white", highlight=False, children=main_layout, )) super().__init__( label=tab_label, value=tab_label, children=wcc.FlexBox(children=flex_children), )
def main_layout(self) -> html.Div: return html.Div(children=[ html.Div( style={ "height": "40vh", "overflow-y": "auto" }, children=[ wcc.FlexBox(children=[ wcc.FlexColumn( [ self.overview_report_volume_changes, ], flex=7, style={"margin-right": "20px"}, ), wcc.FlexColumn(self.dataset_info, flex=3), ], ), ], ), html.Div( style={"margin-top": "20px"}, children=[ wcc.Header("QC_FLAG descriptions", style=LayoutStyle.HEADER), dcc.Markdown(qc_flag_description()), ], ), ])
def main_layout(self, dframe: pd.DataFrame, selectors: list, map_figure: go.Figure) -> html.Div: return html.Div(children=[ wcc.Header("Maximum capillary pressure scaling", style=LayoutStyle.HEADER), wcc.FlexBox( style={ "margin-top": "10px", "height": "40vh" }, children=[ wcc.FlexColumn( dcc.Markdown(pc_columns_description()), flex=7, style={"margin-right": "40px"}, ), wcc.FlexColumn( FullScreen( wcc.Graph( style={ "height": "100%", "min-height": "35vh" }, figure=map_figure, )), flex=3, ), ], ), self.create_max_pc_table(dframe, text_columns=selectors), ])
def main_layout( self, main_figure: go.Figure, map_figure: go.Figure, qc_volumes: dict, ) -> wcc.FlexBox: return wcc.FlexBox(children=[ wcc.FlexColumn( flex=4, children=wcc.Graph( style={"height": "85vh"}, id=self.get_uuid(LayoutElements.MAIN_FIGURE), figure=main_figure, ), ), wcc.FlexColumn( flex=1, children=[ FullScreen( wcc.Graph( responsive=True, style={ "height": "100%", "min-height": "45vh" }, id=self.get_uuid(LayoutElements.MAP_FIGURE), figure=map_figure, )), self.info_box(qc_volumes, height="35vh"), ], ), ])
def property_response_view(parent) -> wcc.FlexBox: return wcc.FlexBox( style={"margin": "20px"}, children=[ html.Div(style={"flex": 1}, children=selector_view(parent=parent)), html.Div( style={ "flex": 2, "height": "80vh" }, className="framed", children=[ html.Div( style={"height": "38vh"}, children=timeseries_view(parent=parent), ), html.Div( style={"height": "39vh"}, children=surface_view(parent=parent, tab="response") if parent.surface_folders is not None else None, ), ], ), correlation_view(parent=parent), ], )
def map_layout(self): return wcc.FlexBox(children=[ dcc.Dropdown( id=self.ids("surface-name"), options=[{ "label": name, "value": name } for name in self.surfacenames], value=self.surfacenames[0], clearable=False, multi=False, ), dcc.Dropdown( id=self.ids("surface-type"), options=[{ "label": name, "value": name } for name in [ "stddev", "mean", "p10", "p90", "minimum", "maximum", ]], value="stddev", clearable=False, multi=False, ), ], )
def layout(self): return wcc.FlexBox(children=[ html.Div( style={"flex": 1}, children=[ self.matrix_plot, html.Div( style={"padding": "5px"}, children=[ html.Label( "Set ensemble in all plots:", style={"font-weight": "bold"}, ), Widgets.dropdown_from_dict( self.ids("ensemble-all"), self.ensembles), ], ), ], ), html.Div( style={"flex": 1}, children=[ html.Div( style={"height": "400px"}, children=[wcc.Graph(id=self.ids("scatter"))], ) ] + self.control_div, ), ])
def layout(self) -> html.Div: return html.Div( [ wcc.Header( f"Disk usage on {self.scratch_dir} per user as of {self.date}", style={"text-align": "center"}, ), wcc.FlexBox( children=[ wcc.Frame( color="white", children=wcc.FlexColumn( wcc.Graph( figure=self.pie_chart, config={"displayModeBar": False}, ) ), ), wcc.Frame( color="white", children=wcc.FlexColumn( flex=2, children=wcc.Graph(figure=self.bar_chart), ), ), ] ), ] )
def layout(self): return wcc.FlexBox( id=self.ids("layout"), children=[ html.Div(style={"flex": 1}, children=self.surface_layout), html.Div(style={"flex": 1}, children=self.seismic_layout), ], )
def layout(self) -> wcc.FlexBox: return wcc.FlexBox(children=[ html.Div( style={"flex": 1}, children=[ self.well_layout, self.surface_names_layout, self.seismic_layout, self.ensemble_layout, self.marginal_log_layout, self.intersection_option, ], ), html.Div( id=self.ids("viz_wrapper"), style={ "position": "relative", "flex": 8 }, children=[ html.Div(wcc.Graph(id=self.ids("graph"))), html.Div( id=self.ids("map_wrapper"), style={ "position": "absolute", "width": "30%", "height": "40%", "right": 100, "top": 350, "zIndex": 10000, "visibility": "hidden", }, children=[ self.map_layout, LeafletMap( id=self.ids("map"), layers=[], unitScale={}, autoScaleMap=True, minZoom=-5, updateMode="update", mouseCoords={"position": "bottomright"}, colorBar={"position": "bottomleft"}, ), ], ), html.Button( style={"float": "right"}, id=self.ids("show_map"), children="Show map", ), dcc.Store(id=self.ids("fencespec"), storage_type="session", data=[]), ], ), ], )
def surface_layout(self): """Layout for surface section""" return html.Div(children=[ wcc.FlexBox(children=[ html.Div(children=[ html.Label( style={ "font-weight": "bold", "textAlign": "center", }, children="Select surface", ), dcc.Dropdown( id=self.ids("surface"), options=[{ "label": name, "value": path } for name, path in zip(self.surfacenames, self.surfacefiles)], value=self.surfacefiles[0], clearable=False, ), ]), html.Div(children=[ dcc.RadioItems( id=self.ids("surface-type"), options=[ { "label": "Display surface z-value", "value": "surface", }, { "label": "Display seismic attribute as z-value", "value": "attribute", }, ], value="surface", ), ], ), ], ), html.Div(children=[ html.Div( style={ "marginTop": "20px", "height": "800px", "zIndex": -9999, }, children=LayeredMap( id=self.ids("map-view"), draw_toolbar_polyline=True, hillShading=True, layers=[], ), ) ]), ])
def layout(self) -> html.Div: """Returns a table with dataframe columns and clickable color column Add this to the layout of the plugin""" return html.Div( style={ "fontSize": "0.8em", "height": "600px", "fontColor": "black", }, children=[ dcc.Store( id=self.color_store_id, data=list(self._dframe["COLOR"].values), storage_type="session", ), wcc.FlexBox( style={"display": "flex"}, children=[ html.Div( style={ "flex": 2, "overflowY": "scroll", "height": "550px" }, children=dash_table.DataTable( id={ "id": self._uuid, "element": "table" }, fixed_rows={"headers": True}, columns=self._columns, style_header={ "opacity": 0.5, }, data=self._dframe.to_dict("records"), style_data_conditional=self. data_style_in_table, ), ), html.Div( id={ "id": self._uuid, "element": "pickerwrapper" }, style={"flex": 1}, children=[ html.Label( "Click on a table row to get a color picker", style={"padding": "15px"}, ) ], ), ], ), ], )
def layout(self): return wcc.FlexBox( style={ "padding-top": 10, }, children=[ html.Div(style={"flex": "1"}, children=self.control_div), html.Div(style={"flex": "3"}, children=self.plot_fig), ], )
def map_view_layout(self) -> html.Div: return html.Div(children=[ wcc.FlexBox(children=[ html.Div(children=[ html.Label( style={ "font-weight": "bold", "textAlign": "center", }, children="Select surface", ), dcc.Dropdown( id=self.ids("map-dropdown"), options=[{ "label": name, "value": name } for name in self.surfacenames], value=self.surfacenames[0], clearable=False, persistence=True, persistence_type="session", ), ]), ], ), html.Div( style={ "marginTop": "0px", "height": "800px", "zIndex": -9999, }, children=[ # pylint: disable=no-member webviz_subsurface_components.LeafletMap( id=self.ids("layered-map"), layers=[], unitScale={}, autoScaleMap=True, minZoom=-19, drawTools={ "drawMarker": False, "drawPolygon": False, "drawPolyline": True, "position": "topright", }, switch={ "value": False, "disabled": False, "label": "Hillshading", }, mouseCoords={"position": "bottomright"}, colorBar={"position": "bottomright"}, ), ], ), ])
def layout(self): """Main layout""" return wcc.FlexBox( id=self.uuid("layout"), children=[ html.Div(style={"flex": 1}, children=self.control_layout), html.Div( style={"flex": 3}, children=wcc.Graph(id=self.uuid("paralell-coords-plot")), ), ], )
def property_response_view( get_uuid: Callable, property_model: PropertyStatisticsModel, vector_model: Union[SimulationTimeSeriesModel, ProviderTimeSeriesDataModel], surface_folders: Optional[Dict], ) -> wcc.FlexBox: return wcc.FlexBox( style={"margin": "20px"}, children=[ wcc.FlexColumn(children=wcc.Frame( style={ "height": "80vh", "overflowY": "auto" }, children=selector_view( get_uuid=get_uuid, property_model=property_model, vector_model=vector_model, surface_folders=surface_folders, ), )), wcc.FlexColumn( flex=4, children=wcc.Frame( style={"height": "80vh"}, color="white", highlight=False, children=[ html.Div( style={"height": "38vh"}, children=timeseries_view(get_uuid=get_uuid), ), html.Div( style={"height": "39vh"}, children=surface_view(get_uuid=get_uuid, tab="response") if surface_folders is not None else None, ), ], ), ), wcc.FlexColumn( flex=4, children=wcc.Frame( style={"height": "80vh"}, color="white", highlight=False, children=correlation_view(get_uuid=get_uuid), ), ), ], )