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

Is it possible to set the concentric variable in ipycytoscape? #257

Closed
micw42 opened this issue May 5, 2021 · 5 comments
Closed

Is it possible to set the concentric variable in ipycytoscape? #257

micw42 opened this issue May 5, 2021 · 5 comments
Labels
question Further information is requested

Comments

@micw42
Copy link

micw42 commented May 5, 2021

In the concentric layout of cytoscape.js, it is possible to put a node in a certain "layer" of the circle through the concentric variable of the layout:

concentric: function( node ){ 
      return node.data("rank");
  }

Here is the cytoscape.js documentation about this

Is there a similar function to this in ipycytoscape? Thank you so much!

@micw42 micw42 added the question Further information is requested label May 5, 2021
@ianhi
Copy link
Collaborator

ianhi commented May 5, 2021

Hi @micw42 good question! I think you're looking for the code in this example: https://github.com/QuantStack/ipycytoscape/blob/master/examples/Concentric%20example.ipynb

The important step is: cytoscapeobj.set_layout(name='concentric')

Hope that works for you!

@micw42
Copy link
Author

micw42 commented May 6, 2021

Hi @ianhi Thank you for answering my question! Sorry I wasn't being very clear before. I've already donecytoscapeobj.set_layout(name='concentric') I was wondering if there were a way to control which concentric layer a node ends up in? For example, here is the graph I made:

image

Would it be possible to make the red node on the left be in the center? Cytoscape.js allows you to set a function that determines which layer a node is in, so I wonder if this is also possible in ipycytoscape? Thank you so much for your help; I really appreciate it :)

@marimeireles
Copy link
Collaborator

Hey @micw42, thanks for opening the issue.
I think the reason why you can't do this is the same as: #238?
What do you think? If it is, we can close this issue and keep the discussion centralized in there.
For now we don't have a fix! But feel free to add your thoughts and questions there. I can't work on it at the moment but would gladly review a PR if you wanna try it! :)
Cheers.

@micw42
Copy link
Author

micw42 commented May 7, 2021

Hey @marimeireles Yeah, I think it's the same; sorry I didn't see it earlier! Thank you :)

@micw42 micw42 closed this as completed May 7, 2021
@marimeireles
Copy link
Collaborator

No probs! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants