return brush independently from container

This commit is contained in:
Colin Megill
2018-06-28 01:10:05 -04:00
parent a4e75fceba
commit 64223ff95e
+11 -9
View File
@@ -23,21 +23,23 @@ export const setupSVGandBrushElements = (
.attr("height", side) .attr("height", side)
.attr("class", `${styles.graphSVG}`); .attr("class", `${styles.graphSVG}`);
svg.append("g").call( const brush = d3
d3
.brush() .brush()
.extent([ .extent([
[0, 0], [0, 0],
[ [responsive.height - graphPaddingTop, responsive.height - graphPaddingTop]
responsive.height - graphPaddingTop,
responsive.height - graphPaddingTop
]
]) ])
.on("brush", handleBrushSelectAction) .on("brush", handleBrushSelectAction)
.on("end", handleBrushDeselectAction) .on("end", handleBrushDeselectAction);
);
const brushContainer = svg
.append("g")
.attr("class", "graph_brush")
.call(brush);
return { return {
svg svg,
brushContainer,
brush
}; };
}; };