Steven Burrows | d576f64 | 2016-09-26 10:40:51 -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 | angular.module('ovTopo2') |
| 26 | .factory('Topo2CountryFilters', [ |
| 27 | function (_$log_, _wss_, _t2ds_) { |
| 28 | return { |
| 29 | s_america: function (c) { |
| 30 | return c.properties.continent === 'South America'; |
| 31 | }, |
| 32 | ns_america: function (c) { |
| 33 | return c.properties.custom === 'US-cont' || |
| 34 | c.properties.subregion === 'Central America' || |
| 35 | c.properties.continent === 'South America'; |
| 36 | }, |
| 37 | japan: function (c) { |
| 38 | return c.properties.geounit === 'Japan'; |
| 39 | }, |
| 40 | europe: function (c) { |
| 41 | return c.properties.continent === 'Europe'; |
| 42 | }, |
| 43 | italy: function (c) { |
| 44 | return c.properties.geounit === 'Italy'; |
| 45 | }, |
| 46 | uk: function (c) { |
| 47 | // technically, Ireland is not part of the United Kingdom, |
| 48 | // but the map looks weird without it showing. |
| 49 | return c.properties.adm0_a3 === 'GBR' || |
| 50 | c.properties.adm0_a3 === 'IRL'; |
| 51 | }, |
| 52 | s_korea: function (c) { |
| 53 | return c.properties.adm0_a3 === 'KOR'; |
| 54 | }, |
| 55 | australia: function (c) { |
| 56 | return c.properties.adm0_a3 === 'AUS'; |
| 57 | } |
| 58 | }; |
| 59 | } |
| 60 | ]); |
| 61 | })(); |