Skip to main content
Sign in
Snippets Groups Projects
Commit eb5fe47b authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Add previous years values on slider variables.

parent 2b3a39ae
Branches
Tags
No related merge requests found
......@@ -864,7 +864,7 @@
max: 100 * slider.stepValue,
min: 0,
name: slider.name,
period: $year.toString(),
period: $year.toString(), // Previous years are added later.
situationIndex: previousSituationsPopulationCount,
}
axisBySituationIndex = {
......@@ -901,6 +901,22 @@
situationIndex1.localeCompare(situationIndex2),
)
.map(([, axis]) => axis)
.reduce((parallelAxes, axis) => {
// Add previous years of each axis.
const year = parseInt(axis.period)
parallelAxes.push(
{
...axis,
period: (year - 2).toString(),
},
{
...axis,
period: (year - 1).toString(),
},
axis,
)
return parallelAxes
}, []) as Axis[]
$axes = parallelAxes.length === 0 ? [] : [parallelAxes]
let updatedVectorLength = 1
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment