Skip to content

Commit

Permalink
recalculate clippath on chart.redraw; also avoid Webkit select("clipp…
Browse files Browse the repository at this point in the history
…ath") bug
  • Loading branch information
Davis Ford committed Oct 18, 2014
1 parent dcd566c commit 49c1366
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/coordinate-grid-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,10 @@ dc.coordinateGridMixin = function (_chart) {

function generateClipPath() {
var defs = dc.utils.appendOrSelect(_parent, 'defs');

var chartBodyClip = dc.utils.appendOrSelect(defs, 'clipPath').attr('id', getClipPathId());
// cannot select <clippath> elements; bug in WebKit, must select by id
// https://groups.google.com/forum/#!topic/d3-js/6EpAzQ2gU9I
var id = getClipPathId();
var chartBodyClip = dc.utils.appendOrSelect(defs, id).attr('id', id);

var padding = _clipPadding * 2;

Expand Down Expand Up @@ -989,6 +991,7 @@ dc.coordinateGridMixin = function (_chart) {
_chart._preprocessData();

drawChart(false);
generateClipPath();

return _chart;
};
Expand Down

0 comments on commit 49c1366

Please sign in to comment.