diff --git a/zeppelin-web/.eslintrc b/zeppelin-web/.eslintrc index 07090caf37..b40bba1de2 100644 --- a/zeppelin-web/.eslintrc +++ b/zeppelin-web/.eslintrc @@ -39,7 +39,6 @@ "no-redeclare": 0, "standard/object-curly-even-spacing": 0, "no-eval": 0, - "no-extra-semi": 0, "no-unneeded-ternary": 0, "padded-blocks": 0, "no-var": 0, diff --git a/zeppelin-web/src/app/handsontable/handsonHelper.js b/zeppelin-web/src/app/handsontable/handsonHelper.js index 8e5519acec..f845750684 100644 --- a/zeppelin-web/src/app/handsontable/handsonHelper.js +++ b/zeppelin-web/src/app/handsontable/handsonHelper.js @@ -21,7 +21,7 @@ export default class HandsonHelper { this.rows = rows || []; this.comment = comment || ''; this._numericValidator = this._numericValidator.bind(this); - }; + } getHandsonTableConfig (columns, columnNames, resultRows) { var self = this; @@ -68,7 +68,7 @@ export default class HandsonHelper { TH.style['white-space'] = 'normal'; } }; - }; + } /* ** Private Service Functions diff --git a/zeppelin-web/src/app/helium/helium.controller.js b/zeppelin-web/src/app/helium/helium.controller.js index b0f6f93d19..2307934fab 100644 --- a/zeppelin-web/src/app/helium/helium.controller.js +++ b/zeppelin-web/src/app/helium/helium.controller.js @@ -58,7 +58,7 @@ export default function HeliumCtrl ($scope, $rootScope, $sce, $scope.bundleOrder = visPackageOrder; $scope.bundleOrderChanged = false; }); - }; + } var orderPackageByPubDate = function (a, b) { if (!a.pkg.published) { diff --git a/zeppelin-web/src/app/notebookRepos/notebookRepos.controller.js b/zeppelin-web/src/app/notebookRepos/notebookRepos.controller.js index 876310c072..8715b29872 100644 --- a/zeppelin-web/src/app/notebookRepos/notebookRepos.controller.js +++ b/zeppelin-web/src/app/notebookRepos/notebookRepos.controller.js @@ -83,5 +83,5 @@ function NotebookReposCtrl ($http, baseUrlSrv, ngToast) { function _init () { _getInterpreterSettings(); - }; + } } diff --git a/zeppelin-web/src/app/tabledata/columnselector.js b/zeppelin-web/src/app/tabledata/columnselector.js index c1fe2bcecf..e483325cfd 100644 --- a/zeppelin-web/src/app/tabledata/columnselector.js +++ b/zeppelin-web/src/app/tabledata/columnselector.js @@ -29,7 +29,7 @@ export default class ColumnselectorTransformation extends Transformation { constructor (config, columnSelectorProp) { super(config); this.props = columnSelectorProp; - }; + } getSetting () { var self = this; @@ -49,7 +49,7 @@ export default class ColumnselectorTransformation extends Transformation { } } }; - }; + } /** * Method will be invoked when tableData or config changes @@ -58,7 +58,7 @@ export default class ColumnselectorTransformation extends Transformation { this.tableDataColumns = tableData.columns; this.removeUnknown(); return tableData; - }; + } removeUnknown () { var fields = this.config; @@ -78,5 +78,5 @@ export default class ColumnselectorTransformation extends Transformation { } } } - }; + } } diff --git a/zeppelin-web/src/app/tabledata/passthrough.js b/zeppelin-web/src/app/tabledata/passthrough.js index c57db086fb..d7363d4a9e 100644 --- a/zeppelin-web/src/app/tabledata/passthrough.js +++ b/zeppelin-web/src/app/tabledata/passthrough.js @@ -20,12 +20,12 @@ import Transformation from './transformation'; export default class PassthroughTransformation extends Transformation { constructor (config) { super(config); - }; + } /** * Method will be invoked when tableData or config changes */ transform (tableData) { return tableData; - }; + } } diff --git a/zeppelin-web/src/app/tabledata/pivot.js b/zeppelin-web/src/app/tabledata/pivot.js index 5a07e6b51d..11f4f722e1 100644 --- a/zeppelin-web/src/app/tabledata/pivot.js +++ b/zeppelin-web/src/app/tabledata/pivot.js @@ -20,7 +20,7 @@ import Transformation from './transformation'; export default class PivotTransformation extends Transformation { constructor (config) { super(config); - }; + } getSetting () { var self = this; @@ -53,7 +53,7 @@ export default class PivotTransformation extends Transformation { } } }; - }; + } /** * Method will be invoked when tableData or config changes @@ -78,7 +78,7 @@ export default class PivotTransformation extends Transformation { config.keys, config.groups, config.values); - }; + } removeUnknown () { var config = this.config.common.pivot; @@ -116,7 +116,7 @@ export default class PivotTransformation extends Transformation { unique(config.groups); removeUnknown(config.groups); removeUnknown(config.values); - }; + } selectDefault () { var config = this.config.common.pivot; @@ -131,7 +131,7 @@ export default class PivotTransformation extends Transformation { config.values.push(this.tableDataColumns[1]); } } - }; + } pivot (data, keys, groups, values) { var aggrFunc = { @@ -258,5 +258,5 @@ export default class PivotTransformation extends Transformation { schema: schema, rows: rows }; - }; + } } diff --git a/zeppelin-web/src/app/tabledata/tabledata.js b/zeppelin-web/src/app/tabledata/tabledata.js index 02ff40937b..57a83b878a 100644 --- a/zeppelin-web/src/app/tabledata/tabledata.js +++ b/zeppelin-web/src/app/tabledata/tabledata.js @@ -20,7 +20,7 @@ export default class TableData { this.columns = columns || []; this.rows = rows || []; this.comment = comment || ''; - }; + } loadParagraphResult (paragraphResult) { if (!paragraphResult || paragraphResult.type !== 'TABLE') { @@ -69,5 +69,5 @@ export default class TableData { this.comment = comment; this.columns = columnNames; this.rows = rows; - }; + } } diff --git a/zeppelin-web/src/app/tabledata/transformation.js b/zeppelin-web/src/app/tabledata/transformation.js index 4db08b20d0..c4b1bbb9f1 100644 --- a/zeppelin-web/src/app/tabledata/transformation.js +++ b/zeppelin-web/src/app/tabledata/transformation.js @@ -19,7 +19,7 @@ export default class Transformation { constructor (config) { this.config = config; this._emitter; - }; + } /** * return { @@ -29,14 +29,14 @@ export default class Transformation { */ getSetting () { // override this - }; + } /** * Method will be invoked when tableData or config changes */ transform (tableData) { // override this - }; + } /** * render setting @@ -81,23 +81,23 @@ export default class Transformation { } else { this._render(targetEl, template, scope); } - }; + } _render (targetEl, template, scope) { this._targetEl = targetEl; targetEl.html(template); this._compile(targetEl.contents())(scope); this._scope = scope; - }; + } setConfig (config) { this.config = config; - }; + } /** * Emit config. config will sent to server and saved. */ emitConfig (config) { this._emitter(config); - }; + } } diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js b/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js index 36166b6c8a..abf606bc9d 100644 --- a/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js +++ b/zeppelin-web/src/app/visualization/builtins/visualization-areachart.js @@ -23,15 +23,15 @@ export default class AreachartVisualization extends Nvd3ChartVisualization { super(targetEl, config); this.pivot = new PivotTransformation(config); - }; + } type () { return 'stackedAreaChart'; - }; + } getTransformation () { return this.pivot; - }; + } render (pivot) { var d3Data = this.d3DataFromPivot( @@ -46,7 +46,7 @@ export default class AreachartVisualization extends Nvd3ChartVisualization { this.xLabels = d3Data.xLabels; super.render(d3Data); - }; + } /** * Set new config @@ -54,7 +54,7 @@ export default class AreachartVisualization extends Nvd3ChartVisualization { setConfig (config) { super.setConfig(config); this.pivot.setConfig(config); - }; + } configureChart (chart) { var self = this; @@ -74,5 +74,5 @@ export default class AreachartVisualization extends Nvd3ChartVisualization { self.emitConfig(self.config); }, 500); }); - }; + } } diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js b/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js index ff00279239..5df6d03634 100644 --- a/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js +++ b/zeppelin-web/src/app/visualization/builtins/visualization-barchart.js @@ -23,15 +23,15 @@ export default class BarchartVisualization extends Nvd3ChartVisualization { super(targetEl, config); this.pivot = new PivotTransformation(config); - }; + } type () { return 'multiBarChart'; - }; + } getTransformation () { return this.pivot; - }; + } render (pivot) { var d3Data = this.d3DataFromPivot( @@ -54,7 +54,7 @@ export default class BarchartVisualization extends Nvd3ChartVisualization { setConfig (config) { super.setConfig(config); this.pivot.setConfig(config); - }; + } configureChart (chart) { var self = this; @@ -106,8 +106,6 @@ export default class BarchartVisualization extends Nvd3ChartVisualization { }); }; - - getSetting(chart) { var self = this; var configObj = self.config; diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-linechart.js b/zeppelin-web/src/app/visualization/builtins/visualization-linechart.js index 8ff34df774..8e3ef2dd2a 100644 --- a/zeppelin-web/src/app/visualization/builtins/visualization-linechart.js +++ b/zeppelin-web/src/app/visualization/builtins/visualization-linechart.js @@ -23,7 +23,7 @@ export default class LinechartVisualization extends Nvd3ChartVisualization { super(targetEl, config); this.pivot = new PivotTransformation(config); - }; + } type () { if (this.config.lineWithFocus) { @@ -31,11 +31,11 @@ export default class LinechartVisualization extends Nvd3ChartVisualization { } else { return 'lineChart'; } - }; + } getTransformation () { return this.pivot; - }; + } render (pivot) { var d3Data = this.d3DataFromPivot( @@ -50,7 +50,7 @@ export default class LinechartVisualization extends Nvd3ChartVisualization { this.xLabels = d3Data.xLabels; super.render(d3Data); - }; + } /** * Set new config @@ -64,7 +64,7 @@ export default class LinechartVisualization extends Nvd3ChartVisualization { super.destroy(); this.currentMode = config.lineWithFocus; } - }; + } configureChart (chart) { var self = this; @@ -84,7 +84,7 @@ export default class LinechartVisualization extends Nvd3ChartVisualization { } else { chart.forceY([]); } - }; + } getSetting (chart) { var self = this; @@ -114,9 +114,9 @@ export default class LinechartVisualization extends Nvd3ChartVisualization { } } }; - }; + } defaultY () { return undefined; - }; + } } diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-nvd3chart.js b/zeppelin-web/src/app/visualization/builtins/visualization-nvd3chart.js index a850cd325b..4109618328 100644 --- a/zeppelin-web/src/app/visualization/builtins/visualization-nvd3chart.js +++ b/zeppelin-web/src/app/visualization/builtins/visualization-nvd3chart.js @@ -21,13 +21,13 @@ export default class Nvd3ChartVisualization extends Visualization { constructor (targetEl, config) { super(targetEl, config); this.targetEl.append(''); - }; + } refresh () { if (this.chart) { this.chart.update(); } - }; + } render (data) { var type = this.type(); @@ -58,19 +58,19 @@ export default class Nvd3ChartVisualization extends Visualization { .duration(animationDuration) .call(this.chart); d3.select('#' + this.targetEl[0].id + ' svg').style.height = height + 'px'; - }; + } type () { // override this and return chart type - }; + } configureChart (chart) { // override this to configure chart - }; + } groupedThousandsWith3DigitsFormatter (x) { return d3.format(',')(d3.round(x, 3)); - }; + } customAbbrevFormatter (x) { var s = d3.format('.3s')(x); @@ -78,11 +78,11 @@ export default class Nvd3ChartVisualization extends Visualization { case 'G': return s.slice(0, -1) + 'B'; } return s; - }; + } defaultY () { return 0; - }; + } xAxisTickFormat (d, xLabels) { if (xLabels[d] && (isNaN(parseFloat(xLabels[d])) || !isFinite(xLabels[d]))) { // to handle string type xlabel @@ -90,14 +90,14 @@ export default class Nvd3ChartVisualization extends Visualization { } else { return d; } - }; + } yAxisTickFormat (d) { if (Math.abs(d) >= Math.pow(10, 6)) { return this.customAbbrevFormatter(d); } return this.groupedThousandsWith3DigitsFormatter(d); - }; + } d3DataFromPivot ( schema, rows, keys, groups, values, allowTextXAxis, fillMissingValues, multiBarChart) { @@ -246,7 +246,7 @@ export default class Nvd3ChartVisualization extends Visualization { xLabels: rowIndexValue, d3g: d3g }; - }; + } /** * method will be invoked when visualization need to be destroyed. @@ -257,5 +257,5 @@ export default class Nvd3ChartVisualization extends Visualization { d3.selectAll('#' + this.targetEl[0].id + ' svg > *').remove(); this.chart = undefined; } - }; + } } diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js b/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js index 5215570b8b..3a60c62c75 100644 --- a/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js +++ b/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js @@ -22,15 +22,15 @@ export default class PiechartVisualization extends Nvd3ChartVisualization { constructor (targetEl, config) { super(targetEl, config); this.pivot = new PivotTransformation(config); - }; + } type () { return 'pieChart'; - }; + } getTransformation () { return this.pivot; - }; + } render (pivot) { // [ZEPPELIN-2253] New chart function will be created each time inside super.render() @@ -64,7 +64,7 @@ export default class PiechartVisualization extends Nvd3ChartVisualization { // [].concat flattens it, http://stackoverflow.com/a/10865042/5154397 d3g = [].concat.apply([], d3g); super.render({d3g: d3g}); - }; + } /** * Set new config @@ -72,12 +72,12 @@ export default class PiechartVisualization extends Nvd3ChartVisualization { setConfig (config) { super.setConfig(config); this.pivot.setConfig(config); - }; + } configureChart (chart) { chart.x(function (d) { return d.label; }) .y(function (d) { return d.value; }) .showLabels(false) .showTooltipPercent(true); - }; + } } diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-scatterchart.js b/zeppelin-web/src/app/visualization/builtins/visualization-scatterchart.js index 527af9f141..41a36f951b 100644 --- a/zeppelin-web/src/app/visualization/builtins/visualization-scatterchart.js +++ b/zeppelin-web/src/app/visualization/builtins/visualization-scatterchart.js @@ -43,15 +43,15 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { } ]; this.columnselector = new ColumnselectorTransformation(config, this.columnselectorProps); - }; + } type () { return 'scatterChart'; - }; + } getTransformation () { return this.columnselector; - }; + } render (tableData) { this.tableData = tableData; @@ -61,7 +61,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { this.yLabels = d3Data.yLabels; super.render(d3Data); - }; + } configureChart (chart) { var self = this; @@ -76,7 +76,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { chart.showDistX(true).showDistY(true); // handle the problem of tooltip not showing when muliple points have same value. - }; + } yAxisTickFormat (d, yLabels) { if (yLabels[d] && (isNaN(parseFloat(yLabels[d])) || !isFinite(yLabels[d]))) { // to handle string type xlabel @@ -95,7 +95,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { this.config.xAxis = this.tableData.columns[0]; } } - }; + } setScatterChart (data, refresh) { var xAxis = this.config.xAxis; @@ -239,7 +239,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { yLabels: colIndexValue, d3g: d3g }; - }; + } setDiscreteScatterData (data) { var xAxis = this.config.xAxis; @@ -289,7 +289,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { newRows.push(newRow); } return newRows; - }; + } isDiscrete (field) { var getUnique = function (f) { @@ -320,7 +320,7 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { } else { return false; } - }; + } isValidSizeOption (options) { var xValues = []; @@ -356,5 +356,5 @@ export default class ScatterchartVisualization extends Nvd3ChartVisualization { } return true; - }; + } } diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-table.js b/zeppelin-web/src/app/visualization/builtins/visualization-table.js index f2325592a5..4df1d4114b 100644 --- a/zeppelin-web/src/app/visualization/builtins/visualization-table.js +++ b/zeppelin-web/src/app/visualization/builtins/visualization-table.js @@ -25,11 +25,11 @@ export default class TableVisualization extends Visualization { console.log('Init table viz'); targetEl.addClass('table'); this.passthrough = new PassthroughTransformation(config); - }; + } refresh () { this.hot.render(); - }; + } render (tableData) { var height = this.targetEl.height(); @@ -48,15 +48,15 @@ export default class TableVisualization extends Visualization { this.hot = new Handsontable(container, handsonHelper.getHandsonTableConfig( columns, columnNames, resultRows)); this.hot.validateCells(null); - }; + } destroy () { if (this.hot) { this.hot.destroy(); } - }; + } getTransformation () { return this.passthrough; - }; + } } diff --git a/zeppelin-web/src/app/visualization/visualization.js b/zeppelin-web/src/app/visualization/visualization.js index 934f496a8d..d855f975ef 100644 --- a/zeppelin-web/src/app/visualization/visualization.js +++ b/zeppelin-web/src/app/visualization/visualization.js @@ -22,28 +22,28 @@ export default class Visualization { this._dirty = false; this._active = false; this._emitter; - }; + } /** * get transformation */ getTransformation () { // override this - }; + } /** * Method will be invoked when data or configuration changed */ render (tableData) { // override this - }; + } /** * Refresh visualization. */ refresh () { // override this - }; + } /** * method will be invoked when visualization need to be destroyed. @@ -51,7 +51,7 @@ export default class Visualization { */ destroy () { // override this - }; + } /** * return { @@ -61,7 +61,7 @@ export default class Visualization { */ getSetting () { // override this - }; + } /** * Activate. invoked when visualization is selected @@ -72,21 +72,21 @@ export default class Visualization { this._dirty = false; } this._active = true; - }; + } /** * Activate. invoked when visualization is de selected */ deactivate () { this._active = false; - }; + } /** * Is active */ isActive () { return this._active; - }; + } /** * When window or paragraph is resized @@ -97,7 +97,7 @@ export default class Visualization { } else { this._dirty = true; } - }; + } /** * Set new config @@ -109,14 +109,14 @@ export default class Visualization { } else { this._dirty = true; } - }; + } /** * Emit config. config will sent to server and saved. */ emitConfig (config) { this._emitter(config); - }; + } /** * render setting @@ -160,7 +160,7 @@ export default class Visualization { } else { _renderSetting(this, targetEl, template, scope); } - }; + } } function _renderSetting (instance, targetEl, template, scope) { @@ -168,4 +168,4 @@ function _renderSetting (instance, targetEl, template, scope) { targetEl.html(template); instance._compile(targetEl.contents())(scope); instance._scope = scope; -}; +}