1

I'm trying to create a chart which represents a time-series of events. Events can have effects which are new events. Any one event can have multiple nodes which affect it. This makes the data a graph.

var events = { 
    0: {effects: [4, 5], year: 2000},
    1: {effects: [4, 5], year: 2001},
    2: {effects: [6, 7], year: 2004},
    3: {effects: [6, 7], year: 2005},
    4: {effects: [8], year: 2008},
    5: {effects: [9], year: 2008},
    6: {effects: [10], year: 2009},
    7: {effects: [9]: year: 2009},
    8: {effects: [], year: 2010},
    9: {effects: [], year: 2011},
   10: {effects: [], year: 2013},
   11: {effects: [], year: 2014}
}

I want to show the relationship from a node to its effects by drawing the links. I also want to plot the nodes on a timeline along the x-axis where the distance along the x-axis is a function of the year when the event happened.

I tried using the D3.js tree layout but ran into the problem of one node having multiple parents. I tried using the force-layout but I couldn't figure out how to constrain the layout so that the x position is a function of the year when the event occurred.

I'd appreciate any pointers to examples of tree-layouts with multiple parents or a force-layout where the position along the horizontal axis is constrained.

Thanks in advance!

Shailesh
  • 595
  • 3
  • 17
  • 1
    [Here](http://www.larsko.org/v/igdp/index-alt.html) is an example where only the y position is set by the force layout. You basically ignore anything that shouldn't be set in the `.tick()` function. – Lars Kotthoff Feb 17 '14 at 21:23
  • see http://stackoverflow.com/a/20643596/214446 – mb21 Aug 29 '14 at 15:45

0 Answers0