Skip to content

Commit deb1990

Browse files
author
Gerwald Tschinkel
committed
Merge branch 'develop'
2 parents c0a0600 + 36a766d commit deb1990

File tree

95 files changed

+18261
-16176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+18261
-16176
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.swp
2+
/nbproject/
23
/.vscode/settings.json

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "Dashboard/uRank"]
22
path = Dashboard/uRank
33
url = https://github.com/cecidisi/uRank
4+
[submodule "WebGlVisualization"]
5+
path = WebGlVisualization
6+
url = https://github.com/PeterHasitschka/eexcess_webgl_vis.git
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
(function(){
2+
3+
var TextVizCategory = {};
4+
5+
6+
TextVizCategory.initialize = function(EEXCESSObj){
7+
// load CSS
8+
// load other needed scripts (require.js is available)
9+
};
10+
11+
TextVizCategory.draw = function (allData, inputData, $container, filters, settings, e){
12+
var $vis = $container.find('.TextVizCategory');
13+
if ($vis.length == 0){
14+
$vis = $('<div class="TextVizCategory" style="text-align: center;"></div>').css('padding-top', '10px').css('padding-bottom', '10px');
15+
$container.append($vis);
16+
}
17+
18+
$vis.html(filters[0].category + ': ' + underscore(filters[0].categoryValues).join(', '));
19+
};
20+
21+
TextVizCategory.finalize = function(){
22+
};
23+
24+
PluginHandler.registerFilterVisualisation(TextVizCategory, {
25+
'displayName' : 'TestMini Category',
26+
'type' : 'category',
27+
'isTextual': true
28+
});
29+
})();

Dashboard/Plugins/FilterTextVizGeo.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
(function(){
2+
3+
var TextVizGeo = {};
4+
TextVizGeo.geoNamesUrl = 'http://api.geonames.org/citiesJSON?&username=eexcess&lang=en'; // &north=44.1&south=-9.9&east=-22.4&west=55.2
5+
6+
TextVizGeo.initialize = function(EEXCESSObj){
7+
// load CSS
8+
// load other needed scripts (require.js is available)
9+
};
10+
11+
TextVizGeo.draw = function (allData, inputData, $container, filters) {
12+
var $vis = $container.find('.TextVizGeo');
13+
if ($vis.length == 0){
14+
$vis = $('<div class="TextVizGeo" style="text-align: center;"></div>').css('padding-top', '10px').css('padding-bottom', '10px');
15+
$container.append($vis);
16+
}
17+
18+
var geoNamesAreaUrl = TextVizGeo.geoNamesUrl + '&north='+filters[0].to.lat+'&west='+filters[0].to.lng+'&south='+filters[0].from.lat+'&east='+filters[0].from.lng;
19+
console.log(geoNamesAreaUrl);
20+
$.ajax({
21+
url: geoNamesAreaUrl,
22+
dataType : 'jsonp',
23+
success: function(data){
24+
console.log(data);
25+
var output = underscore(data.geonames).map('name').join(', ');
26+
$vis.html(output);
27+
}
28+
});
29+
30+
if (filters[0].from != null && filters[0].to != null)
31+
$vis.html('NE: ' + filters[0].from.lat.toFixed(4) + ", " + filters[0].from.lng.toFixed(4) + " <br />SW: " + filters[0].to.lat.toFixed(4) + ", " + filters[0].to.lng.toFixed(4));
32+
else
33+
$vis.html('');
34+
};
35+
36+
TextVizGeo.finalize = function(){
37+
};
38+
39+
PluginHandler.registerFilterVisualisation(TextVizGeo, {
40+
'displayName' : 'TestMini Geo',
41+
'type' : 'geo',
42+
'isTextual': true
43+
});
44+
})();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
(function(){
2+
3+
var TextVizTime = {};
4+
5+
TextVizTime.initialize = function(EEXCESSObj){
6+
// load CSS
7+
// load other needed scripts (require.js is available)
8+
};
9+
10+
TextVizTime.draw = function (allData, inputData, $container, filters, settings) {
11+
var $vis = $container.find('.TextVizTime');
12+
if ($vis.length == 0){
13+
$vis = $('<div class="TextVizTime" style="text-align:center;"></div>').css('padding-top', '10px').css('padding-bottom', '10px');
14+
$container.append($vis);
15+
}
16+
17+
$vis.html('' + filters[0].from + " - " + filters[0].to);
18+
};
19+
20+
TextVizTime.finalize = function(){
21+
};
22+
23+
PluginHandler.registerFilterVisualisation(TextVizTime, {
24+
'displayName' : 'TestMini',
25+
'type' : 'time',
26+
'isTextual': true
27+
});
28+
})();

