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?
CodePudding user response:
I have found this plugin which is exactly what I needed:
https://bl.ocks.org/skokenes/a85800be6d89c76c1ca98493ae777572
It is lasso plugin in d3.js plugins.