Merge pull request #199 from airbnb/touchups

Fix a few minor bugs
This commit is contained in:
Maxime Beauchemin 2016-03-27 08:09:08 -07:00
commit 0a8a1eda94
7 changed files with 33 additions and 17 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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') {

View File

@ -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;

View File

@ -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)

View File

@ -120,10 +120,12 @@ html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
# 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.

View File

@ -1,3 +1,6 @@
.. warning:: This project used to be name Panoramix and has been renamed
to Dashed in March 2016
Overview
=======================================