Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New plotting page #110

Merged
merged 11 commits into from
Feb 2, 2021
Merged

New plotting page #110

merged 11 commits into from
Feb 2, 2021

Conversation

ManInFez
Copy link
Contributor

@ManInFez ManInFez commented Jan 26, 2021

This is the start of having a single page, and user defined layout of various plots (param distributions, response plots, etc...). As of now only response plots are visible.

New selection widget should be included as soon as parallel coord is merged

Persistence for ensemble selector and response selector is now working (sort of)

resolves #72

@ManInFez ManInFez changed the title New plotting page WIP: New plotting page Jan 26, 2021
Copy link
Contributor

@autt autt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this new way of selecting multiple responses! How about adding a label with the response name to each plot, so its clear which plot is showing which response when multiple responses are selected?

@ManInFez ManInFez force-pushed the new-plotting-page branch 2 times, most recently from 52a8c6f to 26430cd Compare February 1, 2021 09:53
@ManInFez ManInFez force-pushed the new-plotting-page branch 2 times, most recently from 25f5360 to 2a137ee Compare February 1, 2021 10:40
@ManInFez ManInFez changed the title WIP: New plotting page New plotting page Feb 1, 2021
@ManInFez ManInFez force-pushed the new-plotting-page branch 3 times, most recently from 7a8e5ca to 5076b88 Compare February 1, 2021 12:06
@@ -107,7 +107,7 @@
"margin": {
"l": 5,
"b": 5,
"t": 5,
"t": 25,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we want to increase margin?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes the menu was covering the top plot in the legend

n_clicks = 0 if n_clicks is None else n_clicks
if n_clicks % 2 == 0:
def update_ensemble_selector_view_size(
n_clicks, class_name, class_name_container, maximized
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like n_clicks is not in use anymore, maybe it can be replaced by underscore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -58,7 +58,10 @@ def update_ensemble_selector(selected_ensembles, _, elements):
ctx = dash.callback_context
triggered_id = ctx.triggered[0]["prop_id"].split(".")[0]

if triggered_id == parent.uuid("ensemble-selection-store"):
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, maybe, make the function name more descriptive for update_ensemble_selector? Function update_ensemble_selection is fine!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to update_ensemble_selector_graph

@ManInFez ManInFez force-pushed the new-plotting-page branch 2 times, most recently from 78d4f25 to 4ce78cb Compare February 1, 2021 13:43
@@ -0,0 +1,88 @@
# Could go into seperate file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this comment can be removed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

)
def update_parameter_options(selected_ensembles):
def update_parameter_options(selected_ensembles, _, prev_plot_selection):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want an underscore prefix here? (And on the rest of all callback functions?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually rather have it only on functions in the files that are not callbacks ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense 👍 I was just wondering as some callback functions has underscore prefixes and some does not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a commit to clean up the style :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I like consistency 👍

@@ -73,6 +76,7 @@ def update_ensemble_selector(selected_ensembles, _, elements):
element["data"].update(
Copy link
Contributor

@xjules xjules Feb 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This updates ensemble regardless it's selected or not, is it intentional? Ok, got it now :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, because it should remove the color if it is not selected

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I deleted the comment as I grasped the code in the end :)

@ManInFez ManInFez force-pushed the new-plotting-page branch 2 times, most recently from c737a41 to 7cdd4e4 Compare February 1, 2021 14:00
if not selected_ensembles:
raise PreventUpdate

if dash.callback_context.triggered[0]["prop_id"].split(".")[0] == parent.uuid(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter-selector is not longer among inputs, so can go away I reckon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has already been removed 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still see it there though:

if dash.callback_context.triggered[0]["prop_id"].split(".")[0] == parent.uuid(
            "parameter-selector"
        ):
            bin_count = None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed now

)
def _update_histogram(parameter, hist_check_values, bin_count, selected_ensembles):
def update_histogram(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the prior checkbox gone?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, the check-box prior is there again - weird ... need to do some more tests or it might be some caching issue :)

@xjules
Copy link
Contributor

xjules commented Feb 1, 2021

Could you also replace in multi_response_controller.py (in func. def _get_realizations_statistics_plots)

style.update({"line": {"color": color}})

which actually overwrites the entire line style just the color only

to:

style["line"]["color"] = color
style_mean = deepcopy(style)
style_mean["line"]["dash"] = "solid"

while updating the mean

mean_data = PlotModel(
        x_axis=x_axis, y_axis=_mean, text="Mean", name="Mean", **style_mean
)

@ManInFez
Copy link
Contributor Author

ManInFez commented Feb 2, 2021

Could you also replace in multi_response_controller.py (in func. def _get_realizations_statistics_plots)

style.update({"line": {"color": color}})

which actually overwrites the entire line style just the color only

to:

style["line"]["color"] = color
style_mean = deepcopy(style)
style_mean["line"]["dash"] = "solid"

while updating the mean

mean_data = PlotModel(
        x_axis=x_axis, y_axis=_mean, text="Mean", name="Mean", **style_mean
)

I thnk this is outside the scope of this issue..... it is already quite big

@oysteoh
Copy link
Contributor

oysteoh commented Feb 2, 2021

Looks very good! One "annoying" thing - at least for me - is that i really want an opportunity to shuffle around the charts after i've added what i want.... 🤔 Not sure if it is possible or wise to this right now, just a thought i had while using it 😄

@ManInFez
Copy link
Contributor Author

ManInFez commented Feb 2, 2021

I do not think that will be possible with setup as it is today.. Could be something to investigate in the future

parameters = [] if not parameters else parameters
responses = [] if not responses else responses
current_selection = [] if not current_selection else current_selection
for plot in current_selection.copy():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work? Is the copy created upfront or every cycle a new copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only in the beginning

Copy link
Contributor

@xjules xjules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and worked smoothly! Very good job!

@ManInFez ManInFez merged commit 361c548 into master Feb 2, 2021
@ManInFez ManInFez deleted the new-plotting-page branch February 2, 2021 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split parameters / responses into two pages
4 participants