Skip to content

Commit fc6e403

Browse files
committed
feat: sorting by citations in PubMed
1 parent 60586f4 commit fc6e403

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

vis/js/default-config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Config } from "./@types/config";
22
import { localization } from "./i18n/localization";
33

4-
54
/* eslint-disable no-template-curly-in-string */
65
var config: Config = {
76
/*** basic visualization modes ***/
@@ -144,7 +143,7 @@ var config: Config = {
144143
//show result type (document type) in list entry
145144
show_resulttype: false,
146145
//sort options for sort dropdown
147-
sort_options: ["readers", "title", "authors", "year"],
146+
sort_options: ["citations", "title", "authors", "year"],
148147
//filter options for filter dropdown
149148
filter_options: ["all", "open_access", "publication", "dataset"],
150149
//custom data property to filter for. if null, defaults are used with above filter options

vis/js/utils/data.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ const getWordFilterFunction = (searchedKeywords) => {
132132
};
133133

134134
const getPropertyOrEmptyString = (object, property) => {
135-
if (Object.prototype.hasOwnProperty.call(object, property) && object[property] !== null && object[property] !== undefined) {
135+
if (
136+
Object.prototype.hasOwnProperty.call(object, property) &&
137+
object[property] !== null &&
138+
object[property] !== undefined
139+
) {
136140
return object[property].toString().toLowerCase().trim();
137141
}
138142

@@ -539,9 +543,9 @@ export const commentsSanitizer = (value) => {
539543
};
540544

541545
export const queryConcatenator = (terms) => {
542-
let filtered_terms = terms.filter(element => {
543-
return element !== '' && element !== null && element !== undefined
546+
let filtered_terms = terms.filter((element) => {
547+
return element !== "" && element !== null && element !== undefined;
544548
});
545549
let concatenatedQueries = filtered_terms.join(" and ");
546-
return concatenatedQueries
547-
}
550+
return concatenatedQueries;
551+
};

0 commit comments

Comments
 (0)