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

Enable hover on parallel edges #663

Closed
wants to merge 2 commits into from

Conversation

vigorouscoding
Copy link

If you copy the example file into the sigma.js master you will see that only the first edge will be highlighted because the node count (for parallel edges) is not used.

@Yomguithereal
Copy link
Collaborator

Hello @vigorouscoding. I am not sure to understand the way your commits fix the problem. Why do you pass an edge count to functions that do not take it? Did you forget other changes in your commit somehow?

@vigorouscoding
Copy link
Author

Hello @Yomguithereal. The original functions reside in src/utils/sigma.utils.js and are overwritten by plugins/sigma.renderers.parallelEdges/utils.js.
For each function an extra parameter is added:
* @param {number} a Modifier for the amplitude of the curve.
and
* @param {number} a Modifier to the loop size.

So basically I just looked at code in plugins/sigma.renderers.parallelEdges/sigma.canvas.edges.curvedArrow.js where I saw the following code and made the small change at the correct place in the src/misc/sigma.misc.bindEvents.js.

    cp = (source.id === target.id) ?
      sigma.utils.getSelfLoopControlPoints(sX, sY, tSize, count) :
      sigma.utils.getQuadraticControlPoint(sX, sY, tX, tY, count);

I hope this explanation is not too convoluted.

@vigorouscoding
Copy link
Author

any news on this? can I do anything to further explain my changes?

@sim51
Copy link
Collaborator

sim51 commented Oct 21, 2021

Thanks for this PR, even though it hasn't been merged.

For a few years, we focused on Sigma.js v2, and this week we released it!
It is probably better now to upgrade to this new version as v1 will no longer be maintained.

This PR will therefore be closed.

@sim51 sim51 closed this Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants