In line and stackedArea, removed the exit() transitions. They cause too many bugs and are not necessary for chart transitions to look nice.

Updated version to 1.1.14
master
Robin Hu 11 years ago
parent 4c6c8da076
commit 7472209eb2

@ -2,7 +2,7 @@
var nv = window.nv || {};
nv.version = '1.1.13b';
nv.version = '1.1.14b';
nv.dev = true //set false when in production
window.nv = nv;
@ -67,7 +67,10 @@ nv.render = function render(step) {
nv.render.queue.splice(0, i);
if (nv.render.queue.length) setTimeout(arguments.callee, 0);
else { nv.render.active = false; nv.dispatch.render_end(); }
else {
nv.dispatch.render_end();
nv.render.active = false;
}
}, 0);
};

@ -26,7 +26,7 @@ nv.models.line = function() {
.size(16) // default size
.sizeDomain([16,256]) //set to speed up calculation, needs to be unset if there is a custom size accessor
;
//============================================================
@ -108,11 +108,9 @@ nv.models.line = function() {
groups.enter().append('g')
.style('stroke-opacity', 1e-6)
.style('fill-opacity', 1e-6);
groups.exit()
.transition()
.style('stroke-opacity', 1e-6)
.style('fill-opacity', 1e-6)
.remove();
groups.exit().remove();
groups
.attr('class', function(d,i) { return 'nv-group nv-series-' + i })
.classed('hover', function(d) { return d.hover })
@ -141,7 +139,7 @@ nv.models.line = function() {
});
groups.exit().selectAll('path.nv-area')
.remove();
areaPaths
.transition()
.attr('d', function(d) {
@ -168,15 +166,7 @@ nv.models.line = function() {
.x(function(d,i) { return nv.utils.NaNtoZero(x0(getX(d,i))) })
.y(function(d,i) { return nv.utils.NaNtoZero(y0(getY(d,i))) })
);
groups.exit().selectAll('path.nv-line')
.transition()
.attr('d',
d3.svg.line()
.interpolate(interpolate)
.defined(defined)
.x(function(d,i) { return nv.utils.NaNtoZero(x(getX(d,i))) })
.y(function(d,i) { return nv.utils.NaNtoZero(y(getY(d,i))) })
);
linePaths
.transition()
.attr('d',
@ -206,11 +196,11 @@ nv.models.line = function() {
chart.dispatch = scatter.dispatch;
chart.scatter = scatter;
d3.rebind(chart, scatter, 'id', 'interactive', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange',
d3.rebind(chart, scatter, 'id', 'interactive', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange',
'sizeDomain', 'forceX', 'forceY', 'forceSize', 'clipVoronoi', 'useVoronoi', 'clipRadius', 'padData','highlightPoint','clearHighlights');
chart.options = nv.utils.optionsFunc.bind(chart);
chart.margin = function(_) {
if (!arguments.length) return margin;
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;

@ -181,9 +181,9 @@ nv.models.stackedArea = function() {
seriesIndex: d.seriesIndex
});
})
path.exit().transition()
.attr('d', function(d,i) { return zeroArea(d.values,i) })
.remove();
path.exit().remove();
path
.style('fill', function(d,i){
return d.color || color(d, d.seriesIndex)

Loading…
Cancel
Save