Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. onload="loadVisualization('./csv/DataSet1.csv')"
  2.  
  3. <script>
  4.  
  5. var parcoords = d3.parcoords()("#NetworkData").alpha(.1)
  6.  
  7. function loadVisualization(source)
  8. {
  9. parcoords = d3.parcoords()("#NetworkData").alpha(.1)
  10. d3.csv(source, function(data)
  11. {
  12. parcoords
  13. .data( data.map(function(d)
  14. {
  15. return { "Time": d3.time.format("%H:%M:%S").parse(d.Time),
  16. "Source": (d.Source),
  17. "Destination": (d.Destination),
  18. "Protocol": (d.Protocol),
  19. "Length": (d.Length),
  20. "Destination Port": (d.DestPort),
  21. }
  22. }) )
  23. .color( "steelblue" )
  24. .mode("queue")
  25. .render()
  26. .reorderable()
  27. .interactive()
  28. .brushable();
  29. });
  30. }
  31.  
  32. function reloadNewData()
  33. {
  34. // Delete all data and reload from new source
  35. d3.select("#NetworkData").remove();
  36. source = './csv/DataSet_New.csv'
  37. loadVisualization(source)
  38. }
  39.  
  40. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement