Skip to content

Commit

Permalink
feat(gaph): Add number of ORCID who defended a thesis in France
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Feb 5, 2024
1 parent c67cd02 commit b4b19e5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 10 deletions.
50 changes: 41 additions & 9 deletions src/components/Charts/orcid/general/get-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,22 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) {
objectType: ['orcid'],
});
queries.push(Axios.post(ES_ORCID_API_URL, query3, HEADERS));
const query4 = getFetchOptions({
key: 'orcidNumberWithFilter',
domain,
parameters: [
'year',
['address', 'employment', 'education'],
'has_these',
],
objectType: ['orcid'],
});
queries.push(Axios.post(ES_ORCID_API_URL, query4, HEADERS));
const res = await Axios.all(queries);
const data1 = res[0].data.aggregations.orcid_per_year.buckets;
const data2 = res[1].data.aggregations.orcid_per_year.buckets;
const data3 = res[2].data.aggregations.orcid_per_year.buckets;
const data4 = res[3].data.aggregations.orcid_per_year.buckets;
const dataGraph2 = [
{
data: data3.map((item) => ({
Expand All @@ -57,14 +69,8 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) {
},
];
const bsoDomain = intl.formatMessage({ id: `app.bsoDomain.${domain}` });
const categories = [];
const total = [];
const employment = [];
const noOutline = {
style: {
textOutline: 'none',
},
};
const categories = [];
data1.forEach((el) => {
const currentDate = Highcharts.dateFormat(
'%Y',
Expand All @@ -79,6 +85,7 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) {
bsoDomain,
});
});
const employment = [];
data2.forEach((el) => {
const currentDate = Highcharts.dateFormat(
'%Y',
Expand All @@ -92,6 +99,20 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) {
y_current: el.distinct_orcid.value,
});
});
const thesis = [];
data4.forEach((el) => {
const currentDate = Highcharts.dateFormat(
'%Y',
new Date(el.key_as_string).getTime(),
);
thesis.push({
bsoDomain,
creation_date: currentDate,
x: thesis.length,
y: el.total_orcid.value,
y_current: el.distinct_orcid.value,
});
});

const comments = {
beforeLastObservationSnap: getObservationLabel(
Expand All @@ -111,7 +132,7 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) {
data: total,
turboThreshold: 0,
color: getCSSValue('--green-light-125'),
dataLabels: noOutline,
dataLabels: { style: { textOutline: 'none' } },
},
{
name: capitalize(
Expand All @@ -122,7 +143,18 @@ function useGetData(beforeLastObservationSnap, observationSnap, domain) {
data: employment,
turboThreshold: 0,
color: getCSSValue('--affiliations-etablissements-125'),
dataLabels: noOutline,
dataLabels: { style: { textOutline: 'none' } },
},
{
name: capitalize(
intl.formatMessage({
id: 'app.orcid.thesis-count',
}),
),
data: thesis,
turboThreshold: 0,
color: getCSSValue('--thesesfr'),
dataLabels: { style: { textOutline: 'none' } },
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/pages/BaroNational/NationalOrcid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ export default function NationalOrcid() {
intlKey='app.national-orcid.general.users'
>
<BSOChart id='orcid.general.chart-evolution' />
<BSOChart id='orcid.general.creation-by-year' />
<BSOChart id='orcid.general.chart-indicator-these-year' />
<BSOChart id='orcid.general.chart-indicator-these-discipline' />
<BSOChart id='orcid.general.creation-by-year' />
<BSOChart id='orcid.general.chart-indicator-active' />
</QuestionSection>
<QuestionSection
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,7 @@
"app.orcid.nb": "Number of ORCID accounts",
"app.orcid.count": "Total number of French ORCID to-date",
"app.orcid.employment-count": "Total number of ORCID with a French employement to-date",
"app.orcid.thesis-count": "Total ORCIDs who defended a thesis in France",
"app.orcid.creation-date": "ORCID account creation date",
"app.orcid.these-proportion": "Proportion of French PhD that have an ORCID",
"app.orcid.general": "General",
Expand Down
1 change: 1 addition & 0 deletions src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,7 @@
"app.orcid.address": "ORCID déclarant une adresse en France",
"app.orcid.count": "Total ORCID français à date",
"app.orcid.employment-count": "Total ORCID avec employeur français à date",
"app.orcid.thesis-count": "Total ORCID ayant soutenu une thèse en France",
"app.orcid.nb": "Nombre de comptes ORCID",
"app.orcid.perc": "Proportion de comptes ORCID",
"app.orcid.creation-date": "Date de création de l'ORCID",
Expand Down

0 comments on commit b4b19e5

Please sign in to comment.