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

The ELK layout algorithm adapter for Cytoscape.js

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

Science Score: 23.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
  • Committers with academic emails
    3 of 13 committers (23.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.7%) to scientific vocabulary

Keywords from Contributors

cytoscapejs graph-theory cytoscapejs-extension visualisation
Last synced: 10 months ago · JSON representation

Repository

The ELK layout algorithm adapter for Cytoscape.js

Basic Info
  • Host: GitHub
  • Owner: cytoscape
  • License: mit
  • Language: JavaScript
  • Default Branch: master
  • Size: 538 KB
Statistics
  • Stars: 48
  • Watchers: 7
  • Forks: 29
  • Open Issues: 0
  • Releases: 0
Created about 8 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

cytoscape-elk

Description

The elk layout algorithm adapter for Cytoscape.js

ELK is a set of layout algorithms implemented by the Eclipse Foundation in Java. The source code is compiled to JS by the ELK.js project using GWT. This Cytoscape extension adds support for the ELK layout aglorithms in Cytoscape.

Dependencies

  • Cytoscape.js >= 3.2.0
  • elkjs >= 0.9.2

Usage instructions

Download the library: * via npm or yarn: npm install cytoscape-elk or yarn add cytoscape-elk, * 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 elk from 'cytoscape-elk';

cytoscape.use( elk ); ```

CommonJS require:

```js let cytoscape = require('cytoscape'); let elk = require('cytoscape-elk');

cytoscape.use( elk ); // register extension ```

AMD:

