From 3c5f7799c4040fb00bf87a1f0e4e5b29c5e6f164 Mon Sep 17 00:00:00 2001 From: andrei Date: Mon, 12 Jan 2026 13:26:53 +0100 Subject: [PATCH 1/3] refactor: remove indexes --- server/preprocessing/other-scripts/base.R | 1 + 1 file changed, 1 insertion(+) diff --git a/server/preprocessing/other-scripts/base.R b/server/preprocessing/other-scripts/base.R index dbbebddf3..01619adba 100644 --- a/server/preprocessing/other-scripts/base.R +++ b/server/preprocessing/other-scripts/base.R @@ -248,6 +248,7 @@ etl <- function(res, repo, non_public) { subject_cleaned = gsub("(wikidata)?\\.org/entity/[qQ]([\\d]+)?", "", subject_cleaned) # remove wikidata classification subject_cleaned = gsub("", "", subject_cleaned) # remove subject_cleaned = gsub("\\[No keyword\\]", "", subject_cleaned) + subject_cleaned = gsub("\\[[^]]*\\]", "", subject_cleaned) # remove any text inside square brackets subject_cleaned = gsub("\\[[^\\[]+\\][^\\;]+(;|$)?", "", subject_cleaned) # remove classification subject_cleaned = gsub("[0-9]{2,} [A-Z]+[^;]*(;|$)?", "", subject_cleaned) #remove classification subject_cleaned = gsub(" -- ", "; ", subject_cleaned) #replace inconsistent keyword separation From 22b84797e80683d53084df3a2089c60477699a82 Mon Sep 17 00:00:00 2001 From: andrei Date: Mon, 5 Jan 2026 15:23:18 +0100 Subject: [PATCH 2/3] bugfix: test setup --- vis/test/component/citationmodal.test.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vis/test/component/citationmodal.test.tsx b/vis/test/component/citationmodal.test.tsx index 14a040d09..23fcd10d9 100644 --- a/vis/test/component/citationmodal.test.tsx +++ b/vis/test/component/citationmodal.test.tsx @@ -43,8 +43,9 @@ const getMockStoreData = (isStreamgraph: boolean) => { const getCitationText = (isStreamgraph: boolean) => { const mockStoreData = getMockStoreData(isStreamgraph); const citationTemplate = mockStoreData.localization.citation_template; + const currentYear = new Date().getFullYear(); const mockCitationStringData = { - year: "2025", + year: String(currentYear), type: isStreamgraph ? "Streamgraph" : "Knowledge Map", query: "climate change and impact", source: "http://localhost:3000/", @@ -53,7 +54,7 @@ const getCitationText = (isStreamgraph: boolean) => { return formatString(citationTemplate, mockCitationStringData).replace( " [].", - "." + ".", ); }; @@ -68,7 +69,7 @@ const setup = (isStreamgraph: boolean) => { - + , ); }; From 383780ef94b64fdc072ef7fd097fea4295f7d194 Mon Sep 17 00:00:00 2001 From: chreman Date: Thu, 29 Jan 2026 18:42:25 +0100 Subject: [PATCH 3/3] missing configs and parameters for snapshot functionality --- .../headstart/preprocessing/Snapshot.php | 3 +- server/preprocessing/conf/config.ini | 2 ++ server/services/getChartSVG.js | 6 +++- server/services/search.php | 3 ++ .../services/snapshot/data-config_aquanavi.js | 33 +++++++++++++++++++ server/services/snapshot/data-config_base.js | 2 ++ .../services/snapshot/data-config_openaire.js | 2 +- server/services/snapshot/data-config_orcid.js | 1 + .../services/snapshot/data-config_pubmed.js | 1 + .../services/snapshot/headstart_snapshot.php | 8 +++-- 10 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 server/services/snapshot/data-config_aquanavi.js diff --git a/server/classes/headstart/preprocessing/Snapshot.php b/server/classes/headstart/preprocessing/Snapshot.php index a395eacb1..79ddc98a9 100644 --- a/server/classes/headstart/preprocessing/Snapshot.php +++ b/server/classes/headstart/preprocessing/Snapshot.php @@ -28,9 +28,10 @@ public function __construct($ini_array, $query, $id, $service, $service_name, $v $snap_php = $ini_array["snapshot"]["snapshot_php"]; $storage = $ini_array["snapshot"]["storage_path"]; $nodemodules = $ini_array["snapshot"]["nodemodules_path"]; + $chrome_executable_path = $ini_array["snapshot"]["chrome_executable_path"]; $url = "{$host}{$snap_php}?{$url_postfix}"; - $this->cmd = "{$node_path} {$getsvg} \"{$url}\" {$storage}{$post_data['file']}.png {$nodemodules}"; + $this->cmd = "{$node_path} {$getsvg} \"{$url}\" {$storage}{$post_data['file']}.png {$nodemodules} {$chrome_executable_path}"; } public function takeSnapshot() { diff --git a/server/preprocessing/conf/config.ini b/server/preprocessing/conf/config.ini index ba2bbfd34..56de127b3 100644 --- a/server/preprocessing/conf/config.ini +++ b/server/preprocessing/conf/config.ini @@ -32,6 +32,8 @@ storage_path = "/path/to/storage/" snapshot_php = "server/services/snapshot/headstart_snapshot.php" # snapshot_local_protocol fallback for non-server environments snapshot_local_protocol = "http://" +# chrome executable path (optional, only needed if puppeteer cannot find chrome automatically) +chrome_executable_path = "/path/to/chrome" [connection] diff --git a/server/services/getChartSVG.js b/server/services/getChartSVG.js index 97db18b93..c382beef6 100644 --- a/server/services/getChartSVG.js +++ b/server/services/getChartSVG.js @@ -7,7 +7,11 @@ function timeout(ms) { (async() => { try { - const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox'] }); + const browser = await puppeteer.launch({ + headless: true, + args: ['--no-sandbox', '--disable-setuid-sandbox'], + executablePath: process.argv[5] + }); await timeout(1000) const page = await browser.newPage(); await timeout(1000) diff --git a/server/services/search.php b/server/services/search.php index 957952ccb..5fdf8b81d 100644 --- a/server/services/search.php +++ b/server/services/search.php @@ -221,6 +221,9 @@ function search( } else { $vis_type = "overview"; } + if (isset($post_params["vis_type"]) && $post_params["vis_type"] == "geomap") { + $vis_type = "geomap"; + } $snapshot = new \headstart\preprocessing\Snapshot($ini_array, $query, $unique_id, $service, $repo2snapshot[$service], $vis_type); $snapshot->takeSnapshot(); } diff --git a/server/services/snapshot/data-config_aquanavi.js b/server/services/snapshot/data-config_aquanavi.js new file mode 100644 index 000000000..e96ea58eb --- /dev/null +++ b/server/services/snapshot/data-config_aquanavi.js @@ -0,0 +1,33 @@ +var data_config = { + tag: "visualization", + mode: "search_repos", + + service: "base", + + title: "", + base_unit: "citations", + use_area_uri: true, + show_multiples: false, + show_dropdown: false, + preview_type: "pdf", + sort_options: ["relevance", "title", "authors", "year"], + is_force_areas: true, + language: "eng_pubmed", + area_force_alpha: 0.015, + show_list: true, + content_based: true, + url_prefix: "https://www.base-search.net/Record/", + + show_context: true, + create_title_from_context: true, + context_most_relevant_tooltip: true, + + doi_outlink: true, + filter_menu_dropdown: true, + sort_menu_dropdown: true, + filter_options: ["all", "open_access"], + //show number of open access documents in context + show_context_oa_number: false, + + visualization_type: "geomap", // Used in the reducer named "chartType" to determine the visualization type: overview, timeline, geomap +}; diff --git a/server/services/snapshot/data-config_base.js b/server/services/snapshot/data-config_base.js index aae557785..129e3c2b7 100644 --- a/server/services/snapshot/data-config_base.js +++ b/server/services/snapshot/data-config_base.js @@ -28,4 +28,6 @@ var data_config = { filter_options: ["all", "open_access"], //show number of open access documents in context show_context_oa_number: false, + + visualization_type: "overview", // Used in the reducer named "chartType" to determine the visualization type: overview, timeline, geomap }; diff --git a/server/services/snapshot/data-config_openaire.js b/server/services/snapshot/data-config_openaire.js index 6c7105734..0075c4c28 100644 --- a/server/services/snapshot/data-config_openaire.js +++ b/server/services/snapshot/data-config_openaire.js @@ -64,5 +64,5 @@ var data_config = { cited_by_tweeters_count: 'tweets', 'readers.mendeley': 'readers' }, - + visualization_type: "overview", // Used in the reducer named "chartType" to determine the visualization type: overview, timeline, geomap }; diff --git a/server/services/snapshot/data-config_orcid.js b/server/services/snapshot/data-config_orcid.js index 49ac74440..818f79e89 100644 --- a/server/services/snapshot/data-config_orcid.js +++ b/server/services/snapshot/data-config_orcid.js @@ -28,4 +28,5 @@ var data_config = { filter_options: ["all", "open_access"], //show number of open access documents in context show_context_oa_number: false, + visualization_type: "overview", // Used in the reducer named "chartType" to determine the visualization type: overview, timeline, geomap }; diff --git a/server/services/snapshot/data-config_pubmed.js b/server/services/snapshot/data-config_pubmed.js index 481c63580..bdf3902ce 100644 --- a/server/services/snapshot/data-config_pubmed.js +++ b/server/services/snapshot/data-config_pubmed.js @@ -34,4 +34,5 @@ var data_config = { filter_menu_dropdown: true, sort_menu_dropdown: true, filter_options: ["all", "open_access"], + visualization_type: "overview", // Used in the reducer named "chartType" to determine the visualization type: overview, timeline, geomap }; diff --git a/server/services/snapshot/headstart_snapshot.php b/server/services/snapshot/headstart_snapshot.php index aad65271f..4c3a7304b 100644 --- a/server/services/snapshot/headstart_snapshot.php +++ b/server/services/snapshot/headstart_snapshot.php @@ -11,6 +11,7 @@