blob: 9123ac778274e9c8d14b08f7c0de047c2ec23696 [file] [log] [blame]
Steven Burrowsec1f45c2016-08-08 16:14:41 +01001/*
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/*
18ONOS GUI -- Topology Layout Module.
19Module that contains the d3.force.layout logic
20*/
21
22(function () {
23 'use strict';
24
Steven Burrows6deb4ce2016-08-26 16:06:23 +010025 function nodeEnter(node) {
26 node.onEnter(this, node);
Steven Burrowsec1f45c2016-08-08 16:14:41 +010027 }
28
Steven Burrowsdfa52b02016-09-02 13:50:43 +010029 function nodeExit(node) {
30 node.onExit(this, node);
31 }
32
Steven Burrowsbeef9352016-10-21 14:09:50 -050033 function hostEnter(node) {
34 node.onEnter(this, node);
Steven Burrowsec1f45c2016-08-08 16:14:41 +010035 }
36
37 function linkEntering(link) {
38 link.onEnter(this);
39 }
40
41 angular.module('ovTopo2')
42 .factory('Topo2D3Service',
Steven Burrowsbeef9352016-10-21 14:09:50 -050043 [function (_is_) {
44 return {
45 nodeEnter: nodeEnter,
46 nodeExit: nodeExit,
47 hostEnter: hostEnter,
48 linkEntering: linkEntering
49 };
50 }]
Steven Burrowsec1f45c2016-08-08 16:14:41 +010051);
52})();