Skip to content

ViSR: Make plots size correctly - #164

Closed
Abigail-Yates wants to merge 8 commits into
pvws-tomoo-viewerfrom
ay/visr-plot-sizing
Closed

ViSR: Make plots size correctly #164
Abigail-Yates wants to merge 8 commits into
pvws-tomoo-viewerfrom
ay/visr-plot-sizing

Conversation

@Abigail-Yates

Copy link
Copy Markdown
Collaborator

This is the only solution I have found so far that achieves all 3 of these objectives:

  • Plots fill their parent box
  • SliceView plot resizes correctly when the controls drawer is opened and closed
  • Plots resize correctly when the window size is changed

The pay off for all 3 of these working is that when the window is resized, the whole React-Grid remounts, so we see a white screen whilst the window resizes and the grid/plots re-render.

This also has added 2 'Box' components around the Heatmap plot in SliceViewer.tsx which might be less ideal for making it a reusable component.

Other solutions I have found have only achieved max 2/3 of the list.

@Abigail-Yates Abigail-Yates changed the title Make Davidia plots fill parent boxes ViSR: Make Davidia plots fill parent boxes Aug 19, 2026
@Abigail-Yates

Copy link
Copy Markdown
Collaborator Author

I have got a slight variation on this locally where, for the Tomography view, only the slice view remounts, which could be slightly better.

@Abigail-Yates Abigail-Yates changed the title ViSR: Make Davidia plots fill parent boxes ViSR: Make plots size correctly Aug 20, 2026
@Abigail-Yates

Abigail-Yates commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

Another alternative is to make the plot remount when the controls drawer is opened/collapsed instead of when the window is resized - I think this is maybe the way to go.
SliceViewer can still be used generally - a 'resizeKey' is optional so does not need to be specified. If it is specified, then the plot will remount when the value changes.

@Abigail-Yates

Copy link
Copy Markdown
Collaborator Author

Covered in #176 which also fixes issues

@Abigail-Yates
Abigail-Yates deleted the ay/visr-plot-sizing branch August 28, 2026 09: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.

1 participant