Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [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 Layout Module. |
| 19 | Module that contains the d3.force.layout logic |
| 20 | */ |
| 21 | |
| 22 | (function () { |
| 23 | 'use strict'; |
| 24 | |
Steven Burrows | 6deb4ce | 2016-08-26 16:06:23 +0100 | [diff] [blame] | 25 | function nodeEnter(node) { |
| 26 | node.onEnter(this, node); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 27 | } |
| 28 | |
Steven Burrows | dfa52b0 | 2016-09-02 13:50:43 +0100 | [diff] [blame] | 29 | function nodeExit(node) { |
| 30 | node.onExit(this, node); |
| 31 | } |
| 32 | |
Steven Burrows | beef935 | 2016-10-21 14:09:50 -0500 | [diff] [blame] | 33 | function hostEnter(node) { |
| 34 | node.onEnter(this, node); |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | function linkEntering(link) { |
| 38 | link.onEnter(this); |
| 39 | } |
| 40 | |
| 41 | angular.module('ovTopo2') |
| 42 | .factory('Topo2D3Service', |
Steven Burrows | beef935 | 2016-10-21 14:09:50 -0500 | [diff] [blame] | 43 | [function (_is_) { |
| 44 | return { |
| 45 | nodeEnter: nodeEnter, |
| 46 | nodeExit: nodeExit, |
| 47 | hostEnter: hostEnter, |
| 48 | linkEntering: linkEntering |
| 49 | }; |
| 50 | }] |
Steven Burrows | ec1f45c | 2016-08-08 16:14:41 +0100 | [diff] [blame] | 51 | ); |
| 52 | })(); |