nutella_framework 0.4.23 → 0.4.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/framework_components/monitoring-bot/monitoring-bot.rb +11 -2
  4. data/framework_components/monitoring-interface/.gitignore +2 -0
  5. data/framework_components/monitoring-interface/README.md +1 -0
  6. data/framework_components/monitoring-interface/bower.json +29 -0
  7. data/framework_components/monitoring-interface/bower_components/bower-mqttws/.bower.json +23 -0
  8. data/framework_components/monitoring-interface/bower_components/bower-mqttws/bower.json +14 -0
  9. data/framework_components/monitoring-interface/bower_components/bower-mqttws/mqttws31.js +2081 -0
  10. data/framework_components/monitoring-interface/bower_components/bower-mqttws/readme.md +4 -0
  11. data/framework_components/monitoring-interface/bower_components/nutella_lib/.bower.json +37 -0
  12. data/framework_components/monitoring-interface/bower_components/nutella_lib/LICENSE +21 -0
  13. data/framework_components/monitoring-interface/bower_components/nutella_lib/README.md +15 -0
  14. data/framework_components/monitoring-interface/bower_components/nutella_lib/bower.json +28 -0
  15. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/mqtt_client_hello_world.html +23 -0
  16. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/nutella_hello_world.html +52 -0
  17. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/mqtt_client_hello_world.js +14 -0
  18. data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/nutella_hello_world.js +38 -0
  19. data/framework_components/monitoring-interface/bower_components/nutella_lib/nutella_lib.js +789 -0
  20. data/framework_components/monitoring-interface/bower_components/nutella_lib/package.json +30 -0
  21. data/framework_components/monitoring-interface/css/Monitoring Interface.html +215 -0
  22. data/framework_components/monitoring-interface/css/Monitoring Interface_files/animations.js +27 -0
  23. data/framework_components/monitoring-interface/css/Monitoring Interface_files/application-view-controller.js +232 -0
  24. data/framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js +61 -0
  25. data/framework_components/monitoring-interface/css/Monitoring Interface_files/bootstrap.min.js +7 -0
  26. data/framework_components/monitoring-interface/css/Monitoring Interface_files/cursor.css +7 -0
  27. data/framework_components/monitoring-interface/css/Monitoring Interface_files/d3.v3.min.js +5 -0
  28. data/framework_components/monitoring-interface/css/Monitoring Interface_files/graphics.js +156 -0
  29. data/framework_components/monitoring-interface/css/Monitoring Interface_files/grid-layout.js +103 -0
  30. data/framework_components/monitoring-interface/css/Monitoring Interface_files/highlight.min.js +2 -0
  31. data/framework_components/monitoring-interface/css/Monitoring Interface_files/instance-view-controller.js +104 -0
  32. data/framework_components/monitoring-interface/css/Monitoring Interface_files/jquery-1.10.0.min.js +6 -0
  33. data/framework_components/monitoring-interface/css/Monitoring Interface_files/notification-center.js +63 -0
  34. data/framework_components/monitoring-interface/css/Monitoring Interface_files/notifications.js +14 -0
  35. data/framework_components/monitoring-interface/css/Monitoring Interface_files/page.css +33 -0
  36. data/framework_components/monitoring-interface/css/Monitoring Interface_files/radial-layout.js +175 -0
  37. data/framework_components/monitoring-interface/css/Monitoring Interface_files/tab-table.js +8 -0
  38. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.css +0 -0
  39. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.js +320 -0
  40. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.css +10 -0
  41. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.js +426 -0
  42. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-element.js +205 -0
  43. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-notification.js +94 -0
  44. data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-tab.js +229 -0
  45. data/framework_components/monitoring-interface/css/Monitoring Interface_files/underscore-min.js +5 -0
  46. data/framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js +68 -0
  47. data/framework_components/monitoring-interface/css/Monitoring Interface_files/window-view-controller.js +169 -0
  48. data/framework_components/monitoring-interface/css/alerts.css +3 -0
  49. data/framework_components/monitoring-interface/css/bootstrap.min.css +5 -0
  50. data/framework_components/monitoring-interface/css/cursor.css +7 -0
  51. data/framework_components/monitoring-interface/css/highlight.default.min.css +1 -0
  52. data/framework_components/monitoring-interface/css/page.css +41 -0
  53. data/framework_components/monitoring-interface/css/ui-application.css +0 -0
  54. data/framework_components/monitoring-interface/css/ui-connection-view.css +10 -0
  55. data/framework_components/monitoring-interface/css/ui-legend-view.css +7 -0
  56. data/framework_components/monitoring-interface/data/alert.json +8 -0
  57. data/framework_components/monitoring-interface/data/data.json +2118 -0
  58. data/framework_components/monitoring-interface/data/data2.json +814 -0
  59. data/framework_components/monitoring-interface/data/data3.json +823 -0
  60. data/framework_components/monitoring-interface/data/data4.json +848 -0
  61. data/framework_components/monitoring-interface/data/message.json +999 -0
  62. data/framework_components/monitoring-interface/gulpfile.js +29 -0
  63. data/framework_components/monitoring-interface/img/arrow_white.svg +120 -0
  64. data/framework_components/monitoring-interface/img/arrow_white_right.svg +104 -0
  65. data/framework_components/monitoring-interface/img/back.svg +164 -0
  66. data/framework_components/monitoring-interface/img/cross_red_border_white.svg +143 -0
  67. data/framework_components/monitoring-interface/img/cross_red_border_white_mouseover.svg +143 -0
  68. data/framework_components/monitoring-interface/img/email.svg +89 -0
  69. data/framework_components/monitoring-interface/img/email_highlighted.svg +89 -0
  70. data/framework_components/monitoring-interface/index.html +144 -0
  71. data/framework_components/monitoring-interface/js/d3/layout/grid-layout.js +103 -0
  72. data/framework_components/monitoring-interface/js/d3/layout/radial-layout.js +184 -0
  73. data/framework_components/monitoring-interface/js/d3/plugin/graphics.js +156 -0
  74. data/framework_components/monitoring-interface/js/d3/plugin/tab-table.js +8 -0
  75. data/framework_components/monitoring-interface/js/d3/ui/animations.js +27 -0
  76. data/framework_components/monitoring-interface/js/d3/ui/ui-application.js +471 -0
  77. data/framework_components/monitoring-interface/js/d3/ui/ui-connection-view.js +847 -0
  78. data/framework_components/monitoring-interface/js/d3/ui/ui-element.js +245 -0
  79. data/framework_components/monitoring-interface/js/d3/ui/ui-legend.js +174 -0
  80. data/framework_components/monitoring-interface/js/d3/ui/ui-notification.js +90 -0
  81. data/framework_components/monitoring-interface/js/d3/ui/ui-tab.js +309 -0
  82. data/framework_components/monitoring-interface/js/lib/JSXTransformer-0.12.2.js +15199 -0
  83. data/framework_components/monitoring-interface/js/lib/bootstrap.min.js +7 -0
  84. data/framework_components/monitoring-interface/js/lib/d3.v3.min.js +5 -0
  85. data/framework_components/monitoring-interface/js/lib/highlight.min.js +2 -0
  86. data/framework_components/monitoring-interface/js/lib/jquery-1.10.0.min.js +6 -0
  87. data/framework_components/monitoring-interface/js/lib/nutella_lib.js +5121 -0
  88. data/framework_components/monitoring-interface/js/lib/react-with-addons-0.12.2.js +19822 -0
  89. data/framework_components/monitoring-interface/js/lib/underscore-min.js +5 -0
  90. data/framework_components/monitoring-interface/js/model/alerts-model.js +74 -0
  91. data/framework_components/monitoring-interface/js/model/applications-model.js +78 -0
  92. data/framework_components/monitoring-interface/js/model/messages-model.js +112 -0
  93. data/framework_components/monitoring-interface/js/notification/notification-center.js +63 -0
  94. data/framework_components/monitoring-interface/js/notification/notifications.js +21 -0
  95. data/framework_components/monitoring-interface/js/react/dist/ui-alerts.js +178 -0
  96. data/framework_components/monitoring-interface/js/react/dist/ui-message-send.js +389 -0
  97. data/framework_components/monitoring-interface/js/react/dist/ui-messages.js +103 -0
  98. data/framework_components/monitoring-interface/js/react/src/ui-alerts.js +178 -0
  99. data/framework_components/monitoring-interface/js/react/src/ui-message-send.js +389 -0
  100. data/framework_components/monitoring-interface/js/react/src/ui-messages.js +103 -0
  101. data/framework_components/monitoring-interface/js/view-controller/application-view-controller.js +256 -0
  102. data/framework_components/monitoring-interface/js/view-controller/instance-view-controller.js +112 -0
  103. data/framework_components/monitoring-interface/js/view-controller/view-controller.js +74 -0
  104. data/framework_components/monitoring-interface/js/view-controller/window-view-controller.js +169 -0
  105. data/framework_components/monitoring-interface/nutella.json +6 -0
  106. data/framework_components/order.json +1 -0
  107. data/framework_components/roomcast-bot/roomcast_bot.rb +139 -117
  108. data/framework_components/roomcast-channel-creator/dist/app.js +9 -7
  109. data/framework_components/roomcast-channel-creator/index.html +1 -1
  110. data/framework_components/roomcast-channel-creator/src/app/components/main.js +8 -6
  111. data/framework_components/roomcast-package-creator/dist/app.js +4 -4
  112. data/framework_components/roomcast-package-creator/index.html +1 -1
  113. data/framework_components/roomcast-package-creator/package.json +3 -3
  114. data/framework_components/roomcast-package-creator/src/app/components/ConfigurationsPanel.js +2 -2
  115. data/framework_components/roomcast-package-creator/src/app/components/PoolRow.js +1 -1
  116. data/framework_components/roomcast-teacher-controls/.gitignore +2 -0
  117. data/framework_components/roomcast-teacher-controls/README.md +9 -0
  118. data/framework_components/roomcast-teacher-controls/dist/app.js +38327 -0
  119. data/framework_components/roomcast-teacher-controls/dist/main.css +3052 -0
  120. data/framework_components/roomcast-teacher-controls/dist/nutella_lib.js +5121 -0
  121. data/framework_components/roomcast-teacher-controls/gulp/config.js +51 -0
  122. data/framework_components/roomcast-teacher-controls/gulp/tasks/browserify.js +77 -0
  123. data/framework_components/roomcast-teacher-controls/gulp/tasks/build.js +3 -0
  124. data/framework_components/roomcast-teacher-controls/gulp/tasks/css.js +7 -0
  125. data/framework_components/roomcast-teacher-controls/gulp/tasks/default.js +3 -0
  126. data/framework_components/roomcast-teacher-controls/gulp/tasks/fonts.js +7 -0
  127. data/framework_components/roomcast-teacher-controls/gulp/tasks/less.js +16 -0
  128. data/framework_components/roomcast-teacher-controls/gulp/tasks/mui-fonts.js +7 -0
  129. data/framework_components/roomcast-teacher-controls/gulp/tasks/nutella.js +7 -0
  130. data/framework_components/roomcast-teacher-controls/gulp/tasks/setWatch.js +5 -0
  131. data/framework_components/roomcast-teacher-controls/gulp/tasks/svgs.js +7 -0
  132. data/framework_components/roomcast-teacher-controls/gulp/tasks/watch.js +12 -0
  133. data/framework_components/roomcast-teacher-controls/gulp/util/bundleLogger.js +21 -0
  134. data/framework_components/roomcast-teacher-controls/gulp/util/handleErrors.js +15 -0
  135. data/framework_components/roomcast-teacher-controls/gulpfile.js +16 -0
  136. data/framework_components/roomcast-teacher-controls/index.html +51 -0
  137. data/framework_components/roomcast-teacher-controls/nutella.json +6 -0
  138. data/framework_components/roomcast-teacher-controls/package.json +38 -0
  139. data/framework_components/roomcast-teacher-controls/src/app/app.js +22 -0
  140. data/framework_components/roomcast-teacher-controls/src/app/components/ActivitiesGrid.js +87 -0
  141. data/framework_components/roomcast-teacher-controls/src/app/components/ActivityCard.js +141 -0
  142. data/framework_components/roomcast-teacher-controls/src/app/components/Channel.js +70 -0
  143. data/framework_components/roomcast-teacher-controls/src/app/components/Footer.js +34 -0
  144. data/framework_components/roomcast-teacher-controls/src/app/components/main.js +74 -0
  145. data/framework_components/roomcast-teacher-controls/src/less/main.less +186 -0
  146. data/framework_components/roomcast-teacher-controls/src/less/my_overrides.less +14 -0
  147. data/lib/commands/meta/run_command.rb +11 -9
  148. metadata +135 -2
