Skip to content

Commit be4e140

Browse files
Merge pull request #703 from OpenKnowledgeMaps/openaire-modal
Openaire modal
2 parents 1c30492 + f1002d1 commit be4e140

11 files changed

Lines changed: 542 additions & 31 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
var data_config = {
2+
tag: "visualization",
3+
mode: "local_files",
4+
5+
bubble_min_scale: 1,
6+
bubble_max_scale: 1,
7+
8+
paper_min_scale: 1,
9+
paper_max_scale: 1,
10+
11+
dynamic_sizing: true,
12+
dynamic_force_area: true,
13+
dynamic_force_papers: true,
14+
15+
service: "openaire",
16+
base_unit: "citations",
17+
use_area_uri: true,
18+
preview_type: "pdf",
19+
sort_options: ["relevance", "title", "authors", "year"],
20+
filter_options: ["all", "open_access"],
21+
filter_menu_dropdown: true,
22+
is_force_areas: true,
23+
language: "eng_openaire",
24+
area_force_alpha: 0.015,
25+
show_list: true,
26+
content_based: true,
27+
url_prefix: "https://www.openaire.eu/search/publication?articleId=",
28+
url_prefix_datasets: "https://www.openaire.eu/en/search/dataset?datasetId=",
29+
30+
show_context: true,
31+
create_title_from_context: true,
32+
create_title_from_context_style: 'viper',
33+
show_context_oa_number: false,
34+
35+
viper_edit_modal: false,
36+
embed_modal: true,
37+
share_modal: true,
38+
39+
doi_outlink: true,
40+
41+
metric_list: false,
42+
43+
credit: true,
44+
45+
scale_toolbar: false,
46+
47+
scale_types: ['content_based', 'citation_count', 'cited_by_tweeters_count', 'readers.mendeley'],
48+
scale_explanation: {
49+
content_based: 'The size of the bubbles is relative to the number of documents related to them.',
50+
citation_count: 'The size of the documents and bubbles is relative to the number of citations related to them. The citation data was retrieved from Crossref.',
51+
cited_by_tweeters_count: 'The size of the documents and bubbles is relative to the number of tweets related to them. The tweet data was retrieved from Altmetric.com.',
52+
'readers.mendeley': 'The size of the documents and bubbles is relative to the number of Mendeley readers related to them. The readership data was retrieved from Altmetric.com.'
53+
},
54+
scale_label: {
55+
content_based: 'Documents',
56+
citation_count: 'Citations',
57+
cited_by_tweeters_count: 'Tweets',
58+
'readers.mendeley': 'Readers'
59+
},
60+
scale_base_unit: {
61+
citation_count: 'citations',
62+
cited_by_tweeters_count: 'tweets',
63+
'readers.mendeley': 'readers'
64+
},
65+
66+
is_evaluation: true,
67+
evaluation_service: ["matomo"],
68+
69+
use_hypothesis: true,
70+
71+
// a new field for specifying the type of information to render correct type of info modal window
72+
modal_info_type: "openaire",
73+
74+
};

examples/project_website/data/openaire.json

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.

