reafactor: deplace desc

wip-related-pages
Sébastien Arod 2024-09-17 13:54:59 +02:00
parent 030c1f2b8e
commit 4a4311e829
9 changed files with 38 additions and 6 deletions

View File

@ -6,7 +6,7 @@ import {
StatDesc,
StatGroupDesc,
StatsType,
} from "../../../statistiques/v2/StatsDesc";
} from "../../../statistiques/v2/desc/StatsDesc";
import { listAllChildrenBlocks } from "../../utils/listAllChildrenBlocks";
import { removeBlocks } from "../../utils/removeBlocks";

View File

@ -1,5 +1,5 @@
import { statsPenalesDesc } from "./penales/StatsPenales";
import { StatsType } from "./StatsDesc";
import { StatsType } from "./desc/StatsDesc";
export const eLStatsV2Desc = {
label: "Stats v2",

View File

@ -1,4 +1,4 @@
import { ValueFormatOptions } from "../../format/ValueFormatOptions";
import { ValueFormatOptions } from "../../../format/ValueFormatOptions";
export type StatGroupDesc = {
label: string;

View File

@ -1,4 +1,4 @@
import { StatsType } from "../StatsDesc";
import { StatsType } from "../desc/StatsDesc";
export const statsGeneralesDesc = {
label: "Stats Générales",

View File

@ -1,4 +1,4 @@
import { StatsType } from "../StatsDesc";
import { StatsType } from "../desc/StatsDesc";
export const statsPenalesDesc = {
label: "Stats Pénales",

View File

@ -0,0 +1,19 @@
import { Famille } from "../../../data/Famille";
import { SankeyData } from "../sankey/SankeyData";
export function computeSequencEvtPenalSankeyData(familles: Famille[]) {
const sankeyData: SankeyData = {};
familles.forEach((f) => {
// Compute all transitions, Events are already sorted
for (let index = 0; index < f.Evenements.length - 1; index++) {
const fromEvt = f.Evenements[index];
const toEvt = f.Evenements[index + 1];
const fromTransitions = sankeyData[fromEvt.Type] || {};
sankeyData[fromEvt.Type] = {
...fromTransitions,
[toEvt.Type]: (fromTransitions[toEvt.Type] || 0) + 1,
};
}
});
return sankeyData;
}

View File

@ -0,0 +1,8 @@
/**
* Sankey diagram transitions
*/
export type SankeyData = {
[fromKey: string]: {
[toKey: string]: number;
};
};

View File

@ -0,0 +1,5 @@
import { SankeyData } from "./SankeyData";
eport function sankeyDataToMermaidDiagram(sankeyData: SankeyData) {
}

View File

@ -1,4 +1,4 @@
import { StatsType } from "../StatsDesc";
import { StatsType } from "../desc/StatsDesc";
export const statsSocialesDesc = {
label: "Stats Sociales",