Adding "use strict"; in all chart code.

Fixed any exceptions thrown when "use strict" was added.
master
Robin Hu 11 years ago
parent 6d0b196892
commit 9fbe68c8d8

@ -7,6 +7,7 @@ the rectangle. The dispatch is given one object which contains the mouseX/Y loca
It also has 'pointXValue', which is the conversion of mouseX to the x-axis scale.
*/
nv.interactiveGuideline = function() {
"use strict";
var tooltip = nv.models.tooltip();
//Public settings
var width = null
@ -25,7 +26,7 @@ nv.interactiveGuideline = function() {
//Private variables
var previousXCoordinate = null
isMSIE = navigator.userAgent.indexOf("MSIE") !== -1 //Check user-agent for Microsoft Internet Explorer.
var isMSIE = navigator.userAgent.indexOf("MSIE") !== -1 //Check user-agent for Microsoft Internet Explorer.
;
@ -196,6 +197,7 @@ Has the following known issues:
* Won't work if there are duplicate x coordinate values.
*/
nv.interactiveBisect = function (values, searchVal, xAccessor) {
"use strict";
if (! values instanceof Array) return null;
if (typeof xAccessor !== 'function') xAccessor = function(d,i) { return d.x;}

@ -1,5 +1,5 @@
nv.models.axis = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.chartName = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -4,7 +4,7 @@
// http://projects.instantcognition.com/protovis/bulletchart/
nv.models.bullet = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -3,7 +3,7 @@
// based on the work of Clint Ivy, Jamie Love, and Jason Davies.
// http://projects.instantcognition.com/protovis/bulletchart/
nv.models.bulletChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.cumulativeLineChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
//TODO: consider deprecating by adding necessary features to multiBar model
nv.models.discreteBar = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.discreteBarChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.distribution = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
//TODO: consider deprecating and using multibar with single series for this
nv.models.historicalBar = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.historicalBarChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,5 @@
nv.models.indentedTree = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,5 @@
nv.models.legend = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------
@ -131,7 +131,7 @@ nv.models.legend = function() {
columnWidths = [];
seriesPerRow--;
for (k = 0; k < seriesWidths.length; k++) {
for (var k = 0; k < seriesWidths.length; k++) {
if (seriesWidths[k] > (columnWidths[k % seriesPerRow] || 0) )
columnWidths[k % seriesPerRow] = seriesWidths[k];
}

@ -1,6 +1,6 @@
nv.models.line = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.lineChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.linePlusBarChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.linePlusBarWithFocusChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,6 @@
nv.models.line = function() {
"use strict";
//Default Settings
var margin = {top: 0, right: 0, bottom: 0, left: 0},
width = 960,

@ -1,5 +1,6 @@
nv.models.lineChart = function() {
"use strict";
var margin = {top: 30, right: 20, bottom: 50, left: 60},
color = nv.utils.defaultColor(),
width = null,

@ -1,6 +1,6 @@
nv.models.lineWithFocusChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------
@ -271,7 +271,7 @@ nv.models.lineWithFocusChart = function() {
.attr('y', 0)
.attr('height', availableHeight2);
gBrush = g.select('.nv-x.nv-brush')
var gBrush = g.select('.nv-x.nv-brush')
.call(brush);
gBrush.selectAll('rect')
//.attr('y', -5)
@ -366,7 +366,7 @@ nv.models.lineWithFocusChart = function() {
function onBrush() {
brushExtent = brush.empty() ? null : brush.extent();
extent = brush.empty() ? x2.domain() : brush.extent();
var extent = brush.empty() ? x2.domain() : brush.extent();
//The brush extent cannot be less than one. If it is, don't update the line chart.
if (Math.abs(extent[0] - extent[1]) <= 1) {

@ -1,6 +1,6 @@
nv.models.multiBar = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.multiBarChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.multiBarHorizontal = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.multiBarHorizontalChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,5 @@
nv.models.multiBarTimeSeries = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,5 @@
nv.models.multiBarTimeSeriesChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,5 @@
nv.models.multiChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.ohlcBar = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -3,7 +3,7 @@
// http://bl.ocks.org/jasondavies/1341281
nv.models.parallelCoordinates = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,5 @@
nv.models.pie = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,5 +1,5 @@
nv.models.pieChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.scatter = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.scatterChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.scatterPlusLineChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.sparkline = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.sparklinePlus = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.stackedArea = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -1,6 +1,6 @@
nv.models.stackedAreaChart = function() {
"use strict";
//============================================================
// Public Variables with Default Settings
//------------------------------------------------------------

@ -5,7 +5,7 @@ window.nv.tooltip.show is the old tooltip code.
window.nv.tooltip.* also has various helper methods.
*/
(function() {
"use strict";
window.nv.tooltip = {};
/* Model which can be instantiated to handle tooltip rendering.

Loading…
Cancel
Save