js require(['cytoscape', 'cytoscape-elk'], function( cytoscape, elk ){ elk( cytoscape ); // register extension });

Plain HTML/JS has the extension registered for you automatically, because no require() is needed.

API

``js var options = { nodeDimensionsIncludeLabels: false, // Boolean which changes whether label dimensions are included when calculating node dimensions fit: true, // Whether to fit padding: 20, // Padding on fit animate: false, // Whether to transition the node positions animateFilter: function( node, i ){ return true; }, // Whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions animationDuration: 500, // Duration of animation in ms if enabled animationEasing: undefined, // Easing of animation if enabled transform: function( node, pos ){ return pos; }, // A function that applies a transform to the final node position ready: undefined, // Callback on layoutready stop: undefined, // Callback on layoutstop nodeLayoutOptions: undefined, // Per-node options function elk: { // All options are available at http://www.eclipse.org/elk/reference.html // // 'org.eclipse.' can be dropped from the identifier. The subsequent identifier has to be used as property key in quotes. // E.g. for 'org.eclipse.elk.direction' use: // 'elk.direction' // // Enums use the name of the enum as string e.g. instead of Direction.DOWN use: // 'elk.direction': 'DOWN' // // The main field to set isalgorithm`, which controls which particular layout algorithm is used. // Example (downwards layered layout): 'algorithm': 'layered', 'elk.direction': 'DOWN', }, priority: function( edge ){ return null; }, // Edges with a non-nil value are skipped when geedy edge cycle breaking is enabled };

cy.layout( options ).run(); ```

You can set layout options per node by defining a nodeLayoutOptions function which is called on a per-node basis. This is useful for tweaking the layout of a particular node, like for setting its partition for the layered layout. For instance, if you want to store these options within the node's scratch object, you can do something like this:

js nodeLayoutOptions: node => n.scratch('layoutOptions')
The set of options.elk.algorithm values that are supported by ELK.js follows:

  • box : (Demo) (Docs) Pack the nodes like boxes.
  • disco : (Demo) (Docs) Pack the (disconnected) components. A secondary layout may be applied to each component via options.elk.componentLayoutAlgorithm.
  • force : (Demo) (Docs) Apply a basic force-directed layout.
  • layered : (Demo) (Docs) Apply a hierarchical layout, appropriate for DAGs and trees.
  • mrtree : (Demo (Docs) Apply a traditional, hierarchical tree layout.
  • random : (Demo) (Docs) Apply random positions to the nodes.
  • stress : (Demo) (Docs) Apply a force-directed layout.

See the ELK.js documentation and the ELK algorithm options documentation for more information.

Build targets

  • npm run test : Run Mocha tests in ./test
  • npm run build : Build ./src/** into cytoscape.js-elk
  • 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. To publish:

  1. Build the extension : npm run build
  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 .

Owner

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

GitHub Events

Total
  • Issues event: 1
  • Watch event: 6
  • Issue comment event: 4
  • Push event: 3
  • Pull request event: 1
  • Fork event: 2
  • Create event: 1
Last Year
  • Issues event: 1
  • Watch event: 6
  • Issue comment event: 4
  • Push event: 3
  • Pull request event: 1
  • Fork event: 2
  • Create event: 1

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 117
  • Total Committers: 13
  • Avg Commits per committer: 9.0
  • Development Distribution Score (DDS): 0.581
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Max Franz m****z@g****m 49
Aarni Koskela a****x@i****i 20
John j****n@c****k 19
Simon Warchol s****l@g****u 9
PeterTSmith p****l@g****m 4
Marshall Chen j****i@g****m 4
Dylan Fong d****g@u****a 4
Lorenz Nenntwich 3****N 2
Alexander Li a****0@g****m 2
yuan0728a 6****a 1
Saul Shanabrook s****k@g****m 1
Ivan Tadeu Ferreira Antunes Filho i****a@g****m 1
PeterTSmith p****h@M****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 26
  • Total pull requests: 23
  • Average time to close issues: 6 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 24
  • Total pull request authors: 13
  • Average comments per issue: 3.04
  • Average comments per pull request: 2.74
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: 22 days
  • Average time to close pull requests: 1 minute
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.5
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mafar (3)
  • timscorbett (1)
  • cloakedch (1)
  • icd2k3 (1)
  • Lorenz-N (1)
  • KraProgrammer (1)
  • kobajder (1)
  • tunesmith (1)
  • jamesscottbrown (1)
  • bujoralexandru (1)
  • sathyesh (1)
  • maxkfranz (1)
  • ashkank83 (1)
  • vincerubinetti (1)
  • rk-fsdev (1)
Pull Request Authors
  • saulshanabrook (5)
  • dependabot[bot] (5)
  • vrangavajjala (2)
  • akx (2)
  • j-barata (2)
  • simonwarchol (1)
  • maxkfranz (1)
  • itf (1)
  • Lorenz-N (1)
  • kmad-newrelic (1)
  • hasanbalci (1)
  • yuan0728a (1)
  • EddieBenji (1)
Top Labels
Issue Labels
stale (18)
Pull Request Labels
dependencies (5) stale (3)

Packages

  • Total packages: 2
  • Total downloads:
    • npm 30,440 last-month
  • Total docker downloads: 33
  • Total dependent packages: 7
    (may contain duplicates)
  • Total dependent repositories: 72
    (may contain duplicates)
  • Total versions: 40
  • Total maintainers: 2
npmjs.org: cytoscape-elk

The ELK layout algorithm adapter for Cytoscape.js

  • Versions: 21
  • Dependent Packages: 7
  • Dependent Repositories: 72
  • Downloads: 30,440 Last month
  • Docker Downloads: 33
Rankings
Dependent repos count: 1.6%
Downloads: 1.6%
Dependent packages count: 2.8%
Average: 3.6%
Forks count: 4.8%
Stargazers count: 7.1%
Maintainers (2)
Last synced: 11 months ago
proxy.golang.org: github.com/cytoscape/cytoscape.js-elk
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.6%
Average: 5.8%
Dependent repos count: 5.9%
Last synced: 11 months ago

Dependencies

package.json npm
  • @babel/core ^7.0.0 development
  • @babel/preset-env ^7.0.0 development
  • babel-loader ^8.0.0 development
  • eslint ^7.13.0 development
  • eslint-config-prettier ^6.15.0 development
  • gh-pages ^1.0.0 development
  • npm-run-all ^4.1.2 development
  • prettier ^2.1.2 development
  • webpack ^5.4.0 development
  • webpack-cli ^4.2.0 development
  • webpack-dev-server ^3.11.0 development
  • elkjs ^0.7.0