Dashboard/Plugins/FilterVisCategoryHex.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
}
2828
}
2929
});
30-
3130
};
3231

3332
/*
@@ -39,6 +38,12 @@
3938
afterInitCallback = function () { FilterVisCategoryHex.draw(allData, inputData, $container, filters, settings); };
4039
return;
4140
}
41+
42+
if (settings.textualFilterMode == 'textOnly'){
43+
FilterVisCategoryHex.drawText($container, filters);
44+
return;
45+
}
46+
4247
var base, svg, focus = null;
4348
var categoryValues = underscore(filters).map('categoryValues');
4449
var selectedData = underscore(filters).map('dataWithinFilter');
@@ -61,10 +66,24 @@
6166
}
6267
generateMiniBarElements(data, dataSet, category, selectedData, categoryValues);
6368
interactMiniBar(selectedData, category, categoryValues, data);
69+
70+
if (settings.textualFilterMode == 'textAndViz'){
71+
FilterVisCategoryHex.drawText($container, filters);
72+
}
6473
};
6574

6675
FilterVisCategoryHex.finalize = function(){
6776
};
77+
78+
FilterVisCategoryHex.drawText = function ($container, filters){
79+
var $vis = $container.find('.FilterVisCategoryHexText');
80+
if ($vis.length == 0){
81+
$vis = $('<div class="FilterVisCategoryHexText" style="text-align: center;"></div>').css('padding-top', '10px').css('padding-bottom', '10px');
82+
$container.append($vis);
83+
}
84+
85+
$vis.html(filters[0].category + ': ' + underscore(filters[0].categoryValues).join(', '));
86+
};
6887

6988
/*
7089
* generates the svg specific svg elements
@@ -76,6 +95,19 @@
7695
var svg = base.select("svg.minibarchart_svg").attr('height', dataSet.height).attr("viewBox", "0 0 " + width + " " + dataSet.height + " ");
7796
var focus = svg.select(".FilterVis_focus");
7897
var color = getColorOfMainVisualization(inputData);
98+
99+
100+
// If no colors appear, try to get it from WebGLVis, which may be active
101+
if (!color.length) {
102+
103+
if (IQHN) {
104+
/** @type {IQHN.RingRepresentation} **/
105+
var ringrep = IQHN.RingRepresentation.activeRepresentations[0];
106+
color = ringrep.getColorsOfRing(category);
107+
}
108+
}
109+
110+
79111
focus.append("g")
80112
.selectAll(".points_fill")
81113
.data(dataSet.points_fill)