examples/project_website/data/openaire_organizations.json

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
4+
<head>
5+
<base href="//localhost:8080/project_website/">
6+
7+
<script type="text/javascript" src="./data-config_openaire.js"></script>
8+
<title>
9+
Overview of research on digital education - Open Knowledge Maps</title>
10+
11+
<meta http-equiv="content-type" content="text/html; charset=utf-8">
12+
<meta http-equiv="content-style-type" content="text/css">
13+
<meta http-equiv="content-language" content="en">
14+
<meta name="viewport" content="width=device-width,initial-scale=1">
15+
<meta name="robots" content="follow">
16+
<meta name="revisit-after" content="1 month">
17+
<meta name="distribution" content="global">
18+
<meta name="author" content="Open Knowledge Maps">
19+
<meta name="publisher" content="Open Knowledge Maps">
20+
<meta name="keywords" content="knowldege visualization, open knowledge, open science">
21+
22+
<meta name="description"
23+
content="Get an overview of digital education, find relevant papers, and identify important concepts.">
24+
25+
<!-- FAVICONS -->
26+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=xQz6nej7eR">
27+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png?v=xQz6nej7eR">
28+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=xQz6nej7eR">
29+
<link rel="manifest" href="/site.webmanifest?v=xQz6nej7eR">
30+
<link rel="mask-icon" href="/safari-pinned-tab.svg?v=xQz6nej7eR" color="#263d54">
31+
<link rel="shortcut icon" href="/favicon.ico?v=xQz6nej7eR">
32+
<meta name="apple-mobile-web-app-title" content="OKMaps">
33+
<meta name="application-name" content="OKMaps">
34+
<meta name="msapplication-TileColor" content="#263d54">
35+
<meta name="theme-color" content="#ffffff">
36+
37+
<!-- TODO -->
38+
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
39+
40+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800' rel='stylesheet' type='text/css'>
41+
42+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
43+
<!-- TODO <script src="lib/bootstrap.min.js"></script> -->
44+
45+
<!-- TODO <link rel="stylesheet" href="./css/main.css?v=2021-10-11-1"> -->
46+
47+
<script type="text/javascript">
48+
$(document).ready(function () {
49+
$('[data-toggle="popover"]').popover({trigger: "hover", placement: "right"});
50+
});
51+
</script>
52+
</head>
53+
54+
<body class="vis">
55+
<!-- TODO <link rel="stylesheet" href="./search-flow/css/search-flow.css"> -->
56+
57+
<div class="overflow-vis">
58+
<div id="visualization" style="background-color:white;"></div>
59+
</div>
60+
61+
<!-- TODO -->
62+
<script type="text/javascript" src="../../dist/headstart.js"></script>
63+
<script type="text/javascript">
64+
$(document).ready(function () {
65+
headstart.start();
66+
})
67+
</script>
68+
69+
70+
<link rel="stylesheet" href="../../dist/headstart.css">
71+
72+
<script>
73+
data_config.options = [{
74+
"id": "time_range",
75+
"multiple": false,
76+
"name": "Time Range",
77+
"type": "dropdown",
78+
"fields": [{"id": "any-time", "text": "All time"}, {
79+
"id": "last-month",
80+
"text": "Last month"
81+
}, {"id": "last-year", "text": "Last year"}, {
82+
"id": "user-defined",
83+
"text": "Custom range",
84+
"class": "user-defined",
85+
"inputs": [{"id": "from", "label": "From: ", "class": "time_input"}, {
86+
"id": "to",
87+
"label": "To: ",
88+
"class": "time_input"
89+
}]
90+
}]
91+
}, {
92+
"id": "sorting",
93+
"multiple": false,
94+
"name": "Sorting",
95+
"type": "dropdown",
96+
"fields": [{"id": "most-relevant", "text": "Most relevant"}, {"id": "most-recent", "text": "Most recent"}]
97+
}, {
98+
"id": "document_types",
99+
"multiple": true,
100+
"name": "Document types",
101+
"type": "dropdown",
102+
"width": "140px",
103+
"fields": [{"id": "4", "text": "Audio", "selected": false}, {
104+
"id": "11",
105+
"text": "Book",
106+
"selected": false
107+
}, {"id": "111", "text": "Book part", "selected": false}, {
108+
"id": "13",
109+
"text": "Conference object",
110+
"selected": false
111+
}, {"id": "16", "text": "Course material", "selected": false}, {
112+
"id": "7",
113+
"text": "Dataset",
114+
"selected": false
115+
}, {"id": "5", "text": "Image\/video", "selected": false}, {
116+
"id": "12",
117+
"text": "Journal\/newspaper",
118+
"selected": false
119+
}, {"id": "121", "text": "Journal\/newspaper article", "selected": true}, {
120+
"id": "122",
121+
"text": "Journal\/newspaper other content",
122+
"selected": false
123+
}, {"id": "17", "text": "Lecture", "selected": false}, {
124+
"id": "19",
125+
"text": "Manuscript",
126+
"selected": false
127+
}, {"id": "3", "text": "Map", "selected": false}, {
128+
"id": "52",
129+
"text": "Moving image\/video",
130+
"selected": false
131+
}, {"id": "2", "text": "Musical notation", "selected": false}, {
132+
"id": "F",
133+
"text": "Other\/Unknown material",
134+
"selected": false
135+
}, {"id": "1A", "text": "Patent", "selected": false}, {
136+
"id": "14",
137+
"text": "Report",
138+
"selected": false
139+
}, {"id": "15", "text": "Review", "selected": false}, {
140+
"id": "6",
141+
"text": "Software",
142+
"selected": false
143+
}, {"id": "51", "text": "Still image", "selected": false}, {
144+
"id": "1",
145+
"text": "Text",
146+
"selected": false
147+
}, {"id": "18", "text": "Thesis", "selected": false}, {
148+
"id": "181",
149+
"text": "Thesis: bachelor",
150+
"selected": false
151+
}, {"id": "183", "text": "Thesis: doctoral and postdoctoral", "selected": false}, {
152+
"id": "182",
153+
"text": "Thesis: master",
154+
"selected": false
155+
}]
156+
}, {
157+
"id": "min_descsize",
158+
"multiple": false,
159+
"name": "Abstract",
160+
"type": "dropdown",
161+
"width": "145px",
162+
"fields": [{
163+
"id": "300",
164+
"text": "High metadata quality (abstract required, minimum length: 300 characters)"
165+
}, {
166+
"id": "0",
167+
"text": "Low metadata quality (no abstract required, which may significantly reduce map quality)"
168+
}]
169+
}];
170+
171+
data_config.credit_embed = true;
172+
</script>
173+
174+
<link rel="stylesheet" href="./css/main.css">
175+
<script>
176+
data_config.files = [{
177+
title: "digital education",
178+
file: "./data/openaire.json",
179+
// file: "./data/openaire_organizations.json",
180+
// other attributes:
181+
is_streamgraph: false, // set true for streamgraph data
182+
show_area: true, // set false for streamgraph data
183+
}]
184+
data_config.is_streamgraph = data_config.files[0].is_streamgraph;
185+
data_config.show_area = data_config.files[0].show_area;
186+
data_config.server_url = window.location.href.replace(/[^/]*$/, '') + "./headstart/server/";
187+
</script>
188+
</body>
189+
190+
<!-- Matomo -->
191+
<script>
192+
// set this to true to enable Matomo tracking
193+
var enable_tracking = false;
194+
if (enable_tracking) {
195+
var _paq = window._paq = window._paq || [];
196+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
197+
_paq.push(['trackPageView']);
198+
_paq.push(['enableLinkTracking']);
199+
(function () {
200+
var u = "//dev.openknowledgemaps.org/piwik_stats/";
201+
_paq.push(['setTrackerUrl', u + 'matomo.php']);
202+
_paq.push(['setSiteId', '1']);
203+
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
204+
g.async = true;
205+
g.src = u + 'matomo.js';
206+
s.parentNode.insertBefore(g, s);
207+
})();
208+
}
209+
</script>
210+
<!-- End Matomo Code -->
211+
212+
</html>

