Giter VIP home page Giter VIP logo

ggraph's Introduction

ggraph - Graph visualization for messy data

Build Status Coverage Status

This is a library built on top D3 with the goal of improving how we work with large and messy graphs. It extends the notion of nodes and links with groups of nodes. This is useful when multiple nodes are in fact the same thing or belong to the same group.

Live demo: https://gransk.com/ggraph.html

Some examples of nodes that may belong together:

  • IPs in the same subnet
  • Emails / monikers
  • File fingerprints
  • Bitcoin addresses in same wallet
  • Alternative spellings and typos

Data model

The easiest apporach is to call ggraph.convert with a valid D3 object:

var graph = {
  nodes:[
    {id: "Maria West", type: "female"},
    {id: "Hazel Santiago", type: "male"},
    {id: "Sheldon Roy", type: "male"}    
  ],
  links: [
    {source: "Maria West", target: "Hazel Santiago", value:100},
    {source: "Maria West", target: "Sheldon Roy"}    
  ]
}

converted = ggraph.convert(graph);

Usage

Initialization:

ggraph.init('container', 25); // Marker timeout
ggraph.draw(converted);

Merge nodes into groups:

// Merge selected
ggraph.merge(selection.all());

// Into single group
ggraph.merge(['Maria West', 'Sheldon Roy']);

// Into several groups
ggraph.merge([
  ['A', 'B'],
  ['C', 'D']
]);

Split and remove:

ggraph.split(['Maria West', 'Sheldon Roy']);
ggraph.remove(['Maria West', 'Hazel Santiago']);

Building

git clone https://github.com/pcbje/ggraph && cd ggraph
npm install
node_modules/.bin/karma start tests/cover.conf.js
node_modules/.bin/karma start tests/watch.conf.js
node_modules/.bin/grunt min

Disclaimer

This is a work in progress. Contributions are very much welcome!

ggraph's People

Contributors

pcbje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ggraph's Issues

Position of nodes

How would I make so I can drag the nodes away from each other and make them so they stay wherever I dragged them? Thank you ^^

Assign value to nodes on grouping?

I'm not sure what the scope of this library is going to be, but it seems to me the core focus could be to normalize and group nodes manually based on some kind of relationship. When grouping nodes it would be nice to be able to give the relationship some kind of name or group name.

Persisting the relationship names would be beyond the scope of this I'm sure (bring your own persistence model), but an easy interface to assign perhaps a new attribute and value would be great.

Actually maybe even creating an export to CSV option would be a quick and dirty persistence mechanism. I definitely want to use this in one of my projects in the near future, so I'm willing to help with some of the features. I haven't dug into the code yet, but some of this ad-hoc kind of functionality might be best accomplished through some kind of plugin model when you can easily add functionality to the control area.

Graph scaling

Firstly, thanks a lot for the great library.
How I can make all graph (nodes, edges, labels, etc) a little bit larger?

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.