Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Add support for selecting edges #4

Open
jmillegard opened this issue Jun 20, 2016 · 0 comments
Open

Add support for selecting edges #4

jmillegard opened this issue Jun 20, 2016 · 0 comments

Comments

@jmillegard
Copy link
Contributor

jmillegard commented Jun 20, 2016

Is it possible to add support for selecting edges? Something like this:

{{visjs-edge eId=edge.id from=1 to=2 select=(action 'edgeClicked')}}

So that the action can take the edge-id (eID) as first paramerer if set.

I think this should be enough is visjs-network.js:

network.on('selectEdge', (e) => { let [ selectedEdge ] = e.edges; let matchingChildEdge = _this.get('_childLayers').find((c) => { return '${c.get('eId')}' === '${selectedEdge}'; }); if (matchingChildEdge) { matchingChildEdge.get('select')(selectedEdge, e); } });

I can send a pull request if the feature is wanted. Thanks for a great addon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant