예제 #1
0
 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()),
             ],
         ),
     ])
예제 #2
0
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,
            ),
        ),
    ])
예제 #3
0
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),
                        ),
                    )
                ],
            ),
        ],
    )
예제 #4
0
 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),
     ])
예제 #5
0
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"), ),
                    )
                ],
            ),
        ],
    )
예제 #6
0
 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),
                         ),
                     ),
                 ]
             ),
         ]
     )
예제 #7
0
 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_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 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),
                ),
            ),
        ],
    )
예제 #10
0
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 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")),
                 ),
             ),
         ],
     )
예제 #12
0
 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),
             ),
         ]),
     )
예제 #13
0
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=[],
                                )
                            ],
                        ),
                    ],
                ),
            ),
        ]
    )
예제 #14
0
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 layout(self) -> wcc.FlexBox:
     return wcc.FlexBox(
         id=self.uuid("layout"),
         children=[
             wcc.FlexColumn(children=wcc.Frame(
                 style={"height": "90vh"},
                 children=[
                     wcc.Selectors(label="Ensembles",
                                   children=[self.delta_layout]),
                     wcc.Selectors(
                         label="Time series",
                         children=wsc.VectorSelector(
                             id=self.uuid("vectors"),
                             maxNumSelectedNodes=3,
                             data=self.vector_data,
                             persistence=True,
                             persistence_type="session",
                             selectedTags=self.plot_options.get(
                                 "vectors", [self.smry_cols[0]]),
                             numSecondsUntilSuggestionsAreShown=0.5,
                             lineBreakAfterTag=True,
                         ),
                     ),
                     wcc.Selectors(
                         label="Visualization",
                         id=self.uuid("visualization"),
                         children=[
                             wcc.RadioItems(
                                 id=self.uuid("statistics"),
                                 options=[
                                     {
                                         "label": "Individual realizations",
                                         "value": "realizations",
                                     },
                                     {
                                         "label": "Statistical lines",
                                         "value": "statistics",
                                     },
                                     {
                                         "label": "Statistical fanchart",
                                         "value": "fanchart",
                                     },
                                 ],
                                 value=self.plot_options.get(
                                     "visualization", "statistics"),
                             ),
                         ],
                     ),
                     wcc.Selectors(
                         label="Options",
                         id=self.uuid("options"),
                         children=[
                             wcc.Checklist(
                                 id=self.uuid("trace_options"),
                                 options=[{
                                     "label": val,
                                     "value": val
                                 } for val in ["History", "Histogram"]],
                                 value=["History"],
                             ),
                             html.Div(
                                 id=self.uuid("view_stat_options"),
                                 style={"display": "block"}
                                 if "statistics" in self.plot_options.
                                 get("visualization", ""
                                     ) else {"display": "none"},
                                 children=[
                                     wcc.Checklist(
                                         id=self.uuid("stat_options"),
                                         options=[{
                                             "label": val,
                                             "value": val
                                         } for val in [
                                             "Mean",
                                             "P10 (high)",
                                             "P50 (median)",
                                             "P90 (low)",
                                             "Maximum",
                                             "Minimum",
                                         ]],
                                         value=[
                                             "Mean",
                                             "P10 (high)",
                                             "P90 (low)",
                                         ],
                                     ),
                                 ],
                             ),
                         ],
                     ),
                     wcc.Selectors(
                         label="Calculations",
                         children=[self.from_cumulatives_layout],
                     ),
                 ],
             )),
             wcc.FlexColumn(
                 flex=4,
                 children=[
                     wcc.Frame(
                         style={"height": "90vh"},
                         highlight=False,
                         color="white",
                         children=wcc.Graph(
                             style={"height": "85vh"},
                             id=self.uuid("graph"),
                         ),
                     ),
                     dcc.Store(
                         id=self.uuid("date"),
                         storage_type="session",
                         data=json.dumps(self.plot_options.get(
                             "date", None)),
                     ),
                 ],
             ),
         ],
     )
 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,
                 ),
             ),
         ],
     )