Dashboard/Plugins/FilterVizGeo-Data.js renamed to Dashboard/Plugins/FilterVisGeo-Data.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dashboard/Plugins/FilterVizGeo.js renamed to Dashboard/Plugins/FilterVisGeo.js

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,53 @@
11
(function () {
22

3-
var FilterVizGeo = {};
3+
var FilterVisGeo = {};
44
//var d3 = d3 || {};
55
var path, zoom, afterInitCallback, width, height, svg, projection, selectedArea;
66
var initializationFinished = false;
7+
8+
FilterVisGeo.geoNamesUrl = 'http://api.geonames.org/citiesJSON?&username=eexcess&lang=en'; // &north=44.1&south=-9.9&east=-22.4&west=55.2
79

8-
FilterVizGeo.initialize = function (EEXCESSObj) {
10+
FilterVisGeo.initialize = function (EEXCESSObj) {
911
path = 'libs/topojson.min.js';
1012
Modernizr.load({
1113
test: path,
12-
load: [path, 'Plugins/FilterVizGeo-Data.js'],
14+
load: [path, 'Plugins/FilterVisGeo-Data.js'],
1315
complete: function () {
14-
//console.log("FilterVizGeo load completed");
16+
//console.log("FilterVisGeo load completed");
1517
initializationFinished = true;
1618
if (afterInitCallback)
1719
afterInitCallback();
1820
}
1921
});
2022
};
2123

22-
//FilterVizGeo.draw = function (allData, selectedData, inputData, $container, category, categoryValues, northEast, southWest) {
23-
FilterVizGeo.draw = function (allData, inputData, $container, filters) {
24+
FilterVisGeo.draw = function (allData, inputData, $container, filters, settings) {
2425

25-
var $vis = $container.find('.FilterVizGeo');
26+
var $vis = $container.find('.FilterVisGeo');
2627
if ($vis.length == 0) {
27-
$vis = $('<div class="FilterVizGeo"></div>');
28+
$vis = $('<div class="FilterVisGeo"></div>');
2829
$container.append($vis);
2930
}
31+
3032
width = $vis.width();
3133
height = width * 0.6;
3234
$vis.height(height); // its important to set the height before the callback delay, because otherwise
3335

3436
if (!initializationFinished) {
35-
afterInitCallback = function () { FilterVizGeo.draw(allData, inputData, $container, filters); };
37+
afterInitCallback = function () { FilterVisGeo.draw(allData, inputData, $container, filters, settings); };
38+
return;
39+
}
40+
41+
if (settings.textualFilterMode == 'textOnly'){
42+
FilterVisGeo.drawText($container, filters);
43+
$vis.height(0);
3644
return;
3745
}
3846

47+
if (settings.textualFilterMode == 'textAndViz'){
48+
FilterVisGeo.drawText($container, filters);
49+
}
50+
3951
// todo: show filters
4052
// filters[i].from = northEast
4153
// filters[i].to = southWest
@@ -99,7 +111,7 @@
99111
var i = 0;
100112
updateSelectedArea(filters[i].from, filters[i].to);
101113
var grayColorPlate = ["#000000", "#D8D8D8 ", "#B8B8B8 ", "#686868 ", "#A8A8A8 ", "#413839","#303030","#463E3F","#4C4646","#504A4B","#565051","#5C5858","#625D5D","#666362","#6D6968","#726E6D","#736F6E","#837E7C","#848482","#B6B6B4"]
102-
var countries = topojson.feature(FilterVizGeoWorldShape, FilterVizGeoWorldShape.objects.countries);
114+
var countries = topojson.feature(FilterVisGeoWorldShape, FilterVisGeoWorldShape.objects.countries);
103115
var asia = { type: "FeatureCollection", name: "Asia", color: grayColorPlate[0], id: 1, features: countries.features.filter(function (d) { return d.properties.continent == "Asia"; }) };
104116
var africa = { type: "FeatureCollection", name: "Africa", color: grayColorPlate[1], id: 2, features: countries.features.filter(function (d) { return d.properties.continent == "Africa"; }) };
105117
var europe = { type: "FeatureCollection", name: "Europe", color: grayColorPlate[2], id: 3, features: countries.features.filter(function (d) { return d.properties.continent == "Europe"; }) };
@@ -136,7 +148,7 @@
136148

137149
svg.attr("width", width)
138150
.attr("height", height);
139-
151+
140152
// selectedBrush.attr("x", 1);
141153
// selectedBrush.attr("y", 1);
142154
// selectedBrush.attr("width", 100);
@@ -231,6 +243,31 @@
231243
}
232244
}
233245

246+
FilterVisGeo.drawText = function ($container, filters) {
247+
var $vis = $container.find('.FilterVisGeoText');
248+
if ($vis.length == 0){
249+
$vis = $('<div class="FilterVisGeoText" style="text-align: center;"></div>').css('padding-top', '10px').css('padding-bottom', '10px');
250+
$container.append($vis);
251+
}
252+
253+
var geoNamesAreaUrl = FilterVisGeo.geoNamesUrl + '&north='+filters[0].to.lat+'&west='+filters[0].to.lng+'&south='+filters[0].from.lat+'&east='+filters[0].from.lng;
254+
console.log('call geonames:', geoNamesAreaUrl);
255+
$.ajax({
256+
url: geoNamesAreaUrl,
257+
dataType : 'jsonp',
258+
success: function(data){
259+
console.log('data received from geonames', data);
260+
var output = underscore(data.geonames).map('name').join(', ');
261+
$vis.html(output);
262+
}
263+
});
264+
265+
if (filters[0].from != null && filters[0].to != null)
266+
$vis.html('NE: ' + filters[0].from.lat.toFixed(4) + ", " + filters[0].from.lng.toFixed(4) + " <br />SW: " + filters[0].to.lat.toFixed(4) + ", " + filters[0].to.lng.toFixed(4));
267+
else
268+
$vis.html('');
269+
};
270+
234271
function addOnCtrlPressedEvent() {
235272
d3.select(window)
236273
.on('keydown', function () {
@@ -328,14 +365,14 @@
328365

329366

330367

331-
FilterVizGeo.finalize = function ($container) {
368+
FilterVisGeo.finalize = function ($container) {
332369
if ($container.find('svg')){
333370
var svg = d3.select($container.find('svg')[0]);
334371
svg.remove();
335372
}
336373
};
337374

338-
PluginHandler.registerFilterVisualisation(FilterVizGeo, {
375+
PluginHandler.registerFilterVisualisation(FilterVisGeo, {
339376
'displayName': 'Geo',
340377
'type': 'geo',
341378
});
Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
(function(){
22

3-
var FilterVisKeywords = {};
3+
var FilterVisKeywords = {};
44

5-
FilterVisKeywords.initialize = function(EEXCESSObj){
6-
};
5+
FilterVisKeywords.initialize = function(EEXCESSObj){
6+
};
77

8-
//FilterVisKeywords.draw = function(allData, selectedData, inputData, $container, category, categoryValues, from, to) {
9-
FilterVisKeywords.draw = function (allData, inputData, $container, filters) {
8+
FilterVisKeywords.draw = function (allData, inputData, $container, filters, settings) {
109

1110
//var categoryValues = filters[0]['categoryValues'];
1211
var categoryValues = underscore.chain(filters).map('categoryValues').flatten().uniq().value();
1312
var selectedData = underscore(filters).map('dataWithinFilter');
1413

15-
var $vis = $container.find('.FilterVisKeywords');
16-
17-
if ($vis.length == 0){
18-
$vis = $('<div class="FilterVisKeywords"></div>');
19-
$container.append($vis);
20-
}
21-
22-
var keywordsItmes = []
23-
for(var i=0; i < categoryValues.length; i++) {
24-
var color = "#000000";
25-
var keyword = categoryValues[i];
26-
if(inputData.colors.length > i) {
27-
color = inputData.colors[i];
28-
}
29-
var keywordSpanItem = '<span><font color="'+color+'"><b>' + keyword + '</b></font></span>'
30-
keywordsItmes.push(keywordSpanItem);
31-
}
32-
var items = keywordsItmes.join(' ');
33-
34-
$vis.html('<div class="" style="align:center; padding:5px;">' + items + '</div>');
35-
};
14+
var $vis = $container.find('.FilterVisKeywords');
15+
if ($vis.length == 0){
16+
$vis = $('<div class="FilterVisKeywords"></div>');
17+
$container.append($vis);
18+
}
19+
20+
var keywordsItmes = []
21+
for(var i=0; i < categoryValues.length; i++) {
22+
var keyword = categoryValues[i];
23+
var keywordFormated = '<span>' + keyword + '</span>';
24+
if (settings.textualFilterMode != 'textOnly'){
25+
var color = "#000000";
26+
if(inputData.colors.length > i) {
27+
color = inputData.colors[i];
28+
}
29+
keywordFormated = '<span style="color:' + color + '; font-weight:bold;">' + keyword + '</span>';
30+
}
31+
keywordsItmes.push(keywordFormated);
32+
}
33+
var items = keywordsItmes.join(', ');
34+
35+
$vis.html('<div class="" style="align:center; padding:5px;">' + items + '</div>');
36+
};
3637

37-
FilterVisKeywords.finalize = function(){
38-
};
39-
40-
PluginHandler.registerFilterVisualisation(FilterVisKeywords, {
41-
'displayName' : 'Keywords',
42-
'type' : 'keyword',
43-
});
38+
39+
FilterVisKeywords.finalize = function(){
40+
};
41+
42+
PluginHandler.registerFilterVisualisation(FilterVisKeywords, {
43+
'displayName' : 'Keywords',
44+
'type' : 'keyword',
45+
});
4446
})();

0 commit comments

Comments
 (0)