diff --git a/caravel/assets/.eslintrc b/caravel/assets/.eslintrc index f2cf5bd4020..bec934dcf99 100644 --- a/caravel/assets/.eslintrc +++ b/caravel/assets/.eslintrc @@ -30,7 +30,7 @@ "brace-style": [2, "1tbs", { "allowSingleLine": true }], "callback-return": [2, ["callback"]], "camelcase": [0], - "comma-dangle": [2, "never"], + "comma-dangle": [2, "always-multiline"], "comma-spacing": [2], "comma-style": [2, "last"], "curly": [2, "all"], diff --git a/caravel/assets/javascripts/modules/caravel.js b/caravel/assets/javascripts/modules/caravel.js index e5057cd0fb9..fe7023f8bb0 100644 --- a/caravel/assets/javascripts/modules/caravel.js +++ b/caravel/assets/javascripts/modules/caravel.js @@ -32,7 +32,7 @@ var sourceMap = { treemap: 'treemap.js', cal_heatmap: 'cal_heatmap.js', horizon: 'horizon.js', - mapbox: 'mapbox.jsx' + mapbox: 'mapbox.jsx', }; var color = function () { @@ -41,13 +41,13 @@ var color = function () { //rausch hackb kazan babu lima beach barol '#ff5a5f', '#7b0051', '#007A87', '#00d1c1', '#8ce071', '#ffb400', '#b4a76c', '#ff8083', '#cc0086', '#00a1b3', '#00ffeb', '#bbedab', '#ffd266', '#cbc29a', - '#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e' + '#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e', ]; var spectrums = { blue_white_yellow: ['#00d1c1', 'white', '#ffb400'], fire: ['white', 'yellow', 'red', 'black'], white_black: ['white', 'black'], - black_white: ['black', 'white'] + black_white: ['black', 'white'], }; var colorBnb = function () { // Color factory @@ -84,7 +84,7 @@ var color = function () { return { bnbColors: bnbColors, category21: colorBnb(), - colorScalerFactory: colorScalerFactory + colorScalerFactory: colorScalerFactory, }; }; @@ -124,7 +124,7 @@ var px = (function () { }], // If the first of the month, do "month day, year." ["%Y", function (d) { return true; - }] // fall back on month, year + }], // fall back on month, year ]); function formatDate(dttm) { @@ -226,7 +226,7 @@ var px = (function () { render_template: function (s) { var context = { width: this.width, - height: this.height + height: this.height, }; return Mustache.render(s, context); }, @@ -235,7 +235,7 @@ var px = (function () { var parser = document.createElement('a'); parser.href = data.json_endpoint; var endpoint = parser.pathname + this.querystring({ - extraFilters: params.extraFilters + extraFilters: params.extraFilters, }); endpoint += "&json=true"; endpoint += "&force=" + this.force; @@ -395,7 +395,7 @@ var px = (function () { if (dashboard !== undefined) { delete dashboard.removeFilter(slice_id, col, vals); } - } + }, }; var visType = data.form_data.viz_type; px.registerViz(visType); @@ -424,7 +424,7 @@ var px = (function () { timeFormatFactory: timeFormatFactory, color: color(), getParam: getParam, - initFavStars: initFavStars + initFavStars: initFavStars, }; })(); diff --git a/caravel/assets/javascripts/modules/utils.js b/caravel/assets/javascripts/modules/utils.js index 2e3520beea0..a6ad2afe2d4 100644 --- a/caravel/assets/javascripts/modules/utils.js +++ b/caravel/assets/javascripts/modules/utils.js @@ -120,5 +120,5 @@ module.exports = { showModal: showModal, toggleCheckbox: toggleCheckbox, fixDataTableBodyHeight: fixDataTableBodyHeight, - d3format: d3format + d3format: d3format, }; diff --git a/caravel/assets/javascripts/sql.js b/caravel/assets/javascripts/sql.js index 0d9038e0e51..305aed681cd 100644 --- a/caravel/assets/javascripts/sql.js +++ b/caravel/assets/javascripts/sql.js @@ -32,12 +32,12 @@ $(document).ready(function () { editor.setTheme("ace/theme/crimson_editor"); editor.setOptions({ minLines: 16, - maxLines: Infinity + maxLines: Infinity, }); editor.getSession().setMode("ace/mode/sql"); editor.focus(); $("select").select2({ - dropdownAutoWidth: true + dropdownAutoWidth: true, }); function showTableMetadata() { @@ -49,7 +49,7 @@ $(document).ready(function () { $("#create_view").click(function () { showModal({ title: "Error", - body: "Sorry, this feature is not yet implemented" + body: "Sorry, this feature is not yet implemented", }); }); $(".sqlcontent").show(); @@ -80,8 +80,8 @@ $(document).ready(function () { data: { data: JSON.stringify({ database_id: $('#database_id').val(), - sql: editor.getSession().getValue() - }) + sql: editor.getSession().getValue(), + }), }, success: function (data) { $('#loading').hide(0); @@ -92,14 +92,14 @@ $(document).ready(function () { retrieve: true, paging: false, searching: true, - aaSorting: [] + aaSorting: [], }); }, error: function (err, err2) { $('#loading').hide(0); $('#results').show(0); $('#results').html(err.responseText); - } + }, }); }); } diff --git a/caravel/assets/javascripts/welcome.js b/caravel/assets/javascripts/welcome.js index 5eac3f49ccf..fc0194896ff 100644 --- a/caravel/assets/javascripts/welcome.js +++ b/caravel/assets/javascripts/welcome.js @@ -35,7 +35,7 @@ function modelViewTable(selector, modelView, orderCol, order) { bLengthChange: false, aaSorting: [], searching: true, - bInfo: false + bInfo: false, }); // Hack to move the searchbox in the right spot @@ -74,7 +74,7 @@ $(document).ready(function () { domain: "month", subDomain: "day", itemName: "action", - tooltip: true + tooltip: true, }); }); modelViewTable('#dash_table', 'DashboardModelViewAsync', 'changed_on', 'desc'); diff --git a/caravel/assets/spec/helpers/browser.js b/caravel/assets/spec/helpers/browser.js index b847b83a1f3..9803cceda00 100644 --- a/caravel/assets/spec/helpers/browser.js +++ b/caravel/assets/spec/helpers/browser.js @@ -16,7 +16,7 @@ Object.keys(document.defaultView).forEach((property) => { }); global.navigator = { - userAgent: 'node.js' + serAgent: 'node.js', }; documentRef = document; diff --git a/caravel/assets/visualizations/big_number.js b/caravel/assets/visualizations/big_number.js index 42bec762029..d97728f01b6 100644 --- a/caravel/assets/visualizations/big_number.js +++ b/caravel/assets/visualizations/big_number.js @@ -180,7 +180,7 @@ function bigNumberVis(slice) { return { render: render, - resize: render + resize: render, }; } diff --git a/caravel/assets/visualizations/cal_heatmap.js b/caravel/assets/visualizations/cal_heatmap.js index 8629a4e5502..5ce2cd760a7 100644 --- a/caravel/assets/visualizations/cal_heatmap.js +++ b/caravel/assets/visualizations/cal_heatmap.js @@ -39,7 +39,7 @@ function calHeatmap(slice) { subDomain: json.data["subdomain"], range: json.data["range"], browsing: true, - legend: [extents[0], extents[0]+step, extents[0]+step*2, extents[0]+step*3] + legend: [extents[0], extents[0]+step, extents[0]+step*2, extents[0]+step*3], }); } catch (e) { slice.error(e); @@ -51,7 +51,7 @@ function calHeatmap(slice) { return { render: render, - resize: render + resize: render, }; } diff --git a/caravel/assets/visualizations/directed_force.js b/caravel/assets/visualizations/directed_force.js index e6ca616b773..62359a768d6 100644 --- a/caravel/assets/visualizations/directed_force.js +++ b/caravel/assets/visualizations/directed_force.js @@ -24,10 +24,10 @@ function directedForceVis(slice) { // Compute the distinct nodes from the links. links.forEach(function (link) { link.source = nodes[link.source] || (nodes[link.source] = { - name: link.source + name: link.source, }); link.target = nodes[link.target] || (nodes[link.target] = { - name: link.target + name: link.target, }); link.value = Number(link.value); @@ -168,7 +168,7 @@ function directedForceVis(slice) { }; return { render: render, - resize: render + resize: render, }; } diff --git a/caravel/assets/visualizations/filter_box.js b/caravel/assets/visualizations/filter_box.js index 4e4b030ed7d..c7844708b6e 100644 --- a/caravel/assets/visualizations/filter_box.js +++ b/caravel/assets/visualizations/filter_box.js @@ -30,7 +30,7 @@ function filterBox(slice) { $.getJSON(slice.jsonEndpoint({ // filter box should ignore the filters // otherwise there will be only a few options in the dropdown menu - extraFilters: false + extraFilters: false, }), function (payload) { var maxes = {}; @@ -57,7 +57,7 @@ function filterBox(slice) { dropdownAutoWidth: true, data: data, multiple: true, - formatResult: select2Formatter + formatResult: select2Formatter, }) .on('change', fltChanged); @@ -85,7 +85,7 @@ function filterBox(slice) { }; return { render: refresh, - resize: refresh + resize: refresh, }; } diff --git a/caravel/assets/visualizations/heatmap.js b/caravel/assets/visualizations/heatmap.js index 35cd7272583..9778e352b9b 100644 --- a/caravel/assets/visualizations/heatmap.js +++ b/caravel/assets/visualizations/heatmap.js @@ -17,7 +17,7 @@ function heatmapVis(slice) { top: 10, right: 10, bottom: 35, - left: 35 + left: 35, }; d3.json(slice.jsonEndpoint(), function (error, payload) { @@ -92,7 +92,7 @@ function heatmapVis(slice) { .range([0, hmWidth]), d3.scale.linear() .domain([0, heatmapDim[Y]]) - .range([0, hmHeight]) + .range([0, hmHeight]), ]; var container = d3.select(slice.selector); @@ -228,7 +228,7 @@ function heatmapVis(slice) { } return { render: refresh, - resize: refresh + resize: refresh, }; } diff --git a/caravel/assets/visualizations/horizon.js b/caravel/assets/visualizations/horizon.js index 0fefed31c01..a0d0633fa17 100644 --- a/caravel/assets/visualizations/horizon.js +++ b/caravel/assets/visualizations/horizon.js @@ -230,7 +230,7 @@ function horizonViz(slice) { } return { render: refresh, - resize: refresh + resize: refresh, }; } diff --git a/caravel/assets/visualizations/iframe.js b/caravel/assets/visualizations/iframe.js index a32f475c31d..5238d20346d 100644 --- a/caravel/assets/visualizations/iframe.js +++ b/caravel/assets/visualizations/iframe.js @@ -19,7 +19,7 @@ function iframeWidget(slice) { return { render: refresh, - resize: refresh + resize: refresh, }; } diff --git a/caravel/assets/visualizations/markup.js b/caravel/assets/visualizations/markup.js index 4b841af1bb5..9f55146d6e4 100644 --- a/caravel/assets/visualizations/markup.js +++ b/caravel/assets/visualizations/markup.js @@ -15,7 +15,7 @@ function markupWidget(slice) { } return { render: refresh, - resize: refresh + resize: refresh, }; } diff --git a/caravel/assets/visualizations/nvd3_vis.js b/caravel/assets/visualizations/nvd3_vis.js index 928a1b4be4e..191f35faa1d 100644 --- a/caravel/assets/visualizations/nvd3_vis.js +++ b/caravel/assets/visualizations/nvd3_vis.js @@ -267,7 +267,7 @@ function nvd3Vis(slice) { return { render: render, - resize: update + resize: update, }; } diff --git a/caravel/assets/visualizations/parallel_coordinates.js b/caravel/assets/visualizations/parallel_coordinates.js index 7cd2da83f36..b24e95de405 100644 --- a/caravel/assets/visualizations/parallel_coordinates.js +++ b/caravel/assets/visualizations/parallel_coordinates.js @@ -76,7 +76,7 @@ function parallelCoordVis(slice) { mouseover: function (d) { parcoords.highlight([d]); }, - mouseout: parcoords.unhighlight + mouseout: parcoords.unhighlight, }); // update data table on brush event parcoords.on("brush", function (d) { @@ -88,7 +88,7 @@ function parallelCoordVis(slice) { mouseover: function (d) { parcoords.highlight([d]); }, - mouseout: parcoords.unhighlight + mouseout: parcoords.unhighlight, }); }); } @@ -101,7 +101,7 @@ function parallelCoordVis(slice) { return { render: refresh, - resize: refresh + resize: refresh, }; } diff --git a/caravel/assets/visualizations/pivot_table.js b/caravel/assets/visualizations/pivot_table.js index bc16a9d1eeb..643f1e59dcf 100644 --- a/caravel/assets/visualizations/pivot_table.js +++ b/caravel/assets/visualizations/pivot_table.js @@ -21,7 +21,7 @@ module.exports = function (slice) { bInfo: false, scrollY: height + "px", scrollCollapse: true, - scrollX: true + scrollX: true, }); table.column('-1').order('desc').draw(); utils.fixDataTableBodyHeight( @@ -34,6 +34,6 @@ module.exports = function (slice) { } return { render: refresh, - resize: refresh + resize: refresh, }; }; diff --git a/caravel/assets/visualizations/sankey.js b/caravel/assets/visualizations/sankey.js index 80134fb7f16..d3ed68b4c31 100644 --- a/caravel/assets/visualizations/sankey.js +++ b/caravel/assets/visualizations/sankey.js @@ -13,7 +13,7 @@ function sankeyVis(slice) { top: 5, right: 5, bottom: 5, - left: 5 + left: 5, }; var width = slice.width() - margin.left - margin.right; var height = slice.height() - margin.top - margin.bottom; @@ -143,7 +143,7 @@ function sankeyVis(slice) { "