examples/viper/building_map.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
console.log(data)
7373
if (data.status === "success") {
7474
$("#progressbar").progressbar("option", "value", 100);
75-
window.clearTimeout(progessbar_timeout);
75+
window.clearTimeout(progressbar_timeout);
7676

7777
var file = data.id;
7878
window.location.replace("project?id=" + file);
@@ -100,7 +100,7 @@
100100
}
101101

102102
var showErrorCreation = function () {
103-
clearTimeout(progessbar_timeout);
103+
clearTimeout(progressbar_timeout);
104104
$("#progressbar").hide();
105105
$(".waiting-description").hide();
106106
$(".waiting-title").html('Creating an overview for <span class="project_name">' + window.dataParamsForOpening.acronymtitle + '</span> failed.');
@@ -113,7 +113,7 @@
113113
}
114114

115115
var showErrorBackend = function (error) {
116-
clearTimeout(progessbar_timeout);
116+
clearTimeout(progressbar_timeout);
117117
$("#progressbar").hide();
118118
$(".waiting-description").hide();
119119
$(".waiting-title").html('Creating an overview for <span class="project_name">' + window.dataParamsForOpening.acronymtitle + '</span> failed.');
@@ -134,7 +134,7 @@
134134

135135
$("#progressbar").progressbar("option", "value", value);
136136

137-
progessbar_timeout = window.setTimeout(tick_function, tick_interval * milliseconds);
137+
progressbar_timeout = window.setTimeout(tick_function, tick_interval * milliseconds);
138138

139139
if (value >= 100) {
140140
$("#progress").html("Creating your visualization takes longer than expected. Please stay tuned!")
@@ -166,7 +166,7 @@
166166
var milliseconds = 6000;
167167
}
168168

169-
var progessbar_timeout = window.setTimeout(tick_function, tick_interval * milliseconds);
169+
var progressbar_timeout = window.setTimeout(tick_function, tick_interval * milliseconds);
170170
</script>
171171

172172
</body>

examples/viper/js/data-config_openaire.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ var data_config = {
44

55
bubble_min_scale: 1,
66
bubble_max_scale: 1,
7-
7+
88
paper_min_scale: 1,
99
paper_max_scale: 1,
10-
10+
1111
dynamic_sizing: true,
1212
dynamic_force_area: true,
1313
dynamic_force_papers: true,
@@ -25,23 +25,23 @@ var data_config = {
2525
content_based: true,
2626
url_prefix: "https://www.openaire.eu/search/publication?articleId=",
2727
url_prefix_datasets: "https://www.openaire.eu/en/search/dataset?datasetId=",
28-
28+
2929
show_context: true,
3030
create_title_from_context: true,
3131
create_title_from_context_style: 'viper',
32-
32+
3333
viper_edit_modal: true,
3434
embed_modal: true,
3535
share_modal: true,
3636

3737
doi_outlink: true,
3838

3939
metric_list: true,
40-
40+
4141
credit: false,
4242

4343
scale_toolbar: true,
44-
44+
4545
scale_types: ['content_based', 'citation_count', 'cited_by_tweeters_count', 'readers.mendeley'],
4646
scale_explanation: {
4747
content_based: 'The size of the bubbles is relative to the number of documents related to them.',
@@ -60,9 +60,12 @@ var data_config = {
6060
cited_by_tweeters_count: 'tweets',
6161
'readers.mendeley': 'readers'
6262
},
63-
63+
6464
is_evaluation: true,
65-
65+
6666
use_hypothesis: true,
67-
67+
68+
// a new field for specifying the type of information to render correct type of info modal window
69+
modal_info_type: "viper",
70+
6871
};

0 commit comments

Comments
 (0)