cytoscape-fcose
fCoSE: a fast Compound Spring Embedder
Science Score: 75.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
✓Academic publication links
Links to: sciencedirect.com -
○Committers with academic emails
-
✓Institutional organization owner
Organization ivis-at-bilkent has institutional domain (www.cs.bilkent.edu.tr) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Keywords
Repository
fCoSE: a fast Compound Spring Embedder
Basic Info
Statistics
- Stars: 165
- Watchers: 9
- Forks: 28
- Open Issues: 11
- Releases: 9
Topics
Metadata Files
README.md
cytoscape-fcose
Description
fCoSE (pron. "f-cosay", fast Compound Spring Embedder), is a faster version of our earlier compound spring embedder algorithm named CoSE, implemented as a Cytoscape.js extension by i-Vis Lab in Bilkent University.
Here are some demos: simple, compound, and constraints, respectively:
fCoSE layout algorithm combines the speed of spectral layout with the aesthetics of force-directed layout. fCoSE runs up to 2 times as fast as CoSE while achieving similar aesthetics.

Furthermore, fCoSE also supports a fairly rich set of constraint types (i.e., fixed position, vertical/horizontal alignment and relative placement).

You can see constraint support in action in the following videos: fixed node, alignment, relative placement, hybrid, real life graphs. Constraints can also be added incrementally on a given layout.
Please cite the following when you use this layout:
H. Balci and U. Dogrusoz, "fCoSE: A Fast Compound Graph Layout Algorithm with Constraint Support," in IEEE Transactions on Visualization and Computer Graphics, 28(12), pp. 4582-4593, 2022.
U. Dogrusoz, E. Giral, A. Cetintas, A. Civril and E. Demir, "A Layout Algorithm For Undirected Compound Graphs", Information Sciences, 179, pp. 980-994, 2009.
Dependencies
- Cytoscape.js ^3.2.0
- cose-base ^2.0.0
- cytoscape-layout-utilities.js (optional for packing disconnected components) ^1.0.0
Documentation
fCoSE supports user-defined placement constraints as well as its full support for compound graphs. These constraints may be defined for simple nodes. Supported constraint types are:
- Fixed node constraint: The user may provide exact desired positions for a set of nodes called fixed nodes. For example, in order to position node n1 to (x: 100, y: 200) and node n2 to (x: 200, y: -300) as a result of the layout,
fixedNodeConstraintoption should be set as follows:
js
fixedNodeConstraint: [{nodeId: 'n1', position: {x: 100, y: 200}},
{nodeId: 'n2', position: {x: 200, y: -300}}],
Alignment constraint: This constraint aims to align two or more nodes (with respect to their centers) vertically or horizontally. For example, for the vertical alignment of nodes {n1, n2, n3} and {n4, n5}, and horizontal alignment of nodes {n2, n4} as a result of the layout,
alignmentConstraintoption should be set as follows:js alignmentConstraint: {vertical: [['n1', 'n2', 'n3'], ['n4', 'n5']], horizontal: [['n2', 'n4']]},**Note:* Alignment constraints in a direction must be given in most compact form. Example:['n1', 'n2', 'n3']instead of['n1', 'n2'], ['n1', 'n3'].*Relative placement constraint: The user may constrain the position of a node relative to another node in either vertical or horizontal direction. For example, in order to position node n1 to be above of node n2 by at least 100 pixels and position node n3 to be on the left of node n4 by at least 75 pixels as a result of the layout,
relativePlacementConstraintoption should be set as follows:
js
relativePlacementConstraint: [{top: 'n1', bottom: 'n2', gap: 100},
{left: 'n3', right: 'n4', gap: 75}],
The gap property is optional. If it is omitted, average idealEdgeLength is used as the gap value.
Usage instructions
Download the library:
* via npm: npm install cytoscape-fcose,
* via bower: bower install cytoscape-fcose, or
* via direct download in the repository (probably from a tag).
Import the library as appropriate for your project:
ES import:
```js import cytoscape from 'cytoscape'; import fcose from 'cytoscape-fcose';
cytoscape.use( fcose ); ```
CommonJS require:
```js let cytoscape = require('cytoscape'); let fcose = require('cytoscape-fcose');
cytoscape.use( fcose ); // register extension ```
AMD:
js
require(['cytoscape', 'cytoscape-fcose'], function( cytoscape, fcose ){
fcose( cytoscape ); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require() is needed. Just add the following files:
<script src="https://unpkg.com/layout-base/layout-base.js"></script>
<script src="https://unpkg.com/cose-base/cose-base.js"></script>
<script src="https://unpkg.com/cytoscape-fcose/cytoscape-fcose.js"></script>
API
When calling the layout, e.g. cy.layout({ name: 'fcose', ... }), the following options are supported:
```js var defaultOptions = {
// 'draft', 'default' or 'proof' // - "draft" only applies spectral layout // - "default" improves the quality with incremental layout (fast cooling rate) // - "proof" improves the quality with incremental layout (slow cooling rate) quality: "default", // Use random node positions at beginning of layout // if this is set to false, then quality option must be "proof" randomize: true, // Whether or not to animate the layout animate: true, // Duration of animation in ms, if enabled animationDuration: 1000, // Easing of animation, if enabled animationEasing: undefined, // Fit the viewport to the repositioned nodes fit: true, // Padding around layout padding: 30, // Whether to include labels in node dimensions. Valid in "proof" quality nodeDimensionsIncludeLabels: false, // Whether or not simple nodes (non-compound nodes) are of uniform dimensions uniformNodeDimensions: false, // Whether to pack disconnected components - cytoscape-layout-utilities extension should be registered and initialized packComponents: true, // Layout step - all, transformed, enforced, cose - for debug purpose only step: "all",
/* spectral layout options */
// False for random, true for greedy sampling samplingType: true, // Sample size to construct distance matrix sampleSize: 25, // Separation amount between nodes nodeSeparation: 75, // Power iteration tolerance piTol: 0.0000001,
/* incremental layout options */
// Node repulsion (non overlapping) multiplier
nodeRepulsion: node => 4500,
// Ideal edge (non nested) length
idealEdgeLength: edge => 50,
// Divisor to compute edge forces
edgeElasticity: edge => 0.45,
// Nesting factor (multiplier) to compute ideal edge length for nested edges
nestingFactor: 0.1,
// Maximum number of iterations to perform - this is a suggested value and might be adjusted by the algorithm as required
numIter: 2500,
// For enabling tiling
tile: true,
// The comparison function to be used while sorting nodes during tiling operation.
// Takes the ids of 2 nodes that will be compared as a parameter and the default tiling operation is performed when this option is not set.
// It works similar to compareFunction parameter of Array.prototype.sort()
// If node1 is less then node2 by some ordering criterion tilingCompareBy(nodeId1, nodeId2) must return a negative value
// If node1 is greater then node2 by some ordering criterion tilingCompareBy(nodeId1, nodeId2) must return a positive value
// If node1 is equal to node2 by some ordering criterion tilingCompareBy(nodeId1, nodeId2) must return 0
tilingCompareBy: undefined,
// Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
tilingPaddingVertical: 10,
// Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
tilingPaddingHorizontal: 10,
// Gravity force (constant)
gravity: 0.25,
// Gravity range (constant) for compounds
gravityRangeCompound: 1.5,
// Gravity force (constant) for compounds
gravityCompound: 1.0,
// Gravity range (constant)
gravityRange: 3.8,
// Initial cooling factor for incremental layout
initialEnergyOnIncremental: 0.3,
/* constraint options */
// Fix desired nodes to predefined positions // [{nodeId: 'n1', position: {x: 100, y: 200}}, {...}] fixedNodeConstraint: undefined, // Align desired nodes in vertical/horizontal direction // {vertical: [['n1', 'n2'], [...]], horizontal: [['n2', 'n4'], [...]]} alignmentConstraint: undefined, // Place two nodes relatively in vertical/horizontal direction // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}, {...}] relativePlacementConstraint: undefined,
/* layout event callbacks */
ready: () => {}, // on layoutready
stop: () => {} // on layoutstop
};
``
To be able to usepackComponentsoption,cytoscape-layout-utilitiesextension should also be registered in the application.
Packing related [options](https://github.com/iVis-at-Bilkent/cytoscape.js-layout-utilities#default-options) should be set viacytoscape-layout-utilities` extension.
If they are not set, fCoSE uses default options.
Build targets
npm run test: Run Mocha tests in./testnpm run build: Build./src/**intocytoscape-fcose.jsnpm run watch: Automatically build on changes with live reloading (N.b. you must already have an HTTP server running)npm run dev: Automatically build on changes with live reloading with webpack dev servernpm run lint: Run eslint on the source
N.b. all builds use babel, so modern ES features can be used in the src.
Publishing instructions
This project is set up to automatically be published to npm and bower. To publish:
- Build the extension :
npm run build:release - Commit the build :
git commit -am "Build for release" - Bump the version number and tag:
npm version major|minor|patch - Push to origin:
git push && git push --tags - Publish to npm:
npm publish . - If publishing to bower for the first time, you'll need to run
bower register cytoscape-fcose https://github.com/iVis-at-Bilkent/cytoscape.js-fcose.git - Make a new release for Zenodo.
Team
Owner
- Name: i-Vis at Bilkent
- Login: iVis-at-Bilkent
- Kind: organization
- Website: http://www.cs.bilkent.edu.tr/~ivis/
- Twitter: iVisAtBilkent
- Repositories: 50
- Profile: https://github.com/iVis-at-Bilkent
i-Vis Research Lab at Bilkent University
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
title: "cytoscape.js-fcose"
version: 2.1.0
date-released: 2021-06-25
url: "https://github.com/iVis-at-Bilkent/cytoscape.js-fcose"
preferred-citation:
type: article
authors:
- family-names: "Balci"
given-names: "Hasan"
orcid: "https://orcid.org/0000-0001-8319-7758"
- family-names: "Dogrusoz"
given-names: "Ugur"
orcid: "https://orcid.org/0000-0002-7153-0784"
doi: "10.1109/TVCG.2021.3095303"
journal: "IEEE Transactions on Visualization and Computer Graphics"
title: "fCoSE: A Fast Compound Graph Layout Algorithm with Constraint Support"
issue: 12
volume: 28
start: 4582 # First page number
end: 4593 # Last page number
month: 12
year: 2022
GitHub Events
Total
- Watch event: 23
- Push event: 2
- Fork event: 7
Last Year
- Watch event: 23
- Push event: 2
- Fork event: 7
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Hasan Balcı | b****9@g****m | 175 |
| ugurdogrusoz | u****z@g****m | 25 |
| hasanbalci | h****i@h****D | 1 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 58
- Total pull requests: 13
- Average time to close issues: 2 months
- Average time to close pull requests: about 6 hours
- Total issue authors: 36
- Total pull request authors: 4
- Average comments per issue: 2.12
- Average comments per pull request: 0.15
- Merged pull requests: 11
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 6
- Pull requests: 1
- Average time to close issues: about 2 months
- Average time to close pull requests: 3 days
- Issue authors: 6
- Pull request authors: 1
- Average comments per issue: 2.67
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ugurdogrusoz (16)
- hasanbalci (5)
- canbax (3)
- josephrocca (2)
- ghost (1)
- gverger (1)
- pmuno007 (1)
- dchaplinsky (1)
- epideveloper (1)
- duuliy (1)
- johnha (1)
- burner1024 (1)
- jonng1000 (1)
- jamesscottbrown (1)
- zx2022x (1)
Pull Request Authors
- hasanbalci (10)
- melkorCBA (2)
- josephrocca (1)
- fdominik (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- npm 4,838,204 last-month
- Total docker downloads: 1,686,694,416
-
Total dependent packages: 35
(may contain duplicates) -
Total dependent repositories: 10,156
(may contain duplicates) - Total versions: 22
- Total maintainers: 1
npmjs.org: cytoscape-fcose
The fCoSE layout for Cytoscape.js by Bilkent with fast compound node placement
- Homepage: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose
- License: MIT
-
Latest release: 2.2.0
published about 3 years ago
Rankings
Maintainers (1)
bower.io: cytoscape-fcose
The fCoSE layout for Cytoscape.js by Bilkent with fast compound node placement
- License: MIT
-
Latest release: v2.2.0
published about 3 years ago
Rankings
repo1.maven.org: org.webjars.npm:cytoscape-fcose
WebJar for cytoscape-fcose
- Homepage: https://www.webjars.org
- Documentation: https://appdoc.app/artifact/org.webjars.npm/cytoscape-fcose/
- License: MIT
-
Latest release: 2.2.0
published about 3 years ago
Rankings
Dependencies
- cose-base ^1.0.0
- cytoscape ^3.2.0
- 1176 dependencies
- babel-core ^6.24.1 development
- babel-loader ^7.1.4 development
- babel-preset-env ^1.5.1 development
- camelcase ^6.2.0 development
- chai 4.0.2 development
- cpy-cli ^3.1.1 development
- cross-env ^7.0.3 development
- eslint ^7.26.0 development
- gh-pages ^1.0.0 development
- mocha 8.4.0 development
- npm-run-all ^4.1.2 development
- rimraf ^3.0.2 development
- update ^0.7.4 development
- updater-license ^1.0.0 development
- webpack ^5.37.0 development
- webpack-cli ^4.7.0 development
- webpack-dev-server ^3.11.2 development
- cose-base ^2.0.0


