Skip to content

Commit

Permalink
feat: add velo
Browse files Browse the repository at this point in the history
  • Loading branch information
desoindx committed Jan 3, 2025
1 parent bd7464d commit 0baaeb4
Show file tree
Hide file tree
Showing 18 changed files with 162 additions and 41 deletions.
3 changes: 2 additions & 1 deletion app/api/v1/transport/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const computeTransportEmission = (
* - 4 : Voiture thermique
* - 5 : Voiture électrique
* - 6 : Autocar thermique
* - 7 : Vélo ou marche
* - 7 : Vélo
* - 8 : Vélo à assistance électrique
* - 9 : Bus thermique
* - 10 : Tramway
Expand All @@ -166,6 +166,7 @@ export const computeTransportEmission = (
* - 27 : Covoiturage électrique (2 passagers)
* - 28 : Covoiturage électrique (3 passagers)
* - 29 : Covoiturage électrique (4 passagers)
* - 30 : Marche
* - in: query
* name: ignoreRadiativeForcing
* default: 0
Expand Down
3 changes: 2 additions & 1 deletion npm/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ Liste des équivalents à comparer parmis la liste suivante :
- voitureelectrique+3 : km en voiture électrique avec 3 passagers
- voitureelectrique+4 : km en voiture électrique avec 4 passagers
- autocar : km en autocar thermique
- velo : vélo ou marche
- velo : vélo mécanique
- marche : marche
- veloelectrique : km en vélo à assistance électrique
- trottinette : km en trottinette à assistance électrique
- busthermique : km en bus thermique
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"devDependencies": {
"@babel/cli": "^7.25.9",
"@babel/core": "^7.26.0",
"@babel/helper-split-export-declaration": "^7.24.7",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"@babel/preset-typescript": "^7.26.0",
Expand Down
47 changes: 47 additions & 0 deletions public/icons/marche.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 37 additions & 29 deletions public/icons/velo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/meta/marche-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/meta/marche-es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/meta/marche-fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/meta/velo-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/meta/velo-es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/meta/velo-fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions src/components/shareable/overScreens/Data/TransportData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ const FRTransportData = () => {
avions. Les impacts de l’aviation varient selon les hypothèses retenues sur ces traînées et leur persistance.
</p>
</div>
<h2 className={styles.title}>Vélo mécanique</h2>
<div className={styles.content}>
<p>
Similaire au vélo à assistance électrique, une hypothèse de durée de vie de <b>12 ans</b> et une distance
parcourue de <b>30 000 km</b>. En éliminant l'impact lié au moteur, à la batterie, et aux systèmes
électroniques d’un vélo électrique, un vélo mécanique avec un cadre aluminium, partage la majorité de ses
composantes avec le vélo à assistance électrique. L'empreinte carbone d'un vélo mécanique est estimée à 
<b>5,19 kg CO₂</b>. L’énergie calorique utilisée par le cycliste pour pédaler le vélo n’est pas prise en
compte.
</p>
</div>
<div className={styles.content}>
<p>
Vous avez une question ? Vous souhaitez aller plus loin dans la compréhension ?{' '}
Expand Down Expand Up @@ -228,6 +239,17 @@ const ESTransportData = () => {
persistencia.
</p>
</div>
<h2 className={styles.title}>Bicicleta mecánica</h2>
<div className={styles.content}>
<p>
Similar a la bicicleta asistida eléctricamente, se asume una vida útil de <b>12 años</b> y una distancia
recorrida de <b>30 000 km</b>. Eliminando el impacto relacionado con el motor, la batería y los sistemas
electrónicos de una bicicleta eléctrica, una bicicleta mecánica con un cuadro de aluminio comparte la mayoría
de sus componentes con la bicicleta asistida eléctricamente. La huella de carbono de una bicicleta mecánica se
estima en <b>5,19 kg CO₂</b>. La energía calórica utilizada por el ciclista para pedalear la bicicleta no se
tiene en cuenta.
</p>
</div>
<div className={styles.content}>
<p>
¿Tienes alguna pregunta? ¿Quieres saber más?{' '}
Expand Down Expand Up @@ -346,6 +368,16 @@ const ENTransportData = () => {
about these contrails and their persistence.
</p>
</div>
<h2 className={styles.title}>Mechanical Bicycle</h2>
<div className={styles.content}>
<p>
Similar to the electrically assisted bicycle, an assumed lifespan of <b>12 years</b> and a distance traveled
of <b>30,000 km</b>. By eliminating the impact related to the motor, battery, and electronic systems of an
electric bicycle, a mechanical bicycle with an aluminum frame shares most of its components with the
electrically assisted bicycle. The carbon footprint of a mechanical bicycle is estimated at <b>5.19 kg CO₂</b>
. The caloric energy used by the cyclist to pedal the bicycle is not taken into account.
</p>
</div>
<div className={styles.content}>
<p>
You have a question ? Do you want to go further in understanding?{' '}
Expand Down
22 changes: 20 additions & 2 deletions src/data/categories/deplacement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,36 @@ export const deplacements = [
min: 16,
},
},
{
id: 30,
synonyms: ['marcher'],
slug: 'marche',
type: 'foot',
category: 4,
default: true,
tile: false,
total: 0,
display: {
max: 30,
},
},
{
id: 7,
synonyms: ['marcher', 'pedaler'],
synonyms: ['pedaler'],
slug: 'velo',
type: 'foot',
category: 4,
total: 0,
default: true,
tile: false,
display: {
max: 30,
},
ecv: [
{
id: 5,
value: 0.00017,
},
],
},
{
id: 8,
Expand Down
15 changes: 11 additions & 4 deletions src/utils/Equivalent/values.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,19 @@
"en": "km by ;combustion coach",
"es": "km en ;autocar termico"
},
"velo": {
"marche": {
"category": 4,
"value": 0,
"fr": "vélo ou marche",
"en": "bicycle or walking",
"es": "Bicicleta o a pie"
"fr": "Marche",
"en": "Walking",
"es": "A pie"
},
"velo": {
"category": 4,
"value": 17,
"fr": "km en ;Vélo mécanique",
"en": "km by ;Mechanical bike",
"es": "km en ;Bicicleta mecanica"
},
"veloelectrique": {
"category": 4,
Expand Down
3 changes: 2 additions & 1 deletion testa/getEmissionPerDistance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ describe('getEmissionPerDistance', () => {
id: 6,
name: 'Autocar thermique',
},
{ id: 7, name: 'Vélo ou marche', emissions: { gco2e: 0, kgco2e: 0, tco2e: 0 } },
{ id: 30, name: 'Marche', emissions: { gco2e: 0, kgco2e: 0, tco2e: 0 } },
{ id: 7, name: 'Vélo mécanique', emissions: { gco2e: 0, kgco2e: 0, tco2e: 0 } },
{
id: 8,
name: 'Vélo à assistance électrique',
Expand Down
7 changes: 6 additions & 1 deletion testa/transport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ describe('transport', () => {
},
{
id: 7,
name: 'Vélo ou marche',
name: 'Vélo mécanique',
value: 0,
},
{
id: 30,
name: 'Marche',
value: 0,
},
{
Expand Down
2 changes: 1 addition & 1 deletion teste/distance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test('Transport distance default values', async ({ page }) => {
timeout: 60000,
})
await expect(page.getByTestId('comparison-tile-0')).toHaveText(
'Vélo ou marche0 kg CO₂eMoyen le plus écologique2.18Kg CO₂eévités'
'Vélo mécanique0 kg CO₂eMoyen le plus écologique2.18Kg CO₂eévités'
)
await expect(page.getByTestId('comparison-tile-1')).toHaveText('Voiture thermique2.18 kg CO₂e')

Expand Down
Loading

0 comments on commit 0baaeb4

Please sign in to comment.