Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI authored and arnaudambro committed Feb 7, 2024
1 parent 5672129 commit 4a1f110
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dashboard/src/recoil/evolutiveStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4a1f110

Please sign in to comment.