Skip to content

Commit 2ac200e

Browse files
committed
Merging in upstream changes
2 parents 2a76897 + aecd147 commit 2ac200e

27 files changed

+711
-102
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Minifying your fork:
2121

2222
The Makefile requires [UglifyJS](https://github.com/mishoo/UglifyJS).
2323

24-
The easist way to install is to install via npm. Run `npm install
24+
The easiest way to install is to install via npm. Run `npm install
2525
uglify-js` from your home directory, then add the output from `npm bin`
2626
into your path so that you have access to `uglifyjs` from the command
2727
line (remember to restart your terminal window when adding to the path.)

build.sh

-6
This file was deleted.

examples/cumulativeLineChart.html

+23-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,14 @@
4949

5050

5151
// Wrapping in nv.addGraph allows for '0 timeout render', stors rendered charts in nv.graphs, and may do more in the future... it's NOT required
52+
var chart;
5253
nv.addGraph(function() {
53-
var chart = nv.models.cumulativeLineChart()
54-
.x(function(d) { return d[0] })
55-
.y(function(d) { return d[1]/100 })
56-
.color(d3.scale.category10().range());
54+
55+
chart = nv.models.cumulativeLineChart()
56+
.x(function(d) { return d[0] })
57+
.y(function(d) { return d[1]/100 })
58+
.color(d3.scale.category10().range())
59+
.clipVoronoi(false);
5760

5861
chart.xAxis
5962
.tickFormat(function(d) {
@@ -64,6 +67,7 @@
6467
.tickFormat(d3.format(',.1%'));
6568

6669
d3.select('#chart1 svg')
70+
// .datum(cumulativeTestData())
6771
.datum(cumulativeTestData())
6872
//.transition().duration(500)
6973
.call(chart);
@@ -72,10 +76,25 @@
7276
nv.utils.windowResize(chart.update);
7377
//nv.utils.windowResize(function() { d3.select('#chart1 svg').call(chart) });
7478

79+
80+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
81+
7582
return chart;
7683
});
7784

7885

86+
function flatTestData() {
87+
return [
88+
{
89+
key: "Snakes",
90+
values: [0,1,2,3,4,5,6,7,8,9].map(function(d) {
91+
var currentDate = new Date();
92+
currentDate.setDate(currentDate.getDate() + d);
93+
return [currentDate, 0]
94+
})
95+
}
96+
];
97+
}
7998

8099

81100
function cumulativeTestData() {

examples/lineChart.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151

5252

5353
// Wrapping in nv.addGraph allows for '0 timeout render', stores rendered charts in nv.graphs, and may do more in the future... it's NOT required
54+
var chart;
55+
5456
nv.addGraph(function() {
55-
var chart = nv.models.lineChart();
57+
chart = nv.models.lineChart();
5658

5759
chart
5860
.x(function(d,i) { return i })
@@ -75,6 +77,8 @@
7577
nv.utils.windowResize(chart.update);
7678
//nv.utils.windowResize(function() { d3.select('#chart1 svg').call(chart) });
7779

80+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
81+
7882
return chart;
7983
});
8084

examples/linePlusBarChart.html

+7-4
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@
5353
},
5454
{
5555
"key" : "Price" ,
56-
"values" : [ [ 1136005200000 , 71.89] , [ 1138683600000 , 75.51] , [ 1141102800000 , 68.49] , [ 1143781200000 , 62.72] , [ 1146369600000 , 70.39] , [ 1149048000000 , 59.77] , [ 1151640000000 , 57.27] , [ 1154318400000 , 67.96] , [ 1156996800000 , 67.85] , [ 1159588800000 , 76.98] , [ 1162270800000 , 81.08] , [ 1164862800000 , 91.66] , [ 1167541200000 , 84.84] , [ 1170219600000 , 85.73] , [ 1172638800000 , 84.61] , [ 1175313600000 , 92.91] , [ 1177905600000 , 99.8] , [ 1180584000000 , 121.191] , [ 1183176000000 , 122.04] , [ 1185854400000 , 131.76] , [ 1188532800000 , 138.48] , [ 1191124800000 , 153.47] , [ 1193803200000 , 189.95] , [ 1196398800000 , 182.22] , [ 1199077200000 , 198.08] , [ 1201755600000 , 135.36] , [ 1204261200000 , 125.02] , [ 1206936000000 , 143.5] , [ 1209528000000 , 173.95] , [ 1212206400000 , 188.75] , [ 1214798400000 , 167.44] , [ 1217476800000 , 158.95] , [ 1220155200000 , 169.53] , [ 1222747200000 , 113.66] , [ 1225425600000 , 107.59] , [ 1228021200000 , 92.67] , [ 1230699600000 , 85.35] , [ 1233378000000 , 90.13] , [ 1235797200000 , 89.31] , [ 1238472000000 , 105.12] , [ 1241064000000 , 125.83] , [ 1243742400000 , 135.81] , [ 1246334400000 , 142.43] , [ 1249012800000 , 163.39] , [ 1251691200000 , 168.21] , [ 1254283200000 , 185.35] , [ 1256961600000 , 188.5] , [ 1259557200000 , 199.91] , [ 1262235600000 , 210.732] , [ 1264914000000 , 192.063] , [ 1267333200000 , 204.62] , [ 1270008000000 , 235.0] , [ 1272600000000 , 261.09] , [ 1275278400000 , 256.88] , [ 1277870400000 , 251.53] , [ 1280548800000 , 257.25] , [ 1283227200000 , 243.1] , [ 1285819200000 , 283.75] , [ 1288497600000 , 300.98] , [ 1291093200000 , 311.15] , [ 1293771600000 , 322.56] , [ 1296450000000 , 339.32] , [ 1298869200000 , 353.21] , [ 1301544000000 , 348.5075] , [ 1304136000000 , 350.13] , [ 1306814400000 , 347.83] , [ 1309406400000 , 335.67] , [ 1312084800000 , 390.48] , [ 1314763200000 , 384.83] , [ 1317355200000 , 381.32] , [ 1320033600000 , 404.78] , [ 1322629200000 , 382.2] , [ 1325307600000 , 405.0] , [ 1327986000000 , 456.48] , [ 1330491600000 , 542.44] , [ 1333166400000 , 599.55] , [ 1335758400000 , 583.98]]
56+
"values" : [ [ 1136005200000 , 71.89] , [ 1138683600000 , 75.51] , [ 1141102800000 , 68.49] , [ 1143781200000 , 62.72] , [ 1146369600000 , 70.39] , [ 1149048000000 , 59.77] , [ 1151640000000 , 57.27] , [ 1154318400000 , 67.96] , [ 1156996800000 , 67.85] , [ 1159588800000 , 76.98] , [ 1162270800000 , 81.08] , [ 1164862800000 , 91.66] , [ 1167541200000 , 84.84] , [ 1170219600000 , 85.73] , [ 1172638800000 , 84.61] , [ 1175313600000 , 92.91] , [ 1177905600000 , 99.8] , [ 1180584000000 , 121.191] , [ 1183176000000 , 122.04] , [ 1185854400000 , 131.76] , [ 1188532800000 , 138.48] , [ 1191124800000 , 153.47] , [ 1193803200000 , 189.95] , [ 1196398800000 , 182.22] , [ 1199077200000 , 198.08] , [ 1201755600000 , 135.36] , [ 1204261200000 , 125.02] , [ 1206936000000 , 143.5] , [ 1209528000000 , 173.95] , [ 1212206400000 , 188.75] , [ 1214798400000 , 167.44] , [ 1217476800000 , 158.95] , [ 1220155200000 , 169.53] , [ 1222747200000 , 113.66] , [ 1225425600000 , 107.59] , [ 1228021200000 , 92.67] , [ 1230699600000 , 85.35] , [ 1233378000000 , 90.13] , [ 1235797200000 , 89.31] , [ 1238472000000 , 105.12] , [ 1241064000000 , 125.83] , [ 1243742400000 , 135.81] , [ 1246334400000 , 142.43] , [ 1249012800000 , 163.39] , [ 1251691200000 , 168.21] , [ 1254283200000 , 185.35] , [ 1256961600000 , 188.5] , [ 1259557200000 , 199.91] , [ 1262235600000 , 210.732] , [ 1264914000000 , 192.063] , [ 1267333200000 , 204.62] , [ 1270008000000 , 235.0] , [ 1272600000000 , 261.09] , [ 1275278400000 , 256.88] , [ 1277870400000 , 251.53] , [ 1280548800000 , 257.25] , [ 1283227200000 , 243.1] , [ 1285819200000 , 283.75] , [ 1288497600000 , 300.98] , [ 1291093200000 , 311.15] , [ 1293771600000 , 322.56] , [ 1296450000000 , 339.32] , [ 1298869200000 , 353.21] , [ 1301544000000 , 348.5075] , [ 1304136000000 , 350.13] , [ 1306814400000 , 347.83] , [ 1309406400000 , 335.67] , [ 1312084800000 , 390.48] , [ 1314763200000 , 384.83] , [ 1317355200000 , 381.32] , [ 1320033600000 , 404.78] , [ 1322629200000 , 382.2] , [ 1325307600000 , 405.0] , [ 1327986000000 , 456.48] , [ 1330491600000 , 542.44] , [ 1333166400000 , 599.55] , [ 1335758400000 , 583.98] ]
5757
}
5858
].map(function(series) {
5959
series.values = series.values.map(function(d) { return {x: d[0], y: d[1] } });
6060
return series;
6161
});
6262

63-
63+
/*
6464
//For testing single data point
6565
var testdata = [
6666
{
@@ -76,11 +76,12 @@
7676
series.values = series.values.map(function(d) { return {x: d[0], y: d[1] } });
7777
return series;
7878
});
79+
*/
7980

80-
81+
var chart;
8182

8283
nv.addGraph(function() {
83-
var chart = nv.models.linePlusBarChart()
84+
chart = nv.models.linePlusBarChart()
8485
.margin({top: 30, right: 60, bottom: 50, left: 70})
8586
.x(function(d,i) { return i })
8687
.color(d3.scale.category10().range());
@@ -105,6 +106,8 @@
105106

106107
nv.utils.windowResize(chart.update);
107108

109+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
110+
108111
return chart;
109112
});
110113

examples/multiBarChart.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
});
5353

5454

55-
55+
var chart;
5656
nv.addGraph(function() {
57-
var chart = nv.models.multiBarChart();
57+
chart = nv.models.multiBarChart();
5858

5959
chart.xAxis
6060
.showMaxMin(true)
@@ -69,6 +69,8 @@
6969

7070
nv.utils.windowResize(chart.update);
7171

72+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
73+
7274
return chart;
7375
});
7476

examples/multiBarHorizontalChart.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@
136136
];
137137

138138

139-
139+
var chart;
140140
nv.addGraph(function() {
141-
var chart = nv.models.multiBarHorizontalChart()
141+
chart = nv.models.multiBarHorizontalChart()
142142
.x(function(d) { return d.label })
143143
.y(function(d) { return d.value })
144144
.margin({top: 30, right: 20, bottom: 50, left: 175})
@@ -156,6 +156,8 @@
156156

157157
nv.utils.windowResize(chart.update);
158158

159+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
160+
159161
return chart;
160162
});
161163

examples/pieChart.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959

6060

6161

62-
62+
var chart;
6363
nv.addGraph(function() {
6464
var width = 500,
6565
height = 500;
6666

67-
var chart = nv.models.pieChart()
67+
chart = nv.models.pieChart()
6868
.x(function(d) { return d.key })
6969
.y(function(d) { return d.y })
7070
//.showLabels(false)
@@ -80,6 +80,8 @@
8080
.attr('height', height)
8181
.call(chart);
8282

83+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
84+
8385
return chart;
8486
});
8587

examples/scatterChart.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@
6161

6262

6363
//Format A
64+
var chart;
6465
nv.addGraph(function() {
65-
var chart = nv.models.scatterChart()
66+
chart = nv.models.scatterChart()
6667
.showDistX(true)
6768
.showDistY(true)
6869
//.height(500)
@@ -79,6 +80,8 @@
7980

8081
nv.utils.windowResize(chart.update);
8182

83+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
84+
8285
return chart;
8386
});
8487

examples/scatterPlusLineChart.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@
6161

6262

6363
//Format A
64+
var chart;
6465
nv.addGraph(function() {
65-
var chart = nv.models.scatterPlusLineChart()
66+
chart = nv.models.scatterPlusLineChart()
6667
.showDistX(true)
6768
.showDistY(true)
6869
//.height(500)
@@ -78,6 +79,8 @@
7879

7980
nv.utils.windowResize(chart.update);
8081

82+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
83+
8184
return chart;
8285
});
8386

examples/stackedAreaChart.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,9 @@
190190
var colors = d3.scale.category20();
191191
keyColor = function(d, i) {return colors(d.key)};
192192

193+
var chart;
193194
nv.addGraph(function() {
194-
var chart = nv.models.stackedAreaChart()
195+
chart = nv.models.stackedAreaChart()
195196
.x(function(d) { return d[0] })
196197
.y(function(d) { return d[1] })
197198
.color(keyColor)
@@ -211,6 +212,8 @@
211212

212213
nv.utils.windowResize(chart.update);
213214

215+
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
216+
214217
return chart;
215218
});
216219

0 commit comments

Comments
 (0)