Skip to content

Commit

Permalink
fix(graph): Correct graph
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Feb 8, 2024
1 parent 5041507 commit 0e79ce4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Glossaire from './pages/About/Glossaire';
import Methodology from './pages/About/Methodology';
import OpenData from './pages/About/OpenData';
import BaroNational from './pages/BaroNational';
import NationalOrcid from './pages/BaroNational/NationalOrcid';
import NationalPublications from './pages/BaroNational/NationalPublications';
import NationalResearchData from './pages/BaroNational/NationalResearchData';
import NationalSoftwareCode from './pages/BaroNational/NationalSoftwareCode';
Expand All @@ -28,6 +27,7 @@ import Policy from './pages/Declinaisons/Policy';
import Variations from './pages/Declinaisons/Variations';
import Error404 from './pages/Error404';
import Integration from './pages/Integration';
import NationalOrcid from './pages/NationalOrcid';
import Project from './pages/Project';
import messagesEN from './translations/en.json';
import messagesFR from './translations/fr.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ import React from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { useLocation } from 'react-router-dom';

import Banner from '../../../components/Banner';
import BSOChart from '../../../components/Charts';
import Chip from '../../../components/Chip';
import GlossaryFormattedMessage from '../../../components/Glossary/GlossaryFormattedMessage';
import GraphNavigation from '../../../components/GraphNavigation';
import GraphContent from '../../../components/GraphNavigation/GraphContent';
import GraphItem from '../../../components/GraphNavigation/GraphItem';
import Icon from '../../../components/Icon';
import QuestionSection from '../../../components/question-section';
import ScrollTop from '../../../components/ScrollTop';
import { mobileButtonLabel } from '../../../utils/constants';
import { getCSSValue, isInProduction } from '../../../utils/helpers';
import useLang from '../../../utils/Hooks/useLang';
import Banner from '../../components/Banner';
import BSOChart from '../../components/Charts';
import Chip from '../../components/Chip';
import GlossaryFormattedMessage from '../../components/Glossary/GlossaryFormattedMessage';
import GraphNavigation from '../../components/GraphNavigation';
import GraphContent from '../../components/GraphNavigation/GraphContent';
import GraphItem from '../../components/GraphNavigation/GraphItem';
import Icon from '../../components/Icon';
import QuestionSection from '../../components/question-section';
import ScrollTop from '../../components/ScrollTop';
import { mobileButtonLabel } from '../../utils/constants';
import { getCSSValue, isInProduction } from '../../utils/helpers';
import useLang from '../../utils/Hooks/useLang';

