You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2018/08/27 22:46:55 UTC

[incubator-superset] branch master updated: [bugfix] BigNumber crash, Horizon indent and Myanmar geojson (#5746)

This is an automated email from the ASF dual-hosted git repository.

hugh 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 0781cf2  [bugfix] BigNumber crash, Horizon indent and Myanmar geojson (#5746)
0781cf2 is described below

commit 0781cf2cfb15b49900625d705e8c484e1b956909
Author: Krist Wongsuphasawat <kr...@gmail.com>
AuthorDate: Mon Aug 27 15:46:52 2018 -0700

    [bugfix] BigNumber crash, Horizon indent and Myanmar geojson (#5746)
    
    * fix myanmar geojson
    
    * fix indent of horizon in dashboard
    
    * Fix bignumber crash when color_picker is undefined
---
 superset/assets/src/visualizations/BigNumber.jsx             | 7 +++++--
 superset/assets/src/visualizations/HorizonChart.css          | 3 ++-
 superset/assets/src/visualizations/countries/myanmar.geojson | 3 ++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/superset/assets/src/visualizations/BigNumber.jsx b/superset/assets/src/visualizations/BigNumber.jsx
index f5c701d..e2658f3 100644
--- a/superset/assets/src/visualizations/BigNumber.jsx
+++ b/superset/assets/src/visualizations/BigNumber.jsx
@@ -231,14 +231,17 @@ BigNumberVis.defaultProps = defaultProps;
 function adaptor(slice, payload) {
   const { formData, containerId } = slice;
   const { data, subheader, compare_suffix: compareSuffix } = payload.data;
-  const { r, g, b } = formData.color_picker;
   const compareLag = Number(payload.data.compare_lag);
   const supportTrendline = formData.viz_type === 'big_number';
   const showTrendline = supportTrendline && formData.show_trend_line;
   const startYAxisAtZero = formData.start_y_axis_at_zero;
   const formatValue = d3FormatPreset(formData.y_axis_format);
   const bigNumber = supportTrendline ? data[data.length - 1][1] : data[0][0];
-  const userColor = color.rgb(r, g, b).hex();
+  let userColor;
+  if (formData.color_picker) {
+    const { r, g, b } = formData.color_picker;
+    userColor = color.rgb(r, g, b).hex();
+  }
 
   let percentChange = 0;
   let formattedSubheader = subheader;
diff --git a/superset/assets/src/visualizations/HorizonChart.css b/superset/assets/src/visualizations/HorizonChart.css
index 3b78fdd..54bb8c5 100644
--- a/superset/assets/src/visualizations/HorizonChart.css
+++ b/superset/assets/src/visualizations/HorizonChart.css
@@ -9,9 +9,10 @@
   margin: 0px;
 }
 
-.horizon-row span {
+.horizon-row span.title {
   position: absolute;
   color: #333;
   font-size: 0.8em;
+  margin: 0;
   text-shadow: 1px 1px rgba(255, 255, 255, 0.75);
 }
diff --git a/superset/assets/src/visualizations/countries/myanmar.geojson b/superset/assets/src/visualizations/countries/myanmar.geojson
index b749d07..e4bfc84 100644
--- a/superset/assets/src/visualizations/countries/myanmar.geojson
+++ b/superset/assets/src/visualizations/countries/myanmar.geojson
@@ -17,4 +17,5 @@
 { "type": "Feature", "properties": { "ID": 13, "NAME": "Yangon Region", "PCODE": "MMR013", "ISO": "MM-06" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 96.3117, 17.1927 ], [ 96.3189, 17.1843 ], [ 96.3335, 17.1686 ], [ 96.3659, 17.1495 ], [ 96.3906, 17.1167 ], [ 96.4037, 17.0729 ], [ 96.3985, 17.0431 ], [ 96.3809, 17.0189 ], [ 96.3797, 16.999 ], [ 96.4057, 16.9962 ], [ 96.4064, 16.98 ], [ 96.4774, 16.9646 ], [ 96.4891, 16.9795 ], [ 96.5169, 16.9941 ], [ 96.5633, 16.9823  [...]
 { "type": "Feature", "properties": { "ID": 14, "NAME": "Shan State", "PCODE": "MMR014", "ISO": "MM-17" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 97.6383, 23.8632 ], [ 97.7066, 23.8653 ], [ 97.7297, 23.8992 ], [ 97.7489, 23.9023 ], [ 97.7707, 23.9364 ], [ 97.8097, 23.9502 ], [ 97.8834, 23.9965 ], [ 97.8968, 24.0154 ], [ 97.9434, 24.022 ], [ 97.9813, 24.0358 ], [ 97.9954, 24.0507 ], [ 98.041, 24.0739 ], [ 98.0769, 24.0801 ], [ 98.1199, 24.0947 ], [ 98.1984, 24.1018 ], [...]
 { "type": "Feature", "properties": { "ID": 17, "NAME": "Ayeyarwady Region", "PCODE": "MMR017", "ISO": "MM-07" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 95.2486, 15.8501 ], [ 95.2309, 15.871 ], [ 95.2737, 15.9566 ], [ 95.2722, 16.0313 ], [ 95.2963, 16.0564 ], [ 95.3035, 16.077 ], [ 95.3233, 16.0868 ], [ 95.3446, 16.0419 ], [ 95.3421, 15.9863 ], [ 95.3358, 15.9678 ], [ 95.3135, 15.9456 ], [ 95.2755, 15.8775 ], [ 95.2486, 15.8501 ] ] ], [ [ [ 95.1827, 16.1123 ], [ 95.1 [...]
-{ "type": "Feature", "properties": { "ID": 18, "NAME": "Naypyitaw", "PCODE": "MMR018", "ISO": "MM-18" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 96.5048, 20.1931 ], [ 96.4858, 20.1627 ], [ 96.4604, 20.1541 ], [ 96.4411, 20.1363 ], [ 96.456, 20.0977 ], [ 96.4758, 20.07 ], [ 96.4678, 20.056 ], [ 96.443, 20.0519 ], [ 96.4437, 20.0327 ], [ 96.4203, 20.0204 ], [ 96.3711, 20.0243 ], [ 96.3635, 20.013 ], [ 96.393, 19.9645 ], [ 96.442, 19.9152 ], [ 96.455, 19.8937 ], [ 96.44 [...]
+{ "type": "Feature", "properties": { "ID": 18, "NAME": "Naypyitaw", "PCODE": "MMR018", "ISO": "MM-18" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 96.5048, 20.1931 ], [ 96.4858, 20.1627 ], [ 96.4604, 20.1541 ], [ 96.4411, 20.1363 ], [ 96.456, 20.0977 ], [ 96.4758, 20.07 ], [ 96.4678, 20.056 ], [ 96.443, 20.0519 ], [ 96.4437, 20.0327 ], [ 96.4203, 20.0204 ], [ 96.3711, 20.0243 ], [ 96.3635, 20.013 ], [ 96.393, 19.9645 ], [ 96.442, 19.9152 ], [ 96.455, 19.8937 ], [ 96.44 [...]
+]}