https://github.com/cytoscape/cytoscape.js-cola
The Cola.js physics simulation layout for Cytoscape.js
Science Score: 33.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
2 of 11 committers (18.2%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.6%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
The Cola.js physics simulation layout for Cytoscape.js
Basic Info
- Host: GitHub
- Owner: cytoscape
- License: mit
- Language: JavaScript
- Default Branch: master
- Size: 15 MB
Statistics
- Stars: 163
- Watchers: 24
- Forks: 68
- Open Issues: 0
- Releases: 12
Topics
Metadata Files
README.md
cytoscape-cola
Description
The Cola.js physics simulation layout for Cytoscape.js (demo, non-animated demo, compound demo, constraint demo)
The cola layout uses a force-directed physics simulation with several sophisticated constraints, written by Tim Dwyer. For more information about Cola and its parameters, refer to its documentation.
It supports noncompound and compound graphs well.
Dependencies
- Cytoscape.js ^3.2.0
- Cola.js ^3.1.2
Usage instructions
Download the library:
* via npm: npm install cytoscape-cola,
* via bower: bower install cytoscape-cola, 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 cola from 'cytoscape-cola';
cytoscape.use( cola ); ```
CommonJS require:
```js let cytoscape = require('cytoscape'); let cola = require('cytoscape-cola');
cytoscape.use( cola ); // register extension ```
AMD:
js
require(['cytoscape', 'cytoscape-cola'], function( cytoscape, cola ){
cola( cytoscape ); // register extension
});
Plain HTML/JS has the extension registered for you automatically, because no require() is needed.
API
Call the layout, e.g. cy.layout({ name: 'cola', ... }), with options:
```js // default layout options var defaults = { animate: true, // whether to show the layout as it's running refresh: 1, // number of ticks per frame; higher is faster but more jerky maxSimulationTime: 4000, // max length in ms to run the layout ungrabifyWhileSimulating: false, // so you can't drag nodes during layout fit: true, // on every layout reposition of nodes, fit the viewport padding: 30, // padding around the simulation boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } nodeDimensionsIncludeLabels: false, // whether labels should be included in determining the space used by a node
// layout event callbacks ready: function(){}, // on layoutready stop: function(){}, // on layoutstop
// positioning options randomize: false, // use random node positions at beginning of layout avoidOverlap: true, // if true, prevents overlap of node bounding boxes handleDisconnected: true, // if true, avoids disconnected components from overlapping convergenceThreshold: 0.01, // when the alpha value (system energy) falls below this value, the layout stops nodeSpacing: function( node ){ return 10; }, // extra spacing around nodes flow: undefined, // use DAG/tree flow layout if specified, e.g. { axis: 'y', minSeparation: 30 } alignment: undefined, // relative alignment constraints on nodes, e.g. {vertical: [[{node: node1, offset: 0}, {node: node2, offset: 5}]], horizontal: [[{node: node3}, {node: node4}], [{node: node5}, {node: node6}]]} gapInequalities: undefined, // list of inequality constraints for the gap between the nodes, e.g. [{"axis":"y", "left":node1, "right":node2, "gap":25}] centerGraph: true, // adjusts the node positions initially to center the graph (pass false if you want to start the layout from the current position)
// different methods of specifying edge length
// each can be a constant numerical value or a function like function( edge ){ return 2; }
edgeLength: undefined, // sets edge length directly in simulation
edgeSymDiffLength: undefined, // symmetric diff edge length in simulation
edgeJaccardLength: undefined, // jaccard edge length in simulation
// iterations of cola algorithm; uses default values on undefined unconstrIter: undefined, // unconstrained initial layout iterations userConstIter: undefined, // initial layout iterations with user-specified constraints allConstIter: undefined, // initial layout iterations with all constraints including non-overlap }; ```
Notes
- The
alignmentoption isn't as flexible as the raw Cola option. Here, only integers can be used to specify relative positioning, so it's a bit limited. If you'd like to see a more sophisticated implementation, please send a pull request.
Build targets
npm run test: Run Mocha tests in./testnpm run build: Build./src/**intocytoscape-cola.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-cola https://github.com/cytoscape/cytoscape.js-cola.git - Make a new release for Zenodo.
Owner
- Name: Cytoscape Consortium
- Login: cytoscape
- Kind: organization
- Website: http://www.cytoscape.org/
- Repositories: 153
- Profile: https://github.com/cytoscape
GitHub Events
Total
- Issues event: 3
- Watch event: 15
- Delete event: 5
- Issue comment event: 17
- Gollum event: 1
- Pull request event: 12
- Fork event: 2
- Create event: 5
Last Year
- Issues event: 3
- Watch event: 15
- Delete event: 5
- Issue comment event: 17
- Gollum event: 1
- Pull request event: 12
- Fork event: 2
- Create event: 5
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Max Franz | m****z@g****m | 67 |
| Manfred Cheung | m****n@u****a | 6 |
| Hasan Balcı | b****9@g****m | 5 |
| Dylan Fong | d****g@u****a | 5 |
| Alexander Li | a****0@g****m | 4 |
| dependabot[bot] | 4****] | 3 |
| Jesse Desaever | j****r@w****e | 2 |
| metincansiper | m****r@g****m | 1 |
| Mathis Neumann | m****s@s****t | 1 |
| somedmguy | d****7@y****m | 1 |
| Joseph Stahl | j****t@o****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 50
- Total pull requests: 63
- Average time to close issues: 5 months
- Average time to close pull requests: about 1 month
- Total issue authors: 43
- Total pull request authors: 8
- Average comments per issue: 2.32
- Average comments per pull request: 1.86
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 55
Past Year
- Issues: 3
- Pull requests: 14
- Average time to close issues: 27 days
- Average time to close pull requests: 24 days
- Issue authors: 3
- Pull request authors: 2
- Average comments per issue: 1.0
- Average comments per pull request: 1.79
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 13
Top Authors
Issue Authors
- maxkfranz (4)
- EyMaddis (3)
- KonradHoeffner (2)
- pmackay (2)
- baieric (1)
- josephrocca (1)
- tntmarket (1)
- enjoiful (1)
- Tornike-Kiknadze (1)
- metincansiper (1)
- alep85 (1)
- TimNZ (1)
- dwjohnston (1)
- daana81 (1)
- bkovitz (1)
Pull Request Authors
- dependabot[bot] (67)
- mpfz0r (2)
- deje1011 (2)
- EyMaddis (1)
- obender (1)
- somedmguy (1)
- hasanbalci (1)
- metincansiper (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- npm 137,280 last-month
- Total docker downloads: 368
-
Total dependent packages: 42
(may contain duplicates) -
Total dependent repositories: 294
(may contain duplicates) - Total versions: 57
- Total maintainers: 5
npmjs.org: cytoscape-cola
The Cola.js physics simulation layout for Cytoscape.js
- Homepage: https://github.com/cytoscape/cytoscape.js-cola
- License: MIT
-
Latest release: 2.5.1
published over 4 years ago
Rankings
Maintainers (5)
bower.io: cytoscape-cola
The Cola.js physics simulation layout for Cytoscape.js
- License: MIT
-
Latest release: v2.5.1
published over 4 years ago
Rankings
repo1.maven.org: org.webjars.npm:cytoscape-cola
WebJar for cytoscape-cola
- Homepage: https://www.webjars.org
- Documentation: https://appdoc.app/artifact/org.webjars.npm/cytoscape-cola/
- License: MIT
-
Latest release: 2.5.1
published almost 2 years ago
Rankings
repo1.maven.org: org.webjars.bower:cytoscape-cola
WebJar for cytoscape-cola
- Homepage: http://webjars.org
- Documentation: https://appdoc.app/artifact/org.webjars.bower/cytoscape-cola/
- License: MIT
-
Latest release: 2.2.3
published over 7 years ago
Rankings
Dependencies
- cytoscape ^3.2.0
- 1146 dependencies
- babel-core ^6.24.1 development
- babel-loader ^7.0.0 development
- babel-preset-env ^1.5.1 development
- camelcase ^4.1.0 development
- chai 4.0.2 development
- cpy-cli ^1.0.1 development
- cross-env ^5.2.1 development
- eslint ^3.9.1 development
- gh-pages ^1.0.0 development
- mocha 3.4.2 development
- npm-run-all ^4.1.5 development
- rimraf ^2.7.1 development
- update ^0.7.4 development
- updater-license ^1.0.0 development
- webpack ^2.6.1 development
- webpack-dev-server ^2.11.5 development
- webcola ^3.4.0