-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
set default charts layout #5425
set default charts layout #5425
Conversation
3a2f7c4
to
a7831a1
Compare
const rowContainer = newComponentFactory(ROW_TYPE); | ||
layout[rowContainer.id] = rowContainer; | ||
parent.children.push(rowContainer.id); | ||
if (newSlicesCounter % 3 === 0) { |
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 think a more robust way to do this is to use the grid width from constants.js
and the actual width of the newly-created chartHolder
component below. If the current row doesn't have enough width for the new component, then you can add a new row.
Your approach would break if someone unknowingly changed the default chart width.
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.
fixed according to comment.
a7c9ebe
to
414e883
Compare
414e883
to
d4328ea
Compare
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.
LGTM!
Codecov Report
@@ Coverage Diff @@
## master #5425 +/- ##
==========================================
- Coverage 63.37% 63.36% -0.02%
==========================================
Files 349 349
Lines 22110 22117 +7
Branches 2455 2457 +2
==========================================
+ Hits 14013 14014 +1
- Misses 8083 8089 +6
Partials 14 14
Continue to review full report at Codecov.
|
(cherry picked from commit daf2116)
Users might be able to add charts into dashboard programmatically, without setting layout for those new charts. So I added a function that group those newly added charts 3 item in a row, attached the bottom of dashboard. This is the same behavior as in the old dashboard.
also some of our users feel default chart size is too small (3 out of 12 columns grid). So i make it as big as old dashboard (4 out of 12 columns grid).
@williaster