Skip to content
Snippets Groups Projects
Select Git revision
  • cb461038a1005838cbaae858d4afa717bfedefb2
  • master default protected
  • doc-script-gen-off-tests
  • 366-signe-a-cote-du-droit-en-vigueur-sur-l-ui-pour-indiquer-que-la-reforme-a-eu-lieu-mais-qu-elle-n
  • revalo_retraites
  • 381-pb-affichage-labels-des-parametres-sur-plus-de-3-lignes
  • ajoute-duplicate-aide-logement
  • poc_castype_ia
  • parametres-editables-budget
  • ui-parametres
  • 355-les-dispositifs-prestations-sociales-du-graphique-se-cachent-montrent-en-meme-temps-2
  • 358-les-variables-dont-le-montant-est-nul-apparaissent-en-bleu-et-non-cliquables
  • 356-ajuster-la-largeur-sur-les-graphiques-budgetaires
  • incoherence_cas_type_0
  • fix-ui-suppression-tranches-baremes
  • ajout-agregat-cehr-version-plf
  • impact_carbone
  • xlsx
  • header_revamp
  • 270-concevoir-la-page-d-accueil-leximpact
  • 219-conversion-des-montants-min-et-max-de-l-axe-des-x-en-smic
  • 0.0.1177
  • 0.0.1176
  • 0.0.1175
  • 0.0.1174
  • 0.0.1173
  • 0.0.1172
  • 0.0.1171
  • 0.0.1170
  • 0.0.1169
  • 0.0.1168
  • 0.0.1167
  • 0.0.1166
  • 0.0.1165
  • 0.0.1164
  • 0.0.1163
  • 0.0.1162
  • 0.0.1161
  • 0.0.1160
  • 0.0.1159
  • 0.0.1158
41 results

decompositions.ts

Blame
  • decompositions.ts 53.59 KiB
    import decompositionCoreByNameUnknown from "@leximpact/socio-fiscal-openfisca-json/decompositions.json"
    import waterfallsUnknown from "@leximpact/socio-fiscal-openfisca-json/waterfalls.json"
    import type {
      Decomposition as DecompositionCore,
      DecompositionByName as DecompositionCoreByName,
      DecompositionReference,
      EntityByKey,
      Variable,
      VariableByName,
      Waterfall,
      WaterfallOptions,
    } from "@openfisca/json-model"
    
    import type { CalculationName } from "$lib/calculations"
    import { reformChangesByName } from "$lib/reforms"
    import type { Situation } from "$lib/situations"
    import {
      variableSummaryByName,
      variableSummaryByNameByReformName,
    } from "$lib/variables"
    import deepEqual from "deep-equal"
    
    export type {
      Decomposition as DecompositionCore,
      DecompositionByName as DecompositionCoreByName,
    } from "@openfisca/json-model"
    
    export interface CalculationEvaluation {
      delta: number[]
      deltaAtVectorIndex: number
    }
    
    export type CalculationEvaluationByName = Partial<{
      [name in CalculationName]: CalculationEvaluation
    }>
    
    export interface Decomposition extends DecompositionCore {
      name: string
      open?: boolean
    }
    
    export type DecompositionByName = { [name: string]: Decomposition }
    
    export interface Evaluation {
      calculationEvaluationByName: CalculationEvaluationByName
      fromOpenFisca?: boolean
    }
    
    export type EvaluationByName = { [name: string]: Evaluation }
    
    export interface LatchkeyDataItem {
      aggregate?: Decomposition
      leaf: Decomposition
    }
    
    export interface VisibleDecomposition extends VisibleDecompositionBase {
      rows: VisibleRow[]
      visibleEvaluationByCalculationName: VisibleEvaluationByCalculationName
    }
    
    export interface VisibleDecompositionBase {
      decomposition: Decomposition
      depth: number
      trunk: boolean
      variable?: Variable
      /// These children are not always the same as the one from the decomposition,
      /// because, the visible children of a decomposition, are not always the same
      /// as the children used to calculate the evaluation of the decomposition
      /// from OpenFisca variables.
      visibleChildren?: DecompositionReference[]