d4dagdemo.js 498 B

1234567891011121314151617181920212223242526272829303132
  1. import {d4daglayout} from "./d4dag.js";
  2. let graph, svg,
  3. graphData = {
  4. numLayer: 4,
  5. maxPerLayer: 2,
  6. nodeList: [
  7. {label: 'Rubecula', layer: 0},
  8. {label: 'Turdus', layer: 3},
  9. {label: 'Corvus', layer: 1},
  10. {label: 'Falco', layer: 1},
  11. {label: 'Cathartes', layer: 2},
  12. {label: 'Parus', layer: 0}
  13. ],
  14. adjList: [
  15. [2, 3, 4],
  16. [],
  17. [1],
  18. [],
  19. [],
  20. [2]
  21. ]
  22. };
  23. graph = new d4daglayout({
  24. });
  25. console.log("Version number " + graph.version());
  26. graph.layout(graphData);