def layout(self) -> wcc.FlexBox: """Main layout""" return wcc.FlexBox( id=self.uuid("layout"), children=[ wcc.FlexColumn( flex=1, children=wcc.Frame( style={"height": "80vh"}, children=[ wcc.Selectors(label="Controls", children=self.control_layout) ] + ([ wcc.Selectors( label="Filters", id=self.uuid("filters"), children=self.filter_layout, ) ] if self.response_filters else []), ), ), wcc.FlexColumn( flex=3, children=wcc.Frame( color="white", highlight=False, style={"height": "80vh"}, children=[ wcc.Graph( style={"height": "75vh"}, id=self.uuid("correlation-graph"), ), dcc.Store( id=self.uuid("initial-parameter"), storage_type="session", ), ], ), ), wcc.FlexColumn( flex=3, children=wcc.Frame( color="white", highlight=False, style={"height": "80vh"}, children=wcc.Graph(style={"height": "75vh"}, id=self.uuid("distribution-graph")), ), ), ], )
def layout(self) -> html.Div: return html.Div( id=self.uuid("layout"), children=wcc.FlexBox(children=[ wcc.FlexColumn(children=[ wcc.Frame( color="white", style={ "minWidth": "200px", "height": "400px" }, children=wcc.Graph( config={"displayModeBar": False}, id=self.uuid("inline"), ), ), wcc.Frame( color="white", style={ "minWidth": "200px", "height": "400px" }, children=wcc.Graph( config={"displayModeBar": False}, id=self.uuid("xline"), ), ), ], ), wcc.FlexColumn(children=[ wcc.Frame( color="white", style={ "minWidth": "200px", "height": "400px" }, children=wcc.Graph( config={"displayModeBar": False}, id=self.uuid("zslice"), ), ), html.Div(style={"height": "400px"}, children=self.settings_layout), ], ), dcc.Store( id=self.uuid("state-storage"), storage_type="session", data=json.dumps(self.init_state), ), ]), )
def tornado_plots_layout(uuid: str) -> html.Div: return html.Div(children=[ wcc.Frame( color="white", highlight=False, style={"height": "44vh"}, children=[ wcc.FlexBox(children=[ html.Div( style={"flex": 1}, children=wcc.Graph( id={ "id": uuid, "element": "bulktornado", "page": "tornado", }, config={"displayModeBar": False}, style={"height": "42vh"}, ), ), html.Div( style={"flex": 1}, children=wcc.Graph( id={ "id": uuid, "element": "inplacetornado", "page": "tornado", }, config={"displayModeBar": False}, style={"height": "42vh"}, ), ), ]) ], ), wcc.Frame( color="white", highlight=False, style={"height": "44vh"}, children=html.Div( id={ "id": uuid, "wrapper": "table", "page": "tornado" }, style={"display": "block"}, ), ), ])
def tab_view_layout(main_layout: list, sidebar_layout: list) -> wcc.FlexBox: return wcc.FlexBox( children=[ wcc.Frame( style={"flex": 1, "height": "87vh"}, children=sidebar_layout, ), wcc.Frame( style={"flex": 6, "height": "87vh"}, color="white", highlight=False, children=main_layout, ), ] )
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 layout(self) -> html.Div: return wcc.FlexBox([ wcc.Frame( style={ "height": "90vh", "flex": 1 }, children=[ wcc.Dropdown( label="Well", id=self.uuid("well"), options=[{ "label": name, "value": name } for name in self._well_set_model.well_names], value=self.initial_well_name, clearable=False, ), wcc.Dropdown( label="Log template", id=self.uuid("template"), options=[{ "label": name, "value": name } for name in list(self._log_templates.keys())], value=self.initial_log_template, clearable=False, ), ], ), wcc.Frame( style={ "flex": 6, "height": "90vh" }, children=[ WellLogViewerComponent( id=self.uuid("well-log-viewer"), template=self._log_templates.get( self.initial_log_template), welllog=xtgeo_well_logs_to_json_format( well=self._well_set_model.get_well( self.initial_well_name)), colorTables=self.colortables, ) ], ), ])
def dataset_info(self) -> html.Div: max_pc, min_pc = self.datamodel.pc_scaling_min_max wvol, hcvol = self.datamodel.vol_diff_total number_style = { "font-weight": "bold", "font-size": "17px", "margin-left": "20px", } data = [ ("HC Volume difference:", f"{hcvol:.2f} %"), ("Water Volume difference:", f"{wvol:.2f} %"), ("Maximum Capillary Pressure scaling:", f"{max_pc:.1f}"), ("Minimum Capillary Pressure scaling:", f"{min_pc:.3g}"), ] return wcc.Frame( style={"height": "90%"}, children=[ wcc.Header("Information", style=LayoutStyle.HEADER), self.information_dialog, wcc.Header("Key numbers", style=LayoutStyle.HEADER), html.Div([ html.Div([text, html.Span(num, style=number_style)]) for text, num in data ]), ], )
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 layout(self) -> html.Div: return wcc.FlexBox([ wcc.Frame( style={ "height": "90vh", "flex": 1 }, children=[ wcc.Dropdown( label="Well", id=self.uuid("well"), options=[{ "label": name, "value": name } for name in self._well_set_model.well_names], value=self._initial_settings.get( "well_name", self._well_set_model.well_names[0]), clearable=False, ), wcc.Dropdown( label="Log template", id=self.uuid("template"), options=[{ "label": name, "value": name } for name in list(self._log_templates.keys())], value=self._initial_settings.get( "logtemplate", list(self._log_templates.keys())[0]), clearable=False, ), ], ), wcc.Frame( style={ "flex": 6, "height": "90vh" }, children=[ WellLogViewerComponent( id=self.uuid("well-log-viewer"), template=self._log_templates[list( self._log_templates.keys())[0]], ) ], ), ])
def layout(self) -> wcc.FlexBox: return wcc.FlexBox(children=[ wcc.Frame(style={ "flex": "1", "height": "90vh" }, children=self.control_div), wcc.Frame( color="white", highlight=False, style={ "flex": "6", "height": "90vh" }, children=self.plot_fig, ), ], )
def parameter_qc_view(get_uuid: Callable, parametermodel: ParametersModel) -> wcc.FlexBox: return wcc.FlexBox(children=[ wcc.FlexColumn( wcc.Frame( style={"height": "80vh"}, children=selector_view(get_uuid=get_uuid, parametermodel=parametermodel), ), ), wcc.FlexColumn( flex=4, children=wcc.Frame( color="white", highlight=False, style={"height": "80vh"}, children=[ wcc.RadioItems( vertical=False, id=get_uuid("property-qc-plot-type"), options=[ { "label": "Distribution plots", "value": "distribution", }, { "label": "Box plots", "value": "box" }, { "label": "Statistics table", "value": "table" }, ], value="distribution", ), html.Div( style={ "height": "75vh", "margin-top": "20px" }, id=get_uuid("property-qc-wrapper"), ), ], ), ), ], )
def main_view( get_uuid: Callable, ensemble_names: List[str], data_column_names: List[str], parameter_names: List[str], realizations: List[int], initial_data: Dict, initial_layout: Dict, ) -> html.Div: return wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "90vh" }, children=[ data_stores(get_uuid=get_uuid), data_selectors_view( get_uuid=get_uuid, ensemble_names=ensemble_names, data_column_names=data_column_names, parameter_names=parameter_names, initial_data=initial_data, ), line_traces_view(get_uuid=get_uuid, ), highlight_realizations_view(get_uuid=get_uuid, realizations=realizations), plot_options_view(get_uuid=get_uuid, initial_layout=initial_layout), ], ), wcc.Frame( style={ "flex": 5, "height": "90vh" }, color="white", highlight=False, children=wcc.Graph(style={"height": "86vh"}, id=get_uuid("graph")), ), ])
def table_main_layout(uuid: str) -> html.Div: return wcc.Frame( id={ "id": uuid, "wrapper": "table", "page": "table" }, color="white", highlight=False, style={"height": "91vh"}, children=[], )
def comparison_qc_plots_layout( fig_diff_vs_real: Optional[go.Figure], fig_corr: go.Figure, fig_diff_vs_response: go.Figure, barfig: go.Figure, ) -> html.Div: real_plot = fig_diff_vs_real is not None return html.Div( children=[ html.Div( children=wcc.Graph( config={"displayModeBar": False}, style={"height": "21vh"}, figure=fig_diff_vs_real, ) if real_plot else [], ), wcc.FlexBox( style={"height": "31vh" if real_plot else "52vh"}, children=[ wcc.FlexColumn( children=wcc.Graph( config={"displayModeBar": False}, style={"height": "30vh" if real_plot else "51vh"}, figure=fig_diff_vs_response, ) ), wcc.FlexColumn( children=wcc.Graph( config={"displayModeBar": False}, style={"height": "30vh" if real_plot else "51vh"}, figure=fig_corr, ) ), ], ), wcc.Frame( style={"height": "29vh"}, children=[ wcc.Header("Highlighted data"), wcc.Graph( config={"displayModeBar": False}, style={"height": "25vh"}, figure=barfig, ) if barfig is not None else html.Div("No data within highlight criteria"), ], ), ] )
def custom_plotting_layout(uuid: str) -> html.Div: return wcc.Frame( color="white", highlight=False, style={"height": "91vh"}, children=[ wcc.RadioItems( id={ "id": uuid, "element": "plot-table-select" }, options=[ { "label": "Plot", "value": "graph" }, { "label": "Table", "value": "table" }, ], value="graph", vertical=False, ), html.Div( id={ "id": uuid, "wrapper": "graph", "page": "custom" }, style={"display": "inline"}, children=wcc.Graph( id={ "id": uuid, "element": "graph", "page": "custom" }, config={"displayModeBar": False}, style={"height": "85vh"}, ), ), html.Div( id={ "id": uuid, "wrapper": "table", "page": "custom" }, style={"display": "none"}, ), ], )
def layout(self) -> html.Div: return wcc.FlexBox(children=[ wcc.Frame( style={"flex": 1}, children=[ wcc.Selectors(label="Selectors", children=self.response_layout), wcc.Selectors( label="Filters", children=[ self.single_filter_layout, self.multi_filter_layout, ], ), ], ), wcc.Frame( color="white", highlight=False, style={"flex": 5}, children=self._tornado_widget.layout, ), ])
def settings_layout(self) -> wcc.FlexBox: """Layout for color and other settings""" return wcc.Frame( style={"width": "40%"}, children=[ html.Div( style={"width": "100%"}, children=wcc.Dropdown( label="Seismic cube", id=self.uuid("cube"), options=[{ "label": Path(cube).stem, "value": cube } for cube in self.segyfiles], value=self.segyfiles[0], clearable=False, ), ), html.Div(children=[ wcc.Label(children="Set colorscale", ), wcc.ColorScales( id=self.uuid("color-scale"), colorscale=self.initial_colors, nSwatches=12, ), ], ), html.Div(children=[ wcc.RangeSlider( label="Color range", id=self.uuid("color-values"), min=self.init_state["min_value"], max=self.init_state["max_value"], value=[ self.init_state["min_value"], self.init_state["max_value"], ], tooltip={"placement": "bottom"}, step=calculate_slider_step( min_value=self.init_state["min_value"], max_value=self.init_state["max_value"], steps=100, ), ), ], ), html.Button(id=self.uuid("color-reset"), children="Reset Range"), html.Button(id=self.uuid("zoom"), children="Reset zoom"), ], )
def layout(self) -> wcc.FlexBox: return wcc.FlexBox(children=[ wcc.Frame( style={ "flex": 1, "height": "90vh" }, children=[ wcc.Selectors( label="Ensemble in both plots", children=wcc.Dropdown( id=self.ids("ensemble-all"), options=[{ "label": k, "value": v } for k, v in self.ensembles.items()], value=list(self.ensembles.values())[0], clearable=False, ), ) ] + self.control_div, ), wcc.Frame( style={ "flex": 6, "height": "90vh" }, children=[ html.Div(children=[ self.matrix_plot, wcc.Graph(style={"height": "45vh"}, id=self.ids("scatter")), ], ) ], ), ])
def well_control_tab( get_uuid: Callable, data_models: Dict[str, EnsembleWellAnalysisData] ) -> wcc.FlexBox: return wcc.FlexBox( children=[ controls(get_uuid, data_models), wcc.Frame( style={"flex": 5, "height": "87vh"}, color="white", highlight=False, id=get_uuid(WellControlLayoutElements.GRAPH), children=[], ), ] )
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 convergence_plot_layout(uuid: str) -> html.Div: return wcc.Frame( color="white", highlight=False, style={"height": "91vh"}, children=[ wcc.Graph( id={ "id": uuid, "element": "plot", "page": "conv" }, config={"displayModeBar": False}, style={"height": "85vh"}, ) ], )
def plots_per_zone_region_layout(uuid: str, volumemodel: InplaceVolumesModel) -> html.Div: selectors = [ x for x in ["ZONE", "REGION", "FACIES"] if x in volumemodel.selectors ] height = max(88 / len(selectors), 25) layout = [] for selector in selectors: layout.append( wcc.Frame( color="white", highlight=False, style={"height": f"{height}vh"}, children=wcc.FlexBox(children=[ html.Div( style={"flex": 1}, children=wcc.Graph( id={ "id": uuid, "chart": "pie", "selector": selector, "page": "per_zr", }, config={"displayModeBar": False}, style={"height": f"{height}vh"}, ), ), html.Div( style={"flex": 3}, children=wcc.Graph( id={ "id": uuid, "chart": "bar", "selector": selector, "page": "per_zr", }, config={"displayModeBar": False}, style={"height": f"{height}vh"}, ), ), ]), )) return html.Div(layout)
def selector_view(get_uuid: Callable, property_model: PropertyStatisticsModel) -> html.Div: return wcc.Frame( style={ "height": "80vh", "overflowY": "auto" }, children=[ wcc.Selectors( label="Selectors", children=[ ensemble_selector( get_uuid=get_uuid, ensembles=property_model.ensembles, tab="delta", ), delta_ensemble_selector( get_uuid=get_uuid, ensembles=property_model.ensembles, tab="delta", ), property_selector( get_uuid=get_uuid, properties=property_model.properties, tab="delta", ), source_selector(get_uuid=get_uuid, sources=property_model.sources, tab="delta"), ], ), wcc.Selectors( label="Filters", children=[ filter_selector(get_uuid=get_uuid, property_model=property_model, tab="delta") ], ), ], )
def layout(self) -> html.Div: return wcc.FlexBox( children=[ html.Div( style={"flex": 5}, children=main_view( get_uuid=self.uuid, ensemble_names=self._ensemble_names, data_column_names=self._data_column_names, parameter_names=self._parameter_names, realizations=self._realizations, initial_data=self._initial_data, initial_layout=self._initial_layout, ), ), wcc.Frame( style={"flex": 1, "height": "90vh"}, children=self._parameter_filter.layout, ), ] )
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 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 layout(self) -> html.Div: return wcc.FlexBox( id=self.ids("layout"), children=[ wcc.FlexColumn( flex=1, children=wcc.Frame( style={"height": "90vh"}, children=[ wcc.Selectors( label="Selectors", children=[ self.ensemble_selector, self.smry_selector ], ), dcc.Store( id=self.ids("date-store"), storage_type="session", ), ], ), ), wcc.FlexColumn( flex=3, children=wcc.Frame( style={"height": "90vh"}, color="white", highlight=False, 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="", ), html.Div( style={"fontSize": "15px"}, children=dash_table.DataTable( id=self.ids("table"), sort_action="native", filter_action="native", page_action="native", page_size=10, ), ), ], ), ], ), ), wcc.FlexColumn( flex=3, children=wcc.Frame( style={"height": "90vh"}, color="white", highlight=False, id=self.ids("tornado-wrapper"), children=self.tornadoplot.layout, ), ), ], )
def layout(self): return wcc.FlexBox( id=self.ids("layout"), children=[ wcc.Frame( style={"flex": 1}, children=[ wcc.Selectors( label="Map settings", children=[ wcc.Dropdown( id=self.ids("surface"), label="Select surface", options=[{ "label": name, "value": path } for name, path in zip( self.surfacenames, self.surfacefiles)], value=self.surfacefiles[0], clearable=False, ), wcc.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", ), ], ), wcc.Selectors( label="Intersection settings", children=[ wcc.Dropdown( label="Select seismic cube", id=self.ids("cube"), options=[{ "label": Path(cube).stem, "value": cube } for cube in self.segyfiles], value=self.segyfiles[0], clearable=False, ), wcc.Label(children="Set colorscale", ), wcc.ColorScales( id=self.ids("color-scale"), colorscale=self.initial_colors, nSwatches=12, ), wcc.RangeSlider( label="Set color range", id=self.ids("color-values"), tooltip={ "placement": "bottom", "always_visible": True, }, marks=None, ), html.Button( id=self.ids("color-range-btn"), children="Reset Range", ), ], ), ], ), wcc.Frame( highlight=False, style={ "height": "800px", "flex": 3, }, children=[ LeafletMap( id=self.ids("map-view"), autoScaleMap=True, minZoom=-19, updateMode="update", layers=[], drawTools={ "drawMarker": False, "drawPolygon": False, "drawPolyline": True, "position": "topright", }, mouseCoords={"position": "bottomright"}, colorBar={"position": "bottomleft"}, switch={ "value": False, "disabled": False, "label": "Hillshading", }, ), ], ), html.Div( style={ "flex": 3, "height": "800px" }, children=[ wcc.Graph(config={"displayModeBar": False}, id=self.ids("fence-view")), ], ), ], )
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 parameter_response_view( get_uuid: Callable, parametermodel: ParametersModel, parameterfilter_layout: html.Div, vectormodel: SimulationTimeSeriesModel, theme: WebvizConfigTheme, ) -> wcc.FlexBox: return wcc.FlexBox(children=[ wcc.FlexColumn( flex=1, children=selector_view( get_uuid=get_uuid, parametermodel=parametermodel, vectormodel=vectormodel, theme=theme, ), ), wcc.FlexColumn( flex=4, children=wcc.FlexBox(children=[ wcc.FlexColumn( flex=2, children=[ wcc.Frame( style={"height": "38.5vh"}, color="white", highlight=False, children=timeseries_view(get_uuid=get_uuid), ), wcc.Frame( style={"height": "38.5vh"}, color="white", highlight=False, children=[ wcc.Graph( id=get_uuid("vector-vs-param-scatter"), config={"displayModeBar": False}, style={"height": "38vh"}, ) ], ), ], ), wcc.FlexColumn( flex=2, children=[ wcc.Frame( color="white", highlight=False, style={"height": "38.5vh"}, children=[ wcc.Graph( config={"displayModeBar": False}, style={"height": "38vh"}, id=get_uuid("vector-corr-graph"), ), ], ), wcc.Frame( color="white", highlight=False, style={"height": "38.5vh"}, children=[ wcc.Graph( config={"displayModeBar": False}, style={"height": "38vh"}, id=get_uuid("param-corr-graph"), ), ], ), ], ), wcc.FlexColumn( id=get_uuid("param-filter-wrapper"), style={"display": "none"}, flex=1, children=wcc.Frame( style={"height": "80vh"}, children=parameterfilter_layout, ), ), ], ), ), ], )