From 96532c018b303e4df38d25612b28e77ef96d66b7 Mon Sep 17 00:00:00 2001 From: Fil Date: Sat, 21 May 2016 00:47:48 +0200 Subject: [PATCH] fix weird transition on barChart exit() #822 the transition to `height(0)` was making the bar "fly away", now we keep its y and height, but transition it towards where it "should be". trimming a little bit of the width gives nicer results imho so that a small ap is preserved between bars. But it's something that can be removed if you prefer to keep it simple. --- dc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dc.js b/dc.js index 259f66b3a..1f2dde89c 100644 --- a/dc.js +++ b/dc.js @@ -5433,7 +5433,8 @@ dc.barChart = function (parent, chartGroup) { .select('title').text(dc.pluck('data', _chart.title(d.name))); dc.transition(bars.exit(), _chart.transitionDuration()) - .attr('height', 0) + .attr('x', function(d) { return _chart.x()(d.x); }) + .attr('width', _barWidth * 0.9) .remove(); } @@ -10746,4 +10747,4 @@ return dc;} } )(); -//# sourceMappingURL=dc.js.map \ No newline at end of file +//# sourceMappingURL=dc.js.map