[incubator-superset] branch master updated: data point no clipEdge (#6614)

2019-01-09 Thread maximebeauchemin
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin 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 4243723  data point no clipEdge (#6614)
4243723 is described below

commit 42437236b2b9ce385010730a6b85b4aa84a225c2
Author: zhaoyu89730105 <89730...@163.com>
AuthorDate: Thu Jan 10 12:35:20 2019 +0800

data point no clipEdge (#6614)
---
 superset/assets/src/visualizations/nvd3/NVD3Vis.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/superset/assets/src/visualizations/nvd3/NVD3Vis.js 
b/superset/assets/src/visualizations/nvd3/NVD3Vis.js
index 9377604..0b8fb2e 100644
--- a/superset/assets/src/visualizations/nvd3/NVD3Vis.js
+++ b/superset/assets/src/visualizations/nvd3/NVD3Vis.js
@@ -280,6 +280,7 @@ function nvd3Vis(element, props) {
 }
 chart.xScale(d3.time.scale.utc());
 chart.interpolate(lineInterpolation);
+chart.clipEdge(false);
 break;
 
   case 'time_pivot':



[incubator-superset] branch master updated: Bump requirements (#6625)

2019-01-09 Thread maximebeauchemin
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin 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 fbf9586  Bump requirements (#6625)
fbf9586 is described below

commit fbf9586adfe0b971b35584f2622d750be8d57126
Author: Mahendra M 
AuthorDate: Wed Jan 9 16:00:04 2019 -0800

Bump requirements (#6625)

* Bump requirements

* Fix setup.py for email reports
---
 requirements.txt | 4 ++--
 setup.py | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index 7c7d2f1..838cb6d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,7 +19,7 @@ chardet==3.0.4# via requests
 click==6.7
 colorama==0.3.9
 contextlib2==0.5.5
-croniter==0.3.25
+croniter==0.3.26
 cryptography==2.4.2
 decorator==4.3.0  # via retry
 defusedxml==0.5.0 # via python3-openid
@@ -80,7 +80,7 @@ retry==0.9.2
 rfc3986==1.1.0# via tableschema
 rsa==4.0  # via google-auth
 sasl==0.2.1   # via thrift-sasl
-selenium==3.14.0
+selenium==3.141.0
 simplejson==3.15.0
 six==1.11.0   # via bleach, cryptography, google-auth, gsheetsdb, 
isodate, jsonlines, linear-tsv, pathlib2, polyline, pydruid, python-dateutil, 
sasl, sqlalchemy-utils, tableschema, tabulator, thrift
 sqlalchemy-utils==0.32.21
diff --git a/setup.py b/setup.py
index 32f77f2..07318d8 100644
--- a/setup.py
+++ b/setup.py
@@ -58,6 +58,7 @@ setup(
 'click>=6.0, <7.0.0',  # click >=7 forces "-" instead of "_"
 'colorama',
 'contextlib2',
+'croniter>=0.3.26',
 'cryptography>=2.4.2',
 'flask>=1.0.0, <2.0.0',
 'flask-appbuilder>=1.12.1, <2.0.0',
@@ -83,6 +84,8 @@ setup(
 'python-geohash',
 'pyyaml>=3.13',
 'requests>=2.20.0',
+'retry>=0.9.2',
+'selenium>=3.141.0',
 'simplejson>=3.15.0',
 'sqlalchemy',
 'sqlalchemy-utils',
@@ -92,9 +95,6 @@ setup(
 'thrift-sasl>=0.2.1',
 'unicodecsv',
 'unidecode>=0.04.21',
-'croniter==0.3.25',
-'selenium==3.14.0',
-'retry==0.9.2',
 ],
 extras_require={
 'cors': ['flask-cors>=2.0.0'],



[incubator-superset] branch master updated: Improve padding in NVD3Vis (#6626)

2019-01-09 Thread beto
This is an automated email from the ASF dual-hosted git repository.

beto 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 f6ac0da  Improve padding in NVD3Vis (#6626)
f6ac0da is described below

commit f6ac0daf7e2a0f46542a5d6d5015de71e1f19ede
Author: Beto Dealmeida 
AuthorDate: Wed Jan 9 15:43:57 2019 -0800

Improve padding in NVD3Vis (#6626)

* WIP, fixing padding

* Remove testing code
---
 superset/assets/src/visualizations/nvd3/NVD3Vis.js | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/superset/assets/src/visualizations/nvd3/NVD3Vis.js 
b/superset/assets/src/visualizations/nvd3/NVD3Vis.js
index a31c67e..9377604 100644
--- a/superset/assets/src/visualizations/nvd3/NVD3Vis.js
+++ b/superset/assets/src/visualizations/nvd3/NVD3Vis.js
@@ -549,6 +549,14 @@ function nvd3Vis(element, props) {
   .attr('width', width)
   .call(chart);
 
+if (xLabelRotation > 0) {
+  // shift labels to the left so they look better
+  const xTicks = svg.select('.nv-x.nv-axis > g').selectAll('g');
+  xTicks
+.selectAll('text')
+.attr('dx', -6.5);
+}
+
 // align yAxis1 and yAxis2 ticks
 if (isVizTypes(['dual_line', 'line_multi'])) {
   const count = chart.yAxis1.ticks();
@@ -615,11 +623,15 @@ function nvd3Vis(element, props) {
 // If x bounds are shown, we need a right margin
 margins.right = Math.max(20, maxXAxisLabelHeight / 2) + marginPad;
   }
-  if (xLabelRotation === 45) {
-margins.bottom = maxXAxisLabelHeight + marginPad;
-margins.right = maxXAxisLabelHeight + marginPad;
-  } else if (staggerLabels) {
+  if (staggerLabels) {
 margins.bottom = 40;
+  } else {
+margins.bottom = (
+  maxXAxisLabelHeight * Math.sin(Math.PI * xLabelRotation / 180)
+) + marginPad;
+margins.right = (
+  maxXAxisLabelHeight * Math.cos(Math.PI * xLabelRotation / 180)
+) + marginPad;
   }
 
   if (isVizTypes(['dual_line', 'line_multi'])) {



[incubator-superset] 01/04: Fix deck.gl Polygon not show (#6545)

2019-01-09 Thread michellet
This is an automated email from the ASF dual-hosted git repository.

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

commit 83929985d0e0228a347711d07501f5ff4c67f6ad
Author: MukaJiTrue <45657828+mukajit...@users.noreply.github.com>
AuthorDate: Wed Dec 19 02:16:09 2018 +0700

Fix deck.gl Polygon not show (#6545)

* Fix deck.gl Polygon not show

* Replace "//" to "// "

(cherry picked from commit 926f78c21d2ef513edcbc9af2e766bfe5c8e8b53)
---
 superset/assets/src/visualizations/deckgl/utils.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/superset/assets/src/visualizations/deckgl/utils.js 
b/superset/assets/src/visualizations/deckgl/utils.js
index 10c9363..149ef2b 100644
--- a/superset/assets/src/visualizations/deckgl/utils.js
+++ b/superset/assets/src/visualizations/deckgl/utils.js
@@ -89,8 +89,10 @@ export function getBuckets(fd, features, accessor) {
   breakPoints.slice(1).forEach((value, i) => {
 const range = breakPoints[i] + ' - ' + breakPoints[i + 1];
 const mid = 0.5 * (parseInt(breakPoints[i], 10) + parseInt(breakPoints[i + 
1], 10));
+   // fix polygon doesn't show
+   const metricLabel = fd.metric ? fd.metric.label || fd.metric : null;
 buckets[range] = {
-  color: colorScaler({ [fd.metric.label || fd.metric]: mid }),
+  color: colorScaler({ [metricLabel || fd.metric]: mid }),
   enabled: true,
 };
   });



[incubator-superset] branch 0.30 updated (7dddc61 -> 2521587)

2019-01-09 Thread michellet
This is an automated email from the ASF dual-hosted git repository.

michellet pushed a change to branch 0.30
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.


from 7dddc61  0.30rc2
 new 8392998  Fix deck.gl Polygon not show (#6545)
 new e667437  [RfC] Fix URL too long (#6519)
 new a8dd142  [fix] url shortner for long explore url (#6449)
 new 2521587  0.30rc3

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 superset/assets/package.json   |  2 +-
 .../src/explore/components/ExploreViewContainer.jsx|  2 +-
 superset/assets/src/explore/exploreUtils.js| 18 --
 superset/assets/src/visualizations/deckgl/utils.js |  4 +++-
 superset/views/core.py |  9 +++--
 5 files changed, 28 insertions(+), 7 deletions(-)



[incubator-superset] 02/04: [RfC] Fix URL too long (#6519)

2019-01-09 Thread michellet
This is an automated email from the ASF dual-hosted git repository.

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

commit e667437328060e60dfa69d63916ce64939ff93a4
Author: Maxime Beauchemin 
AuthorDate: Tue Dec 18 16:14:20 2018 -0800

[RfC] Fix URL too long (#6519)

When a URL gets too long (usually happens with controls that allow
free form text), it creates an array of bugs.
* bug when creating a short URL, because the POST request's referrer
field is too long
* a bug when saving a chart (when the modal shows up) also because of
the referrer being too long

Some work has been done in the past to mitigate this, and I'm unclear if
it's some sort of regression because of the Flask upgrade or some
browser change, or whether these bugs have always been around.

This is a request for comment on an approach that works. Let me know if
you can think of better ideas as to how to manage this.

My current solution looks for 8000+ characters URLs and shrinks them to
only `/superset/explore/?URL_IS_TOO_LONG_TO_SHARE_data=...` and we
only keep the formData keys for `datasource` and `viz_type`. Not super
elegant but does the trick.
(cherry picked from commit 42067e077b404f4ca6f002ade273d55a3dec8616)
---
 .../src/explore/components/ExploreViewContainer.jsx|  2 +-
 superset/assets/src/explore/exploreUtils.js| 18 --
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/superset/assets/src/explore/components/ExploreViewContainer.jsx 
b/superset/assets/src/explore/components/ExploreViewContainer.jsx
index 162cb16..ae52a0b 100644
--- a/superset/assets/src/explore/components/ExploreViewContainer.jsx
+++ b/superset/assets/src/explore/components/ExploreViewContainer.jsx
@@ -171,7 +171,7 @@ class ExploreViewContainer extends React.Component {
 
   addHistory({ isReplace = false, title }) {
 const { payload } = getExploreUrlAndPayload({ formData: 
this.props.form_data });
-const longUrl = getExploreLongUrl(this.props.form_data);
+const longUrl = getExploreLongUrl(this.props.form_data, null, false);
 try {
   if (isReplace) {
 history.replaceState(payload, title, longUrl);
diff --git a/superset/assets/src/explore/exploreUtils.js 
b/superset/assets/src/explore/exploreUtils.js
index 4eac3ab..e9bcc9f 100644
--- a/superset/assets/src/explore/exploreUtils.js
+++ b/superset/assets/src/explore/exploreUtils.js
@@ -2,6 +2,8 @@
 import URI from 'urijs';
 import { availableDomains } from '../utils/hostNamesConfig';
 
+const MAX_URL_LENGTH = 8000;
+
 export function getChartKey(explore) {
   const slice = explore.slice;
   return slice ? (slice.slice_id) : 0;
@@ -40,7 +42,7 @@ export function getURIDirectory(formData, endpointType = 
'base') {
   return directory;
 }
 
-export function getExploreLongUrl(formData, endpointType) {
+export function getExploreLongUrl(formData, endpointType, allowOverflow = 
true, extraSearch = {}) {
   if (!formData.datasource) {
 return null;
   }
@@ -48,11 +50,23 @@ export function getExploreLongUrl(formData, endpointType) {
   const uri = new URI('/');
   const directory = getURIDirectory(formData, endpointType);
   const search = uri.search(true);
+  Object.keys(extraSearch).forEach((key) => {
+search[key] = extraSearch[key];
+  });
   search.form_data = JSON.stringify(formData);
   if (endpointType === 'standalone') {
 search.standalone = 'true';
   }
-  return uri.directory(directory).search(search).toString();
+  const url = uri.directory(directory).search(search).toString();
+  if (!allowOverflow && url.length > MAX_URL_LENGTH) {
+const minimalFormData = {
+  datasource: formData.datasource,
+  viz_type: formData.viz_type,
+};
+return getExploreLongUrl(
+  minimalFormData, endpointType, false, { URL_IS_TOO_LONG_TO_SHARE: null 
});
+  }
+  return url;
 }
 
 export function getExploreUrlAndPayload({



[incubator-superset] 03/04: [fix] url shortner for long explore url (#6449)

2019-01-09 Thread michellet
This is an automated email from the ASF dual-hosted git repository.

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

commit a8dd1428dbbc4d86baf6c1340ac469b636929f22
Author: Grace Guo 
AuthorDate: Mon Jan 7 14:28:30 2019 -0800

[fix] url shortner for long explore url (#6449)

- redirect explore url with r parameter
- redirect to relative path
(cherry picked from commit be1895f2dcae307f51b576bfebd49b82c5699756)
---
 superset/views/core.py | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index f9eb299..a15d724 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -756,8 +756,13 @@ class R(BaseSupersetView):
 @expose('/')
 def index(self, url_id):
 url = db.session.query(models.Url).filter_by(id=url_id).first()
-if url:
-return redirect('/' + url.url)
+if url and url.url:
+explore_url = '//superset/explore/?'
+if url.url.startswith(explore_url):
+explore_url += f'r={url_id}'
+return redirect(explore_url[1:])
+else:
+return redirect(url.url[1:])
 else:
 flash('URL to nowhere...', 'danger')
 return redirect('/')



[incubator-superset] 04/04: 0.30rc3

2019-01-09 Thread michellet
This is an automated email from the ASF dual-hosted git repository.

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

commit 2521587655e389361cfd6361d08934fb9e272dd1
Author: Michelle Thomas 
AuthorDate: Wed Jan 9 10:45:00 2019 -0800

0.30rc3
---
 superset/assets/package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset/assets/package.json b/superset/assets/package.json
index 2f41286..d60d9e7 100644
--- a/superset/assets/package.json
+++ b/superset/assets/package.json
@@ -1,6 +1,6 @@
 {
   "name": "superset",
-  "version": "0.29.0rc2",
+  "version": "0.29.0rc3",
   "description": "Superset is a data exploration platform designed to be 
visual, intuitive, and interactive.",
   "license": "Apache-2.0",
   "directories": {