Update as you drag on cumulativeLineChart... turned off animation so update would be fluid

This commit is contained in:
Bob Monteverde 2012-10-19 17:03:49 -04:00
parent c09602e3c2
commit d47ced5ee0
4 changed files with 20 additions and 12 deletions

View File

@ -65,7 +65,7 @@ nv.addGraph(function() {
d3.select('#chart1 svg')
.datum(cumulativeTestData())
.transition().duration(500)
//.transition().duration(500)
.call(chart);
//TODO: Figure out a good way to do this automatically

View File

@ -1623,6 +1623,7 @@ nv.models.cumulativeLineChart = function() {
d.i = Math.round(dx.invert(d.x));
d3.select(this).attr('transform', 'translate(' + dx(d.i) + ',0)');
chart.update();
}
function dragEnd(d,i) {
@ -1788,7 +1789,8 @@ nv.models.cumulativeLineChart = function() {
var linesWrap = g.select('.nv-linesWrap')
.datum(data.filter(function(d) { return !d.disabled }))
d3.transition(linesWrap).call(lines);
//d3.transition(linesWrap).call(lines);
linesWrap.call(lines);
var indexLine = linesWrap.selectAll('.nv-indexLine')
@ -1840,7 +1842,8 @@ nv.models.cumulativeLineChart = function() {
d.disabled = !d.disabled;
rescaleY = !d.disabled;
selection.transition().call(chart);
//selection.transition().call(chart);
selection.call(chart);
});
@ -1855,7 +1858,8 @@ nv.models.cumulativeLineChart = function() {
});
}
selection.transition().call(chart);
//selection.transition().call(chart);
selection.call(chart);
});
/*

10
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -73,6 +73,7 @@ nv.models.cumulativeLineChart = function() {
d.i = Math.round(dx.invert(d.x));
d3.select(this).attr('transform', 'translate(' + dx(d.i) + ',0)');
chart.update();
}
function dragEnd(d,i) {
@ -238,7 +239,8 @@ nv.models.cumulativeLineChart = function() {
var linesWrap = g.select('.nv-linesWrap')
.datum(data.filter(function(d) { return !d.disabled }))
d3.transition(linesWrap).call(lines);
//d3.transition(linesWrap).call(lines);
linesWrap.call(lines);
var indexLine = linesWrap.selectAll('.nv-indexLine')
@ -290,7 +292,8 @@ nv.models.cumulativeLineChart = function() {
d.disabled = !d.disabled;
rescaleY = !d.disabled;
selection.transition().call(chart);
//selection.transition().call(chart);
selection.call(chart);
});
@ -305,7 +308,8 @@ nv.models.cumulativeLineChart = function() {
});
}
selection.transition().call(chart);
//selection.transition().call(chart);
selection.call(chart);
});
/*