0

I have two tables in database like this:

Table_1
PK Column generated by db...
Any other columns...

Table_1_association
PK Column generated by db...
FK Column for Table_1
Another FK Column for Table_1

In this case, I can have the follow lines in Table_1_association

FK1 -> FK2

1 -> 2
1 -> 3
1 -> 4
1 -> 5
1 -> 6
1 -> 7
7 -> 8
7 -> 9
10 -> 1
10 -> 7
10 -> 11
10 -> 12

I can have

9 -> 1

too.

I'd like to make a graph that show this structure. I used FOrceDirected graph with 'arrow' Edges because the direction is FK1 to FK2 (the -> in example above).

But I can't get. Some arrows are in wrong direction.

Does the ForceDirected graph allow this?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
  • I've been having the same problem... it seems that the direction of the arrow is dependent on the order in the list of adjacencies in the json list. I implemented a custom arrow that "should" draw it backwards and that seems to be working, though it is hardly a permenant solution. – AdamRedwine Jan 19 '12 at 20:01

1 Answers1

2

You can specify direction by adding $direction to the data section in the JSON which is a list of two strings representing the "from" node ID and the "to" node ID, respectively. For example:

"adjacencies" : [
   {
      "nodeTo" : "222",
      "data" : {
         "$direction" : [
            "111",
            "222"
         ]
      }
   }
]
Sicco
  • 6,167
  • 5
  • 45
  • 61
D Soa
  • 21
  • 2