Skip to content
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

Merged

Conversation

graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented Jul 18, 2018

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

@graceguo-supercat graceguo-supercat force-pushed the gg-DefaultChartsLayout branch 2 times, most recently from 3a2f7c4 to a7831a1 Compare July 18, 2018 22:29
const rowContainer = newComponentFactory(ROW_TYPE);
layout[rowContainer.id] = rowContainer;
parent.children.push(rowContainer.id);
if (newSlicesCounter % 3 === 0) {
Copy link
Contributor

@williaster williaster Jul 18, 2018

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.

Copy link
Author

@graceguo-supercat graceguo-supercat Jul 19, 2018

Choose a reason for hiding this comment

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

fixed according to comment.

@graceguo-supercat graceguo-supercat force-pushed the gg-DefaultChartsLayout branch 2 times, most recently from a7c9ebe to 414e883 Compare July 19, 2018 04:35
Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

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

LGTM!

@codecov-io
Copy link

codecov-io commented Jul 27, 2018

Codecov Report

Merging #5425 into master will decrease coverage by 0.01%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...t/assets/src/dashboard/reducers/getInitialState.js 0% <0%> (ø) ⬆️
...t/assets/src/dashboard/util/newComponentFactory.js 100% <100%> (ø) ⬆️
superset/assets/src/dashboard/util/constants.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d373178...3b17a0a. Read the comment docs.

@graceguo-supercat graceguo-supercat merged commit daf2116 into apache:master Jul 27, 2018
graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this pull request Aug 14, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@graceguo-supercat graceguo-supercat deleted the gg-DefaultChartsLayout branch March 14, 2019 22:52
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants