reafactor: deplace desc
parent
030c1f2b8e
commit
4a4311e829
|
@ -6,7 +6,7 @@ import {
|
||||||
StatDesc,
|
StatDesc,
|
||||||
StatGroupDesc,
|
StatGroupDesc,
|
||||||
StatsType,
|
StatsType,
|
||||||
} from "../../../statistiques/v2/StatsDesc";
|
} from "../../../statistiques/v2/desc/StatsDesc";
|
||||||
import { listAllChildrenBlocks } from "../../utils/listAllChildrenBlocks";
|
import { listAllChildrenBlocks } from "../../utils/listAllChildrenBlocks";
|
||||||
import { removeBlocks } from "../../utils/removeBlocks";
|
import { removeBlocks } from "../../utils/removeBlocks";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { statsPenalesDesc } from "./penales/StatsPenales";
|
import { statsPenalesDesc } from "./penales/StatsPenales";
|
||||||
import { StatsType } from "./StatsDesc";
|
import { StatsType } from "./desc/StatsDesc";
|
||||||
|
|
||||||
export const eLStatsV2Desc = {
|
export const eLStatsV2Desc = {
|
||||||
label: "Stats v2",
|
label: "Stats v2",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ValueFormatOptions } from "../../format/ValueFormatOptions";
|
import { ValueFormatOptions } from "../../../format/ValueFormatOptions";
|
||||||
|
|
||||||
export type StatGroupDesc = {
|
export type StatGroupDesc = {
|
||||||
label: string;
|
label: string;
|
|
@ -1,4 +1,4 @@
|
||||||
import { StatsType } from "../StatsDesc";
|
import { StatsType } from "../desc/StatsDesc";
|
||||||
|
|
||||||
export const statsGeneralesDesc = {
|
export const statsGeneralesDesc = {
|
||||||
label: "Stats Générales",
|
label: "Stats Générales",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { StatsType } from "../StatsDesc";
|
import { StatsType } from "../desc/StatsDesc";
|
||||||
|
|
||||||
export const statsPenalesDesc = {
|
export const statsPenalesDesc = {
|
||||||
label: "Stats Pénales",
|
label: "Stats Pénales",
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* Sankey diagram transitions
|
||||||
|
*/
|
||||||
|
export type SankeyData = {
|
||||||
|
[fromKey: string]: {
|
||||||
|
[toKey: string]: number;
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { SankeyData } from "./SankeyData";
|
||||||
|
|
||||||
|
eport function sankeyDataToMermaidDiagram(sankeyData: SankeyData) {
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
import { StatsType } from "../StatsDesc";
|
import { StatsType } from "../desc/StatsDesc";
|
||||||
|
|
||||||
export const statsSocialesDesc = {
|
export const statsSocialesDesc = {
|
||||||
label: "Stats Sociales",
|
label: "Stats Sociales",
|
||||||
|
|
Loading…
Reference in New Issue