Research regarding react-grid-layout #179
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K#179
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need to research and test how to implement the card functionality provided by the library react-card-grid. Feel free to test whatever you deem to be relevant and provide comments and gifs/screenshot if possible in issue comments.
Documentation: https://github.com/react-grid-layout/react-grid-layout
Parent Issues: #106 #134 #133
I added following code to a separate file in the app folder and got the following result. One can change the width and height of the space the card should occupy. Important to note that in the constant layout, i represent the key in the div. So each card will need an id.
Opinion on library:
Overall the react-grid-layout is responsive and simple to use and prototype.
The only downside is default highlight color. The good thing is it is easily editable in CSS.
The functionality of dragging, sizing, and placing is preimplemented in the library, so no implementation is needed for this project. But modifications can be added if necessary.
Testing:
I prototyped a simple dashboard using three cards (the existing cards) and it works well. There is a negative side with the card not resizing vertically, but again, it has a simple solution of writing more CSS code for the card. The issue is when resizing vertically, it can take space without showing as displayed in the images and gif.
For this prototype i used only three cards using the following code:
However, if the dashboard needs more cards to be added the simplest way is as follows:
Looks really good, thanks for supplying gifs!
There is an option for the layout where all cards start taking up the same amount of space, could be worth using. It changes sizes of cards depending on screen size (pc vs mobile view?). Could be combined with breakpoint.
And to change the compactor so that people can freely place cards anywhere on the screen, one simply adds following to the ReactGridLayout tag. Default value is vertical. It seems to be a bit glitched however, so one may need to look into that a bit more.. Saw that there is a "preventCollision" rule that could most likely solve the issue.
compactor={noCompactor} // horizontal, vertical, none