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.

137 lines
6.3 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JS Bin</title>
  6. <script type="text/javascript" src="../dist/vis.js"></script> <!-- network handling framework -->
  7. <link href="../dist/vis.css" rel="stylesheet" type="text/css"/>
  8. <style type="text/css">
  9. #network{
  10. width: 1200px;
  11. height: 800px;
  12. border: 1px solid lightgray;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <h1>Network Test</h1>
  18. <div id="network"></div>
  19. <script>
  20. var nodes = new vis.DataSet([
  21. {"id":317,"label":"Start - BTN\n317\nSection","x":-817,"y":-24,"group":"Section"},
  22. {"id":318,"label":"End Call\n318\nHangup","x":-933,"y":-175,"group":"Hangup"},
  23. {"id":319,"label":"Call Error\n319\nSpeak","x":-727,"y":-175,"group":"Speak"}, {"id":320,"label":"Welcome\n320\nSpeak","x":-563,"y":-14,"group":"Speak"},
  24. {"id":321,"label":"Enter TN\n321\nPrompt","x":-326,"y":-7,"group":"Prompt"},
  25. {"id":322,"label":"CheckIsTenDigits\n322\nWebService","x":-84,"y":-5,"group":"WebService"},
  26. {"id":323,"label":"VerifyIsTenDigits\n323\nCase","x":207,"y":-4,"group":"Case"},
  27. {"id":324,"label":"CheckIsValidTN\n324\nWebService","x":492,"y":-10,"group":"WebService"},
  28. {"id":325,"label":"Not Ten Digits\n325\nSpeak","x":-76,"y":-274,"group":"Speak"},
  29. {"id":326,"label":"VerifyIsValidTN\n326\nCase","x":821,"y":-9,"group":"Case"},
  30. {"id":327,"label":"Verify TN Is Correct\n327\nPrompt","x":812,"y":265,"group":"Prompt"},
  31. {"id":328,"label":"Not Valid TN\n328\nSpeak","x":499,"y":-210,"group":"Speak"},
  32. {"id":329,"label":"BTN Is Valid\n329\nSpeak","x":812,"y":397,"group":"Speak"},
  33. {"id":330,"label":"Validate TPV ID\n330\nSection","x":708,"y":592,"group":"Section"},
  34. {"id":331,"label":"End Section End Call\n331\nHangup","x":1040,"y":478,"group":"Hangup"},
  35. {"id":332,"label":"Say BTN\n332\nSpeak","x":820,"y":113,"group":"Speak"},
  36. {"id":333,"label":"Get TPV ID\n333\nWebService","x":800,"y":824,"group":"WebService"},
  37. {"id":334,"label":"TPV ID Error\n334\nSpeak","x":1037,"y":682,"group":"Speak"},
  38. {"id":335,"label":"Verify TPV ID Is Valid\n335\nCase","x":798,"y":1059,"group":"Case"},
  39. {"id":336,"label":"TPV ID Is valid\n336\nSpeak","x":802,"y":1304,"group":"Speak"},
  40. {"id":337,"label":"End Call\n337\nSection","x":828,"y":1605,"group":"Section"},
  41. {"id":338,"label":"TPV ID Not Found\n338\nSpeak","x":1211,"y":1055,"group":"Speak"},
  42. {"id":339,"label":"TPV ID End Call\n339\nHangup","x":1074,"y":1616,"group":"Hangup"}
  43. ]);
  44. var edges = new vis.DataSet([
  45. {"id":353,"from":317,"to":318,"label":"Hangup"},{"id":354,"from":317,"to":318,"label":"CcHangup"},{"id":355,"from":317,"to":319,"label":"Error"},{"id":356,"from":319,"to":318,"label":"Continue"},{"id":357,"from":319,"to":318,"label":"Error"},{"id":358,"from":319,"to":318,"label":"Hangup"},{"id":359,"from":317,"to":320,"label":"Continue"},{"id":360,"from":320,"to":321,"label":"Continue"},{"id":361,"from":321,"to":322,"label":"1"},{"id":362,"from":322,"to":323,"label":"Continue"},{"id":363,"from":323,"to":324,"label":"1"},{"id":364,"from":323,"to":325,"label":"2"},{"id":365,"from":325,"to":321,"label":"Continue"},{"id":366,"from":324,"to":326,"label":"Continue"},{"id":367,"from":326,"to":332,"label":"1"},{"id":368,"from":326,"to":328,"label":"2"},{"id":369,"from":327,"to":332,"label":"3"},{"id":370,"from":327,"to":321,"label":"2"},{"id":371,"from":328,"to":321,"label":"Continue"},{"id":372,"from":327,"to":329,"label":"1"},{"id":373,"from":329,"to":330,"label":"Continue"},{"id":374,"from":330,"to":333,"label":"Continue"},{"id":375,"from":330,"to":331,"label":"Hangup"},{"id":376,"from":332,"to":327,"label":"Continue"},{"id":377,"from":330,"to":334,"label":"Error"},{"id":378,"from":334,"to":331,"label":"Continue"},{"id":379,"from":333,"to":335,"label":"Continue"},{"id":380,"from":335,"to":336,"label":"1"},{"id":381,"from":336,"to":337,"label":"Continue"},{"id":382,"from":335,"to":338,"label":"0"},{"id":383,"from":338,"to":337,"label":"Continue"},{"id":384,"from":337,"to":339,"label":"Continue"}
  46. ]);
  47. var container = document.getElementById('network');
  48. var data = {
  49. edges: edges,
  50. nodes: nodes
  51. };
  52. var options = {
  53. manipulation: {
  54. initiallyActive: true,
  55. addNode: true,
  56. addEdge: true,
  57. editEdge: true,
  58. deleteNode: true,
  59. deleteEdge: true
  60. },
  61. nodes: {
  62. physics: false,
  63. },
  64. edges: {
  65. physics: false,
  66. arrows: 'to',
  67. smooth: {
  68. enabled: true,
  69. type: 'continuous'
  70. }
  71. },
  72. interaction: {
  73. dragNodes: true,
  74. dragView: true,
  75. hover: true,
  76. keyboard: {
  77. enabled: true,
  78. bindToWindow: false
  79. },
  80. navigationButtons: true,
  81. selectable: true,
  82. selectConnectedEdges: true,
  83. hoverConnectedEdges: true,
  84. zoomView: true
  85. },
  86. groups: {
  87. Assignment: {
  88. shape: 'box',
  89. color: '#6699ff'
  90. },
  91. Hangup: {
  92. shape: 'box',
  93. color: '#b8b8b8'
  94. },
  95. Prompt: {
  96. shape: 'box',
  97. color: '#00ffff'
  98. },
  99. Section: {
  100. shape: 'circle',
  101. color: '#66ff66'
  102. },
  103. Speak: {
  104. shape: 'box',
  105. color: '#ffff66'
  106. },
  107. StartRecording: {
  108. shape: 'box',
  109. color: '#ff5050'
  110. },
  111. StopRecording: {
  112. shape: 'box',
  113. color: '#ff5050'
  114. },
  115. Transfer: {
  116. shape: 'box',
  117. color: '#ff66ff'
  118. },
  119. TransferAgent: {
  120. shape: 'box',
  121. color: '#ff9900'
  122. },
  123. Case: {
  124. shape: 'box',
  125. color: '#33cccc'
  126. },
  127. WebService: {
  128. shape: 'box',
  129. color: '#33cc33'
  130. }
  131. }
  132. };
  133. var network = new vis.Network(container, data, options);
  134. </script>
  135. </body>
  136. </html>