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

Implement expand button for Vitessce #1651

Merged
merged 21 commits into from
Aug 24, 2023
Merged

Conversation

ivababukova
Copy link
Contributor

@ivababukova ivababukova commented Aug 21, 2023

Fixes #1570

Background

Change List

  • Added a button that can expand or collapse the view under react-grid-layout on click.
  • Expanding or collapsing is regulated with css similarly to how dark/light mode works. The button changes the value of data-expanded propertly. In css, there are 2 types of style defined: for when data-expanded=expanded and for when it is not.
  • Moved the Edit button to appear on the top right of the screen, side by side with the Expand/Collapse button.

Here are screenshots of how this looks in collapsed and expanded mode:

Screenshot 2023-08-22 at 12 51 17 Screenshot 2023-08-22 at 12 51 06

Checklist

  • Ensure PR works with all demos on the dev.vitessce.io homepage
  • Open (draft) PR's into vitessce-python and vitessce-r if this is a release PR
  • Documentation added or updated

@@ -27,6 +27,7 @@ export const useVitessceContainerStyles = makeStyles(theme => ({
transition: 'height 200ms ease',
// Custom
height: 'auto',
marginTop: '30px',
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 did not find a better way to make the react-grid-layout not render on top of the "Expand/Collapse" button. It is because of the usage of position: absolute in expandButtonContainer, which is necessary for the button to be rendered on the right side of the screen

@github-actions
Copy link
Contributor

github-actions bot commented Aug 21, 2023

Size Change: +7.27 kB (0%)

Total Size: 11.4 MB

Filename Size Change
./packages/main/prod/dist/index-********.js 6.94 MB +7.27 kB (0%)
ℹ️ View Unchanged
Filename Size
./packages/main/prod/dist/deflate-********.js 243 B
./packages/main/prod/dist/hglib-********.js 4.34 MB
./packages/main/prod/dist/index.min.js 687 B
./packages/main/prod/dist/jpeg-********.js 15.3 kB
./packages/main/prod/dist/lerc-********.js 47.2 kB
./packages/main/prod/dist/lzw-********.js 2.1 kB
./packages/main/prod/dist/packbits-********.js 576 B
./packages/main/prod/dist/pako.esm-********.js 68.6 kB
./packages/main/prod/dist/raw-********.js 168 B
./packages/main/prod/dist/webimage-********.js 872 B

compressed-size-action

Comment on lines 218 to 224
.vitessceClear {
text-align: center;
text-align: right;
width: 100%;
margin-bottom: 10px;
padding: 10px;
display: 'flex';
flex: 1;
margin-top: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

so that the "Edit" button appears on the top right side of the screen, side by side with the Demo description

@github-actions
Copy link
Contributor

github-actions bot commented Aug 21, 2023

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.45% 9262 / 11806
🔵 Statements 78.45% 9262 / 11806
🔵 Functions 65.6% 267 / 407
🔵 Branches 79.2% 880 / 1111
File CoverageNo changed files found.
Generated in workflow #3127

@keller-mark
Copy link
Member

Hi @ivababukova , thanks! Is there a way to do this without modifying any code in packages/, only in sites/docs? We would not want this change to affect how Vitessce is rendered/styled in any other apps / websites that are currently using it.

It should be possible as this is how the HuBMAP Portal implements the expand button, with only code outside of the Vitessce core https://portal.hubmapconsortium.org/browse/dataset/664b8227e17ee2a35a504dd8c19c2531

@ivababukova
Copy link
Contributor Author

ivababukova commented Aug 21, 2023

Hi @ivababukova , thanks! Is there a way to do this without modifying any code in packages/, only in sites/docs? We would not want this change to affect how Vitessce is rendered/styled in any other apps / websites that are currently using it.

It should be possible as this is how the HuBMAP Portal implements the expand button, with only code outside of the Vitessce core https://portal.hubmapconsortium.org/browse/dataset/664b8227e17ee2a35a504dd8c19c2531

@keller-mark can you point me to the source code of how the expand button for HuBMAP Portal was implemented?

@ivababukova
Copy link
Contributor Author

ivababukova commented Aug 22, 2023

@keller-mark I reimplemented this only modifying files under sites/docs. See the updated screenshots in the PR description for how it looks like. Can you review the code?

@keller-mark
Copy link
Member

Hi @ivababukova, great to see the new implementation. Some comments:

  • The bottom of the Vitessce component is cut off in expanded mode, can this be addressed?
  • When I resize the browser window in expanded mode all of the views shift to the top and overlap each other

@ivababukova
Copy link
Contributor Author

Hi @ivababukova, great to see the new implementation. Some comments:

  • The bottom of the Vitessce component is cut off in expanded mode, can this be addressed?
  • When I resize the browser window in expanded mode all of the views shift to the top and overlap each other

Thanks for the review @keller-mark I have fixed those two issues, can you take another look at the PR?

@keller-mark
Copy link
Member

The browser window resizing still did not work in expanded mode - while the vitessce views did not collapse, the width of the full vitessce component did not change during resizing, i think due to the fixed positioning. I just merged a PR into this branch to fix that and ensure all positioning is absolute or relative

@keller-mark keller-mark merged commit 6762b92 into main Aug 24, 2023
@keller-mark keller-mark deleted the ivababukova/expand-option branch August 24, 2023 19:54
@github-actions github-actions bot mentioned this pull request Aug 24, 2023
@ivababukova
Copy link
Contributor Author

The browser window resizing still did not work in expanded mode - while the vitessce views did not collapse, the width of the full vitessce component did not change during resizing, i think due to the fixed positioning. I just merged a PR into this branch to fix that and ensure all positioning is absolute or relative

Thank you for checking this thoroughly and fixing it, Mark! I didn't notice this problem when I tested for this case

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.

Expand button for vitessce.io (with smaller default <Vitessce/> dimensions)
2 participants