From 4a1f110ec23aab31f84badea1ad920a7d94a7cb8 Mon Sep 17 00:00:00 2001 From: Arnaud AMBROSELLI Date: Tue, 6 Feb 2024 21:41:54 +0100 Subject: [PATCH] comment --- dashboard/src/recoil/evolutiveStats.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dashboard/src/recoil/evolutiveStats.ts b/dashboard/src/recoil/evolutiveStats.ts index 1d58de48b..c020f470d 100644 --- a/dashboard/src/recoil/evolutiveStats.ts +++ b/dashboard/src/recoil/evolutiveStats.ts @@ -135,6 +135,16 @@ export const evolutiveStatsPersonSelector = selectorFamily({ evolutiveStatsIndicators: IndicatorsSelection; }) => ({ get }) => { + // concepts: + // we select "indicators" (for now only one by one is possible) that are fields of the person + // we want to see the evolution of the number of persons for each value of each indicator + // one indicator is: one `field`, one `fromValue` and one `toValue` + // if only `field` is defined, we present a chart with the evolution of number of persons for each value of the field + // if `fromValue` is defined, we present the same chart filtere with the persons that have this value for the field at the beginning of the history + // if `toValue` is defined, we also filter the persons that have this value for the field at the end of the history, so that we present two numbers only + // how do we calculate ? + // we start by the most recent version of the person, and we go back in time, day by day, to the beginning of the history + const indicatorsBase = get(evolutiveStatsIndicatorsBaseSelector); const fieldsMap: FieldsMap = indicatorsBase.reduce((acc, field) => { acc[field.name] = field;