From 5804991b19358278f730d3c424b5c795cfdcf4ce Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Sun, 27 Mar 2016 00:18:26 -0700 Subject: [PATCH] Fix a few minor bugs --- TODO.md | 3 +++ dashed/assets/visualizations/big_number.js | 1 + dashed/assets/visualizations/nvd3_vis.js | 22 +++++++++++++++++----- dashed/templates/dashed/explore.html | 4 ++-- dashed/views.py | 11 +++-------- docs/conf.py | 6 ++++-- docs/index.rst | 3 +++ 7 files changed, 33 insertions(+), 17 deletions(-) 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
- -   + +     diff --git a/dashed/views.py b/dashed/views.py index 723d2b53cff8a..cec973b164ab9 100644 --- a/dashed/views.py +++ b/dashed/views.py @@ -67,14 +67,6 @@ class TableColumnInlineView(CompactCRUDMixin, DashedModelView): # noqa } appbuilder.add_view_no_menu(TableColumnInlineView) -appbuilder.add_link( - "Welcome!", - href='/dashed/welcome', - category='Sources', - category_icon='fa-table', - icon="fa-star") - -appbuilder.add_separator("Sources") class DruidColumnInlineView(CompactCRUDMixin, DashedModelView): # noqa @@ -253,6 +245,9 @@ class SliceAsync(SliceModelView): # noqa list_columns = [ 'slice_link', 'viz_type', 'created_by_', 'modified', 'icons'] + label_columns = { + 'icons': ' ', + } appbuilder.add_view_no_menu(SliceAsync) diff --git a/docs/conf.py b/docs/conf.py index 12b4add802c6e..6be2338a55459 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -120,10 +120,12 @@ # further. For a list of options available for each theme, see the # documentation. html_theme_options = { - #'bootswatch_theme': 'simplex', + # 'bootswatch_theme': 'cosmo', 'navbar_title': 'Dashed Documentation', 'navbar_fixed_top': "false", - #'navbar_class': "navbar navbar-default", + 'navbar_sidebarrel': False, + 'navbar_site_name': "Topics", + #'navbar_class': "navbar navbar-left", } # Add any paths that contain custom themes here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index 43e212ce84181..037db7904c590 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,3 +1,6 @@ +.. warning:: This project used to be name Panoramix and has been renamed + to Dashed in March 2016 + Overview =======================================