Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge to the same node? #810

Closed
EquaI1ty opened this issue Dec 18, 2016 · 5 comments
Closed

Edge to the same node? #810

EquaI1ty opened this issue Dec 18, 2016 · 5 comments

Comments

@EquaI1ty
Copy link

Hi,
I've tried to use sigma.js for the first time. I need to draw edge from n1 to n1 (to the same node), it's possible? Maybe this result can be achieved with help of some plugins?

@Yomguithereal
Copy link
Collaborator

Hello @EquaI1ty. Sigma.js does not support self-links out of the box. I remember a plugin rendering such links but cannot find it back.

@AVermeij
Copy link

I've worked with this type of edges quite a few times with sigma and it actually works very well when using curved edges. When the source and target of the edge are the same, sigma resorts to calculating control points for a self-loop; else, it calculates regular quadratic control points. See lines 29-31 over at https://github.com/jacomyal/sigma.js/blob/master/src/renderers/canvas/sigma.canvas.edges.curve.js.

Add your edge as below and it should show fine:
s.graph.addEdge({ id: 'e1', source: 'n1', target: 'n1', size: Math.random(), type: 'curve' });

@stale
Copy link

stale bot commented Oct 8, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 8, 2021
@stale stale bot closed this as completed Oct 23, 2021
@Gvenvivar25
Copy link

Gvenvivar25 commented Aug 16, 2024

Hello!
In sigma version 3 is it still possible to o draw edge from n1 to n1 (to the same node)? I've tried to use graph as MultiDirectedGraph and such sigma settings as:
defaultEdgeType: 'curved',
edgeProgramClasses: {
straight: EdgeArrowProgram,
curved: EdgeCurveProgram,
},
but I don't see my self-looped edges in the graph, only edges with different target node

@lukaszbachman
Copy link

@Gvenvivar25 it doesn't seem like it's implemented yet in v3. See this ticket: #1429

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

No branches or pull requests

5 participants