2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 import { GraphColors, GraphUIObjects} from "app/utils/constants";
22 import constant = require("lodash/constant");
23 import {ImagesUrl} from "app/utils/constants";
24 import {AngularJSBridge} from "app/services/angular-js-bridge-service";
26 * Created by obarda on 12/18/2016.
28 export class ComponentInstanceNodesStyle {
30 public static getCompositionGraphStyle = ():Array<Cy.Stylesheet> => {
37 'selection-box-color': 'rgb(0, 159, 219)',
38 'selection-box-opacity': 0.2,
39 'selection-box-border-color': '#009fdb',
40 'selection-box-border-width': 1
47 'font-family': 'OpenSans-Regular,sans-serif',
52 'text-border-width': 15,
53 'text-border-color': GraphColors.NODE_UCPE,
60 'background-color': 'transparent',
62 'label': 'data(displayName)',
63 'background-image': 'data(img)',
64 'width': GraphUIObjects.DEFAULT_RESOURCE_WIDTH,
65 'height': GraphUIObjects.DEFAULT_RESOURCE_WIDTH,
66 'background-opacity': 0,
67 "background-width": GraphUIObjects.DEFAULT_RESOURCE_WIDTH,
68 "background-height": GraphUIObjects.DEFAULT_RESOURCE_WIDTH,
69 'text-valign': 'bottom',
70 'text-halign': 'center',
71 'background-fit': 'cover',
72 'background-clip': 'node',
73 'overlay-color': GraphColors.NODE_BACKGROUND_COLOR,
79 selector: '.service-node',
81 'background-color': 'transparent',
82 'label': 'data(displayName)',
85 'background-image': 'data(img)',
89 'text-valign': 'bottom',
90 'text-halign': 'center',
91 'background-opacity': 0,
92 'overlay-color': GraphColors.NODE_BACKGROUND_COLOR,
99 'background-color': 'rgb(255,255,255)',
100 'shape': 'rectangle',
101 'label': 'data(displayName)',
102 'background-image': 'data(img)',
103 'background-width': GraphUIObjects.SMALL_RESOURCE_WIDTH,
104 'background-height': GraphUIObjects.SMALL_RESOURCE_WIDTH,
105 'width': GraphUIObjects.SMALL_RESOURCE_WIDTH,
106 'height': GraphUIObjects.SMALL_RESOURCE_WIDTH,
107 'text-valign': 'bottom',
108 'text-halign': 'center',
109 'background-opacity': 0,
110 'overlay-color': GraphColors.NODE_BACKGROUND_COLOR,
115 selector: '.vl-node',
117 'background-color': 'rgb(255,255,255)',
118 'shape': 'rectangle',
119 'label': 'data(displayName)',
120 'background-image': 'data(img)',
121 'background-width': GraphUIObjects.SMALL_RESOURCE_WIDTH,
122 'background-height': GraphUIObjects.SMALL_RESOURCE_WIDTH,
123 'width': GraphUIObjects.SMALL_RESOURCE_WIDTH,
124 'height': GraphUIObjects.SMALL_RESOURCE_WIDTH,
125 'text-valign': 'bottom',
126 'text-halign': 'center',
127 'background-opacity': 0,
128 'overlay-color': GraphColors.NODE_BACKGROUND_COLOR,
133 selector: '.ucpe-cp',
135 'background-color': GraphColors.NODE_UCPE_CP,
136 'background-width': 15,
137 'background-height': 15,
140 'text-halign': 'center',
141 'overlay-opacity': 0,
142 'label': 'data(displayName)',
143 'text-valign': 'data(textPosition)',
144 'text-margin-y': (ele:Cy.Collection) => {
145 return (ele.data('textPosition') == 'top') ? -5 : 5;
151 selector: '.ucpe-node',
153 'background-fit': 'cover',
159 selector: '.simple-link',
162 'line-color': GraphColors.BASE_LINK,
163 'target-arrow-color': '#3b7b9b',
164 'target-arrow-shape': 'triangle',
165 'curve-style': 'bezier',
166 'control-point-step-size': 30
170 selector: '.vl-link',
173 'line-color': GraphColors.VL_LINK,
174 'curve-style': 'bezier',
175 'control-point-step-size': 30
179 selector: '.vl-link-1',
182 'line-color': GraphColors.ACTIVE_LINK,
183 'curve-style': 'unbundled-bezier',
184 'target-arrow-color': '#3b7b9b',
185 'target-arrow-shape': 'triangle',
186 'control-point-step-size': 30
190 selector: '.ucpe-host-link',
196 selector: '.not-certified-link',
199 'line-color': GraphColors.NOT_CERTIFIED_LINK,
200 'curve-style': 'bezier',
201 'control-point-step-size': 30,
202 'line-style': 'dashed',
203 'target-arrow-color': '#3b7b9b',
204 'target-arrow-shape': 'triangle'
210 selector: '.service-path-link',
213 'line-color': GraphColors.SERVICE_PATH_LINK,
214 'target-arrow-color': GraphColors.SERVICE_PATH_LINK,
215 'target-arrow-shape': 'triangle',
216 'curve-style': 'bezier',
217 'control-point-step-size': 30
221 selector: '.not-certified',
223 'shape': 'rectangle',
224 'background-image': (ele:Cy.Collection) => {
225 return ele.data().initUncertifiedImage(ele, GraphUIObjects.NODE_OVERLAP_MIN_SIZE)
231 selector: 'node:selected',
234 "border-color": GraphColors.NODE_SELECTED_BORDER_COLOR,
239 selector: 'edge:selected',
241 'line-color': GraphColors.ACTIVE_LINK
246 selector: 'edge:active',
251 selector: '.configuration-node',
253 'background-color': 'rgb(255,255,255)',
254 'shape': 'rectangle',
255 'label': 'data(displayName)',
256 'background-image': 'data(img)',
257 'background-width': GraphUIObjects.SMALL_RESOURCE_WIDTH,
258 'background-height': GraphUIObjects.SMALL_RESOURCE_WIDTH,
259 'width': GraphUIObjects.SMALL_RESOURCE_WIDTH,
260 'height': GraphUIObjects.SMALL_RESOURCE_WIDTH,
261 'text-valign': 'bottom',
262 'text-halign': 'center',
263 'background-opacity': 0,
264 'overlay-color': GraphColors.NODE_BACKGROUND_COLOR,
271 public static getBasicNodeHanlde = () => {
280 nodeTypeNames: ["basic-node"],
281 imageUrl: AngularJSBridge.getAngularConfig().imagesPath + ImagesUrl.CANVAS_PLUS_ICON,
288 public static getBasicSmallNodeHandle = () => {
297 nodeTypeNames: ["basic-small-node"],
298 imageUrl: AngularJSBridge.getAngularConfig().imagesPath + ImagesUrl.CANVAS_PLUS_ICON,
304 public static getUcpeCpNodeHandle = () => {
313 nodeTypeNames: ["ucpe-cp-node"],
314 imageUrl: AngularJSBridge.getAngularConfig().imagesPath + ImagesUrl.CANVAS_PLUS_ICON,