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

Multimer edge connection problem #662

Open
msalihaltun opened this issue Apr 21, 2021 · 1 comment
Open

Multimer edge connection problem #662

msalihaltun opened this issue Apr 21, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@msalihaltun
Copy link
Contributor

When multimers are connected with edges, the edge connection points are off centered as in the following screenshot. All the nodes are horizontally/vertically centered with the process node.

image

@msalihaltun msalihaltun added the bug Something isn't working label Apr 21, 2021
msalihaltun added a commit to iVis-at-Bilkent/chise.js that referenced this issue May 28, 2021
  Since cytoscape automatically changes the rendered bounding box
  without changing the node's data properties, multimer edges on
  sbgn bricks were rendering tilted. This commit is a workaround
  to make the edges look better in previews.

  This is not a complete solution to the problem.

  Addresses iVis-at-Bilkent/newt#662.
msalihaltun added a commit that referenced this issue May 28, 2021
  Add a fix amount to shift the regulator when regulator multimer is
  enabled.

  For multimers we do custom rendering. Cytoscape doesn't change node
  data (width, height or position) when doing this but it changes the
  bounding box of the node which causes edges to render tilted.
  Work around this for now by shifting the node to the side by a fixed
  amount.
@msalihaltun
Copy link
Contributor Author

In Newt (or more correctly sbgnviz.js) multimers are rendered as if there were two overlapping nodes with a small offset in position. In the cytoscape graph model it is still a single node (which is intended) and its position data (x, y, width, height) doesn't change. But the bounding box of the node changes when multimer is drawn in this way. This causes the edges connecting to the node to shift automatically to respect the new bounding box.

We use the style property value outside-to-node to connect edges to nodes without calculating the point of connection. Cytoscape handles where exactly to connect the edge endpoint to the node.

Here I made a workaround, specifically for SBGN Bricks regulators where if regulators are multimers they are shifted by a fixed amount to compensate for the shift in bounding box dimensions.

This is not a fix to the multimer edge connection issue as a whole, it is only there as a fix to make SBGN Bricks preview look better.

@ugurdogrusoz ugurdogrusoz removed their assignment Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants