superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccwilli...@apache.org
Subject [incubator-superset] branch master updated: correctly compute slice width in dashboard (#5867)
Date Wed, 12 Sep 2018 17:05:45 GMT
This is an automated email from the ASF dual-hosted git repository.

ccwilliams pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 166058d  correctly compute slice width in dashboard (#5867)
166058d is described below

commit 166058d95f69cfb43e064d4cfd0c0b62a7192d06
Author: Krist Wongsuphasawat <krist.wongz@gmail.com>
AuthorDate: Wed Sep 12 10:05:39 2018 -0700

    correctly compute slice width in dashboard (#5867)
---
 .../src/dashboard/components/gridComponents/ChartHolder.jsx   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/superset/assets/src/dashboard/components/gridComponents/ChartHolder.jsx b/superset/assets/src/dashboard/components/gridComponents/ChartHolder.jsx
index 0598635..366d3fe 100644
--- a/superset/assets/src/dashboard/components/gridComponents/ChartHolder.jsx
+++ b/superset/assets/src/dashboard/components/gridComponents/ChartHolder.jsx
@@ -12,6 +12,7 @@ import {
   GRID_MIN_COLUMN_COUNT,
   GRID_MIN_ROW_UNITS,
   GRID_BASE_UNIT,
+  GRID_GUTTER_SIZE,
 } from '../../util/constants';
 
 const CHART_MARGIN = 32;
@@ -131,8 +132,14 @@ class ChartHolder extends React.Component {
             >
               <Chart
                 id={component.meta.chartId}
-                width={widthMultiple * columnWidth - CHART_MARGIN / 2}
-                height={component.meta.height * GRID_BASE_UNIT - CHART_MARGIN}
+                width={Math.floor(
+                  widthMultiple * columnWidth +
+                    (widthMultiple - 1) * GRID_GUTTER_SIZE -
+                    CHART_MARGIN,
+                )}
+                height={Math.floor(
+                  component.meta.height * GRID_BASE_UNIT - CHART_MARGIN,
+                )}
                 sliceName={component.meta.sliceName || ''}
                 updateSliceName={this.handleUpdateSliceName}
               />


Mime
View raw message