diff --git a/caravel/assets/.eslintrc b/caravel/assets/.eslintrc index f2cf5bd402..bec934dcf9 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 e5057cd0fb..fe7023f8bb 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 2e3520beea..a6ad2afe2d 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 0d9038e0e5..305aed681c 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 5eac3f49cc..fc0194896f 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 b847b83a1f..9803cceda0 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 42bec76202..d97728f01b 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 8629a4e550..5ce2cd760a 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 e6ca616b77..62359a768d 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 4e4b030ed7..c7844708b6 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 35cd727258..9778e352b9 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 0fefed31c0..a0d0633fa1 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 a32f475c31..5238d20346 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 4b841af1bb..9f55146d6e 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 928a1b4be4..191f35faa1 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 7cd2da83f3..b24e95de40 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 bc16a9d1ee..643f1e59dc 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 80134fb7f1..d3ed68b4c3 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) { "
", "", (isFinite(sourcePercent) ? sourcePercent : "100"), "% of ", d.source.name, "
", "" + (isFinite(targetPercent) ? targetPercent : "--") + "% of ", d.target.name, "target", - "
" + "", ].join(""); } return html; @@ -170,7 +170,7 @@ function sankeyVis(slice) { }; return { render: render, - resize: render + resize: render, }; } diff --git a/caravel/assets/visualizations/sunburst.js b/caravel/assets/visualizations/sunburst.js index f2018f400d..a8c6742b96 100644 --- a/caravel/assets/visualizations/sunburst.js +++ b/caravel/assets/visualizations/sunburst.js @@ -71,7 +71,7 @@ function sunburstVis(slice) { width: visWidth / maxBreadcrumbs, height: breadcrumbHeight *0.8, // more margin spacing: 3, - tipTailWidth: 10 + tipTailWidth: 10, }; breadcrumbs = svg.append("svg:g") @@ -301,7 +301,7 @@ function sunburstVis(slice) { function buildHierarchy(rows) { var root = { name: "root", - children: [] + children: [], }; for (var i = 0; i < rows.length; i++) { // each record [groupby1val, groupby2val, ( or 0)n, m1, m2] @@ -338,7 +338,7 @@ function sunburstVis(slice) { childNode = { name: nodeName, children: [], - level: level + level: level, }; children.push(childNode); } @@ -349,7 +349,7 @@ function sunburstVis(slice) { childNode = { name: nodeName, m1: m1, - m2: m2 + m2: m2, }; children.push(childNode); } @@ -379,7 +379,7 @@ function sunburstVis(slice) { return { render: render, - resize: render + resize: render, }; } diff --git a/caravel/assets/visualizations/table.js b/caravel/assets/visualizations/table.js index 1b0d20f67f..2eab71988f 100644 --- a/caravel/assets/visualizations/table.js +++ b/caravel/assets/visualizations/table.js @@ -79,7 +79,7 @@ function tableVis(slice) { return { col: c, val: val, - isMetric: metrics.indexOf(c) >= 0 + isMetric: metrics.indexOf(c) >= 0, }; }); }).enter() @@ -132,7 +132,7 @@ function tableVis(slice) { bInfo: false, scrollY: height + "px", scrollCollapse: true, - scrollX: true + scrollX: true, }); utils.fixDataTableBodyHeight( slice.container.find('.dataTables_wrapper'), height); @@ -148,7 +148,7 @@ function tableVis(slice) { return { render: refresh, - resize: function () {} + resize: function () {}, }; } diff --git a/caravel/assets/visualizations/treemap.js b/caravel/assets/visualizations/treemap.js index 7cc297729f..6a64afcc2f 100644 --- a/caravel/assets/visualizations/treemap.js +++ b/caravel/assets/visualizations/treemap.js @@ -251,7 +251,7 @@ function treemap(slice) { return { render: render, - resize: render + resize: render, }; } diff --git a/caravel/assets/visualizations/word_cloud.js b/caravel/assets/visualizations/word_cloud.js index 6a5e23fefc..c4ff035898 100644 --- a/caravel/assets/visualizations/word_cloud.js +++ b/caravel/assets/visualizations/word_cloud.js @@ -14,7 +14,7 @@ function wordCloudChart(slice) { var data = json.data; var range = [ json.form_data.size_from, - json.form_data.size_to + json.form_data.size_to, ]; var rotation = json.form_data.rotation; var f_rotation; @@ -84,7 +84,7 @@ function wordCloudChart(slice) { return { render: refresh, - resize: refresh + resize: refresh, }; } diff --git a/caravel/assets/visualizations/world_map.js b/caravel/assets/visualizations/world_map.js index 5a24227aec..f807e4e976 100644 --- a/caravel/assets/visualizations/world_map.js +++ b/caravel/assets/visualizations/world_map.js @@ -58,7 +58,7 @@ function worldMapChart(slice) { element: slice.container.get(0), data: data, fills: { - defaultFill: '#ddd' + defaultFill: '#ddd', }, geographyConfig: { popupOnHover: true, @@ -70,7 +70,7 @@ function worldMapChart(slice) { highlightBorderWidth: 1, popupTemplate: function (geo, data) { return '
' + data.name + '
' + f(data.m1) + '
'; - } + }, }, bubblesConfig: { borderWidth: 1, @@ -90,8 +90,8 @@ function worldMapChart(slice) { highlightBorderOpacity: 1, highlightFillOpacity: 0.85, exitDelay: 100, - key: JSON.stringify - } + key: JSON.stringify, + }, }); map.updateChoropleth(d); @@ -108,7 +108,7 @@ function worldMapChart(slice) { return { render: render, - resize: render + resize: render, }; } diff --git a/caravel/assets/webpack.config.js b/caravel/assets/webpack.config.js index 731d50b702..febd1b8988 100644 --- a/caravel/assets/webpack.config.js +++ b/caravel/assets/webpack.config.js @@ -11,17 +11,17 @@ const config = { welcome: APP_DIR + '/javascripts/welcome.js', sql: APP_DIR + '/javascripts/sql.js', standalone: APP_DIR + '/javascripts/standalone.js', - common: APP_DIR + '/javascripts/common.js' + common: APP_DIR + '/javascripts/common.js', }, output: { path: BUILD_DIR, - filename: '[name].entry.js' + filename: '[name].entry.js', }, resolve: { extensions: ['', '.js', '.jsx'], alias: { - webworkify: 'webworkify-webpack' - } + webworkify: 'webworkify-webpack', + }, }, module: { loaders: [ @@ -30,22 +30,22 @@ const config = { exclude: APP_DIR + '/node_modules', loader: 'babel', query: { - presets: ['airbnb', 'es2015', 'react'] - } + presets: ['airbnb', 'es2015', 'react'], + }, }, /* for react-map-gl overlays */ { test: /\.react\.js$/, include: APP_DIR + '/node_modules/react-map-gl/src/overlays', - loader: 'babel' + loader: 'babel', }, /* for require('*.css') */ { test: /\.css$/, include: APP_DIR, - loader: "style-loader!css-loader" + loader: "style-loader!css-loader", }, /* for css linking images */ @@ -61,32 +61,32 @@ const config = { { test: /\.less$/, include: APP_DIR, - loader: "style!css!less" + loader: "style!css!less", }, /* for mapbox */ { test: /\.json$/, - loader: 'json-loader' + loader: 'json-loader', }, { test: /\.js$/, include: APP_DIR + '/node_modules/mapbox-gl/js/render/painter/use_program.js', - loader: 'transform/cacheable?brfs' - } + loader: 'transform/cacheable?brfs', + }, ], postLoaders: [{ include: /node_modules\/mapbox-gl/, loader: 'transform', - query: 'brfs' - }] + query: 'brfs', + }], }, externals: { cheerio: 'window', 'react/lib/ExecutionEnvironment': true, - 'react/lib/ReactContext': true + 'react/lib/ReactContext': true, }, - plugins: [] + plugins: [], }; module.exports = config;