export default function NationalOrcid() {
const intl = useIntl();
Expand Down Expand Up @@ -82,7 +82,10 @@ export default function NationalOrcid() {
</Container>
</Row>
<Row>
<GraphNavigation mobileTitleIntl={mobileButtonLabel[lang][pathname]}>
<GraphNavigation
mobileTitleIntl={mobileButtonLabel[lang][pathname]}
isDisplayed={!isInProduction()}
>
{/* Général */}
<GraphItem
mainLabel={intl.formatMessage({ id: 'app.orcid.general' })}
Expand All @@ -107,6 +110,7 @@ export default function NationalOrcid() {
},
},
]}
isDisplayed={!isInProduction()}
>
<GraphContent>
<QuestionSection
Expand All @@ -115,10 +119,19 @@ export default function NationalOrcid() {
glossaryKeys={['embargo', 'barriere-mobile']}
intlKey='app.national-orcid.general.users'
>
<BSOChart
id='orcid.general.chart-indicator-these-year'
isDisplayed={!isInProduction()}
/>
<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'
isDisplayed={!isInProduction()}
/>
<BSOChart
id='orcid.general.chart-indicator-these-discipline'
isDisplayed={!isInProduction()}
/>
<BSOChart id='orcid.general.chart-indicator-active' />
</QuestionSection>
<QuestionSection
Expand Down
8 changes: 4 additions & 4 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1266,16 +1266,16 @@
"app.national-data.general.creation.title": "What is the trend of data production in publications in France?",
"app.national-data.general.partage.title": "What is the trend of data sharing in publications in France?",
"app.national-data.general.statement.title": "Do publications include a section on data availability?",
"app.national-data.general.voies-ouverture.chart-data-used.title": "Proportion of publications {commentsName} that mention the use of data",
"app.national-data.general.voies-ouverture.chart-data-used.title": "Proportion of publications {commentsName} that mention the use of data by publication year",
"app.national-data.general.voies-ouverture.chart-data-used.tooltip": "<b>Publication year {point.x}</b><br>{point.y:.2f}% of publications ((commentsName)) mention a use of data<br>({point.y_abs} / {point.y_tot} publications analyzed and {point.y_unk} publications where the detection has not been done)",
"app.national-data.general.voies-ouverture.chart-data-used.comments": "This graph shows, by publication year, the proportion of publications for which a mention of data use was detected, among the analyzed publications. This detection is achieved through an automatic analysis of the full text by the DataStet tool.",
"app.national-data.general.voies-ouverture.chart-data-created.title": "Proportion of publications {commentsName} that mention having produced their data",
"app.national-data.general.voies-ouverture.chart-data-created.title": "Proportion of publications {commentsName} that mention having produced their data by publication year",
"app.national-data.general.voies-ouverture.chart-data-created.tooltip": "<b>Publication year {point.x}</b><br>{point.y:.2f}% of publications ((commentsName)) mention a data production<br>({point.y_abs} / {point.y_tot} publications using data)",
"app.national-data.general.voies-ouverture.chart-data-created.comments": "This graph shows, by publication year, the proportion of publications for which a mention of data production has been detected, among the publications that use data. This detection is achieved through an automatic analysis of the full text by the DataStet tool.",
"app.national-data.general.voies-ouverture.chart-data-shared.title": "Proportion of publications {commentsName} that mention the sharing of their data",
"app.national-data.general.voies-ouverture.chart-data-shared.title": "Proportion of publications {commentsName} that mention the sharing of their data by publication year",
"app.national-data.general.voies-ouverture.chart-data-shared.tooltip": "<b>Publication year {point.x}</b><br>{point.y:.2f}% of publications ((commentsName)) mention the sharing of their data<br>({point.y_abs} / {point.y_tot} publications producing data)",
"app.national-data.general.voies-ouverture.chart-data-shared.comments": "This graph shows, by publication year, the proportion of publications for which a mention of data sharing has been detected, among the publications that mention data production. This detection is achieved through an automatic analysis of the full text by the DataStet tool.",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.title": "Proportion of publications in France that mention data sharing among the analyzed publications",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.title": "Proportion of publications in France that mention data sharing among the analyzed publications by publication year",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.tooltip": "<b>Publication year {point.x}</b><br>{point.y:.2f} % of publications ((commentsName)) mention a data sharing<br>({point.y_abs} / {point.y_tot} publications analyzed and {point.y_unk} publications where the detection has not been done)",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.comments": "This graph shows, by publication year, the proportion of publications for which a mention of data sharing has been detected, among the analyzed publications. This detection is achieved through an automatic analysis of the full text by the DataStet tool.",
"app.national-data.general.voies-ouverture.chart-availibility.title": "Proportion of publications {commentsName} that include a \"Data Availability Statement\" section",
Expand Down
8 changes: 4 additions & 4 deletions src/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@
"app.national-data.general.creation.title": "Quelle est la dynamique de production de données dans les publications en France ?",
"app.national-data.general.partage.title": "Quelle est la dynamique de partage des données dans les publications en France ?",
"app.national-data.general.statement.title": "Les publications comportent-elles une section sur la disponibilité des données ?",
"app.national-data.general.voies-ouverture.chart-data-used.title": "Proportion de publications {commentsName} qui mentionnent l'utilisation de données",
"app.national-data.general.voies-ouverture.chart-data-used.title": "Proportion de publications {commentsName} qui mentionnent l'utilisation de données par année de publication",
"app.national-data.general.voies-ouverture.chart-data-used.tooltip": "<b>Année de publication {point.x}</b><br>{point.y:.2f} % des publications ((commentsName)) mentionnent l'utilisation de données<br>({point.y_abs} / {point.y_tot} publications analysées et {point.y_unk} publications pour lesquelles la détection n'a pas été effectuée)",
"app.national-data.general.voies-ouverture.chart-data-used.comments": "Ce graphique montre, par année de publication, la proportion de publications pour lesquelles une mention d'utilisation de données a été détectée parmi les publications analysées. Cette détection est réalisée grâce à une analyse automatique du texte intégral par l'outil DataStet.",
"app.national-data.general.voies-ouverture.chart-data-created.title": "Proportion de publications {commentsName} qui mentionnent avoir produit leurs données",
"app.national-data.general.voies-ouverture.chart-data-created.title": "Proportion de publications {commentsName} qui mentionnent avoir produit leurs données par année de publication",
"app.national-data.general.voies-ouverture.chart-data-created.tooltip": "<b>Année de publication {point.x}</b><br>{point.y:.2f} % des publications ((commentsName)) mentionnent la production de données<br>({point.y_abs} / {point.y_tot} publications qui mentionnent l'utilisation de données)",
"app.national-data.general.voies-ouverture.chart-data-created.comments": "Ce graphique montre, par année de publication, la proportion de publications pour lesquelles une mention de production de données a été détectée, parmi les publications qui mentionnent l'utilisation de données. Cette détection est réalisée grâce à une analyse automatique du texte intégral par l'outil DataStet.",
"app.national-data.general.voies-ouverture.chart-data-shared.title": "Proportion de publications {commentsName} qui mentionnent le partage de leurs données",
"app.national-data.general.voies-ouverture.chart-data-shared.title": "Proportion de publications {commentsName} qui mentionnent le partage de leurs données par année de publication",
"app.national-data.general.voies-ouverture.chart-data-shared.tooltip": "<b>Année de publication {point.x}</b><br>{point.y:.2f} % des publications ((commentsName)) mentionnent le partage de leurs données<br>({point.y_abs} / {point.y_tot} publications qui mentionnent la production de données)",
"app.national-data.general.voies-ouverture.chart-data-shared.comments": "Ce graphique montre, par année de publication, la proportion de publications pour lesquelles une mention de partage de données a été détectée, parmi les publications qui mentionnent la production de données. Cette détection est réalisée grâce à une analyse automatique du texte intégral par l'outil DataStet.",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.title": "Proportion de publications françaises qui mentionnent le partage de données parmi les publications analysées",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.title": "Proportion de publications françaises qui mentionnent le partage de données parmi les publications analysées par année de publication",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.tooltip": "<b>Année de publication {point.x}</b><br>{point.y:.2f} % des publications ((commentsName)) mentionnent le partage de données<br>({point.y_abs} / {point.y_tot} publications analysées et {point.y_unk} publications pour lesquelles la détection n'a pas été effectuée)",
"app.national-data.general.voies-ouverture.chart-data-shared-among-all.comments": "Ce graphique montre, par année de publication, la proportion de publications pour lesquelles une mention de partage de données a été détectée, parmi l'ensemble des publications analysées. Cette détection est réalisée grâce à une analyse automatique du texte intégral par l'outil DataStet.",
"app.national-data.general.voies-ouverture.chart-availibility.title": "Proportion de publications {commentsName} qui incluent une section \"Data Availability Statement\" (déclaration sur la mise à disposition des données)",
Expand Down
10 changes: 4 additions & 6 deletions src/utils/chartOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ export const chartOptions = {
dataLabels: {
allowOverlap: true,
enabled: true,
format: '{point.y:.0f} %',
format: '{point.y:.1f} %',
style: {
color: getCSSValue('--g-800'),
fontSize: '20px',
Expand Down Expand Up @@ -702,7 +702,7 @@ export const chartOptions = {
this.point.category === last.category
&& this.point.y === last.y
) {
return this.point.y.toFixed(0).concat(' %');
return this.point.y.toFixed(1).concat(' %');
}
return '';
},
Expand Down Expand Up @@ -3849,9 +3849,6 @@ export const chartOptions = {
};
options.yAxis = getPercentageYAxis();
options.yAxis.title.text = intl.formatMessage({ id: 'app.availibility' });
options.legend.title.text = intl.formatMessage({
id: 'app.publi.type-hebergement',
});
options.legend.enabled = false;
options.plotOptions = {
series: {
Expand Down Expand Up @@ -3890,7 +3887,7 @@ export const chartOptions = {
options.yAxis.title.text = intl.formatMessage({
id: 'app.orcid.nb-cumulated',
});
options.legend.title.text = null;
options.legend.enabled = false;
options.plotOptions = {
column: {
stacking: 'normal',
Expand All @@ -3903,6 +3900,7 @@ export const chartOptions = {
},
};
options.series = data;
options.exporting.chartOptions.legend.enabled = false;
return options;
},
},
Expand Down

0 comments on commit 0e79ce4

Please sign in to comment.