Guest User

Untitled

a guest
Mar 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. var svg = d3.select("div.div1").append("svg")
  2. .attr('width', width)
  3. .attr('height', height)
  4.  
  5. simulation = d3.forceSimulation()
  6. .force('link', d3.forceLink()
  7. .id(function (link) { return link.id })
  8. .distance(function (link) { return link.propertyObj.distance })
  9. .strength(function (link) { return link.propertyObj.strength })
  10. )
  11. .force('charge', d3.forceManyBody().strength(-45))
  12. .force('center', d3.forceCenter(width / 3, height / 1.90))
  13.  
  14. d3.selectAll("svg > *").remove();
  15.  
  16. simulation.nodes(nodes).on('tick', ticked);
  17. simulation.force("link").links(links);
  18.  
  19. d3.selectAll("svg > *").remove();
Add Comment
Please, Sign In to add comment