-
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
fix(dashboard): fixed FullSize charts broken #13986
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13986 +/- ##
==========================================
+ Coverage 79.12% 79.21% +0.08%
==========================================
Files 936 936
Lines 47411 47408 -3
Branches 5939 5940 +1
==========================================
+ Hits 37516 37553 +37
+ Misses 9768 9728 -40
Partials 127 127
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
superset-frontend/src/dashboard/components/gridComponents/ChartHolder.jsx
Outdated
Show resolved
Hide resolved
LGTM, thanks for this fix. before screen recordingzoom.in.out.in.dashboard.before.movafter screen recordingzoom.in.out.in.dashboard.after.mov |
please delete the comments, thanks!
在 2021-04-07 17:54:52,"Yongjie Zhao" ***@***.***> 写道:
@zhaoyongjie commented on this pull request.
In superset-frontend/src/dashboard/components/gridComponents/ChartHolder.jsx:
@@ -245,8 +245,9 @@ class ChartHolder extends React.Component {
let chartHeight = 0;
if (this.state.isFullSize) {
- chartWidth = document.body.clientWidth - CHART_MARGIN;
- chartHeight = document.body.clientHeight - CHART_MARGIN;
+ //toop fixed FullSize charts broken #13600
nit, please do not stay irrelated comments, thanks
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
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
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.
since this was a regression, is there any way we could add a test for it? If not, lgtm, but ideally we could prevent this happening again (since this isn't a commonly tested feature)
@toop please do add test. 🙏 |
@@ -245,8 +245,8 @@ class ChartHolder extends React.Component { | |||
let chartHeight = 0; | |||
|
|||
if (this.state.isFullSize) { | |||
chartWidth = document.body.clientWidth - CHART_MARGIN; | |||
chartHeight = document.body.clientHeight - CHART_MARGIN; | |||
chartWidth = window.screen.width - CHART_MARGIN; |
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.
Hi there, why we use window.screen.width
instead of window.innerWidth
(previous implementation for you). The window.screen.width
looks like it always gets the whole screen width instead of the browser width.
Thanks again for your contribution!
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 'm sorry! It's not thoughtful. I change it back
@toop Could you fix the CI? thanks |
SUMMARY
When you click the “Maximize chart” option of the chart in the dashboard, the chart is incomplete。
BEFORE:
AFTER:
ADDITIONAL INFORMATION
@junlincc @zhaoyongjie