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

Per-element values, specified by functions #7

Open
maxkfranz opened this issue Nov 18, 2020 · 4 comments
Open

Per-element values, specified by functions #7

maxkfranz opened this issue Nov 18, 2020 · 4 comments
Assignees

Comments

@maxkfranz
Copy link

maxkfranz commented Nov 18, 2020

Some of the layout options should be able to be specified on a per-element basis, rather than a graph-wide basis. For example, the edge length should be able to be specified as a function(edge) : double in order to create an edge-weighted result (i.e. the edge length varies by score).

I think that this feature may have existed before in COSE, but it may have been lost during the refactoring into layout-base and cose-base.

The following options should allow for functions:

  • nodeRepulsion : function(node) : double
  • idealEdgeLength : function(edge) : double
  • edgeElasticity : function(edge) : double

What are your thoughts, @ugurdogrusoz?

I assume that making the change within this project would enable the function options within any of the COSE family of layouts, which is why I'm filing the issue here.

I'm tagging @chrtannus, as he's interested in this topic.

@maxkfranz
Copy link
Author

For reference, the built-in version of COSE allows for functions on the above options, although it is generally not as sophisticated as the later versions: https://js.cytoscape.org/#layouts/cose

It would be great to have the ability to use these function options. I think that's the only thing missing from the later COSE versions that the built-in version has. I'm in the process of evaluating the removal/replacement of the old COSE in Cytoscape.js v4, and not supporting functions would be a blocker.

@ugurdogrusoz
Copy link

@maxkfranz @chrtannus We never had this in cose-bilkent but we had request for it (cytoscape/cytoscape.js-cose-bilkent#1). Anyway we could implement this. Is there a strict timeline for v4 release?

@maxkfranz
Copy link
Author

No, there isn't a strict timeline for v4. However, @chrtannus and I would like to use some of your latest layouts in some of the new Cytoscape cloud projects (e.g. Cytoscape Explore, which is like Google Docs for graphs). For the new cloud projects, having the function options is necessary. We'd really like to use FCoSE, for example, but we need to be able to have edge-weighted results.

The experimentation of layouts like FCoSE in Cytoscape Explore will help to inform how we move forward with Cytoscape v4 w.r.t. FD layouts -- like a case study.

hasanbalci added a commit that referenced this issue Dec 28, 2020
nodeRepulsion, idealEdgeLength and edgeElasticity are now defined in per element basis
hasanbalci added a commit to iVis-at-Bilkent/cose-base that referenced this issue Dec 28, 2020
The removed code snippet is unnecessary after the changes made in layout-base to allow functions for some options
hasanbalci added a commit to iVis-at-Bilkent/cytoscape.js-fcose that referenced this issue Dec 28, 2020
hasanbalci added a commit to cytoscape/cytoscape.js-cose-bilkent that referenced this issue Dec 29, 2020
hasanbalci added a commit to iVis-at-Bilkent/cytoscape.js-cosep that referenced this issue Jan 6, 2021
@hasanbalci
Copy link
Contributor

Progress update:

  • I added per-element value functionality for nodeRepulsion, idealEdgeLength and edgeElasticity in layout-base.
  • I also integrated this functionality into fCoSE, CoSE-Bilkent and CoSEP layouts. fCoSE v2.0.0 is released with this functionality as well as support for user-specified placement constraints.
  • Per-element value functionality is currently only available in the unstable branches of CoSE-Bilkent and CoSEP layouts.
  • I will also integrate this functionality to CiSE layout.

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