diff --git a/TODO.md b/TODO.md index bf783b1abafff..d0d6a328ab83c 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,9 @@ # TODO List of TODO items for Dashed +range filter formatter +sankey example is missing + ## Important * **Getting proper JS testing:** unit tests on the Python side are pretty solid, but now we need a test suite for the JS part of the site, diff --git a/dashed/assets/visualizations/big_number.js b/dashed/assets/visualizations/big_number.js index 7f6bfcd4b0c6f..38c22aa89571e 100644 --- a/dashed/assets/visualizations/big_number.js +++ b/dashed/assets/visualizations/big_number.js @@ -24,6 +24,7 @@ function bigNumberVis(slice) { var fp = d3.format('+.1%'); var width = slice.width(); var height = slice.height(); + div.selectAll("*").remove(); var svg = div.append('svg'); svg.attr("width", width); svg.attr("height", height); diff --git a/dashed/assets/visualizations/nvd3_vis.js b/dashed/assets/visualizations/nvd3_vis.js index 04a0852abab5f..14044b22550d4 100644 --- a/dashed/assets/visualizations/nvd3_vis.js +++ b/dashed/assets/visualizations/nvd3_vis.js @@ -27,7 +27,7 @@ function nvd3Vis(slice) { chart.lines2.xScale(d3.time.scale.utc()); chart.x2Axis .showMaxMin(fd.x_axis_showminmax) - .staggerLabels(true); + .staggerLabels(false); } else { chart = nv.models.lineChart(); } @@ -37,7 +37,7 @@ function nvd3Vis(slice) { chart.interpolate(fd.line_interpolation); chart.xAxis .showMaxMin(fd.x_axis_showminmax) - .staggerLabels(true); + .staggerLabels(false); break; case 'bar': @@ -131,9 +131,6 @@ function nvd3Vis(slice) { var height = slice.height(); height -= 15; // accounting for the staggered xAxis - if (chart.hasOwnProperty("x2Axis")) { - height += 30; - } chart.height(height); slice.container.css('height', height + 'px'); @@ -148,6 +145,21 @@ function nvd3Vis(slice) { if (fd.x_log_scale) { chart.xScale(d3.scale.log()); } + var xAxisFormatter = null; + if (viz_type === 'bubble') { + xAxisFormatter = d3.format('.3s'); + } else if (fd.x_axis_format === 'smart_date') { + xAxisFormatter = px.formatDate; + } else if (fd.x_axis_format !== undefined) { + xAxisFormatter = px.timeFormatFactory(fd.x_axis_format); + } + chart.xAxis.tickFormat(xAxisFormatter); + + if (chart.hasOwnProperty("x2Axis")) { + chart.x2Axis.tickFormat(xAxisFormatter); + height += 30; + } + if (viz_type === 'bubble') { chart.xAxis.tickFormat(d3.format('.3s')); } else if (fd.x_axis_format === 'smart_date') { diff --git a/dashed/templates/dashed/explore.html b/dashed/templates/dashed/explore.html index a10adc3a4e46a..c2519f2464a3c 100644 --- a/dashed/templates/dashed/explore.html +++ b/dashed/templates/dashed/explore.html @@ -58,8 +58,8 @@ cached