Skip to content

Commit

Permalink
Merge pull request #199 from airbnb/touchups
Browse files Browse the repository at this point in the history
Fix a few minor bugs
  • Loading branch information
mistercrunch committed Mar 27, 2016
2 parents 4d2492d + 5804991 commit 0a8a1ed
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
1 change: 1 addition & 0 deletions dashed/assets/visualizations/big_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 17 additions & 5 deletions dashed/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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':
Expand Down Expand Up @@ -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');

Expand All @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions dashed/templates/dashed/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
cached
</span>
<div class="btn-group results" role="group">
<a role="button" tabindex="0" class="btn btn-default" id="shortner" title="Short URL" data-toggle="popover" data-trigger="focus">
<i class="fa fa-link"></i>&nbsp;
<a role="button" tabindex="0" class="btn btn-default" id="shortner" data-toggle="popover" data-trigger="focus">
<i class="fa fa-link" data-toggle="tooltip" title="Short URL"></i>&nbsp;
</a>
<span class="btn btn-default" id="standalone" title="Standalone version, use to embed anywhere" data-toggle="tooltip">
<i class="fa fa-code"></i>&nbsp;
Expand Down
11 changes: 3 additions & 8 deletions dashed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 4 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. warning:: This project used to be name Panoramix and has been renamed
to Dashed in March 2016

Overview
=======================================

Expand Down

0 comments on commit 0a8a1ed

Please sign in to comment.