diff --git a/caravel/assets/visualizations/directed_force.js b/caravel/assets/visualizations/directed_force.js index 3aa63b5910..b4f792d37d 100644 --- a/caravel/assets/visualizations/directed_force.js +++ b/caravel/assets/visualizations/directed_force.js @@ -11,13 +11,13 @@ function directedForceVis(slice) { const width = slice.width(); const height = slice.height() - 25; d3.json(slice.jsonEndpoint(), function (error, json) { - const linkLength = json.form_data.link_length || 200; - const charge = json.form_data.charge || -500; - if (error !== null) { slice.error(error.responseText, error); return; } + const linkLength = json.form_data.link_length || 200; + const charge = json.form_data.charge || -500; + const links = json.data; const nodes = {}; // Compute the distinct nodes from the links. @@ -87,6 +87,7 @@ function directedForceVis(slice) { .on('tick', tick) .start(); + div.selectAll('*').remove(); const svg = div.append('svg') .attr('width', width) .attr('height', height); @@ -169,7 +170,6 @@ function directedForceVis(slice) { return d.name; }); - slice.done(json); }); }; diff --git a/caravel/assets/visualizations/heatmap.js b/caravel/assets/visualizations/heatmap.js index c0750ba56a..2cd4df237b 100644 --- a/caravel/assets/visualizations/heatmap.js +++ b/caravel/assets/visualizations/heatmap.js @@ -18,6 +18,10 @@ function heatmapVis(slice) { }; d3.json(slice.jsonEndpoint(), function (error, payload) { + if (error) { + slice.error(error.responseText, error); + return; + } const data = payload.data; // Dynamically adjusts based on max x / y category lengths function adjustMargins() { @@ -56,10 +60,6 @@ function heatmapVis(slice) { slice.container.html(''); const matrix = {}; - if (error) { - slice.error(error.responseText, error); - return; - } const fd = payload.form_data; adjustMargins(); diff --git a/caravel/data/__init__.py b/caravel/data/__init__.py index 5198a12af7..92ca10284e 100644 --- a/caravel/data/__init__.py +++ b/caravel/data/__init__.py @@ -326,7 +326,7 @@ def load_world_bank_health_n_pop(): defaults, since="1960-01-01", until="now", - whisker_options="Tukey", + whisker_options="Min/max (no outliers)", viz_type='box_plot', groupby=["region"],)), Slice( diff --git a/caravel/utils.py b/caravel/utils.py index 670c0694e0..3c298c780f 100644 --- a/caravel/utils.py +++ b/caravel/utils.py @@ -107,6 +107,7 @@ def get_or_create_main_db(caravel): logging.info(config.get("SQLALCHEMY_DATABASE_URI")) dbobj.set_sqlalchemy_uri(config.get("SQLALCHEMY_DATABASE_URI")) dbobj.expose_in_sqllab = True + dbobj.allow_run_sync = True db.session.add(dbobj) db.session.commit() return dbobj diff --git a/caravel/views.py b/caravel/views.py index 415a03571c..95ef578dc7 100755 --- a/caravel/views.py +++ b/caravel/views.py @@ -1599,9 +1599,7 @@ class Caravel(BaseCaravelView): viz_type = data.get('chartType') table = db.session.query(models.SqlaTable).filter_by(table_name=table_name).first() if not table: - table = models.SqlaTable( - table_name=table_name, - ) + table = models.SqlaTable(table_name=table_name) table.database_id = data.get('dbId') table.sql = data.get('sql') db.session.add(table) diff --git a/caravel/viz.py b/caravel/viz.py index b68b1ebdd2..524a462acf 100755 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -116,6 +116,8 @@ class BaseViz(object): del d['json'] if 'action' in d: del d['action'] + if 'slice_id' in d: + del d['slice_id'] d.update(kwargs) # Remove unchecked checkboxes because HTML is weird like that od = MultiDict() @@ -716,7 +718,7 @@ class BoxPlotViz(NVD3Viz): viz_type = "box_plot" verbose_name = _("Box Plot") sort_series = False - is_timeseries = False + is_timeseries = True fieldsets = ({ 'label': None, 'fields': (