blob: 8cbf19679ccccd5134dbec300c58e8e0360e16b8 [file] [log] [blame]
Sean Condon0c577f62018-11-18 22:40:05 +00001<!--
2~ Copyright 2018-present Open Networking Foundation
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-->
Sean Condon50855cf2018-12-23 15:37:42 +000016<svg:defs xmlns:svg="http://www.w3.org/2000/svg">
17 <!-- Template explanation: Define an SVG Filter that in
18 line 1) render the target object in to a bit map and apply a blur to it
19 based on its alpha channel
20 line 2) take that blurred layer and shift it down and to the right by 4
21 line 3) Merge this blurred and shifted layer and overlay it with the
22 original target object
23 -->
Sean Condon50855cf2018-12-23 15:37:42 +000024 <svg:radialGradient id="three_stops_radial">
25 <svg:stop offset= "0%" style="stop-color: #e3e5d6;" />
26 <svg:stop offset= "70%" style="stop-color: #c3c5b6;" />
27 <svg:stop offset="100%" style="stop-color: #a3a596;" />
28 </svg:radialGradient>
29</svg:defs>
30<!-- Template explanation: Creates an SVG Group and in
31 line 1) transform it to the position calculated by the d3 force graph engine
32 line 2) Give it various CSS styles depending on attributes
33 line 3) When it is clicked, call the method that toggles the selection and
34 emits an event.
35 Other child objects have their own description
36-->
Sean Condon021f0fa2018-12-06 23:31:11 -080037<svg:g xmlns:svg="http://www.w3.org/2000/svg"
38 [attr.transform]="'translate(' + host?.x + ',' + host?.y + '), scale(' + scale + ')'"
39 [ngClass]="['node', 'host', 'endstation', 'fixed', selected?'selected':'', 'hovered']"
Sean Condond88f3662019-04-03 16:35:30 +010040 (click)="toggleSelected(host, $event)">
Sean Condon50855cf2018-12-23 15:37:42 +000041 <svg:desc>Host {{host.id}}</svg:desc>
42 <!-- Template explanation: Creates an SVG Circle and in
43 line 1) Apply the drop shadow defined above to this circle
44 line 2) Apply the radial gradient defined above to the circle
45 -->
46 <svg:circle r="15"
Sean Condon50855cf2018-12-23 15:37:42 +000047 style="fill: url(#three_stops_radial)">
48 </svg:circle>
Sean Condon1ae15802019-03-02 09:07:18 +000049 <svg:use xlink:href="#m_endstation" width="22.5" height="22.5" x="-11.25" y="-11.25">
50 </svg:use>
Sean Condon50855cf2018-12-23 15:37:42 +000051 <!-- Template explanation: Creates an SVG Text
52 line 1) if the labelToggle is not 0
53 line 2) shift it below the circle, and have it centred with the circle
54 line 3) apply a scale and call on the hostName(0 method to get the
55 displayed value
56 -->
57 <svg:text
58 *ngIf="labelToggle != 0"
59 dy="30" text-anchor="middle"
Sean Condon1ae15802019-03-02 09:07:18 +000060 >{{hostName()}}</svg:text>
Sean Condond88f3662019-04-03 16:35:30 +010061</svg:g>