Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
docs: dashboard #814
docs: dashboard #814
Changes from 3 commits
dfe9b57
491495b
8f68a4f
bdb2f6d
e7e9de8
ebabf37
fd05e66
0d02a62
d9775e2
fe44d62
141520b
8b120b7
bbd470e
9663d9b
95353ad
d530e8b
e59ec3b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Panel should probably be mentioned here as well.
We should mention something about row/column being the "top" of the layout trees. Columns should go inside of rows and rows should go inside of columns when making a layout. You can put rows as children of rows and columns as children of columns, but it's basically a no-op I believe in terms of actual layout. Would need to double-check it doesn't do anything special.
row(row(column, column), column)
is the same visually asrow(column, column, column)
Stacks/panels are the "bottom" of the tree. Once you add a stack or panel, the layout in that section is effectively done. If you put a column inside a row, you'll get a flex column within the panel. That detail probably isn't necessary for dashboard though as it is more a column/row/panel detail.
We also implicitly wrap the children when necessary, so you don't have to be explicit about the entire layout if you don't need the extra props of the wrappers.
If you have other row/column siblings, the node will be wrapped in an appropriate row/column. If there are no row/column children, then nodes will be wrapped in stacks if needed.
row(component, component)
will becomerow(stack(component), stack(component))
whilerow(column(comp), comp)
will becomerow(column(comp), column(comp))
and finallyrow(column(stack(comp)), column(stack(comp)))
. They will actually wrap the comp in a panel as well, but I left that out of my example.The rules are basically as follows for automatic wrapping
[col, col]
as the child to dashboard)A final example on this.
dashboard([t1, t2])
would becomedashboard(column(stack(panel(t1)), stack(panel(t2))))
. It would follow rule 1, then 2b, then 3.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
row(row(column, column), column)
actually impacts the width of the panels. The two children of the outer row are given the same width so this results in the inner row splitting 50% of the width in two for each of its inner columns while the column not in the inner row fills up the remaining 50% of the outer row.So rather than AAA|BBB|CCC it's AA|BB|CCCC
I do still think we should push users to put columns in rows and vice versa to make defining their layouts simpler but I don't think we should say it's visually the same thing. Unless that behaviour I discovered above is unintended^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried condensing these points into two main sections: Layout Hierarchy and Automatic Wrapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put rows in rows for that exact reason recently, so I assume that is both intended and useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is intentional AFAIK in golden-layout. It's just something we normally don't do when normalizing layouts because we set width/height instead
These 2 should be equivalent