vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.6 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Network | Dashed lines</title>
  5. <style type="text/css">
  6. body {
  7. font: 10pt sans;
  8. }
  9. #mynetwork {
  10. width: 600px;
  11. height: 600px;
  12. border: 1px solid lightgray;
  13. }
  14. </style>
  15. <script type="text/javascript" src="../../dist/vis.js"></script>
  16. <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />
  17. <script type="text/javascript">
  18. // Called on page load
  19. function draw() {
  20. var nodes = [
  21. {id: 1, label: 'dashed\nline\nexamples'},
  22. {id: 2, label: 'default'},
  23. {id: 3, label: 'dashes: [20, 20]'},
  24. {id: 4, label: 'dashes: [20, 5]'},
  25. {id: 5, label: 'dashes: [5, 20]'},
  26. {id: 6, label: 'dashes: [20, 5, 5, 5]'}
  27. ];
  28. var edges = [
  29. {from: 1, to: 2, dashes: true},
  30. {from: 1, to: 3, dashes: [20, 20]},
  31. {from: 1, to: 4, dashes: [20, 5]},
  32. {from: 1, to: 5, dashes: [5, 20]},
  33. {from: 1, to: 6, dashes: [20, 5, 5, 5]}
  34. ];
  35. // create the network
  36. var container = document.getElementById('mynetwork');
  37. var data = {
  38. nodes: nodes,
  39. edges: edges
  40. };
  41. var options = {
  42. nodes: {
  43. shape: 'box'
  44. },
  45. physics: {
  46. barnesHut: {
  47. springLength: 150
  48. },
  49. stabilization: false
  50. }
  51. };
  52. var network = new vis.Network(container, data, options);
  53. }
  54. </script>
  55. <script src="../googleAnalytics.js"></script>
  56. </head>
  57. <body onload="draw();">
  58. <p>
  59. This example shows the different options for dashed lines.
  60. </p>
  61. <div id="mynetwork"></div>
  62. </body>
  63. </html>