Paul Greyson | 7a30082 | 2013-04-09 12:57:49 -0700 | [diff] [blame] | 1 | /*************************************************************************************************** |
| 2 | functions for creating and interacting with the topology view of the webui |
| 3 | |
| 4 | flow related topology is in flows.js |
| 5 | ***************************************************************************************************/ |
| 6 | |
Paul Greyson | e15c439 | 2013-04-09 15:05:31 -0700 | [diff] [blame] | 7 | (function () { |
Paul Greyson | 7a30082 | 2013-04-09 12:57:49 -0700 | [diff] [blame] | 8 | |
Paul Greyson | 3063625 | 2013-04-09 15:22:04 -0700 | [diff] [blame] | 9 | updateTopology = function() { |
| 10 | |
| 11 | /* currently rings.js and map.js can be included to define the topology display */ |
Paul Greyson | b9e879e | 2013-04-09 21:16:16 -0700 | [diff] [blame] | 12 | |
Paul Greyson | 45aceb2 | 2013-04-09 22:17:03 -0700 | [diff] [blame] | 13 | reconcilePendingLinks(model); |
| 14 | updateLinkMap(links); |
| 15 | |
Paul Greyson | 3063625 | 2013-04-09 15:22:04 -0700 | [diff] [blame] | 16 | drawTopology(); |
| 17 | |
Paul Greyson | 3063625 | 2013-04-09 15:22:04 -0700 | [diff] [blame] | 18 | // setup the mouseover behaviors |
| 19 | var allSwitches = d3.selectAll('.edge, .core, .aggregation'); |
| 20 | |
| 21 | allSwitches.on('mouseover', mouseOverSwitch); |
| 22 | allSwitches.on('mouseout', mouseOutSwitch); |
| 23 | allSwitches.on('mouseup', mouseUpSwitch); |
| 24 | allSwitches.on('mousedown', mouseDownSwitch); |
| 25 | |
| 26 | // only do switch up/down for core switches |
| 27 | d3.selectAll('.core').on('dblclick', doubleClickSwitch); |
| 28 | } |
| 29 | |
Paul Greyson | e15c439 | 2013-04-09 15:05:31 -0700 | [diff] [blame] | 30 | })(); |