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

Add support for selecting edges #4

Description

@jmillegard

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions