Skip to content

Commit 74ba940

Browse files
authored
Merge pull request #606 from OpenKnowledgeMaps/dev
Biweekly release (21-12-09)
2 parents 09c5da4 + ed665a2 commit 74ba940

55 files changed

Lines changed: 2254 additions & 2262 deletions

Some content is hidden

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

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
## 2021-12-09
4+
5+
### New features
6+
7+
- added abbreviation to list entry items (heading, source, authors)
8+
9+
### Changes
10+
11+
- refactored list entries code
12+
- heading & list UI changes
13+
- moved info button to the context line
14+
- moved pdf button
15+
- minor list changes
16+
- major CSS changes (restyled the whole Headstart)
17+
18+
### Removed
19+
20+
- link buttons from list
21+
22+
## 2021-11-25
23+
24+
### New features
25+
26+
- zooming and selecting papers with browser's back/forward buttons
27+
- adding a zoomed bubble/selected paper name to the page title
28+
29+
### Changes
30+
31+
- improved hot reloading in webpack
32+
- urls of local examples have changed
33+
34+
### Removed
35+
36+
- dead tracking code (Google Analytics, our custom endpoint) and related config parameter

examples/project_website/base.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@
8686
<link rel="stylesheet" href="./css/main.css">
8787
<script>
8888
data_config.files = [{
89-
title: "digital education",
90-
file: "./data/digital-education.json"
89+
//title: "digital education",
90+
title: "calcium",
91+
//file: "./data/digital-education.json"
92+
file: "./data/calcium.json"
9193
}]
9294
data_config.server_url = window.location.href.replace(/[^/]*$/, '') + "./headstart/server/";
9395
</script>

examples/project_website/data-config_base.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ var data_config = {
4747
show_cite_button: true,
4848

4949
highlight_query_terms: true,
50+
show_context_oa_number: false,
5051
};

examples/project_website/data-config_pubmed.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ var data_config = {
4545

4646
show_cite_button: true,
4747

48-
highlight_query_terms: true
48+
highlight_query_terms: true,
49+
show_context_oa_number: false,
4950

5051
};

examples/project_website/pubmed.html

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,6 @@
5454
</head>
5555

5656
<body class="vis">
57-
58-
<link rel="stylesheet" href="//localhost/project-website/search-flow/css/search-flow.css">
59-
<script type="text/javascript" src="//localhost/project-website/search-flow/lib/browser-detect.js"></script>
60-
<script>
61-
var browser = BrowserDetect.browser;
62-
var is_supported_browser = false;
63-
if ((browser === "Firefox" || browser === "Safari" || browser === "Chrome")) {
64-
is_supported_browser = true;
65-
}
66-
</script>
67-
68-
69-
<script src="//localhost/project-website/search-flow/js/visualization.js"></script>
70-
<script>
71-
</script>
72-
73-
7457
<div class="overflow-vis">
7558

7659
<div id="visualization" style="background-color:white;"></div>
@@ -87,20 +70,19 @@
8770
<script>
8871
data_config.options = [{ "id": "time_range", "multiple": false, "name": "Time Range", "type": "dropdown", "fields": [{ "id": "any-time", "text": "All time" }, { "id": "last-month", "text": "Last month" }, { "id": "last-year", "text": "Last year" }, { "id": "user-defined", "text": "Custom range", "class": "user-defined", "inputs": [{ "id": "from", "label": "From: ", "class": "time_input" }, { "id": "to", "label": "To: ", "class": "time_input" }] }] }, { "id": "sorting", "multiple": false, "name": "Sorting", "type": "dropdown", "fields": [{ "id": "most-relevant", "text": "Most relevant" }, { "id": "most-recent", "text": "Most recent" }] }, { "id": "article_types", "multiple": true, "width": "140px", "name": "Article types", "type": "dropdown", "fields": [{ "id": "adaptive clinical trial", "text": "Adaptive Clinical Trial", "selected": true }, { "id": "address", "text": "Address", "selected": true }, { "id": "autobiography", "text": "Autobiography", "selected": true }, { "id": "bibliography", "text": "Bibliography", "selected": true }, { "id": "biography", "text": "Biography", "selected": true }, { "id": "book illustrations", "text": "Book Illustrations", "selected": true }, { "id": "case reports", "text": "Case Reports", "selected": true }, { "id": "classical article", "text": "Classical Article", "selected": true }, { "id": "clinical conference", "text": "Clinical Conference", "selected": true }, { "id": "clinical study", "text": "Clinical Study", "selected": true }, { "id": "clinical trial", "text": "Clinical Trial", "selected": true }, { "id": "clinical trial protocol", "text": "Clinical Trial Protocol", "selected": true }, { "id": "clinical trial, phase i", "text": "Clinical Trial, Phase I", "selected": true }, { "id": "clinical trial, phase ii", "text": "Clinical Trial, Phase II", "selected": true }, { "id": "clinical trial, phase iii", "text": "Clinical Trial, Phase III", "selected": true }, { "id": "clinical trial, phase iv", "text": "Clinical Trial, Phase IV", "selected": true }, { "id": "clinical trial, veterinary", "text": "Clinical Trial, Veterinary", "selected": true }, { "id": "collected work", "text": "Collected Work", "selected": true }, { "id": "collected works", "text": "Collected Works", "selected": true }, { "id": "comment", "text": "Comment", "selected": true }, { "id": "comparative study", "text": "Comparative Study", "selected": true }, { "id": "congress", "text": "Congress", "selected": true }, { "id": "consensus development conference", "text": "Consensus Development Conference", "selected": true }, { "id": "consensus development conference, nih", "text": "Consensus Development Conference, NIH", "selected": true }, { "id": "controlled clinical trial", "text": "Controlled Clinical Trial", "selected": true }, { "id": "corrected and republished article", "text": "Corrected and Republished Article", "selected": true }, { "id": "dataset", "text": "Dataset", "selected": true }, { "id": "dictionary", "text": "Dictionary", "selected": true }, { "id": "directory", "text": "Directory", "selected": true }, { "id": "duplicate publication", "text": "Duplicate publication", "selected": true }, { "id": "editorial", "text": "Editorial", "selected": true }, { "id": "electronic supplementary materials", "text": "Electronic Supplementary Materials", "selected": true }, { "id": "english abstract", "text": "English Abstract", "selected": true }, { "id": "ephemera", "text": "Ephemera", "selected": true }, { "id": "equivalence trial", "text": "Equivalence Trial", "selected": true }, { "id": "evaluation studies", "text": "Evaluation Studies", "selected": true }, { "id": "evaluation study", "text": "Evaluation Study", "selected": true }, { "id": "expression of concern", "text": "Expression of Concern", "selected": true }, { "id": "festschrift", "text": "Festschrift", "selected": true }, { "id": "government publication", "text": "Government Publication", "selected": true }, { "id": "guideline", "text": "Guideline", "selected": true }, { "id": "historical article", "text": "Historical Article", "selected": true }, { "id": "interactive tutorial", "text": "Interactive Tutorial", "selected": true }, { "id": "interview", "text": "Interview", "selected": true }, { "id": "introductory journal article", "text": "Introductory Journal Article", "selected": true }, { "id": "journal article", "text": "Journal Article", "selected": true }, { "id": "lecture", "text": "Lecture", "selected": true }, { "id": "legal case", "text": "Legal Case", "selected": true }, { "id": "legislation", "text": "Legislation", "selected": true }, { "id": "letter", "text": "Letter", "selected": true }, { "id": "manuscript", "text": "Manuscript", "selected": true }, { "id": "meta analysis", "text": "Meta Analysis", "selected": true }, { "id": "multicenter study", "text": "Multicenter Study", "selected": true }, { "id": "news", "text": "News", "selected": true }, { "id": "newspaper article", "text": "Newspaper Article", "selected": true }, { "id": "observational study", "text": "Observational Study", "selected": true }, { "id": "observational study, veterinary", "text": "Observational Study, Veterinary", "selected": true }, { "id": "overall", "text": "Overall", "selected": true }, { "id": "patient education handout", "text": "Patient Education Handout", "selected": true }, { "id": "periodical index", "text": "Periodical Index", "selected": true }, { "id": "personal narrative", "text": "Personal Narrative", "selected": true }, { "id": "pictorial work", "text": "Pictorial Work", "selected": true }, { "id": "popular work", "text": "Popular Work", "selected": true }, { "id": "portrait", "text": "Portrait", "selected": true }, { "id": "practice guideline", "text": "Practice Guideline", "selected": true }, { "id": "pragmatic clinical trial", "text": "Pragmatic Clinical Trial", "selected": true }, { "id": "preprint", "text": "Preprint", "selected": true }, { "id": "publication components", "text": "Publication Components", "selected": true }, { "id": "publication formats", "text": "Publication Formats", "selected": true }, { "id": "publication type category", "text": "Publication Type Category", "selected": true }, { "id": "published erratum", "text": "Published Erratum", "selected": true }, { "id": "randomized controlled trial", "text": "Randomized Controlled Trial", "selected": true }, { "id": "randomized controlled trial, veterinary", "text": "Randomized Controlled Trial, Veterinary", "selected": true }, { "id": "research support, american recovery and reinvestment act", "text": "Research Support, American Recovery and Reinvestment Act", "selected": true }, { "id": "research support, n i h, extramural", "text": "Research Support, NIH Extramural", "selected": true }, { "id": "research support, n i h, intramural", "text": "Research Support, NIH Intramural", "selected": true }, { "id": "research support, non u s gov't", "text": "Research Support, U.S. Gov't", "selected": true }, { "id": "research support, u s gov't, non p h s", "text": "Research Support, U.S. Gov't, Non P.H.S", "selected": true }, { "id": "research support, u s gov't, p h s", "text": "Research Support, U.S. Gov't, P.H.S", "selected": true }, { "id": "research support, u s government", "text": "Research Support, U.S. Government", "selected": true }, { "id": "retracted publication", "text": "Retracted Publication", "selected": false }, { "id": "retraction of publication", "text": "Retraction of Publication", "selected": true }, { "id": "review", "text": "Review", "selected": true }, { "id": "scientific integrity review", "text": "Scientific Integrity Review", "selected": true }, { "id": "study characteristics", "text": "Study Characteristics", "selected": true }, { "id": "support of research", "text": "Support of Research", "selected": true }, { "id": "systematic review", "text": "Systematic Review", "selected": true }, { "id": "technical report", "text": "Technical Report", "selected": true }, { "id": "twin study", "text": "Twin Study", "selected": true }, { "id": "validation study", "text": "Validation Study", "selected": true }, { "id": "video audio media", "text": "Video Audio Media", "selected": true }, { "id": "webcasts", "text": "Webcasts", "selected": true }] }];
8972

