https://github.com/cytoscape/cytoscape.js-cola

The Cola.js physics simulation layout for Cytoscape.js

https://github.com/cytoscape/cytoscape.js-cola

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

cytoscapejs cytoscapejs-extension

Keywords from Contributors

visualisation graph-theory projection archival systems-biology generic interactive sequences diagram network-analysis
Last synced: 10 months ago · JSON representation

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
cytoscapejs cytoscapejs-extension
Created almost 11 years ago · Last pushed 11 months ago
Metadata Files
Readme License

README.md

cytoscape-cola

DOI

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 alignment option 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 ./test
  • npm run build : Build ./src/** into cytoscape-cola.js
  • npm 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 server
  • npm 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:

  1. Build the extension : npm run build:release
  2. Commit the build : git commit -am "Build for release"
  3. Bump the version number and tag: npm version major|minor|patch
  4. Push to origin: git push && git push --tags
  5. Publish to npm: npm publish .
  6. 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
  7. Make a new release for Zenodo.

Owner

  • Name: Cytoscape Consortium
  • Login: cytoscape
  • Kind: organization

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

All Time
  • Total Commits: 96
  • Total Committers: 11
  • Avg Commits per committer: 8.727
  • Development Distribution Score (DDS): 0.302
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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
stale (15) enhancement (2)
Pull Request Labels
dependencies (67) stale (64) javascript (6) enhancement (1)

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

  • Versions: 25
  • Dependent Packages: 38
  • Dependent Repositories: 280
  • Downloads: 137,280 Last month
  • Docker Downloads: 333
Rankings
Dependent packages count: 0.7%
Downloads: 0.9%
Dependent repos count: 1.0%
Docker downloads count: 1.1%
Average: 2.0%
Forks count: 3.7%
Stargazers count: 4.6%
Last synced: 11 months ago
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
  • Versions: 25
  • Dependent Packages: 0
  • Dependent Repositories: 4
Rankings
Dependent packages count: 6.0%
Forks count: 7.1%
Average: 8.1%
Stargazers count: 9.4%
Dependent repos count: 9.7%
Last synced: 11 months ago
repo1.maven.org: org.webjars.npm:cytoscape-cola

WebJar for cytoscape-cola

  • Versions: 4
  • Dependent Packages: 4
  • Dependent Repositories: 10
  • Docker Downloads: 35
Rankings
Dependent repos count: 7.6%
Dependent packages count: 13.8%
Average: 17.4%
Forks count: 22.6%
Stargazers count: 25.8%
Last synced: 11 months ago
repo1.maven.org: org.webjars.bower:cytoscape-cola

WebJar for cytoscape-cola

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 32.0%
Average: 40.4%
Dependent packages count: 48.9%
Last synced: 11 months ago

Dependencies

bower.json bower
  • cytoscape ^3.2.0
package-lock.json npm
  • 1146 dependencies
package.json npm
  • 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