Skip to content

Automatic layout of a pixel placed screen for React-Grid-Layout#203

Merged
GregJHarris merged 8 commits into
masterfrom
RGL-auto-layout
Jun 10, 2026
Merged

Automatic layout of a pixel placed screen for React-Grid-Layout#203
GregJHarris merged 8 commits into
masterfrom
RGL-auto-layout

Conversation

@GregJHarris

@GregJHarris GregJHarris commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

This adds the capability to automatically layout react grid layout displays using pixel placed displays.
At the heart of it is calculateDefaultLayout which takes a set of child items a screen width, columns and cell height and computes a first pass layout using the position and width of the child items. Child items are wrapped if the screen width is too narrow to accommodate them. The RGL verticalCompactor is then used to layout and resolve collisons in the y (columns). In addition for responsive screens the horizontalCompactor is also used.

Once a layout has been computed it is dispatched to update the file state, which causes a re-render using the new layout as the updated props are passed down.

I've moved the FileCache into a separate slice to improve separation of concerns.

@abigailalexander abigailalexander left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great, thanks for this change!

@GregJHarris GregJHarris merged commit d974986 into master Jun 10, 2026
2 checks passed
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.

2 participants