Skip to content

Commit

Permalink
feat(networks): add countries tab
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Oct 4, 2024
1 parent 0111306 commit f51942e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
4 changes: 3 additions & 1 deletion client/src/api/networks/network/communities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ const communityGetNodesInfos = (hits: ElasticHits, model: string): any =>
{}
)
hit?.[field].forEach((node) => {
const id = nodeGetId(node[CONFIG[model].field.split(".")[1]])
const key = node[CONFIG[model].field.split(".")[1]]
if (!key) return
const id = nodeGetId(key)
acc[id] = {
...acc?.[id],
publicationsCount: acc?.[id]?.publicationsCount ? acc[id].publicationsCount + 1 : 1,
Expand Down
18 changes: 17 additions & 1 deletion client/src/api/networks/network/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const CONFIG = {
url: (key: string) => `/projects/${key}`,
terminology: {
item: "project",
items: "project",
items: "projects",
link: "co-projects link",
links: "co-projects links",
cluster: "community",
Expand All @@ -98,6 +98,22 @@ export const CONFIG = {
total_link_strength: "co-publications links",
},
},
countries: {
field: "affiliations.country",
aggregation: "affiliations.country.keyword",
co_aggregation: "co_countries.keyword",
url: (_: string, label: string) => `/search/publications?q="${label.replace(/ /g, "+")}"`,
terminology: {
item: "country",
items: "countries",
link: "co-countries link",
links: "co-countries links",
cluster: "community",
clusters: "communities",
link_strength: "co-publications",
total_link_strength: "co-publications links",
},
},
}

const configGetItemDescription = () =>
Expand Down
5 changes: 5 additions & 0 deletions client/src/pages/networks/config/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const NETWORK_TABS_MAPPING = {
label: "projects",
icon: "briefcase-line",
},
countries: {
index: 6,
label: "countries",
icon: "earth-line",
},
}

export const networkTabs = Object.values(NETWORK_TABS_MAPPING).sort((a, b) => a.index - b.index)
Expand Down
7 changes: 6 additions & 1 deletion client/src/pages/networks/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"networks.home.title.domains": "Explore thematic networks in research and innovation through scientific publications",
"networks.home.title.software": "Explore software networks in research and innovation through scientific publications",
"networks.home.title.projects": "Explore software networks in research and innovation through scientific publications",
"networks.home.title.countries": "Explore software networks in research and innovation through scientific publications",
"networks.header.title": "Visualization of networks through a publications analysis",
"networks.header.title.perimeter": "of the perimeter",
"networks.header.subtitle": "Estimated on the basis of co-signatures / co-appearances in the corpus of publications corresponding to the research carried out",
Expand All @@ -19,6 +20,7 @@
"networks.header.tab.domains": "Themes",
"networks.header.tab.software": "Software",
"networks.header.tab.projects": "Projects",
"networks.header.tab.countries": "Countries",
"networks.clusters.button.rm": "Hide communities* information",
"networks.clusters.button.add": "Display communities* information",
"networks.clusters.button.description": "* Using the Louvain method. Community labels are then calculated by generative AI from the community's corpus of publications.",
Expand Down Expand Up @@ -67,12 +69,14 @@
"networks.analytics.clusters.size.title.domains": "Number of themes",
"networks.analytics.clusters.size.title.software": "Number of software",
"networks.analytics.clusters.size.title.projects": "Number of projects",
"networks.analytics.clusters.size.title.countries": "Number of countries",
"networks.analytics.clusters.size.description.authors": "Number of authors per community",
"networks.analytics.clusters.size.description.institutions": "Number of institutions per community",
"networks.analytics.clusters.size.description.structures": "Number of structures per community",
"networks.analytics.clusters.size.description.domains": "Number of themes per community",
"networks.analytics.clusters.size.description.software": "Number of software per community",
"networks.analytics.clusters.size.description.projects": "Number of projects per community",
"networks.analytics.clusters.size.description.countries": "Number of countries per community",
"networks.analytics.clusters.publications.title": "Number of publications",
"networks.analytics.clusters.publications.description": "Number of publications per community",
"networks.analytics.clusters.oa.title": "Open access rate",
Expand All @@ -86,7 +90,8 @@
"networks.section.clusters.structures": "{count, plural, one {# Structures community} other {Structures communities (#)}}",
"networks.section.clusters.domains": "{count, plural, one {# Domains community} other {Themes communities (#)}}",
"networks.section.clusters.software": "{count, plural, one {# Software community} other {Software communities (#)}}",
"networks.section.clusters.projects": "{count, plural, one {# Project community} other {Projects communities (#)}}",
"networks.section.clusters.projects": "{count, plural, one {# Projects community} other {Projects communities (#)}}",
"networks.section.clusters.countries": "{count, plural, one {# Countries community} other {Countries communities (#)}}",
"networks.section.clusters.open-modal-button": "See full list",
"networks.section.clusters.last-activity": "Last publication",
"networks.section.clusters.citations": "{count, plural, one {# Citation} other {# Citations}}",
Expand Down
5 changes: 5 additions & 0 deletions client/src/pages/networks/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"networks.home.title.domains": "Au travers des publications scientifiques, Explorer les réseaux de thématiques de la recherche et de l'innovation",
"networks.home.title.software": "Au travers des publications scientifiques, Explorer les réseaux de logiciels de la recherche et de l'innovation",
"networks.home.title.projects": "Au travers des publications scientifiques, Explorer les réseaux de logiciels de la recherche et de l'innovation",
"networks.home.title.countries": "Au travers des publications scientifiques, Explorer les réseaux de logiciels de la recherche et de l'innovation",
"networks.header.title": "Visualisation des réseaux via une analyse des publications",
"networks.header.title.perimeter": "du périmètre",
"networks.header.subtitle": "Estimé à partir des co-signatures / co-apparitions dans le corpus de publications correspondant à la recherche effectuée",
Expand All @@ -19,6 +20,7 @@
"networks.header.tab.domains": "Thématiques",
"networks.header.tab.software": "Logiciels",
"networks.header.tab.projects": "Projets",
"networks.header.tab.countries": "Pays",
"networks.clusters.button.rm": "Masquer les informations des communautés*",
"networks.clusters.button.add": "Afficher les informations des communautés*",
"networks.clusters.button.description": "* Par la méthode de Louvain. Les labels des communautés sont ensuite calculés par IA générative à partir du corpus des publications de la communauté.",
Expand Down Expand Up @@ -67,12 +69,14 @@
"networks.analytics.clusters.size.title.domains": "Nombre de thématiques",
"networks.analytics.clusters.size.title.software": "Nombre de logiciels",
"networks.analytics.clusters.size.title.projects": "Nombre de projets",
"networks.analytics.clusters.size.title.countries": "Nombre de pays",
"networks.analytics.clusters.size.description.authors": "Nombre d'auteurs par communauté",
"networks.analytics.clusters.size.description.institutions": "Nombre d'établissements par communauté",
"networks.analytics.clusters.size.description.structures": "Nombre de laboratoires par communauté",
"networks.analytics.clusters.size.description.domains": "Nombre de thématiques par communauté",
"networks.analytics.clusters.size.description.software": "Nombre de logiciels par communauté",
"networks.analytics.clusters.size.description.projects": "Nombre de projets par communauté",
"networks.analytics.clusters.size.description.countries": "Nombre de pays par communauté",
"networks.analytics.clusters.publications.title": "Nombre de publications",
"networks.analytics.clusters.publications.description": "Nombre de publications par communauté",
"networks.analytics.clusters.oa.title": "Pourcentage d'accès ouvert",
Expand All @@ -87,6 +91,7 @@
"networks.section.clusters.domains": "{count, plural, one {# Communauté de thématiques} other {Communautés de thématiques (#)}}",
"networks.section.clusters.software": "{count, plural, one {# Communauté de logiciels} other {Communautés de logiciels (#)}}",
"networks.section.clusters.projects": "{count, plural, one {# Communauté de projets} other {Communautés de projets (#)}}",
"networks.section.clusters.countries": "{count, plural, one {# Communauté de pays} other {Communautés de pays (#)}}",
"networks.section.clusters.open-modal-button": "Voir la liste complète",
"networks.section.clusters.last-activity": "Dernière publication",
"networks.section.clusters.citations": "{count, plural, one {# Citation} other {# Citations}}",
Expand Down

0 comments on commit f51942e

Please sign in to comment.