Skip to content

Commit f8b2bea

Browse files
committed
Update to one-way bindings and fix example to provide better samples and descriptions
1 parent 768afa8 commit f8b2bea

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/charts/topology/examples/topology-view.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* <ul style='list-style-type: none'>
1313
* <li>.name - name of the item the node represents
1414
* <li>.status - optional status of the node (can be used to differentiate the circle color)
15-
* <li>.kind - the kind of node
15+
* <li>.kind - the kind of node - this is a general key that needs to be unique for grouping the nodes Filtering and styles use this value as well to correctly select the nodes.
1616
* </ul>
1717
*
1818
* @param {object} relations the object containing all of the node relationships:<br/>
@@ -90,7 +90,7 @@
9090
"name": "registry",
9191
"kind": "Container",
9292
"miq_id": 10000000000235,
93-
"status": "Running",
93+
"status": "Error",
9494
"display_kind": "Container"
9595
},
9696
"ContainerReplicator10r56": {
@@ -226,6 +226,11 @@
226226
$scope.nodes.ContainerService.textY = 9;
227227
$scope.nodes.ContainerService.textX = -1;
228228
229+
$scope.nodes.ContainerGroup.height = 30;
230+
$scope.nodes.ContainerGroup.width = 30;
231+
$scope.nodes.ContainerGroup.radius = 28;
232+
$scope.nodes.ContainerGroup.textY = 8;
233+
229234
$scope.itemSelected = function (item) {
230235
var text = "";
231236
if (item) {
@@ -289,7 +294,7 @@
289294
}
290295
291296
.pf-topology-svg g.ContainerGroup text.glyph {
292-
font-size: 18px;
297+
font-size: 28px;
293298
}
294299
295300
.pf-topology-svg g.Vm text.glyph, .pf-topology-svg g.Host text.glyph {

src/charts/topology/topology.component.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
angular.module('patternfly.charts').component('pfTopology', {
22
bindings: {
3-
items: '=',
4-
relations: '=',
5-
kinds: '=',
6-
icons: '=',
7-
selection: '=',
8-
force: '=',
9-
radius: '=',
3+
items: '<',
4+
relations: '<',
5+
kinds: '<',
6+
icons: '<',
7+
selection: '<',
8+
force: '<',
9+
radius: '<',
1010
nodes: '<',
1111
searchText: '<?',
1212
chartRendered: '&?',
@@ -43,10 +43,6 @@ angular.module('patternfly.charts').component('pfTopology', {
4343
};
4444

4545
ctrl.$onChanges = function (changesObj) {
46-
if (changesObj.kinds || changesObj.items || changesObj.relations) {
47-
ctrl.updateAll();
48-
}
49-
5046
if (changesObj.searchText && graph) {
5147
search(changesObj.searchText.currentValue);
5248
}
@@ -55,7 +51,7 @@ angular.module('patternfly.charts').component('pfTopology', {
5551
toggleLabelVisibility();
5652
}
5753

58-
if (changesObj.selection) {
54+
if (changesObj.selection && graph) {
5955
graph.select(changesObj.selection.currentValue || null);
6056
}
6157
};

0 commit comments

Comments
 (0)