I would like to be able to select data in the scatterplot with pencil via d3js library.
I have found following sample - https://jsfiddle.net/3mjduntb/ - but there is possible to brush only with rectangle.
Source: https://d3-graph-gallery.com/graph/interactivity_brush.html
I can see the API for brushing:
// Add brushing
svg
.call( d3.brush() // Add the brush feature using the d3.brush function
.extent( [ [0,0], [width,height] ] ) // initialise the brush area: start at 0,0 and finishes at width,height: it means I select the whole graph area
.on("start brush", updateChart) // Each time the brush selection changes, trigger the 'updateChart' function
)
I cannot find any way how to modify this selection method?