Simon Hunt | d5b9673 | 2016-07-08 13:22:27 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | ONOS GUI -- Topology Force Module. |
| 19 | Visualization of the topology in an SVG layer, using a D3 Force Layout. |
| 20 | */ |
| 21 | |
| 22 | (function () { |
| 23 | 'use strict'; |
| 24 | |
| 25 | // injected refs |
| 26 | var $log, wss; |
| 27 | |
| 28 | // ========================== Helper Functions |
| 29 | |
| 30 | function init() { |
| 31 | $log.debug('Initialize topo force layout'); |
| 32 | } |
| 33 | |
| 34 | function destroy() { |
| 35 | $log.debug('Destroy topo force layout'); |
| 36 | } |
| 37 | |
| 38 | // ========================== Event Handlers |
| 39 | |
| 40 | function allInstances(data) { |
| 41 | $log.debug('>> topo2AllInstances event:', data) |
| 42 | } |
| 43 | |
| 44 | function currentLayout(data) { |
| 45 | $log.debug('>> topo2CurrentLayout event:', data) |
| 46 | } |
| 47 | |
| 48 | function currentRegion(data) { |
| 49 | $log.debug('>> topo2CurrentRegion event:', data) |
| 50 | } |
| 51 | |
| 52 | function startDone(data) { |
| 53 | $log.debug('>> topo2StartDone event:', data) |
| 54 | } |
| 55 | |
| 56 | // ========================== Main Service Definition |
| 57 | |
| 58 | angular.module('ovTopo2') |
| 59 | .factory('Topo2ForceService', |
| 60 | ['$log', 'WebSocketService', |
| 61 | |
| 62 | function (_$log_, _wss_) { |
| 63 | $log = _$log_; |
| 64 | wss = _wss_; |
| 65 | |
| 66 | return { |
| 67 | init: init, |
| 68 | destroy: destroy, |
| 69 | topo2AllInstances: allInstances, |
| 70 | topo2CurrentLayout: currentLayout, |
| 71 | topo2CurrentRegion: currentRegion, |
| 72 | topo2StartDone: startDone |
| 73 | }; |
| 74 | }]); |
| 75 | }()); |