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

Add color scale setting #632

Merged
merged 33 commits into from
Feb 9, 2024
Merged

Conversation

gen740
Copy link
Member

@gen740 gen740 commented Sep 27, 2023

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

Fixes #426.

What does this implement/fix? Explain your changes.

  • Add the color theme Setting page to the study detail section.
  • Add plotly color themes.

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f838ef5) 69.07% compared to head (280f6a5) 69.39%.
Report is 1 commits behind head on main.

❗ Current head 280f6a5 differs from pull request most recent head 4b74031. Consider uploading reports for the commit 4b74031 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #632      +/-   ##
==========================================
+ Coverage   69.07%   69.39%   +0.31%     
==========================================
  Files          35       35              
  Lines        2393     2369      -24     
==========================================
- Hits         1653     1644       -9     
+ Misses        740      725      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@c-bata c-bata self-assigned this Sep 28, 2023
optuna_dashboard/index.html Outdated Show resolved Hide resolved
@c-bata c-bata removed their assignment Oct 31, 2023
@HideakiImamura HideakiImamura self-assigned this Oct 31, 2023
Copy link
Member

@HideakiImamura HideakiImamura left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I have several comments. PTAL.

optuna_dashboard/ts/components/PlotlyDarkMode.ts Outdated Show resolved Hide resolved
optuna_dashboard/ts/components/Settings.tsx Outdated Show resolved Hide resolved
@not522
Copy link
Member

not522 commented Nov 1, 2023

@nabenabe0928 Could you review this PR?

@nabenabe0928
Copy link
Collaborator

@nabenabe0928 Could you review this PR?

Sure!

Copy link
Member

@HideakiImamura HideakiImamura left a comment

Choose a reason for hiding this comment

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

LGTM.

As a follow-up, it would be great to save the configuration of the setting page in the some storage to maintain the configuration over the page reload, etc.

@nabenabe0928
Copy link
Collaborator

Sorry for the late response, but now I am working on the review!

Copy link
Collaborator

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!
I am still working on the review, but the first yet most important point is that GraphRank.tsx is missing the color scale setting (yes, I know that rank plot was added recently), so could you apply the same modification to it as well?

Copy link
Collaborator

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

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

Still work in progress, but checked App.tsx and AppDrawer.tsx.

selected={page === "settings"}
>
<ListItemIcon sx={styleListItemIcon}>
<SettingsIcon />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it better with ColorLens?
Optionally, I would like to discuss if "settings" is an appropriate name for this feature because the name is too general.
If we add any further configurations here in the future, I am definitely for it:)

@HideakiImamura HideakiImamura removed their assignment Nov 20, 2023
Copy link
Member

@keisuke-umezawa keisuke-umezawa left a comment

Choose a reason for hiding this comment

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

I left some review comments. Could you check them?

<ListItem key="Settings" disablePadding sx={styleListItem}>
<ListItemButton
component={Link}
to={`${URL_PREFIX}/studies/${studyId}/settings`}
Copy link
Member

Choose a reason for hiding this comment

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

This settings seem to be shared among every study. In that case, the url should be${URL_PREFIX}/settings?

Copy link
Member

Choose a reason for hiding this comment

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

I understand the situation, and you want to remember study_id by url, and go back to previous study page.

Copy link
Member

Choose a reason for hiding this comment

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

How about using pop-up to show setting page? I roughly created my example here, although it is very early implementation and needs improvement.

Some reasons:

  1. You can use ${URL_PREFIX}/settings instead of "${URL_PREFIX}/studies/${studyId}/settings" here.
  2. You can show change during tweaking theme on settings.

Copy link
Member

Choose a reason for hiding this comment

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

Also, the place of setting should be below because it is for setting for all pages, imo.
スクリーンショット 2024-01-01 11 49 14

You can see this example here

optuna_dashboard/ts/components/GraphContour.tsx Outdated Show resolved Hide resolved
Comment on lines +51 to +54
<MenuItem value={"default"}>Default</MenuItem>
<MenuItem value={"seaborn"}>Seaborn</MenuItem>
<MenuItem value={"presentation"}>Presentation</MenuItem>
<MenuItem value={"ggplot2"}>GGPlot2</MenuItem>
Copy link
Member

Choose a reason for hiding this comment

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

Those templates seem to be for Light mode. Should we only provide templates compatible for dark mode?

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, there is only one dark template provided in Plotly's GitHub repository. To offer multiple dark mode templates, we should create original color templates. Therefore, adding (or modifying) an additional dark template could be a suitable follow-up.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. I understand.

@keisuke-umezawa
Copy link
Member

@gen740
It looks good to me, and work well in my local env.
In the future, it is better to store those settings somewhere even if we can use the settings when reloading.
Could you make an issue for it to keep it in mind after merging it?

@c-bata @nabenabe0928
Do you want to check this PR again as you requested changes?

@gen740
Copy link
Member Author

gen740 commented Jan 21, 2024

I've realized there is a bug that needs to be fixed. Could we please wait to merge this until it's resolved?

@gen740
Copy link
Member Author

gen740 commented Jan 21, 2024

@keisuke-umezawa
The bug has been fixed. Could you please take another look? Thank you!

@c-bata c-bata dismissed stale reviews from nabenabe0928 and themself January 22, 2024 03:30

Seems resolved

@c-bata
Copy link
Member

c-bata commented Jan 22, 2024

@keisuke-umezawa I've dismissed reviews from both me and @nabenabe0928 since we've been unassigned from this PR. Please merge this PR after checking the latest changes

@c-bata c-bata removed their assignment Jan 22, 2024
@keisuke-umezawa
Copy link
Member

@gen740
Sorry for being late. I set auto-merge. Could you resolve conflicts?

@gen740
Copy link
Member Author

gen740 commented Feb 6, 2024

@keisuke-umezawa
I've resolved the conflicts, so please proceed with the merge. Thank you!

@keisuke-umezawa keisuke-umezawa merged commit f32c497 into optuna:main Feb 9, 2024
8 checks passed
@gen740 gen740 deleted the add_color_scale_setting branch February 9, 2024 01:49
c-bata added a commit that referenced this pull request Feb 14, 2024
…ollow-up

Follow up of #632 (Add color scale setting) & #806 (Add "use plotlypy" button)
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.

Toggling dark mode doesn't change the plotly colour pallete
6 participants