GithubHelp home page GithubHelp logo

schae234 / cytoscape.js-euler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cytoscape/cytoscape.js-euler

0.0 2.0 0.0 2.81 MB

Euler is a fast, high-quality force-directed (physics simulation) layout for Cytoscape.js

License: MIT License

HTML 13.14% JavaScript 86.86%

cytoscape.js-euler's Introduction

cytoscape-euler

Join the chat at https://gitter.im/cytoscape-js-euler/Lobby

Description

Euler is a fast, high-quality force-directed (physics simulation) layout for Cytoscape.js

Contribution guidelines

Please refer to CONTRIBUTING.md and CODE_OF_CONDUCT.md.

Mozilla Global Sprint 2017 instructions

The goal of this project is to create a fast, high quality force-directed layout for Cytoscape.js. Cytoscape.js has several force-directed layouts already, but there is a need for a small filesize, fast-running, high quality layout. The existing layouts have tradeoffs, like prioritising speed over quality.

The layout should:

  • be fast;
  • give high quality results for non-compound graphs;
  • have a relatively small filesize (ideally <20KB);
  • have lots of options for configuring / fine-tuning the layout;
  • have basic support for compound graphs;
  • be modular such that everything but its physics algorithm could be reusable as a generic force-directed layout superclass;
  • use modern tooling so that slush-js can be updated to generate extensions that use this tooling;

These requirements would make Euler fit in a currently unfilled niche in the set of Cytoscape.js layouts. A layout that meets these requirements would be very useful to scientists and commercial developers.

The ngraph.asyncforce package has an existing MIT-licensed layout algorithm. Though the algorithm is good, it's not very customisable and it requires a build-step for users. That means a lot of users (especially scientists) can't use it.

ngraph.forcelayout is a package that uses ngraph.asyncforce and packages it as a Cytoscape layout, but it has some tradeoffs that make that package not meet our requirements: The layout is very large (500KB) and not very customisable, but it's fast and gives good results.

That means we could use the essential bits of the algorithm from ngraph.asyncforce to build the Euler layout, and we could use ngraph.forcelayout as a test to make sure the algorithm is ported correctly. By then adding springs to keep the descendants of each compound node together, we'll have met all of the project requirements. Any additional time that's left can be used to add new features to the layout, probably features identified as nice-to-have during testing or ones that project participants think up.

The tasks to complete the layout project are in the mozsprint2017 milestone.

Dependencies

  • cytoscape@^3.0.0

Usage instructions

Download the library:

  • via npm: npm install cytoscape-euler,
  • via bower: bower install cytoscape-euler, or
  • via direct download in the repository (probably from a tag).

require() the library as appropriate for your project:

ES import:

import cytoscape from 'cytoscape';
import euler from 'cytoscape-euler';

cytoscape.use( euler );

CommonJS:

let cytoscape = require('cytoscape');
let euler = require('cytoscape-euler');

cytoscape.use( euler );

AMD:

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

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

API

TODO describe the options that the Euler layout supports.

Build instructions

  • npm run build : Build ./src/** into cytoscape-euler.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
  2. Bump the version number and tag: npm version major|minor|patch
  3. Publish to npm: npm publish .
  4. If publishing to bower for the first time, you'll need to run bower register cytoscape-euler https://github.com/cytoscape/cytoscape.js-euler.git

cytoscape.js-euler's People

Contributors

maxkfranz avatar gitter-badger avatar

Watchers

James Cloos avatar Rob Schaefer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.