diff --git a/example/d3-area-chunked.js b/example/d3-area-chunked.js index 22538d8..cd427f3 100644 --- a/example/d3-area-chunked.js +++ b/example/d3-area-chunked.js @@ -944,8 +944,8 @@ var clipPath = defs.select(".".concat(className)); // initial render if (clipPath.empty()) { - counter += 1; clipPath = defs.append('clipPath').attr('class', className).attr('id', "d3-area-chunked-clip-".concat(chunkName, "-").concat(counter)); + counter += 1; } return clipPath.attr('id'); diff --git a/src/areaChunked.js b/src/areaChunked.js index c976197..c7199f1 100644 --- a/src/areaChunked.js +++ b/src/areaChunked.js @@ -822,10 +822,10 @@ export default function render() { // initial render if (clipPath.empty()) { - counter += 1; clipPath = defs.append('clipPath') .attr('class', className) .attr('id', `d3-area-chunked-clip-${chunkName}-${counter}`); + counter += 1; } return clipPath.attr('id');