edgelegend

Creates dat.gui legend to change ngraph.pixel edges


Keywords
ngraph, ngraph.pixel, dat.gui, edge, legend
License
MIT
Install
npm install edgelegend@2.0.0

Documentation

edgelegend

Creates dat.gui legend to change ngraph.pixel edges. Click here to see the demo of this plugin.

usage

var renderGraph = require('ngraph.pixel');
var createSetings = require('config.pixel');
var createLegend = require('edgelegend');

var renderer = renderGraph(graph);
var settings = createSettings(renderer);

// add a new group called "Groups", with two colors:
createLegend(settings, 'Groups', [{
  name: 'First',
  color: 0xff0000,
  filter: function(link) {
    return link.fromId <= 50;
  }
}, {
  name: 'Second',
  color: 0x00ff00,
  filter: function(link) {
    return link.fromId > 50;
  }
}]);

install

With npm do:

npm install edgelegend

license

MIT