diff --git a/src/js/charts/cb-chart-grid/parse-chart-grid.js b/src/js/charts/cb-chart-grid/parse-chart-grid.js index e24eba9f..a9a0b5e9 100644 --- a/src/js/charts/cb-chart-grid/parse-chart-grid.js +++ b/src/js/charts/cb-chart-grid/parse-chart-grid.js @@ -78,7 +78,7 @@ function parseChartgrid(config, _chartProps, callback, parseOpts) { var factor = Math.pow(10, maxPrecision); gridSettings.type = _chartProps._grid.type || "line"; - _computed = { + var _computed = { //TODO look at entries for all series not just the first data: bySeries.series[0].values.map(function(d){return +d.entry}), hasColumn: false, diff --git a/src/js/charts/cb-xy/parse-xy.js b/src/js/charts/cb-xy/parse-xy.js index ab1bbe58..5803fb8a 100644 --- a/src/js/charts/cb-xy/parse-xy.js +++ b/src/js/charts/cb-xy/parse-xy.js @@ -182,7 +182,7 @@ function parseXY(config, _chartProps, callback, parseOpts) { if (bySeries.isNumeric) { scale.isNumeric = bySeries.isNumeric; - _computed = { + var _computed = { //TODO look at entries for all series not just the first data: bySeries.series[0].values.map(function(d){return +d.entry}), hasColumn: false, diff --git a/src/js/components/ChartExport.jsx b/src/js/components/ChartExport.jsx index 52fa9343..8d3b4f50 100644 --- a/src/js/components/ChartExport.jsx +++ b/src/js/components/ChartExport.jsx @@ -101,7 +101,7 @@ var ChartExport = React.createClass({ }, downloadPNG: function() { - filename = this._makeFilename("png"); + var filename = this._makeFilename("png"); saveSvgAsPng.saveSvgAsPng(this.state.chartNode, filename, { scale: 2.0 }); }, diff --git a/src/js/components/shared/DataInput.jsx b/src/js/components/shared/DataInput.jsx index 1af7d846..d3bcf56f 100644 --- a/src/js/components/shared/DataInput.jsx +++ b/src/js/components/shared/DataInput.jsx @@ -43,13 +43,13 @@ var DataInput = React.createClass({ _handleReparseUpdate: function(k, v) { if (k == "input") { - input = update(this.props.chartProps.input, { $merge: { + var input = update(this.props.chartProps.input, { $merge: { raw: v, type: undefined }}); ChartViewActions.updateInput(k, input); } else if (k == "type") { - input = update(this.props.chartProps.input, { $set: { + var input = update(this.props.chartProps.input, { $set: { raw: v.raw, type: v.type }}); diff --git a/src/js/util/parse-delimited-input.js b/src/js/util/parse-delimited-input.js index d33c67ab..90d89692 100644 --- a/src/js/util/parse-delimited-input.js +++ b/src/js/util/parse-delimited-input.js @@ -131,6 +131,7 @@ function cast_data(input, columnNames, stripCharsRegex, opts) { var index_types = unique(all_index_types); + /* Dead code, hasDate/isNumeric never used, and strict mode complains about assignment to undefined if(index_types.length !== 1 && !opts.type) { } @@ -138,6 +139,7 @@ function cast_data(input, columnNames, stripCharsRegex, opts) { hasDate = opts.type ? opts.type == "date" : index_types[0] === "date"; isNumeric = opts.type ? opts.type == "numeric" : index_types[0] === "number"; } + */ return { data: data, diff --git a/src/js/util/validate-data-input.js b/src/js/util/validate-data-input.js index 1a09d47c..ae769507 100644 --- a/src/js/util/validate-data-input.js +++ b/src/js/util/validate-data-input.js @@ -8,7 +8,7 @@ var some = require("lodash/some"); var unique = require("lodash/uniq"); var catchChartMistakes = require("./catch-chart-mistakes"); -types = { +let types = { "number": "numeric", "object": "date", "string": "ordinal"