Skip to content

Commit

Permalink
front:finish merge
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandredamiron committed Dec 7, 2023
1 parent a336e4b commit 3eec694
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ export default function SimulationResults({
}
}, [extViewport]);

useEffect(() => {
if (selectedTrain) {
const positions = selectedTrain.base.speeds.map((speed) => speed.position);
const newPositionsScaleDomain = getScaleDomainFromValues(positions);
setPositionScaleDomain({
initial: newPositionsScaleDomain,
current: newPositionsScaleDomain,
});
}
}, [selectedTrain]);

return simulation.trains.length === 0 && !isUpdating ? (
<h1 className="text-center mt-5">{t('noData')}</h1>
) : (
Expand Down

0 comments on commit 3eec694

Please sign in to comment.