Nick Heiner
Nick Heiner

Reputation: 122470

Javascript InfoVis Toolkit: How to specify source/sink for arcs?

I'm using JIT to render graphs. I'm using the RGraph feature.

This JSON defines a graph:

var json = [


    {
        'id': '1',
        'name': 'CS 2110',
        'adjacencies': ['0', '2']
    },

    {
        'id': '1.5',
        'name': 'INFO 2300',
        'adjacencies': ['1']
    },

    {
        'id': '0',
        'name': 'CS 1110',
        'adjacencies': ['1']
    },

    {
        'id': '2',
        'name': 'INFO 3300',
        'adjacencies': ['1']
    },

]

If I want a directed graph, how can I specify which nodes are sources and which are sinks?

Upvotes: 2

Views: 799

Answers (1)

Nick Heiner
Nick Heiner

Reputation: 122470

Looks like you can specify it in the JSON data like so:

data: {
  $direction: ["idfrom", "idTo"]
} 

from:

http://groups.google.com/group/javascript-information-visualization-toolkit/browse_thread/thread/28602df76b6aa194

Upvotes: 2

Related Questions