GithubHelp home page GithubHelp logo

force-graph's Introduction

Force Graph

A very simple, arbitrarily dimensional, force-directed graph implementation in Rust.

This implementation is an exercise in the use of the ndarray crate.

The well known force-directed graph algorithm used here is known to work well for up to a hundred or so nodes. Other more complex algorithms scale to larger graphs.

You could get a constant-time speedup by avoiding the luxurious number of ndarray allocations used in this code, favoring instead re-use of arrays and in-place operations.

Dependencies

A Rust development environment is required, e.g., as installed by rustup.

The cargo-make tool is used to coordinate the example web application, and the trunk tool is used by cargo-make.

Todo: Librarification

The glayout.rs sources contain the platform-independent graph layout code, but this repo isn't set up to build a proper library right now.

Example Web UI

An example showing the layout working can be run via cargo make example after installing the dependencies listed above.

(This repo is also an exercise in Web Assembly and JavaScript integration.)

The most simple workflow is to hit the "New Graph" button and then hit the iterate button to see the algorithm changing the layout.

You will probably need to zoom out. You can pan the viewpoint and zoom using a scrollwheel or two fingers on a trackpad, as usual for graphosaurus WebGL 3D graph displays.

force-graph's People

Contributors

ecashin avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

schettino72

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.