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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/framework_components/monitoring-bot/monitoring-bot.rb +11 -2
- data/framework_components/monitoring-interface/.gitignore +2 -0
- data/framework_components/monitoring-interface/README.md +1 -0
- data/framework_components/monitoring-interface/bower.json +29 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/.bower.json +23 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/bower.json +14 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/mqttws31.js +2081 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/readme.md +4 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/.bower.json +37 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/LICENSE +21 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/README.md +15 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/bower.json +28 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/mqtt_client_hello_world.html +23 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/nutella_hello_world.html +52 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/mqtt_client_hello_world.js +14 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/nutella_hello_world.js +38 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/nutella_lib.js +789 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/package.json +30 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface.html +215 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/animations.js +27 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/application-view-controller.js +232 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js +61 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/bootstrap.min.js +7 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/cursor.css +7 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/d3.v3.min.js +5 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/graphics.js +156 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/grid-layout.js +103 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/highlight.min.js +2 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/instance-view-controller.js +104 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/jquery-1.10.0.min.js +6 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/notification-center.js +63 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/notifications.js +14 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/page.css +33 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/radial-layout.js +175 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/tab-table.js +8 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.css +0 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.js +320 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.css +10 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.js +426 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-element.js +205 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-notification.js +94 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-tab.js +229 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/underscore-min.js +5 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js +68 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/window-view-controller.js +169 -0
- data/framework_components/monitoring-interface/css/alerts.css +3 -0
- data/framework_components/monitoring-interface/css/bootstrap.min.css +5 -0
- data/framework_components/monitoring-interface/css/cursor.css +7 -0
- data/framework_components/monitoring-interface/css/highlight.default.min.css +1 -0
- data/framework_components/monitoring-interface/css/page.css +41 -0
- data/framework_components/monitoring-interface/css/ui-application.css +0 -0
- data/framework_components/monitoring-interface/css/ui-connection-view.css +10 -0
- data/framework_components/monitoring-interface/css/ui-legend-view.css +7 -0
- data/framework_components/monitoring-interface/data/alert.json +8 -0
- data/framework_components/monitoring-interface/data/data.json +2118 -0
- data/framework_components/monitoring-interface/data/data2.json +814 -0
- data/framework_components/monitoring-interface/data/data3.json +823 -0
- data/framework_components/monitoring-interface/data/data4.json +848 -0
- data/framework_components/monitoring-interface/data/message.json +999 -0
- data/framework_components/monitoring-interface/gulpfile.js +29 -0
- data/framework_components/monitoring-interface/img/arrow_white.svg +120 -0
- data/framework_components/monitoring-interface/img/arrow_white_right.svg +104 -0
- data/framework_components/monitoring-interface/img/back.svg +164 -0
- data/framework_components/monitoring-interface/img/cross_red_border_white.svg +143 -0
- data/framework_components/monitoring-interface/img/cross_red_border_white_mouseover.svg +143 -0
- data/framework_components/monitoring-interface/img/email.svg +89 -0
- data/framework_components/monitoring-interface/img/email_highlighted.svg +89 -0
- data/framework_components/monitoring-interface/index.html +144 -0
- data/framework_components/monitoring-interface/js/d3/layout/grid-layout.js +103 -0
- data/framework_components/monitoring-interface/js/d3/layout/radial-layout.js +184 -0
- data/framework_components/monitoring-interface/js/d3/plugin/graphics.js +156 -0
- data/framework_components/monitoring-interface/js/d3/plugin/tab-table.js +8 -0
- data/framework_components/monitoring-interface/js/d3/ui/animations.js +27 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-application.js +471 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-connection-view.js +847 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-element.js +245 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-legend.js +174 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-notification.js +90 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-tab.js +309 -0
- data/framework_components/monitoring-interface/js/lib/JSXTransformer-0.12.2.js +15199 -0
- data/framework_components/monitoring-interface/js/lib/bootstrap.min.js +7 -0
- data/framework_components/monitoring-interface/js/lib/d3.v3.min.js +5 -0
- data/framework_components/monitoring-interface/js/lib/highlight.min.js +2 -0
- data/framework_components/monitoring-interface/js/lib/jquery-1.10.0.min.js +6 -0
- data/framework_components/monitoring-interface/js/lib/nutella_lib.js +5121 -0
- data/framework_components/monitoring-interface/js/lib/react-with-addons-0.12.2.js +19822 -0
- data/framework_components/monitoring-interface/js/lib/underscore-min.js +5 -0
- data/framework_components/monitoring-interface/js/model/alerts-model.js +74 -0
- data/framework_components/monitoring-interface/js/model/applications-model.js +78 -0
- data/framework_components/monitoring-interface/js/model/messages-model.js +112 -0
- data/framework_components/monitoring-interface/js/notification/notification-center.js +63 -0
- data/framework_components/monitoring-interface/js/notification/notifications.js +21 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-alerts.js +178 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-message-send.js +389 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-messages.js +103 -0
- data/framework_components/monitoring-interface/js/react/src/ui-alerts.js +178 -0
- data/framework_components/monitoring-interface/js/react/src/ui-message-send.js +389 -0
- data/framework_components/monitoring-interface/js/react/src/ui-messages.js +103 -0
- data/framework_components/monitoring-interface/js/view-controller/application-view-controller.js +256 -0
- data/framework_components/monitoring-interface/js/view-controller/instance-view-controller.js +112 -0
- data/framework_components/monitoring-interface/js/view-controller/view-controller.js +74 -0
- data/framework_components/monitoring-interface/js/view-controller/window-view-controller.js +169 -0
- data/framework_components/monitoring-interface/nutella.json +6 -0
- data/framework_components/order.json +1 -0
- data/framework_components/roomcast-bot/roomcast_bot.rb +139 -117
- data/framework_components/roomcast-channel-creator/dist/app.js +9 -7
- data/framework_components/roomcast-channel-creator/index.html +1 -1
- data/framework_components/roomcast-channel-creator/src/app/components/main.js +8 -6
- data/framework_components/roomcast-package-creator/dist/app.js +4 -4
- data/framework_components/roomcast-package-creator/index.html +1 -1
- data/framework_components/roomcast-package-creator/package.json +3 -3
- data/framework_components/roomcast-package-creator/src/app/components/ConfigurationsPanel.js +2 -2
- data/framework_components/roomcast-package-creator/src/app/components/PoolRow.js +1 -1
- data/framework_components/roomcast-teacher-controls/.gitignore +2 -0
- data/framework_components/roomcast-teacher-controls/README.md +9 -0
- data/framework_components/roomcast-teacher-controls/dist/app.js +38327 -0
- data/framework_components/roomcast-teacher-controls/dist/main.css +3052 -0
- data/framework_components/roomcast-teacher-controls/dist/nutella_lib.js +5121 -0
- data/framework_components/roomcast-teacher-controls/gulp/config.js +51 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/browserify.js +77 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/build.js +3 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/css.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/default.js +3 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/fonts.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/less.js +16 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/mui-fonts.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/nutella.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/setWatch.js +5 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/svgs.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/watch.js +12 -0
- data/framework_components/roomcast-teacher-controls/gulp/util/bundleLogger.js +21 -0
- data/framework_components/roomcast-teacher-controls/gulp/util/handleErrors.js +15 -0
- data/framework_components/roomcast-teacher-controls/gulpfile.js +16 -0
- data/framework_components/roomcast-teacher-controls/index.html +51 -0
- data/framework_components/roomcast-teacher-controls/nutella.json +6 -0
- data/framework_components/roomcast-teacher-controls/package.json +38 -0
- data/framework_components/roomcast-teacher-controls/src/app/app.js +22 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/ActivitiesGrid.js +87 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/ActivityCard.js +141 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/Channel.js +70 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/Footer.js +34 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/main.js +74 -0
- data/framework_components/roomcast-teacher-controls/src/less/main.less +186 -0
- data/framework_components/roomcast-teacher-controls/src/less/my_overrides.less +14 -0
- data/lib/commands/meta/run_command.rb +11 -9
- metadata +135 -2
data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.js
ADDED
@@ -0,0 +1,426 @@
|
|
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
|
+
|
19
|
+
labelLinkLength: 80,
|
20
|
+
labelLinkWidth: 1,
|
21
|
+
labelLinkColor: defaultPalette.text.dark,
|
22
|
+
labelFieldSize: 120,
|
23
|
+
toolBoxHeight: 50
|
24
|
+
|
25
|
+
|
26
|
+
};
|
27
|
+
|
28
|
+
// Private variables
|
29
|
+
self._innerRadius = undefined;
|
30
|
+
self._outerRadius = undefined;
|
31
|
+
|
32
|
+
// Render the element
|
33
|
+
self.render = function() {
|
34
|
+
|
35
|
+
var layer = self.view;
|
36
|
+
|
37
|
+
// Take the width of the screen
|
38
|
+
self._innerRadius = Math.min(windowViewController.height, windowViewController.width) / 2 - UIConnectionView.style.margin
|
39
|
+
- UIConnectionView.style.labelLinkLength;
|
40
|
+
self._outerRadius = self._innerRadius + UIConnectionView.style.componentThickness;
|
41
|
+
|
42
|
+
var links = layer.layerWithName("links");
|
43
|
+
var components = layer.layerWithName("components");
|
44
|
+
var componentNames = layer.layerWithName("componentNames");
|
45
|
+
var channelTexts = layer.layerWithName("channelTexts");
|
46
|
+
var componentLabels = layer.layerWithName("componentLabels");
|
47
|
+
var componentToolBoxes = layer.layerWithName("componentToolBoxes")
|
48
|
+
|
49
|
+
var componentsData = self.delegate.instanceComponentData; // applicationModel.getInstanceData("application6","instance1").components;
|
50
|
+
|
51
|
+
if(self.delegate.expanded == false ||
|
52
|
+
componentsData == undefined) {
|
53
|
+
components.remove();
|
54
|
+
channelTexts.remove();
|
55
|
+
links.remove();
|
56
|
+
componentNames.remove();
|
57
|
+
return;
|
58
|
+
}
|
59
|
+
|
60
|
+
var radialLayout = d3.layout.radial()
|
61
|
+
.margin(0.2)
|
62
|
+
.radius(self._outerRadius)
|
63
|
+
.linkRadius(self._innerRadius)
|
64
|
+
.data(componentsData);
|
65
|
+
|
66
|
+
// Create component arc generator
|
67
|
+
var arc = d3.svg.arc()
|
68
|
+
.innerRadius(self._innerRadius)
|
69
|
+
.outerRadius(self._outerRadius)
|
70
|
+
.startAngle(function(d){return d.startAngle;})
|
71
|
+
.endAngle(function(d){return d.endAngle;});
|
72
|
+
|
73
|
+
// Create component arc generator zero radius
|
74
|
+
var arcZeroRadius = d3.svg.arc()
|
75
|
+
.innerRadius(0.1)
|
76
|
+
.outerRadius(0.1)
|
77
|
+
.startAngle(function(d){return d.startAngle;})
|
78
|
+
.endAngle(function(d){return d.endAngle;});
|
79
|
+
|
80
|
+
// Create new component arcs
|
81
|
+
components.selectAll(".componentArc")
|
82
|
+
.data(radialLayout.components)
|
83
|
+
.enter()
|
84
|
+
.append("path")
|
85
|
+
.class("componentArc")
|
86
|
+
.style("fill", function(d){
|
87
|
+
if(d.problem == true)
|
88
|
+
return defaultPalette.state.red;
|
89
|
+
else
|
90
|
+
return defaultPalette.state.green;
|
91
|
+
})
|
92
|
+
.attr("d", arcZeroRadius)
|
93
|
+
.each(function(component) {
|
94
|
+
componentToolBoxes.append("rect")
|
95
|
+
.class("toolBox")
|
96
|
+
.attr("id", function() {
|
97
|
+
return component.name;
|
98
|
+
})
|
99
|
+
.margin(undefined)
|
100
|
+
.width(UIConnectionView.style.labelFieldSize)
|
101
|
+
.height(0)
|
102
|
+
|
103
|
+
|
104
|
+
});
|
105
|
+
|
106
|
+
// Update component arcs
|
107
|
+
components.selectAll(".componentArc")
|
108
|
+
.data(radialLayout.components)
|
109
|
+
.transition()
|
110
|
+
.delay(Animations.connectionView.CIRCLE_EXPANSION.delay)
|
111
|
+
.duration(Animations.connectionView.CIRCLE_EXPANSION.duration)
|
112
|
+
.attr("d", arc)
|
113
|
+
.style("fill", function(d){
|
114
|
+
if(d.problem == true)
|
115
|
+
return defaultPalette.state.red;
|
116
|
+
else
|
117
|
+
return defaultPalette.state.green;
|
118
|
+
})
|
119
|
+
.each(function(component) {
|
120
|
+
|
121
|
+
var origin = {
|
122
|
+
x: Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength),
|
123
|
+
y: Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength)
|
124
|
+
};
|
125
|
+
|
126
|
+
componentToolBoxes.select("#"+component.name)
|
127
|
+
.x(function() {
|
128
|
+
if(component.endAngle % (2*Math.PI) < Math.PI) {
|
129
|
+
// 0 <= angle < 180
|
130
|
+
return origin.x;
|
131
|
+
}
|
132
|
+
else {
|
133
|
+
// 180 <= angle < 360
|
134
|
+
return origin.x - UIConnectionView.style.labelFieldSize;
|
135
|
+
}
|
136
|
+
})
|
137
|
+
.y(function() {
|
138
|
+
return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength);
|
139
|
+
})
|
140
|
+
});
|
141
|
+
|
142
|
+
// Remove component arcs
|
143
|
+
components.selectAll(".componentArc")
|
144
|
+
.data(radialLayout.components)
|
145
|
+
.exit()
|
146
|
+
.each(function(component) {
|
147
|
+
componentToolBoxes.select("#"+component.name)
|
148
|
+
.remove();
|
149
|
+
})
|
150
|
+
.remove();
|
151
|
+
|
152
|
+
// Create new publish channels
|
153
|
+
channelTexts.selectAll(".channel")
|
154
|
+
.data(radialLayout.channels)
|
155
|
+
.enter()
|
156
|
+
.append("text")
|
157
|
+
.class("channel")
|
158
|
+
.fill(self.palette.text.dark)
|
159
|
+
.attr("font-size", UIConnectionView.style.linkTextSize)
|
160
|
+
.opacity(0);
|
161
|
+
|
162
|
+
// Update already present text
|
163
|
+
channelTexts.selectAll(".channel")
|
164
|
+
.data(radialLayout.channels)
|
165
|
+
.transition()
|
166
|
+
.delay(Animations.connectionView.CIRCLE_EXPANSION.delay)
|
167
|
+
.duration(Animations.connectionView.CIRCLE_EXPANSION.duration)
|
168
|
+
.rotateText()
|
169
|
+
.text(function(channel) {return channel.channel;})
|
170
|
+
.opacity(1);
|
171
|
+
|
172
|
+
// Delete old text
|
173
|
+
channelTexts.selectAll(".channel")
|
174
|
+
.data(radialLayout.channels)
|
175
|
+
.exit()
|
176
|
+
.transition()
|
177
|
+
.opacity(0)
|
178
|
+
.remove();
|
179
|
+
|
180
|
+
|
181
|
+
// Create arg generator utility
|
182
|
+
var lineGenerator = d3.svg.line.radial()
|
183
|
+
.interpolate("bundle")
|
184
|
+
.tension(UIConnectionView.style.linkTension)
|
185
|
+
.radius(function(d) { return d.radius; })
|
186
|
+
.angle(function(d) { return d.angle; });
|
187
|
+
|
188
|
+
// Create new links between channels
|
189
|
+
links.selectAll(".link")
|
190
|
+
.data(radialLayout.links.map(function(link) {
|
191
|
+
return link.coordinates;
|
192
|
+
}))
|
193
|
+
.enter()
|
194
|
+
.append("path")
|
195
|
+
.class("link")
|
196
|
+
.class("pointer")
|
197
|
+
.opacity(0)
|
198
|
+
.attr("stroke", self.palette.accent2.bright)
|
199
|
+
.attr("d", lineGenerator)
|
200
|
+
.on("mouseover", function(link) {
|
201
|
+
d3.select(this).attr("stroke", "#000000");
|
202
|
+
//d3.select(link.source.name).attr("font-size", UIConnectionView.style.linkTextSizeHold);
|
203
|
+
})
|
204
|
+
.on("mouseout", function(link) {
|
205
|
+
d3.select(this).attr("stroke", "#FFFFFF");
|
206
|
+
//d3.select(link.source.name).attr("font-size", UIConnectionView.style.linkTextSize);
|
207
|
+
})
|
208
|
+
.on("click", function() {
|
209
|
+
// Display the modal view
|
210
|
+
$('#messageDisplay').modal({ show: true});
|
211
|
+
});
|
212
|
+
|
213
|
+
// Update already present links between
|
214
|
+
links.selectAll(".link")
|
215
|
+
.data(radialLayout.links.map(function(link) {
|
216
|
+
return link.coordinates;
|
217
|
+
}))
|
218
|
+
.transition()
|
219
|
+
.delay(Animations.connectionView.LINK_FADE_IN.delay)
|
220
|
+
.duration(Animations.connectionView.LINK_FADE_IN.duration)
|
221
|
+
.opacity(1)
|
222
|
+
.attr("d", lineGenerator);
|
223
|
+
|
224
|
+
// Remove links no more present
|
225
|
+
links.selectAll(".link")
|
226
|
+
.data(radialLayout.links.map(function(link) {
|
227
|
+
return link.coordinates;
|
228
|
+
}))
|
229
|
+
.exit()
|
230
|
+
.transition()
|
231
|
+
.duration(Animations.connectionView.LINK_FADE_IN.duration)
|
232
|
+
.opacity(0)
|
233
|
+
.remove();
|
234
|
+
|
235
|
+
// Create triangles for the subscribed channels
|
236
|
+
var arrowData = [
|
237
|
+
{ "x": 0.0, "y": 0.0},
|
238
|
+
{ "x": 1*UIConnectionView.style.arrow_thick/UIConnectionView.style.arrow_ratio, "y": 1*UIConnectionView.style.arrow_thick},
|
239
|
+
{ "x": -1*UIConnectionView.style.arrow_thick/UIConnectionView.style.arrow_ratio, "y": 1*UIConnectionView.style.arrow_thick}
|
240
|
+
];
|
241
|
+
|
242
|
+
var lineFunction = d3.svg.line()
|
243
|
+
.x(function(d) { return d.x; })
|
244
|
+
.y(function(d) { return d.y; })
|
245
|
+
.interpolate("linear");
|
246
|
+
|
247
|
+
components.selectAll(".subscribeTriangle")
|
248
|
+
.data(radialLayout.publishChannels)
|
249
|
+
.enter()
|
250
|
+
.append("path")
|
251
|
+
.class("subscribeTriangle")
|
252
|
+
.attr("d", lineFunction(arrowData))
|
253
|
+
.attr("fill", self.palette.accent1.dark)
|
254
|
+
.rotateLayer()
|
255
|
+
.opacity(0);
|
256
|
+
|
257
|
+
components.selectAll(".subscribeTriangle")
|
258
|
+
.data(radialLayout.publishChannels)
|
259
|
+
.transition()
|
260
|
+
.duration(Animations.connectionView.ARROW_EXPANSION.duration)
|
261
|
+
.rotateLayer()
|
262
|
+
.opacity(1);
|
263
|
+
|
264
|
+
components.selectAll(".subscribeTriangle")
|
265
|
+
.data(radialLayout.publishChannels)
|
266
|
+
.exit()
|
267
|
+
.transition()
|
268
|
+
.opacity(0)
|
269
|
+
.remove();
|
270
|
+
|
271
|
+
// Create circles for the handle_requests channels
|
272
|
+
var squareData = [
|
273
|
+
{ "x": -1*UIConnectionView.style.square_side/2, "y": 0.0},
|
274
|
+
{ "x": 1*UIConnectionView.style.square_side/2, "y": 0.0},
|
275
|
+
{ "x": 1*UIConnectionView.style.square_side/2, "y": 1*UIConnectionView.style.square_side},
|
276
|
+
{ "x": -1*UIConnectionView.style.square_side/2, "y": 1*UIConnectionView.style.square_side},
|
277
|
+
];
|
278
|
+
|
279
|
+
components.selectAll(".handleRequestsaCircle")
|
280
|
+
.data(radialLayout.handleRequestChannels)
|
281
|
+
.enter()
|
282
|
+
.append("path")
|
283
|
+
.class("handleRequestsaCircle")
|
284
|
+
.attr("d", lineFunction(squareData))
|
285
|
+
.attr("fill", self.palette.accent1.dark)
|
286
|
+
.rotateLayer()
|
287
|
+
.opacity(0);
|
288
|
+
|
289
|
+
components.selectAll(".handleRequestsaCircle")
|
290
|
+
.data(radialLayout.handleRequestChannels)
|
291
|
+
.transition()
|
292
|
+
.duration(Animations.connectionView.ARROW_EXPANSION.duration)
|
293
|
+
.rotateLayer()
|
294
|
+
.opacity(1);
|
295
|
+
|
296
|
+
components.selectAll(".handleRequestsaCircle")
|
297
|
+
.data(radialLayout.handleRequestChannels)
|
298
|
+
.exit()
|
299
|
+
.transition()
|
300
|
+
.opacity(0)
|
301
|
+
.remove();
|
302
|
+
|
303
|
+
// Create new component name
|
304
|
+
componentNames.selectAll(".componentName")
|
305
|
+
.data(radialLayout.components)
|
306
|
+
.enter()
|
307
|
+
.append("text")
|
308
|
+
.class("componentName")
|
309
|
+
.fill(defaultPalette.text.dark)
|
310
|
+
.opacity(0)
|
311
|
+
.on("mouseover", function(d) {
|
312
|
+
componentToolBoxes
|
313
|
+
.select("#"+d.name)
|
314
|
+
.height(UIConnectionView.style.toolBoxHeight);
|
315
|
+
|
316
|
+
})
|
317
|
+
.on("mouseout", function(d) {
|
318
|
+
componentToolBoxes
|
319
|
+
.select("#"+d.name)
|
320
|
+
.height(0);
|
321
|
+
});
|
322
|
+
|
323
|
+
componentNames.selectAll(".componentName")
|
324
|
+
.data(radialLayout.components)
|
325
|
+
.transition()
|
326
|
+
.duration(Animations.connectionView.LINK_FADE_IN.duration)
|
327
|
+
.delay(Animations.connectionView.LINK_FADE_IN.delay)
|
328
|
+
.attr("text-anchor", function(component) {
|
329
|
+
if(component.endAngle % (2*Math.PI) < Math.PI) {
|
330
|
+
// 0 <= angle < 180
|
331
|
+
return "start";
|
332
|
+
}
|
333
|
+
else {
|
334
|
+
// 180 <= angle < 360
|
335
|
+
return "end";
|
336
|
+
}
|
337
|
+
})
|
338
|
+
.x(function(component) {
|
339
|
+
return Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength + 10)
|
340
|
+
})
|
341
|
+
.y(function(component) {
|
342
|
+
return Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength) - 5
|
343
|
+
})
|
344
|
+
.attr("font-size", UIConnectionView.style.componentNameFontSize)
|
345
|
+
.text(function(component) {return component.name; })
|
346
|
+
.opacity(1);
|
347
|
+
|
348
|
+
componentNames.selectAll(".componentName")
|
349
|
+
.data(radialLayout.components)
|
350
|
+
.exit()
|
351
|
+
.transition()
|
352
|
+
.opacity(0)
|
353
|
+
.remove();
|
354
|
+
|
355
|
+
|
356
|
+
// Create new component label
|
357
|
+
componentLabels.selectAll(".componentLabel")
|
358
|
+
.data(radialLayout.components)
|
359
|
+
.enter()
|
360
|
+
.append("polyline")
|
361
|
+
.class("componentLabel")
|
362
|
+
.fill("none")
|
363
|
+
.attr("stroke-width", UIConnectionView.style.labelLinkWidth)
|
364
|
+
.attr("stroke", UIConnectionView.style.labelLinkColor)
|
365
|
+
.opacity(0);
|
366
|
+
|
367
|
+
|
368
|
+
componentLabels.selectAll(".componentLabel")
|
369
|
+
.data(radialLayout.components)
|
370
|
+
.transition()
|
371
|
+
.duration(Animations.connectionView.LINK_FADE_IN.duration)
|
372
|
+
.delay(Animations.connectionView.LINK_FADE_IN.delay)
|
373
|
+
.attr("points", function(component) {
|
374
|
+
|
375
|
+
var point0 = {
|
376
|
+
x: Math.cos(component.endAngle - Math.PI / 2) * self._innerRadius,
|
377
|
+
y: Math.sin(component.endAngle - Math.PI / 2) * self._innerRadius
|
378
|
+
};
|
379
|
+
|
380
|
+
var point1 = {
|
381
|
+
x: Math.cos(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength),
|
382
|
+
y: Math.sin(component.endAngle - Math.PI / 2) * (self._innerRadius + UIConnectionView.style.labelLinkLength)
|
383
|
+
};
|
384
|
+
|
385
|
+
|
386
|
+
var direction;
|
387
|
+
if(Math.sin(component.endAngle) >= 0) {
|
388
|
+
direction = 1;
|
389
|
+
}
|
390
|
+
else {
|
391
|
+
direction = -1;
|
392
|
+
}
|
393
|
+
//Math.sign(Math.sin(component.startAngle))
|
394
|
+
var point2 = {
|
395
|
+
x: point1.x + direction * UIConnectionView.style.labelFieldSize,
|
396
|
+
y: point1.y
|
397
|
+
};
|
398
|
+
|
399
|
+
return[
|
400
|
+
point0.x, point0.y,
|
401
|
+
point1.x, point1.y,
|
402
|
+
point2.x, point2.y
|
403
|
+
|
404
|
+
];
|
405
|
+
})
|
406
|
+
.opacity(1);
|
407
|
+
|
408
|
+
componentLabels.selectAll(".componentLabel")
|
409
|
+
.data(radialLayout.components)
|
410
|
+
.exit()
|
411
|
+
.transition()
|
412
|
+
.opacity(0)
|
413
|
+
.remove();
|
414
|
+
|
415
|
+
};
|
416
|
+
|
417
|
+
// Constructor
|
418
|
+
self.init = function() {
|
419
|
+
}();
|
420
|
+
|
421
|
+
// Destructor
|
422
|
+
self.deinit = function() {
|
423
|
+
};
|
424
|
+
|
425
|
+
return self;
|
426
|
+
};
|
@@ -0,0 +1,205 @@
|
|
1
|
+
/*
|
2
|
+
// palette 1
|
3
|
+
var defaultPalette = {
|
4
|
+
primary: {
|
5
|
+
dark: "#0288D1",
|
6
|
+
normal: "#19BB9B",
|
7
|
+
bright: "#B3E5FC"
|
8
|
+
},
|
9
|
+
text: {
|
10
|
+
dark: "#000000",
|
11
|
+
bright: "#FFFFFF"
|
12
|
+
},
|
13
|
+
accent1: {
|
14
|
+
dark: "#16a689",
|
15
|
+
normal: "#19BB9B",
|
16
|
+
bright: "#1dd9b4"
|
17
|
+
},
|
18
|
+
accent2: {
|
19
|
+
dark: "#F57C00",
|
20
|
+
normal: "#FF9800",
|
21
|
+
bright: "#FFFFFF"
|
22
|
+
},
|
23
|
+
accent3: {
|
24
|
+
dark: "#F57C00",
|
25
|
+
normal: "#FF9800",
|
26
|
+
bright: "#FFE0B2"
|
27
|
+
},
|
28
|
+
background: {
|
29
|
+
dark: "#D2D7D3",
|
30
|
+
normal: "#EEEEEE"
|
31
|
+
|
32
|
+
},
|
33
|
+
state: {
|
34
|
+
red: "#C0392B",
|
35
|
+
//red: "#96281B",
|
36
|
+
//red: "#F26A4B",
|
37
|
+
green: "#019875"
|
38
|
+
}
|
39
|
+
};
|
40
|
+
*/
|
41
|
+
|
42
|
+
/*
|
43
|
+
// palette 2
|
44
|
+
var defaultPalette = {
|
45
|
+
primary: {
|
46
|
+
dark: "#0288D1",
|
47
|
+
normal: "#19BB9B",
|
48
|
+
bright: "#B3E5FC"
|
49
|
+
},
|
50
|
+
text: {
|
51
|
+
dark: "#FFFFFF",
|
52
|
+
bright: "#FFFFFF"
|
53
|
+
},
|
54
|
+
accent1: {
|
55
|
+
dark: "#16a689",
|
56
|
+
normal: "#19BB9B",
|
57
|
+
bright: "#1dd9b4"
|
58
|
+
},
|
59
|
+
accent2: {
|
60
|
+
dark: "#F57C00",
|
61
|
+
normal: "#FF9800",
|
62
|
+
bright: "#FFFFFF"
|
63
|
+
},
|
64
|
+
accent3: {
|
65
|
+
dark: "#F57C00",
|
66
|
+
normal: "#FF9800",
|
67
|
+
bright: "#FFE0B2"
|
68
|
+
},
|
69
|
+
background: {
|
70
|
+
dark: "#534f59",
|
71
|
+
normal: "#39363D"
|
72
|
+
|
73
|
+
},
|
74
|
+
state: {
|
75
|
+
red: "#C0392B",
|
76
|
+
//red: "#96281B",
|
77
|
+
//red: "#F26A4B",
|
78
|
+
green: "#019875"
|
79
|
+
}
|
80
|
+
};
|
81
|
+
*/
|
82
|
+
|
83
|
+
// palette 3
|
84
|
+
var defaultPalette = {
|
85
|
+
primary: {
|
86
|
+
dark: "#0288D1",
|
87
|
+
normal: "#425266",
|
88
|
+
bright: "#B3E5FC"
|
89
|
+
},
|
90
|
+
text: {
|
91
|
+
dark: "#FFFFFF",
|
92
|
+
bright: "#FFFFFF"
|
93
|
+
},
|
94
|
+
accent1: {
|
95
|
+
dark: "#323e4d",
|
96
|
+
normal: "#425266",
|
97
|
+
bright: "#536780"
|
98
|
+
},
|
99
|
+
accent2: {
|
100
|
+
dark: "#FFFFFF",
|
101
|
+
normal: "#FF9800",
|
102
|
+
bright: "#FFFFFF"
|
103
|
+
},
|
104
|
+
accent3: {
|
105
|
+
dark: "#F57C00",
|
106
|
+
normal: "#FF9800",
|
107
|
+
bright: "#FFE0B2"
|
108
|
+
},
|
109
|
+
background: {
|
110
|
+
dark: "#637b99",
|
111
|
+
normal: "#323e4d"
|
112
|
+
|
113
|
+
},
|
114
|
+
state: {
|
115
|
+
red: "#D24D57",
|
116
|
+
//red: "#E74C3C",
|
117
|
+
//red: "#C0392B",
|
118
|
+
//red: "#96281B",
|
119
|
+
//red: "#F26A4B",
|
120
|
+
green: "#26A65B"
|
121
|
+
}
|
122
|
+
};
|
123
|
+
|
124
|
+
var UIElement = function(delegate) {
|
125
|
+
var self = {};
|
126
|
+
|
127
|
+
// Public variables
|
128
|
+
self.delegate = undefined;
|
129
|
+
|
130
|
+
// Private variables
|
131
|
+
var view = undefined;
|
132
|
+
var x = 0;
|
133
|
+
var y = 0;
|
134
|
+
var show = true;
|
135
|
+
|
136
|
+
// Protected variables
|
137
|
+
self.palette = defaultPalette;
|
138
|
+
|
139
|
+
// Getter and setter
|
140
|
+
self.__defineGetter__("x", function() {
|
141
|
+
return x;
|
142
|
+
});
|
143
|
+
|
144
|
+
self.__defineGetter__("y", function() {
|
145
|
+
return y;
|
146
|
+
});
|
147
|
+
|
148
|
+
self.__defineGetter__("view", function() {
|
149
|
+
return view;
|
150
|
+
});
|
151
|
+
|
152
|
+
self.__defineGetter__("show", function() {
|
153
|
+
return show;
|
154
|
+
});
|
155
|
+
|
156
|
+
|
157
|
+
self.__defineSetter__("x", function(newX) {
|
158
|
+
x = newX;
|
159
|
+
self.updateViewPosition();
|
160
|
+
});
|
161
|
+
|
162
|
+
self.__defineSetter__("y", function(newY) {
|
163
|
+
y = newY;
|
164
|
+
self.updateViewPosition();
|
165
|
+
});
|
166
|
+
|
167
|
+
self.__defineSetter__("view", function(newView) {
|
168
|
+
view = newView;
|
169
|
+
self.updateViewPosition();
|
170
|
+
self.updateViewOpacity();
|
171
|
+
});
|
172
|
+
|
173
|
+
self.__defineSetter__("show", function(newShow) {
|
174
|
+
if(show != newShow) {
|
175
|
+
show = newShow;
|
176
|
+
self.updateViewOpacity();
|
177
|
+
}
|
178
|
+
});
|
179
|
+
|
180
|
+
self.updateViewPosition = function() {
|
181
|
+
if(view != undefined) {
|
182
|
+
view.attr("transform", "translate(" + x + ", " + y + ")");
|
183
|
+
}
|
184
|
+
};
|
185
|
+
|
186
|
+
self.updateViewOpacity = function() {
|
187
|
+
if(view != undefined) {
|
188
|
+
view.opacity(show?1:0);
|
189
|
+
}
|
190
|
+
};
|
191
|
+
|
192
|
+
// Constructor
|
193
|
+
self.init = function() {
|
194
|
+
self.delegate = delegate;
|
195
|
+
view = self.delegate.newView();
|
196
|
+
}();
|
197
|
+
|
198
|
+
// Destructor
|
199
|
+
self.deinit = function() {
|
200
|
+
view.remove();
|
201
|
+
};
|
202
|
+
|
203
|
+
return self;
|
204
|
+
|
205
|
+
};
|