예제 #17
0
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,
                    ),
                ),
            ], ),
        ),
    ], )
예제 #18
0
def parameter_response_view(
    get_uuid: Callable,
    parametermodel: ParametersModel,
    vectormodel: SimulationTimeSeriesModel,
    theme: WebvizConfigTheme,
) -> wcc.FlexBox:
    df = parametermodel.dataframe
    parameter_filter = ParameterFilter(
        uuid=get_uuid("parameter-filter"),
        dframe=df[df["ENSEMBLE"].isin(parametermodel.mc_ensembles)].copy(),
        reset_on_ensemble_update=True,
    )
    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=parameter_filter.layout,
                            ),
                        ),
                    ],
                ),
            ),
        ],
    )
예제 #19
0
def main_layout(
    get_uuid: Callable,
    ensemble_names: List[str],
    vector_selector_data: list,
    vector_calculator_data: list,
    predefined_expressions: List[ExpressionInfo],
    custom_vector_definitions: dict,
    realizations: List[int],
    disable_resampling_dropdown: bool,
    selected_resampling_frequency: Frequency,
    selected_visualization: VisualizationOptions,
    ensembles_dates: List[datetime.datetime],
    selected_vectors: Optional[List[str]] = None,
) -> html.Div:
    return wcc.FlexBox(
        id=get_uuid(LayoutElements.TOUR_STEP_MAIN_LAYOUT),
        children=[
            # Settings layout
            wcc.FlexColumn(
                id=get_uuid(LayoutElements.TOUR_STEP_SETTINGS_LAYOUT),
                children=wcc.Frame(
                    style={"height": "90vh"},
                    children=__settings_layout(
                        get_uuid=get_uuid,
                        ensembles=ensemble_names,
                        vector_selector_data=vector_selector_data,
                        vector_calculator_data=vector_calculator_data,
                        predefined_expressions=predefined_expressions,
                        custom_vector_definitions=custom_vector_definitions,
                        realizations=realizations,
                        disable_resampling_dropdown=disable_resampling_dropdown,
                        selected_resampling_frequency=selected_resampling_frequency,
                        selected_visualization=selected_visualization,
                        selected_vectors=selected_vectors,
                        ensembles_dates=ensembles_dates,
                    ),
                ),
            ),
            # Graph layout
            wcc.FlexColumn(
                flex=4,
                children=[
                    wcc.Frame(
                        style={"height": "90vh"},
                        highlight=False,
                        color="white",
                        children=[
                            wcc.Graph(
                                style={"height": "85vh"},
                                id=get_uuid(LayoutElements.GRAPH),
                            ),
                            dcc.Store(
                                # NOTE:Used to trigger graph update callback if data has
                                # changed, i.e. no change of regular INPUT html-elements
                                id=get_uuid(
                                    LayoutElements.GRAPH_DATA_HAS_CHANGED_TRIGGER
                                ),
                                data=0,
                            ),
                        ],
                    )
                ],
            ),
        ],
    )
 def layout(self) -> html.Div:
     """Main layout"""
     return wcc.FlexBox(
         id=self.uuid("layout"),
         children=[
             wcc.FlexColumn(
                 flex=1,
                 children=wcc.Frame(
                     style={"height": "90vh"},
                     children=[
                         wcc.Selectors(
                             label="Selectors",
                             children=[
                                 self.selector(
                                     "Ensemble",
                                     "ensemble",
                                     "ENSEMBLE",
                                 ),
                                 self.selector(
                                     "Grid source",
                                     "source",
                                     "SOURCE",
                                 ),
                                 self.response_selector,
                                 self.plot_selector,
                             ],
                         ),
                         wcc.Selectors(
                             label="Filters",
                             id=self.uuid("filters"),
                             children=self.filter_selectors,
                         ),
                     ],
                 ),
             ),
             wcc.FlexColumn(
                 flex=3,
                 children=wcc.Frame(
                     style={"height": "90vh"},
                     color="white",
                     highlight=False,
                     children=[
                         html.Div(
                             style={"height": "600px"},
                             id=self.uuid("graph-wrapper"),
                         ),
                         html.Div(
                             children=[
                                 html.Div(
                                     id=self.uuid("volume_title"),
                                     style={"textAlign": "center"},
                                     children="",
                                 ),
                                 html.Div(
                                     style={"fontSize": "15px"},
                                     children=DataTable(
                                         id=self.uuid("table"),
                                         sort_action="native",
                                         filter_action="native",
                                         page_action="native",
                                         page_size=10,
                                     ),
                                 ),
                             ],
                         ),
                     ],
                 ),
             ),
             wcc.FlexColumn(
                 flex=3,
                 children=wcc.Frame(
                     style={"height": "90vh"},
                     id=self.uuid("tornado-wrapper"),
                     color="white",
                     highlight=False,
                     children=[self.tornadoplot.layout],
                 ),
             ),
         ],
     )
