diff --git a/front/package-lock.json b/front/package-lock.json index 90ed92f2782..91dd869059b 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -14,11 +14,11 @@ "@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0", "@osrd-project/netzgrafik-frontend": "0.0.0-snapshot.37949a66933e8e1552c9b8e54f702ec491afd415", "@osrd-project/ui-core": "^0.0.61", - "@osrd-project/ui-icons": "^0.0.59", - "@osrd-project/ui-manchette": "^0.0.59", - "@osrd-project/ui-manchette-with-spacetimechart": "^0.0.59", - "@osrd-project/ui-spacetimechart": "^0.0.59", - "@osrd-project/ui-speedspacechart": "^0.0.59", + "@osrd-project/ui-icons": "^0.0.61", + "@osrd-project/ui-manchette": "^0.0.61", + "@osrd-project/ui-manchette-with-spacetimechart": "^0.0.61", + "@osrd-project/ui-spacetimechart": "^0.0.61", + "@osrd-project/ui-speedspacechart": "^0.0.61", "@react-pdf/renderer": "^4.1.6", "@redux-devtools/extension": "^3.3.0", "@reduxjs/toolkit": "^2.5.0", @@ -1970,6 +1970,7 @@ "version": "0.0.61", "resolved": "https://registry.npmjs.org/@osrd-project/ui-core/-/ui-core-0.0.61.tgz", "integrity": "sha512-NiOGAnfI74u6TaUAFUqh6LXHZxwlVJFeIE9tiP03GULLW05oMeWhbpS3cDpWPazpzYwqXR6ZoHRSdvfvVzkJeA==", + "license": "LGPL-3.0-or-later", "dependencies": { "classnames": "^2.5.1", "tailwindcss": "^3.4.1" @@ -1979,18 +1980,18 @@ } }, "node_modules/@osrd-project/ui-icons": { - "version": "0.0.59", - "resolved": "https://registry.npmjs.org/@osrd-project/ui-icons/-/ui-icons-0.0.59.tgz", - "integrity": "sha512-Cq++gtwrrzZOXGf3sLI008by0Tm7ar6hgROncuocRtd1002zRyj5XBN1hrPZEcyTekJEnAQjBJVLcThTNOLyVA==", + "version": "0.0.61", + "resolved": "https://registry.npmjs.org/@osrd-project/ui-icons/-/ui-icons-0.0.61.tgz", + "integrity": "sha512-v1VA6NLJQPL8jjrnWup89Lg4DuHtxq/7bawrh7u3lx/zFkjLusCpEIFR0KQcrcGgoQbc85Be22ST33igb8dbow==", "license": "LGPL-3.0-or-later", "peerDependencies": { "react": ">=18.0" } }, "node_modules/@osrd-project/ui-manchette": { - "version": "0.0.59", - "resolved": "https://registry.npmjs.org/@osrd-project/ui-manchette/-/ui-manchette-0.0.59.tgz", - "integrity": "sha512-/iNltN/f5K2yrASxJhXj0SjOmVyWUc4n6ltjUfO0c6gQrpWSHIDnZMsNViWTEz7OprFmSTzyS+64pZFXwsZCOQ==", + "version": "0.0.61", + "resolved": "https://registry.npmjs.org/@osrd-project/ui-manchette/-/ui-manchette-0.0.61.tgz", + "integrity": "sha512-bYJ+lc7KWU1ibLouZJ7vNLj5NI/j7s6u6PwGMPENa8bqTe4/m/1f4pHv3YlZb70xA8o0eXZRHYFvnmMZlhrBlw==", "license": "LGPL-3.0-or-later", "dependencies": { "classnames": "^2.5.1", @@ -2001,13 +2002,14 @@ } }, "node_modules/@osrd-project/ui-manchette-with-spacetimechart": { - "version": "0.0.59", - "resolved": "https://registry.npmjs.org/@osrd-project/ui-manchette-with-spacetimechart/-/ui-manchette-with-spacetimechart-0.0.59.tgz", - "integrity": "sha512-O/fuyQMEQOjJext5qQ3k07A0soy30aq/ygIUnIC4rAAYBpzSf6M/pHWL7ZrxHWHV/OOFhoA/DGyhwcBCo3ZaUg==", + "version": "0.0.61", + "resolved": "https://registry.npmjs.org/@osrd-project/ui-manchette-with-spacetimechart/-/ui-manchette-with-spacetimechart-0.0.61.tgz", + "integrity": "sha512-amW0suVztPu3eCvJrmVgyXBNsqxe3JqqhFrZZ89NtF3araX4A+D/TZ6/tIOy/7s20FXq8UsCVYlwP6gdA2nLoA==", "license": "LGPL-3.0-or-later", "dependencies": { - "@osrd-project/ui-manchette": "^0.0.59", - "@osrd-project/ui-spacetimechart": "^0.0.59", + "@osrd-project/ui-manchette": "^0.0.61", + "@osrd-project/ui-spacetimechart": "^0.0.61", + "@osrd-project/ui-speedspacechart": "^0.0.61", "classnames": "^2.5.1", "lodash.isequal": "^4.5.0", "vitest": "^2.1.1" @@ -2017,12 +2019,12 @@ } }, "node_modules/@osrd-project/ui-spacetimechart": { - "version": "0.0.59", - "resolved": "https://registry.npmjs.org/@osrd-project/ui-spacetimechart/-/ui-spacetimechart-0.0.59.tgz", - "integrity": "sha512-q9qQNowrQuoLFqhgQxqUye9cJBJO08t4qAhtBvl17g7pC5NlLuYRInCt2BBpelm1M9bLbMxJ2Brk7+FhHcReeQ==", + "version": "0.0.61", + "resolved": "https://registry.npmjs.org/@osrd-project/ui-spacetimechart/-/ui-spacetimechart-0.0.61.tgz", + "integrity": "sha512-tBcCMl4gkAz4XLaYWdZkIRC5mm/ci8AI9+cc8H5q5qLppG9vlq8RyP3W4xwAH7VtJsExZdMHDXUqUditjGmmxA==", "license": "LGPL-3.0-or-later", "dependencies": { - "@types/chroma-js": "^2.4.4", + "@types/chroma-js": "^3.1.0", "chroma-js": "^3.1.1", "lodash": "^4.17.21", "vitest": "^2.1.1" @@ -2034,20 +2036,15 @@ "tailwindcss": ">=3.4" } }, - "node_modules/@osrd-project/ui-spacetimechart/node_modules/@types/chroma-js": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@types/chroma-js/-/chroma-js-2.4.5.tgz", - "integrity": "sha512-6ISjhzJViaPCy2q2e6PgK+8HcHQDQ0V2LDiKmYAh+jJlLqDa6HbwDh0wOevHY0kHHUx0iZwjSRbVD47WOUx5EQ==" - }, "node_modules/@osrd-project/ui-speedspacechart": { - "version": "0.0.59", - "resolved": "https://registry.npmjs.org/@osrd-project/ui-speedspacechart/-/ui-speedspacechart-0.0.59.tgz", - "integrity": "sha512-jQ/Vce1oZlXAOfUMnnoJN6RN6pHIbcNn+ZtPv2Cfs8LPD0fOtee2RtPQVRp6tP6RZDtjBV+8FStFK2WLKao1yA==", + "version": "0.0.61", + "resolved": "https://registry.npmjs.org/@osrd-project/ui-speedspacechart/-/ui-speedspacechart-0.0.61.tgz", + "integrity": "sha512-3qWf9jM/fR2RESbzRh4BfHJw/iFZUoJrh2lfriMIDzzxQMmiXEtYDLxoiImKhgT1VMM+N7rpLsBmFLBWYEigxg==", "license": "LGPL-3.0-or-later", "dependencies": { - "@osrd-project/ui-core": "^0.0.59", - "@osrd-project/ui-icons": "^0.0.59", - "@types/chroma-js": "^2.4.4", + "@osrd-project/ui-core": "^0.0.61", + "@osrd-project/ui-icons": "^0.0.61", + "@types/chroma-js": "^3.1.0", "@types/d3-selection": "^3.0.0", "@types/d3-zoom": "^3.0.0", "chroma-js": "^3.1.1", @@ -2060,29 +2057,6 @@ "react": ">=18.0" } }, - "node_modules/@osrd-project/ui-speedspacechart/node_modules/@osrd-project/ui-core": { - "version": "0.0.59", - "resolved": "https://registry.npmjs.org/@osrd-project/ui-core/-/ui-core-0.0.59.tgz", - "integrity": "sha512-pCPLKcrR/G0yQeWdhRVVnsCbXhY8HpvnpMUQdL4C4b+63RMQEGQH/X7Yd6B7P6BXYpaImaAeAZ7XcK5U6KjhHg==", - "dependencies": { - "classnames": "^2.5.1", - "tailwindcss": "^3.4.1" - }, - "peerDependencies": { - "react": ">=18.0" - } - }, - "node_modules/@osrd-project/ui-speedspacechart/node_modules/@types/chroma-js": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/@types/chroma-js/-/chroma-js-2.4.5.tgz", - "integrity": "sha512-6ISjhzJViaPCy2q2e6PgK+8HcHQDQ0V2LDiKmYAh+jJlLqDa6HbwDh0wOevHY0kHHUx0iZwjSRbVD47WOUx5EQ==" - }, - "node_modules/@osrd-project/ui-speedspacechart/node_modules/@types/d3-selection": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.11.tgz", - "integrity": "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==", - "license": "MIT" - }, "node_modules/@parcel/watcher": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.0.tgz", @@ -4050,8 +4024,7 @@ "node_modules/@types/chroma-js": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@types/chroma-js/-/chroma-js-3.1.0.tgz", - "integrity": "sha512-Uwl3SOtUkbQ6Ye6ZYu4q4xdLGBzmY839sEHYtOT7i691neeyd+7fXWT5VIkcUSfNwIFrIjQutNYQn9h4q5HFvg==", - "dev": true + "integrity": "sha512-Uwl3SOtUkbQ6Ye6ZYu4q4xdLGBzmY839sEHYtOT7i691neeyd+7fXWT5VIkcUSfNwIFrIjQutNYQn9h4q5HFvg==" }, "node_modules/@types/cookie": { "version": "0.6.0", diff --git a/front/package.json b/front/package.json index eb53fba160b..a42d371e6be 100644 --- a/front/package.json +++ b/front/package.json @@ -9,11 +9,11 @@ "@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0", "@osrd-project/netzgrafik-frontend": "0.0.0-snapshot.37949a66933e8e1552c9b8e54f702ec491afd415", "@osrd-project/ui-core": "^0.0.61", - "@osrd-project/ui-icons": "^0.0.59", - "@osrd-project/ui-manchette": "^0.0.59", - "@osrd-project/ui-manchette-with-spacetimechart": "^0.0.59", - "@osrd-project/ui-spacetimechart": "^0.0.59", - "@osrd-project/ui-speedspacechart": "^0.0.59", + "@osrd-project/ui-icons": "^0.0.61", + "@osrd-project/ui-manchette": "^0.0.61", + "@osrd-project/ui-manchette-with-spacetimechart": "^0.0.61", + "@osrd-project/ui-spacetimechart": "^0.0.61", + "@osrd-project/ui-speedspacechart": "^0.0.61", "@react-pdf/renderer": "^4.1.6", "@redux-devtools/extension": "^3.3.0", "@reduxjs/toolkit": "^2.5.0", diff --git a/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts b/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts index d551a0eb0f3..84c313a92e8 100644 --- a/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts +++ b/front/src/modules/simulationResult/components/SpeedSpaceChart/__tests__/helpers.spec.ts @@ -51,7 +51,15 @@ describe('formatStops', () => { weight: null, }, ]; - const expected = [{ position: { start: 0 }, value: 'name ch' }]; + const expected = [ + { + position: { start: 0 }, + value: { + name: 'name ch', + weight: null, + }, + }, + ]; expect(formatStops(operationalPoints)).toEqual(expected); }); }); diff --git a/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts b/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts index a9df7c3313c..b8a34d7ed51 100644 --- a/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts +++ b/front/src/modules/simulationResult/components/SpeedSpaceChart/helpers.ts @@ -101,11 +101,14 @@ const formatMrsp = (mrsp: SimulationResponseSuccess['mrsp']) => ({ }); export const formatStops = (operationalPoints: PathPropertiesFormatted['operationalPoints']) => - operationalPoints.map(({ position, extensions: { identifier, sncf } = {} }) => ({ + operationalPoints.map(({ position, weight, extensions: { identifier, sncf } = {} }) => ({ position: { start: mmToKm(position), }, - value: identifier ? `${identifier.name} ${sncf ? sncf.ch : ''}` : '', + value: { + name: identifier ? `${identifier.name} ${sncf ? sncf.ch : ''}` : '', + weight: weight!, + }, })); export const formatElectrifications = ( @@ -202,7 +205,9 @@ export const formatData = ( const pathLength = simulation.base.positions[simulation.base.positions.length - 1]; const speeds: LayerData[] = formatSpeeds(simulation.base); const ecoSpeeds: LayerData[] = formatSpeeds(simulation.final_output); - const stops: LayerData[] = formatStops(pathProperties!.operationalPoints); + const stops: LayerData<{ name: string; weight: number }>[] = formatStops( + pathProperties!.operationalPoints + ); const electrifications: LayerData[] = formatElectrifications( pathProperties!.electrifications );