90-
9173
data_config.credit_embed = true;
9274
</script>
9375

9476

9577
<link rel="stylesheet" href="./css/main.css">
9678
<script>
9779
data_config.files = [{
98-
//title: "&quot;climate change&quot;",
99-
//file: "./data/climate-change.json",
100-
title: "covid",
101-
file: "./data/covid.json",
80+
title: "&quot;climate change&quot;",
81+
//title: "covid",
82+
file: "./data/climate-change.json",
83+
//file: "./data/covid.json",
10284
}]
103-
data_config.server_url = "//localhost/project-website/headstart/server/";
85+
data_config.server_url = window.location.href.replace(/[^/]*$/, '') + "./headstart/server/";
10486
</script>
10587

10688

vis/js/components/ContextLine.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Timestamp from "../templates/contextfeatures/Timestamp";
1818
import MetadataQuality from "../templates/contextfeatures/MetadataQuality";
1919
import Modifier from "../templates/contextfeatures/Modifier";
2020
import { trackMatomoEvent } from "../utils/useMatomo";
21+
import MoreInfoLink from "../templates/contextfeatures/MoreInfoLink";
2122

2223
const defined = (param) => param !== undefined && param !== null;
2324

@@ -87,6 +88,7 @@ class ContextLine extends React.Component {
8788
{defined(params.searchLanguage) && (
8889
<SearchLang>{params.searchLanguage}</SearchLang>
8990
)}
91+
<MoreInfoLink />
9092
</ContextLineTemplate>
9193
);
9294
}
File renamed without changes.

vis/js/components/Heading.js

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { connect } from "react-redux";
44
import ZoomedInHeadingTemplate from "../templates/ZoomedInHeading";
55
import ZoomedOutHeadingTemplate from "../templates/ZoomedOutHeading";
66

