skokenes / d3-lasso

A lasso plugin for d3
BSD 3-Clause "New" or "Revised" License
88 stars 34 forks source link

Ability to draw a path automatically based on the given selected node info #8

Closed venki227 closed 5 years ago

venki227 commented 5 years ago

Use case: I created a scatter plot and implemented a lasso selection on it. Let's say I have a nodes with names as [1, 2, 3, .....10]. Now I am able to select the nodes 2,3,7,10 using lasso and stored this values in a array. Now I want to invert this operation, like when I give a array of nodes is it possible to draw a path around these given nodes? Please see below image

Screen Shot 2019-07-25 at 1 21 15 PM
venki227 commented 5 years ago

@skokenes Please let me know. Is this possible?

skokenes commented 5 years ago

In this plugin, it is not possible but more generally you should be able to accomplish this in your visualization using d3 and a hull algorithm like the following lib: https://github.com/AndriiHeonia/hull