mirror of https://github.com/apache/superset.git
A few bugfixes
This commit is contained in:
parent
b67906cfe1
commit
1a29163530
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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': (
|
||||
|
|
Loading…
Reference in New Issue