7-
import { changeFile, openInfoModal } from "../actions/index";
8-
97
import {
108
BasicTitle,
119
ProjectTitle,
@@ -21,10 +19,7 @@ const Heading = ({
2119
query,
2220
bubbleTitle,
2321
headingParams,
24-
files,
25-
onFileChange,
2622
streamgraph,
27-
onInfoModalOpen,
2823
}) => {
2924
if (zoomed) {
3025
let label = streamgraph ? localization.area_streamgraph : localization.area;
@@ -33,16 +28,7 @@ const Heading = ({
3328
}
3429

3530
return (
36-
<ZoomedOutHeadingTemplate
37-
introIcon={localization.intro_icon}
38-
introLabel={localization.intro_label}
39-
additionalFeatures={renderAdditionalFeatures(
40-
headingParams,
41-
files,
42-
onFileChange
43-
)}
44-
onInfoClick={onInfoModalOpen}
45-
>
31+
<ZoomedOutHeadingTemplate>
4632
{renderTitle(localization, query, headingParams)}
4733
</ZoomedOutHeadingTemplate>
4834
);
@@ -54,16 +40,10 @@ const mapStateToProps = (state) => ({
5440
query: state.query.text,
5541
bubbleTitle: state.selectedBubble ? state.selectedBubble.title : null,
5642
headingParams: state.heading,
57-
files: state.files,
5843
streamgraph: state.chartType === STREAMGRAPH_MODE,
5944
});
6045

61-
const mapDispatchToProps = (dispatch) => ({
62-
onFileChange: (fileIndex) => dispatch(changeFile(fileIndex)),
63-
onInfoModalOpen: () => dispatch(openInfoModal()),
64-
});
65-
66-
export default connect(mapStateToProps, mapDispatchToProps)(Heading);
46+
export default connect(mapStateToProps)(Heading);
6747

6848
// This should probably make its way to a more global config
6949
const MAX_LENGTH_VIPER = 47;
@@ -198,27 +178,3 @@ const unescapeHTML = (string) => {
198178
}
199179
);
200180
};
201-
202-
const renderAdditionalFeatures = ({ showDropdown }, files, onFileChange) => {
203-
if (showDropdown && files.list.length > 0) {
204-
const handleChange = (e) => {
205-
onFileChange(parseInt(e.target.value));
206-
};
207-
208-
return (
209-
<>
210-
{" "}
211-
Select dataset:{" "}
212-
<select id="datasets" value={files.current} onChange={handleChange}>
213-
{files.list.map((entry, index) => (
214-
<option key={entry.file} value={index}>
215-
{entry.title}
216-
</option>
217-
))}
218-
</select>
219-
</>
220-
);
221-
}
222-
223-
return null;
224-
};

vis/js/components/Headstart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ const Headstart = ({
4848
</div>
4949
)}
5050
{renderList && <List />}
51+
<Footer />
5152
</div>
5253
<Toolbar />
5354
<Modals />
54-
<Footer />
5555
</LocalizationProvider>
5656
);
5757
};

vis/js/components/ListEntries.js

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import React from "react";
22
import { connect } from "react-redux";
33

4-
import BasicListEntries from "./listentries/BasicListEntries";
5-
import ClassificationListEntries from "./listentries/ClassificationListEntries";
6-
import StandardListEntries from "./listentries/StandardListEntries";
7-
import EntriesWrapper from "./listentries/EntriesWrapper";
8-
94
import { useLocalizationContext } from "./LocalizationProvider";
105

116
import { filterData } from "../utils/data";
127
import { STREAMGRAPH_MODE } from "../reducers/chartType";
138

9+
import EntriesWrapper from "./EntriesWrapper";
10+
import BasicListEntry from "../templates/listentry/BasicListEntry";
11+
import ClassificationListEntry from "../templates/listentry/ClassificationListEntry";
12+
import StandardListEntry from "../templates/listentry/StandardListEntry";
13+
1414
const ListEntries = ({
15+
// data
1516
show,
1617
service,
1718
displayedData,
@@ -29,7 +30,7 @@ const ListEntries = ({
2930
let showEmptyMessage = displayedData.length === 0;
3031
if (!isStreamgraph && showEmptyMessage) {
3132
// we have to perform knowledge map filtering here (it's different
32-
// to the filtering in the List.js component - paper selection is
33+
// to the filtering in the List.js component - paper selection is
3334
// not taken into account)
3435
// if the list is empty, but there are visible papers in the zoomed
3536
// bubble, the message is not displayed
@@ -47,15 +48,15 @@ const ListEntries = ({
4748
);
4849
}
4950

50-
if (service === null || typeof service === "undefined") {
51-
return <BasicListEntries displayedData={displayedData} />;
52-
}
53-
54-
if (service.startsWith("linkedcat")) {
55-
return <ClassificationListEntries displayedData={displayedData} />;
56-
}
51+
const ListEntryComponent = getListEntryComponent(service);
5752

58-
return <StandardListEntries displayedData={displayedData} />;
53+
return (
54+
<EntriesWrapper>
55+
{displayedData.map((paper) => (
56+
<ListEntryComponent key={paper.safe_id} paper={paper} />
57+
))}
58+
</EntriesWrapper>
59+
);
5960
};
6061

6162
const mapStateToProps = (state) => ({
@@ -78,3 +79,15 @@ const mapStateToProps = (state) => ({
7879
});
7980

8081
export default connect(mapStateToProps)(ListEntries);
82+
83+
const getListEntryComponent = (service) => {
84+
if (service === null || typeof service === "undefined") {
85+
return BasicListEntry;
86+
}
87+
88+
if (service.startsWith("linkedcat")) {
89+
return ClassificationListEntry;
90+
}
91+
92+
return StandardListEntry;
93+
};

0 commit comments

Comments
 (0)