I\'m looking to migrate from d3v3 to d3v4. In particular i\'m having difficulties in migrating brushes.
Can someone please have a look at below link and let me know
d3-brush
from D3 v3 to D3 v4 (example for brushX)d3.svg.brush()
with d3.brushX()
.brushstart
event to start
, brushend
to end
..x(xScale)
, this method is now missing. Pass brush borders as .extent([[xScale.range()[0], 0], [xScale.range()[1], brushHeight]])
.d3.event.selection
, for getting selected values use d3.event.selection.map(xScale.invert)
..move(brushContainer, selectedDomain.map(xScale))
. To clear selection do .move(brushContainer, null)
. Note that this will fire event handlers..empty()
method is now missing, use d3.event.selection === null
..extent
is now .selection
, .resize
is .handle
and became a rect
instead of g
containing rect
.