cytoscape / cytoscape.js

Graph theory (network) library for visualisation and analysis

Home Page:https://js.cytoscape.org

Repository from Github https://github.comcytoscape/cytoscape.jsRepository from Github https://github.comcytoscape/cytoscape.js

The arrow on the edge "slides" from the center of an edge when using dynamic source offset/target offset

TonyIvanova opened this issue · comments

Environment info

  • Cytoscape.js version: 3.31.2
  • Browser/Node.js & version: Chrome

Current (buggy) behaviour
When using dynamic source offset or target offset the arrow on the edge "slides" from the center
Image

Desired behaviour

Arrow should be exactly on the middle of the edge.

Minimum steps to reproduce

Please see this code here.

The issue is related to this stackoverflow question
For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

  • Ensure that the reporter has included a reproducible demo. They can easily fork this JSBin demo: http://jsbin.com/fiqugiq
  • The issue has been associated with a corresponding milestone.
  • The commits have been incorporated into the corresponding branches. Bug-fix patches go on
    • master and
    • unstable.
  • The issue has been labelled as a bug, if necessary.

@TonyIvanova, would you be able to confirm whether the arrows are placed correctly or whether the lines are placed correctly?

@maxkfranz It looks like the arrow is positioned correctly and the edge is not.
You can see it in this stackblitz example - I added red dots wherever the end of an edge is supposed to be positioned according to the calculation. You can also see that position of the label "slides".

Image

Image

@TonyIvanova, try #3387 and let us know your results

@maxkfranz sorry it took me some time to answer, it works perfectly, thank you!