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

Incorrect Number of Edge Crosses for edges with Bendpoints #7

Open
MobiZaman opened this issue Aug 24, 2021 · 9 comments
Open

Incorrect Number of Edge Crosses for edges with Bendpoints #7

MobiZaman opened this issue Aug 24, 2021 · 9 comments
Assignees

Comments

@MobiZaman
Copy link

While detecting edge crossings, the code does not consider if the edge is composed of multiple segments, hence finding the intersection of the straight line from source to target with other nodes.

@MobiZaman
Copy link
Author

MobiZaman commented Aug 24, 2021

An example figure is given below:
Screenshot from 2021-08-25 02-01-51

For the above graph, the following properties are determined:
Screenshot from 2021-08-25 02-02-46

This shows an incorrect number of edge crossings (which in actual are 5). The fact that the code is using a straight line from source to target can be confirmed by converting the edges with bends to straight edges.
Screenshot from 2021-08-25 02-02-28

The above figure confirms the number of edge crossings to be 3.

@MobiZaman
Copy link
Author

As seen by the graph properties in the previous comment, the number of NodeEdgeOverlaps is also shown to be 1, even though there is no node-edge overlap. Here is another example of incorrect values:
Screenshot from 2021-08-25 02-19-20

@ugurdogrusoz
Copy link

ugurdogrusoz commented Aug 25, 2021

@canbax Let's please add a parameter if needed to consider bend points in calculations of metrics involving edges. Particularly we at least need this for orthogonal edges (edges with horizontal and vertical line segments only). Notice that edge ends might have connection points / ports different from clipping points going into a node's center.

canbax added a commit that referenced this issue Aug 27, 2021
@canbax
Copy link
Member

canbax commented Aug 27, 2021

I didn't add any new parameters. It will check if there are segment points and then it should calculate accordingly

@canbax canbax assigned MobiZaman and ugurdogrusoz and unassigned canbax and MobiZaman Aug 27, 2021
@ugurdogrusoz
Copy link

@MobiZaman Please verify

@MobiZaman
Copy link
Author

Screenshot from 2021-08-28 01-22-21
The edge crosses still don't seem to be determined correctly. For the above drawing, there exist 6 edge crossings, but 1 is not detected by layvo.
Screenshot from 2021-08-28 01-22-39

@ugurdogrusoz
Copy link

Can you attach the json file for easy debugging?

@MobiZaman
Copy link
Author

The edge styling data is also needed to create the bendpoints, so only the json file won't be useful. The bug can be reproduced as follows:

  1. Go to https://rangmehal.pk/ on Chrome or Firefox
  2. Click on the Load graph button and load this graph:
    samplejson.txt
    @canbax This is the same json file that I sent to you before.
  3. Do the C-TSM layout 4 times.
  4. At the fourth run, check the results of this command: cy.layvo("get").generalProperties();. It will give an incorrect value of edge crossings.

Note: Please disregard the values of the parameters displayed on the top of the page. They are incorrect. The correct values can be checked with (cy.layvo("get").generalProperties()) after the layout has finished.

@MobiZaman
Copy link
Author

The code seems to be working fine for now. I will confirm this on multiple graphs and then close this issue.

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

No branches or pull requests

3 participants