def delta_avg_view() -> html.Div:
    return wcc.FlexColumn(children=[], )
def property_delta_view(
    get_uuid: Callable,
    property_model: PropertyStatisticsModel,
    surface_folders: Optional[Dict] = None,
) -> wcc.FlexBox:
    table_surf_options = [{"label": "Table view", "value": "table"}]
    if surface_folders is not None:
        table_surf_options.append({
            "label": "Surface view (click on bar in chart)",
            "value": "surface"
        })
    return wcc.FlexBox(
        style={"margin": "20px"},
        children=[
            wcc.FlexColumn(children=selector_view(
                get_uuid=get_uuid, property_model=property_model)),
            wcc.FlexColumn(
                flex=4,
                children=wcc.Frame(
                    color="white",
                    highlight=False,
                    style={"height": "80vh"},
                    children=[
                        wcc.RadioItems(
                            vertical=False,
                            id=get_uuid("delta-sort"),
                            options=[
                                {
                                    "label": "Sort by Average",
                                    "value": "Avg"
                                },
                                {
                                    "label": "Sort by Standard Deviation",
                                    "value": "Stddev",
                                },
                            ],
                            value="Avg",
                        ),
                        wcc.Graph(
                            id=get_uuid("delta-bar-graph"),
                            config={"displayModeBar": False},
                            style={"height": "75vh"},
                        ),
                    ],
                ),
            ),
            wcc.FlexColumn(
                flex=4,
                children=wcc.Frame(
                    style={"height": "80vh"},
                    color="white",
                    highlight=False,
                    children=[
                        wcc.RadioItems(
                            id=get_uuid("delta-switch-table-surface"),
                            vertical=False,
                            options=table_surf_options,
                            value="table",
                        ),
                        html.Div(id=get_uuid("delta-table-surface-wrapper")),
                    ],
                ),
            ),
        ],
    )
 def layout(self) -> wcc.FlexBox:
     return html.Div(
         id=self.uuid("layout"),
         children=[
             clientside_stores(
                 get_uuid=self.uuid,
                 realizations=self._realizations,
                 initial_settings=self._initial_settings,
             ),
             wcc.FlexBox(children=[
                 wcc.FlexColumn(
                     wcc.Frame(
                         style={
                             "height": "91vh",
                         },
                         children=[
                             html.Div(children=[
                                 wcc.Selectors(
                                     label="Intersection controls",
                                     children=intersection_data_layout(
                                         get_uuid=self.uuid,
                                         surface_attributes=self.
                                         _surf_attrs,
                                         surface_names=self._surfacenames,
                                         ensembles=self.ensembles,
                                         use_wells=self._use_wells,
                                         well_names=self._well_set_model.
                                         well_names if self.
                                         _well_set_model else [],
                                         surface_geometry=self.
                                         first_surface_geometry,
                                         initial_settings=self.
                                         _initial_settings.get(
                                             "intersection_data", {}),
                                     ),
                                 ),
                                 html.Div(
                                     id=self.uuid(
                                         "surface-settings-wrapper"),
                                     children=wcc.Selectors(
                                         label="Map controls",
                                         children=[
                                             map_data_layout(
                                                 uuid=self.uuid(
                                                     "map-settings"),
                                                 surface_attributes=self.
                                                 _surf_attrs,
                                                 surface_names=self.
                                                 _surfacenames,
                                                 ensembles=self.ensembles,
                                                 realizations=self.
                                                 _realizations,
                                                 use_wells=self._use_wells,
                                             )
                                         ],
                                     ),
                                 ),
                                 wcc.Selectors(
                                     label="Filters",
                                     children=[
                                         dialog.open_dialog_layout(
                                             uuid=self.uuid("dialog"),
                                             dialog_id="realization-filter",
                                             title="Realization filter",
                                         ),
                                     ],
                                 ),
                             ], ),
                         ],
                     )),
                 wcc.FlexColumn(
                     flex=6,
                     children=intersection_and_map_layout(
                         get_uuid=self.uuid),
                 ),
             ]),
             dialog.dialog_layout(
                 uuid=self.uuid("dialog"),
                 dialog_id="color",
                 title="Color settings",
                 size="lg",
                 children=[
                     html.Div(children=[self._color_picker.layout], ),
                 ],
             ),
             dialog.dialog_layout(
                 uuid=self.uuid("dialog"),
                 dialog_id="realization-filter",
                 title="Filter realizations",
                 children=[
                     realization_layout(
                         uuid=self.uuid("intersection-data"),
                         realizations=self._realizations,
                         value=self._initial_settings.get(
                             "intersection_data",
                             {}).get("realizations", self._realizations),
                     ),
                     dialog.clear_all_apply_dialog_buttons(
                         uuid=self.uuid("dialog"),
                         dialog_id="realization-filter"),
                 ],
             ),
             dialog.dialog_layout(
                 uuid=self.uuid("dialog"),
                 dialog_id="uncertainty-table",
                 title="Uncertainty table",
                 children=[
                     uncertainty_table_layout(
                         uuid=self.uuid("uncertainty-table"), )
                 ],
             ),
         ],
     )
 def delta_layout(self) -> html.Div:
     show_delta = "block" if self.allow_delta else "none"
     return html.Div(children=[
         html.Div(
             style={"display": show_delta},
             children=wcc.RadioItems(
                 label="Mode",
                 id=self.uuid("mode"),
                 style={"marginBottom": "0.5vh"},
                 options=[
                     {
                         "label": "Individual ensembles",
                         "value": "ensembles",
                     },
                     {
                         "label": "Delta between ensembles",
                         "value": "delta_ensembles",
                     },
                 ],
                 value="ensembles",
             ),
         ),
         wcc.Dropdown(
             wrapper_id=self.uuid("show_ensembles"),
             label="Selected ensembles",
             id=self.uuid("ensemble"),
             clearable=False,
             multi=True,
             options=[{
                 "label": i,
                 "value": i
             } for i in self.ensembles],
             value=[self.ensembles[0]],
         ),
         html.Div(
             id=self.uuid("calc_delta"),
             style={"display": "none"},
             children=[
                 wcc.Label("Selected ensemble delta (A-B):"),
                 wcc.FlexBox(children=[
                     wcc.FlexColumn(
                         min_width="100px",
                         children=wcc.Dropdown(
                             label="Ensemble A",
                             id=self.uuid("base_ens"),
                             clearable=False,
                             options=[{
                                 "label": i,
                                 "value": i
                             } for i in self.ensembles],
                             value=self.ensembles[0],
                         ),
                     ),
                     wcc.FlexColumn(
                         min_width="100px",
                         children=wcc.Dropdown(
                             label="Ensemble B",
                             id=self.uuid("delta_ens"),
                             clearable=False,
                             options=[{
                                 "label": i,
                                 "value": i
                             } for i in self.ensembles],
                             value=self.ensembles[-1],
                         ),
                     ),
                 ], ),
             ],
         ),
     ], )