@@ -0,0 +1,847 @@
1
+ var UIConnectionView = function(delegate) {
2
+ var self = UIElement(delegate);
3
+
4
+ // Protected variables
5
+ self._components = undefined;
6
+
7
+ // Static attributes
8
+ UIConnectionView.style = {
9
+ margin: 100,
10
+ linkTension: 0.6,
11
+ componentThickness: 10,
12
+ arrow_thick: 11,
13
+ arrow_ratio: 1.5,
14
+ square_side: 10.0,
15
+ componentNameFontSize: 15.0,
16
+ linkTextSize: 10,
17
+ linkTextSizeHold: 13,
18
+ labelLinkLength: 80,
19
+ labelLinkWidth: 1,
20
+ labelLinkColor: defaultPalette.text.dark,
21
+ labelFieldSize: 200,
22
+ toolBoxesWidth: 100,
23
+ toolBoxHeight: 20,
24
+ toolBoxTextTopMargin: 15
25
+ };
26
+
27
+ // Private variables
28
+ self._innerRadius = undefined;
29
+ self._outerRadius = undefined;
30
+
31
+ // Render the element
32
+ self.render = function() {
33
+
34
+ var layer = self.view;
35
+
36
+ var componentsData = self.delegate.instanceComponentData;
37
+
38
+ var noDataLayer = layer.layerWithName("no_data");
39
+ var links = layer.layerWithName("links");
40
+ var components = layer.layerWithName("components");
41
+ var componentNames = layer.layerWithName("componentNames");
42
+ var channelTexts = layer.layerWithName("channelTexts");
43
+ var componentLabels = layer.layerWithName("componentLabels");
44
+ var componentToolBoxes = layer.layerWithName("componentToolBoxes");
45
+
46
+ var noComponentLabel = noDataLayer.selectAll(".no_data_text")
47
+ .data([{}])
48
+ .enter()
49
+ .append("text")
50
+ .class("no_data_text")
51
+ .fill(defaultPalette.text.dark)
52
+ .attr("text-anchor", "middle")
53
+ .class("no_interaction")
54
+ .text("No components or channels present");
55
+
56
+ var noChannels = true; // True when all components don't have channels
57
+ if(componentsData != undefined) {
58
+ componentsData.forEach(function (component) {
59
+ if ((component.publish != undefined && component.publish.length > 0) ||
60
+ (component.subscribe != undefined && component.subscribe.length > 0) ||
61
+ (component.handle_request != undefined && component.handle_request.length > 0) ||
62
+ (component.request != undefined && component.request.length > 0)) {
63
+ noChannels = false;
64
+ }
65
+ });
66
+ }
67
+ else {
68
+ noChannels = false;
69
+ }
70
+
71
+ if((componentsData == undefined ||
72
+ componentsData.length == 0 ||
73
+ noChannels == true) &&
74
+ self.delegate.expanded == true) {
75
+ noDataLayer.selectAll(".no_data_text").opacity(1);
76
+ components.remove();
77
+ channelTexts.remove();
78
+ links.remove();
79
+ componentNames.remove();
80
+ componentLabels.remove();
81
+ componentToolBoxes.remove();
82
+ return;
83
+ }
84
+ else {
85
+ noDataLayer.selectAll(".no_data_text").opacity(0);
86
+ }
87
+
88
+ // Create triangles for the subscribed channels
89
+ var arrowData = [
90
+ { "x": 0.0, "y": 0.0},
91
+ { "x": 1*UIConnectionView.style.arrow_thick/UIConnectionView.style.arrow_ratio, "y": 1*UIConnectionView.style.arrow_thick},
92
+ { "x": -1*UIConnectionView.style.arrow_thick/UIConnectionView.style.arrow_ratio, "y": 1*UIConnectionView.style.arrow_thick}
93
+ ];
94
+
95
+ var lineFunction = d3.svg.line()
96
+ .x(function(d) { return d.x; })
97
+ .y(function(d) { return d.y; })
98
+ .interpolate("linear");
99
+
100
+ // Take the width of the screen
101
+ self._innerRadius = Math.min(windowViewController.height, windowViewController.width) / 2 - UIConnectionView.style.margin
102
+ - UIConnectionView.style.labelLinkLength;
103
+ self._outerRadius = self._innerRadius + UIConnectionView.style.componentThickness;
104
+
105
+ var openOptionRect = function(component, index){
106
+ d3.select("#SubscribeBox"+index)
107
+ .transition()
108
+ .height(UIConnectionView.style.toolBoxHeight);
109
+ d3.select("#MessageBox"+index)
110
+ .transition()
111
+ .height(UIConnectionView.style.toolBoxHeight);
112
+ d3.select("#SubscribeText"+index)
113
+ .transition()
114
+ .delay(250)
115
+ .opacity(1);
116
+ d3.select("#SendMessageText"+index)
117
+ .transition()
118
+ .delay(250)
119
+ .opacity(1);
120
+ };
121
+
122
+ var closeOptionRect = function(component, index){
123
+ d3.select("#SubscribeBox"+index)
124
+ .transition()
125
+ .delay(250)
126
+ .height(0);
127
+ d3.select("#SubscribeText"+index)
128
+ .transition()
129
+ .duration(100)
130
+ .delay(250)
131
+ .opacity(0);
132
+ d3.select("#SendMessageText"+index)
133
+ .transition()
134
+ .duration(100)
135
+ .delay(250)
136
+ .opacity(0);
137
+ d3.select("#MessageBox"+index)
138
+ .transition()
139
+ .delay(250)
140
+ .height(0);
141
+ };
142
+
143
+ var rotateArrowDown = function(component,index){
144
+ var origin = {
145
+ x: Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength),
146
+ y: Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength)
147
+ };
148
+
149
+ d3.select("#signifier"+index)
150
+ .transition()
151
+ .attr("transform","translate("+
152
+ function() {
153
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
154
+ // 0 <= angle < 180
155
+ return origin.x + 10;
156
+ }
157
+ else {
158
+ // 180 <= angle < 360
159
+ return origin.x - UIConnectionView.style.labelFieldSize + 10;
160
+ }
161
+ }()
162
+ +","+
163
+ function() {
164
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) - 10;
165
+ }()
166
+ +") rotate(180)");
167
+ };
168
+
169
+ var rotateArrowRight = function(component,index){
170
+ var origin = {
171
+ x: Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength),
172
+ y: Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength)
173
+ };
174
+
175
+ d3.select("#signifier"+index)
176
+ .transition()
177
+ .attr("transform","translate("+
178
+ function() {
179
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
180
+ // 0 <= angle < 180
181
+ return origin.x + 10;
182
+ }
183
+ else {
184
+ // 180 <= angle < 360
185
+ return origin.x - UIConnectionView.style.labelFieldSize + 10;
186
+ }
187
+ }()
188
+ +","+
189
+ function() {
190
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) - 10;
191
+ }()
192
+ +") rotate(90)");
193
+ };
194
+
195
+ if(self.delegate.expanded == false ||
196
+ componentsData == undefined) {
197
+ components.remove();
198
+ channelTexts.remove();
199
+ links.remove();
200
+ componentNames.remove();
201
+ componentLabels.remove();
202
+ componentToolBoxes.remove();
203
+ noDataLayer.remove();
204
+ return;
205
+ }
206
+
207
+ var radialLayout = d3.layout.radial()
208
+ .margin(0.2)
209
+ .radius(self._outerRadius)
210
+ .linkRadius(self._innerRadius)
211
+ .data(componentsData);
212
+
213
+ // Create component arc generator
214
+ var arc = d3.svg.arc()
215
+ .innerRadius(self._innerRadius)
216
+ .outerRadius(self._outerRadius)
217
+ .startAngle(function(d){return d.startAngle;})
218
+ .endAngle(function(d){return d.endAngle;});
219
+
220
+ // Create component arc generator zero radius
221
+ var arcZeroRadius = d3.svg.arc()
222
+ .innerRadius(0.1)
223
+ .outerRadius(0.1)
224
+ .startAngle(function(d){return d.startAngle;})
225
+ .endAngle(function(d){return d.endAngle;});
226
+
227
+ // Create new component arcs
228
+ components.selectAll(".componentArc")
229
+ .data(radialLayout.components)
230
+ .enter()
231
+ .append("path")
232
+ .class("componentArc")
233
+ .style("fill", function(d){
234
+ if(d.problem == true)
235
+ return defaultPalette.state.red;
236
+ else
237
+ return defaultPalette.state.green;
238
+ })
239
+ .attr("d", arcZeroRadius)
240
+ .each(function(component, index) {
241
+ componentToolBoxesGroup = componentToolBoxes.append("g")
242
+ .class("toolBoxGroup")
243
+ .class("pointer")
244
+ .width(UIConnectionView.style.labelFieldSize);
245
+
246
+ componentToolBoxesGroup
247
+ .append("rect")
248
+ .class("toolBox")
249
+ .class("pointer")
250
+ .margin(undefined)
251
+ .width(UIConnectionView.style.toolBoxesWidth)
252
+ .height(0)
253
+ .fill(self.palette.accent1.normal)
254
+ .attr("id", function() {
255
+ return "SubscribeBox"+index;
256
+ });
257
+
258
+ componentToolBoxesGroup.selectAll(".toolBox")
259
+ /*
260
+ .on("mouseover", function() {
261
+ openOptionRect(component);
262
+ rotateArrowDown(component);
263
+ })
264
+ .on("mouseout", function () {
265
+ closeOptionRect(component);
266
+ rotateArrowRight(component);
267
+ });
268
+ */
269
+
270
+ componentToolBoxesGroup
271
+ .append("rect")
272
+ .class("toolBox")
273
+ .class("pointer")
274
+ .margin(undefined)
275
+ .width(UIConnectionView.style.toolBoxesWidth)
276
+ .height(0)
277
+ .fill(self.palette.accent1.normal)
278
+ .attr("id", function() {
279
+ return "MessageBox"+index;
280
+ })
281
+ ;
282
+
283
+ componentToolBoxesGroup
284
+ .append("text")
285
+ .fill(defaultPalette.text.bright)
286
+ .text("subscribe")
287
+ .opacity(0)
288
+ .attr("text-anchor", "middle")
289
+ .class("no_interaction")
290
+ .attr("id", function() {
291
+ return "SubscribeText"+index;
292
+ });
293
+
294
+ componentToolBoxesGroup
295
+ .append("text")
296
+ .opacity(0)
297
+ .fill(defaultPalette.text.bright)
298
+ .text("message")
299
+ .class("no_interaction")
300
+ .attr("text-anchor", "middle")
301
+ .class("no_interaction")
302
+ .attr("id", function() {
303
+ return "SendMessageText"+index;
304
+ });
305
+
306
+ // Add signifier
307
+
308
+ componentToolBoxesGroup.append("path")
309
+ .attr("d", lineFunction(arrowData))
310
+ .attr("fill", self.palette.text.dark)
311
+ .attr("id", function() {
312
+ return "signifier"+index;
313
+ })
314
+ .attr("transform","translate("+
315
+ function() {
316
+ var origin = {
317
+ x: Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength),
318
+ y: Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength)
319
+ };
320
+
321
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
322
+ // 0 <= angle < 180
323
+ return origin.x + 10;
324
+ }
325
+ else {
326
+ // 180 <= angle < 360
327
+ return origin.x - UIConnectionView.style.labelFieldSize + 10;
328
+ }
329
+ }()
330
+ +","+
331
+ function() {
332
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) - 10;
333
+ }()
334
+ +") rotate(90)"
335
+ )
336
+ .opacity(0);
337
+
338
+ // rect to create a muoseover sensitive area on the component name
339
+ // TODO: The problem is here!
340
+ componentToolBoxesGroup.append("rect")
341
+ .fill("white")
342
+ .width(UIConnectionView.style.labelFieldSize)
343
+ .height(20)
344
+ .class("transparent-rect")
345
+ .attr("id", function() {
346
+ return "mouseoverRect"+index;
347
+ })
348
+ .opacity(0);
349
+
350
+ });
351
+
352
+ // Update component arcs
353
+ components.selectAll(".componentArc")
354
+ .data(radialLayout.components)
355
+ .transition()
356
+ .delay(Animations.connectionView.CIRCLE_EXPANSION.delay)
357
+ .duration(Animations.connectionView.CIRCLE_EXPANSION.duration)
358
+ .attr("d", arc)
359
+ .style("fill", function(d){
360
+ if(d.problem == true)
361
+ return defaultPalette.state.red;
362
+ else
363
+ return defaultPalette.state.green;
364
+ })
365
+ .each(function(component, index) {
366
+
367
+ var origin = {
368
+ x: Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength),
369
+ y: Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength)
370
+ };
371
+
372
+ componentToolBoxes.select("#signifier"+index)
373
+ .transition()
374
+ .duration(1000)
375
+ .delay(500)
376
+ .attr("transform","translate("+
377
+ function() {
378
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
379
+ // 0 <= angle < 180
380
+ return origin.x + 10;
381
+ }
382
+ else {
383
+ // 180 <= angle < 360
384
+ return origin.x - UIConnectionView.style.labelFieldSize + 10;
385
+ }
386
+ }()
387
+ +","+
388
+ function() {
389
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) - 10;
390
+ }()
391
+ +") rotate(90)"
392
+ )
393
+ //.delay(Animations.application.APPLICATION_EXPANSION.delay)
394
+ .opacity(1);
395
+
396
+ componentToolBoxes.select("#mouseoverRect"+index)
397
+ .on("mouseover", function() {
398
+ openOptionRect(component, index);
399
+ rotateArrowDown(component, index);
400
+ })
401
+ .on("mouseout", function () {
402
+ closeOptionRect(component, index);
403
+ rotateArrowRight(component, index);
404
+ })
405
+ .x(function() {
406
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
407
+ // 0 <= angle < 180
408
+ return origin.x;
409
+ }
410
+ else {
411
+ // 180 <= angle < 360
412
+ return origin.x - UIConnectionView.style.labelFieldSize;
413
+ }
414
+ })
415
+ .y(function() {
416
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) - 20;
417
+ });
418
+
419
+ componentToolBoxes.select("#SubscribeBox"+index)
420
+ .on("mouseover", function() {
421
+ openOptionRect(component, index);
422
+ rotateArrowDown(component, index);
423
+ })
424
+ .on("mouseout", function () {
425
+ closeOptionRect(component, index);
426
+ rotateArrowRight(component, index);
427
+ })
428
+ .on("click", function() {
429
+ alertsModel.application = applicationModel.viewControllerApplicationSelected.name;
430
+ alertsModel.instance = applicationModel.viewControllerInstanceSelected.name;
431
+ alertsModel.component = component.name;
432
+ $('#mailDisplay').modal({ show: true});
433
+ alertsModel.fetchData();
434
+ })
435
+ //.transition()
436
+ .x(function() {
437
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
438
+ // 0 <= angle < 180
439
+ return origin.x;
440
+ }
441
+ else {
442
+ // 180 <= angle < 360
443
+ return origin.x - UIConnectionView.style.labelFieldSize;
444
+ }
445
+ })
446
+ .y(function() {
447
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) -1;
448
+ });
449
+
450
+ componentToolBoxes.select("#MessageBox"+index)
451
+ .on("mouseover", function() {
452
+ openOptionRect(component, index);
453
+ rotateArrowDown(component, index);
454
+ })
455
+ .on("mouseout", function () {
456
+ closeOptionRect(component, index);
457
+ rotateArrowRight(component, index);
458
+ })
459
+ .on("click", function() {
460
+ alertsModel.application = applicationModel.viewControllerApplicationSelected.name;
461
+ alertsModel.instance = applicationModel.viewControllerInstanceSelected.name;
462
+ alertsModel.component = component.name;
463
+ $('#messageSend').modal({ show: true});
464
+ })
465
+ //.transition()
466
+ .x(function() {
467
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
468
+ // 0 <= angle < 180
469
+ return origin.x + UIConnectionView.style.toolBoxesWidth;
470
+ }
471
+ else {
472
+ // 180 <= angle < 360
473
+ return origin.x - UIConnectionView.style.labelFieldSize + UIConnectionView.style.toolBoxesWidth;
474
+ }
475
+ })
476
+ .y(function() {
477
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) -1;
478
+ });
479
+
480
+ componentToolBoxes.select("#SubscribeText"+index)
481
+ //.transition()
482
+ .x(function() {
483
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
484
+ // 0 <= angle < 180
485
+ return origin.x + (UIConnectionView.style.labelFieldSize/4);
486
+ }
487
+ else {
488
+ // 180 <= angle < 360
489
+ return origin.x - UIConnectionView.style.labelFieldSize + (UIConnectionView.style.labelFieldSize/4);
490
+ }
491
+ })
492
+ .y(function() {
493
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) + UIConnectionView.style.toolBoxTextTopMargin;
494
+ });
495
+
496
+ componentToolBoxes.select("#SendMessageText"+index)
497
+ //.transition()
498
+ .x(function() {
499
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
500
+ // 0 <= angle < 180
501
+ return origin.x + (UIConnectionView.style.labelFieldSize/4*3);
502
+ }
503
+ else {
504
+ // 180 <= angle < 360
505
+ return origin.x - UIConnectionView.style.labelFieldSize + (UIConnectionView.style.labelFieldSize/4*3);
506
+ }
507
+ })
508
+ .y(function() {
509
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) + UIConnectionView.style.toolBoxTextTopMargin;
510
+ });
511
+
512
+ });
513
+
514
+ // Delete component arcs
515
+ components.selectAll(".componentArc")
516
+ .data(radialLayout.components)
517
+ .exit()
518
+ .each(function(component, index) {
519
+
520
+ componentToolBoxes.select("#signifier"+index)
521
+ .transition()
522
+ .opacity(0)
523
+ .remove();
524
+
525
+ componentToolBoxes.select("#mouseoverRect"+index)
526
+ .transition()
527
+ .opacity(0)
528
+ .remove();
529
+
530
+ componentToolBoxes.select("#SubscribeBox"+index)
531
+ .transition()
532
+ .opacity(0)
533
+ .remove();
534
+
535
+ componentToolBoxes.select("#MessageBox"+index)
536
+ .transition()
537
+ .opacity(0)
538
+ .remove();
539
+
540
+ componentToolBoxes.select("#SubscribeText"+index)
541
+ .transition()
542
+ .opacity(0)
543
+ .remove();
544
+
545
+ componentToolBoxes.select("#SendMessageText"+index)
546
+ .transition()
547
+ .opacity(0)
548
+ .remove();
549
+
550
+ });
551
+
552
+
553
+
554
+
555
+ // Remove component arcs
556
+ components.selectAll(".componentArc")
557
+ .data(radialLayout.components)
558
+ .exit()
559
+ .each(function(component) {
560
+ componentToolBoxes.select("#"+component.name)
561
+ .remove();
562
+ })
563
+ .remove();
564
+
565
+ // Create new publish channels
566
+ channelTexts.selectAll(".channel")
567
+ .data(radialLayout.channels)
568
+ .enter()
569
+ .append("text")
570
+ .class("channel")
571
+ .fill(self.palette.text.dark)
572
+ .attr("font-size", UIConnectionView.style.linkTextSize)
573
+ .opacity(0);
574
+
575
+ // Update already present text
576
+ channelTexts.selectAll(".channel")
577
+ .data(radialLayout.channels)
578
+ .transition()
579
+ .delay(Animations.connectionView.CIRCLE_EXPANSION.delay)
580
+ .duration(Animations.connectionView.CIRCLE_EXPANSION.duration)
581
+ .rotateText()
582
+ .text(function(channel) {return channel.channel;})
583
+ .opacity(1);
584
+
585
+ // Delete old text
586
+ channelTexts.selectAll(".channel")
587
+ .data(radialLayout.channels)
588
+ .exit()
589
+ .transition()
590
+ .opacity(0)
591
+ .remove();
592
+
593
+ // Create arg generator utility
594
+ var lineGenerator = d3.svg.line.radial()
595
+ .interpolate("bundle")
596
+ .tension(UIConnectionView.style.linkTension)
597
+ .radius(function(d) { return d.radius; })
598
+ .angle(function(d) { return d.angle; });
599
+
600
+ // Create new links between channels
601
+ links.selectAll(".link")
602
+ .data(radialLayout.links.map(function(link) {
603
+ var points = link.coordinates;
604
+ points.forEach(function(p) {p.link = link});
605
+ return points;
606
+ }))
607
+ .enter()
608
+ .append("path")
609
+ .class("link")
610
+ .class("pointer")
611
+ .opacity(0)
612
+ .attr("stroke", self.palette.accent2.bright)
613
+ .attr("d", lineGenerator)
614
+ .on("mouseover", function() {
615
+ d3.select(this).attr("stroke", "#000000");
616
+ //d3.select(link.source.name).attr("font-size", UIConnectionView.style.linkTextSizeHold);
617
+ })
618
+ .on("mouseout", function() {
619
+ d3.select(this).attr("stroke", "#FFFFFF");
620
+ //d3.select(link.source.name).attr("font-size", UIConnectionView.style.linkTextSize);
621
+ });
622
+
623
+ // Update already present links between
624
+ links.selectAll(".link")
625
+ .data(radialLayout.links.map(function(link) {
626
+ var points = link.coordinates;
627
+ points.forEach(function(p) {p.link = link});
628
+ return points;
629
+ }))
630
+ .on("click", function(points) {
631
+ // Insert the data in the messages model
632
+ messageModel.channel = points[0].link.channel;
633
+ messageModel.from = points[0].link.source.component;
634
+ messageModel.to = points[0].link.destination.component;
635
+ messageModel.type = points[0].link.type;
636
+ messageModel.app_id = applicationModel.viewControllerApplicationSelected.name;
637
+ messageModel.run_id = applicationModel.viewControllerInstanceSelected.name;
638
+
639
+ messageModel.downloadMessages();
640
+
641
+ // Display the modal view
642
+ $('#messageDisplay').modal({ show: true});
643
+ })
644
+ .transition()
645
+ .delay(Animations.connectionView.LINK_FADE_IN.delay)
646
+ .duration(Animations.connectionView.LINK_FADE_IN.duration)
647
+ .opacity(1)
648
+ .attr("d", lineGenerator);
649
+
650
+
651
+ // Remove links no more present
652
+ links.selectAll(".link")
653
+ .data(radialLayout.links.map(function(link) {
654
+ var points = link.coordinates;
655
+ points.forEach(function(p) {p.link = link});
656
+ return points;
657
+ }))
658
+ .exit()
659
+ .transition()
660
+ .duration(Animations.connectionView.LINK_FADE_IN.duration)
661
+ .opacity(0)
662
+ .remove();
663
+
664
+
665
+
666
+ components.selectAll(".subscribeTriangle")
667
+ .data(radialLayout.subscribeChannels)
668
+ .enter()
669
+ .append("path")
670
+ .class("subscribeTriangle")
671
+ .attr("d", lineFunction(arrowData))
672
+ .attr("fill", self.palette.accent1.dark)
673
+ .rotateLayer()
674
+ .opacity(0);
675
+
676
+ components.selectAll(".subscribeTriangle")
677
+ .data(radialLayout.subscribeChannels)
678
+ .transition()
679
+ .duration(Animations.connectionView.ARROW_EXPANSION.duration)
680
+ .rotateLayer()
681
+ .opacity(1);
682
+
683
+ components.selectAll(".subscribeTriangle")
684
+ .data(radialLayout.subscribeChannels)
685
+ .exit()
686
+ .transition()
687
+ .opacity(0)
688
+ .remove();
689
+
690
+ // Create circles for the handle_requests channels
691
+ var squareData = [
692
+ { "x": -1*UIConnectionView.style.square_side/2, "y": 0.0},
693
+ { "x": 1*UIConnectionView.style.square_side/2, "y": 0.0},
694
+ { "x": 1*UIConnectionView.style.square_side/2, "y": 1*UIConnectionView.style.square_side},
695
+ { "x": -1*UIConnectionView.style.square_side/2, "y": 1*UIConnectionView.style.square_side},
696
+ ];
697
+
698
+ components.selectAll(".handleRequestsaCircle")
699
+ .data(radialLayout.handleRequestChannels)
700
+ .enter()
701
+ .append("path")
702
+ .class("handleRequestsaCircle")
703
+ .attr("d", lineFunction(squareData))
704
+ .attr("fill", self.palette.accent1.dark)
705
+ .rotateLayer()
706
+ .opacity(0);
707
+
708
+ components.selectAll(".handleRequestsaCircle")
709
+ .data(radialLayout.handleRequestChannels)
710
+ .transition()
711
+ .duration(Animations.connectionView.ARROW_EXPANSION.duration)
712
+ .rotateLayer()
713
+ .opacity(1);
714
+
715
+ components.selectAll(".handleRequestsaCircle")
716
+ .data(radialLayout.handleRequestChannels)
717
+ .exit()
718
+ .transition()
719
+ .opacity(0)
720
+ .remove();
721
+
722
+ // Create new component name
723
+ componentNames.selectAll(".componentName")
724
+ .data(radialLayout.components)
725
+ .enter()
726
+ .append("text")
727
+ .class("componentName")
728
+ .class("pointer")
729
+ .fill(defaultPalette.text.dark)
730
+ .opacity(0);
731
+
732
+ componentNames.selectAll(".componentName")
733
+ .data(radialLayout.components)
734
+ .transition()
735
+ .duration(Animations.connectionView.LINK_FADE_IN.duration)
736
+ .delay(Animations.connectionView.LINK_FADE_IN.delay)
737
+ .attr("text-anchor", function(component) {
738
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
739
+ // 0 <= angle < 180
740
+ //return "start";
741
+ return "middle";
742
+ }
743
+ else {
744
+ // 180 <= angle < 360
745
+ //return "end";
746
+ return "middle";
747
+ }
748
+ })
749
+ .x(function(component) {
750
+ if(component.endAngle % (2*Math.PI) < Math.PI) {
751
+ // 0 <= angle < 180
752
+ //return "start";
753
+ return Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength + 10) + (UIConnectionView.style.labelFieldSize/2)
754
+ }
755
+ else {
756
+ // 180 <= angle < 360
757
+ //return "end";
758
+ return Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength + 10) - (UIConnectionView.style.labelFieldSize/2)
759
+
760
+ }
761
+ })
762
+ .y(function(component) {
763
+ return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) - 5
764
+ })
765
+ .attr("font-size", UIConnectionView.style.componentNameFontSize)
766
+ .text(function(component) {return component.name; })
767
+ .opacity(1);
768
+
769
+ componentNames.selectAll(".componentName")
770
+ .data(radialLayout.components)
771
+ .exit()
772
+ .transition()
773
+ .opacity(0)
774
+ .remove();
775
+
776
+
777
+ // Create new component label
778
+ componentLabels.selectAll(".componentLabel")
779
+ .data(radialLayout.components)
780
+ .enter()
781
+ .append("polyline")
782
+ .class("componentLabel")
783
+ .fill("none")
784
+ .attr("stroke-width", UIConnectionView.style.labelLinkWidth)
785
+ .attr("stroke", UIConnectionView.style.labelLinkColor)
786
+ .opacity(0);
787
+
788
+
789
+ componentLabels.selectAll(".componentLabel")
790
+ .data(radialLayout.components)
791
+ .transition()
792
+ .duration(Animations.connectionView.LINK_FADE_IN.duration)
793
+ .delay(Animations.connectionView.LINK_FADE_IN.delay)
794
+ .attr("points", function(component) {
795
+
796
+ var point0 = {
797
+ x: Math.cos(component.endAngle - Math.PI / 2) * self._innerRadius,
798
+ y: Math.sin(component.endAngle - Math.PI / 2) * self._innerRadius
799
+ };
800
+
801
+ var point1 = {
802
+ x: Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength),
803
+ y: Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength)
804
+ };
805
+
806
+
807
+ var direction;
808
+ if(Math.sin(component.endAngle) >= 0) {
809
+ direction = 1;
810
+ }
811
+ else {
812
+ direction = -1;
813
+ }
814
+ //Math.sign(Math.sin(component.startAngle))
815
+ var point2 = {
816
+ x: point1.x + direction * UIConnectionView.style.labelFieldSize,
817
+ y: point1.y
818
+ };
819
+
820
+ return[
821
+ point0.x, point0.y,
822
+ point1.x, point1.y,
823
+ point2.x, point2.y
824
+
825
+ ];
826
+ })
827
+ .opacity(1);
828
+
829
+ componentLabels.selectAll(".componentLabel")
830
+ .data(radialLayout.components)
831
+ .exit()
832
+ .transition()
833
+ .opacity(0)
834
+ .remove();
835
+
836
+ };
837
+
838
+ // Constructor
839
+ self.init = function() {
840
+ }();
841
+
842
+ // Destructor
843
+ self.deinit = function() {
844
+ };
845
+
846
+ return self;
847
+ };