Skip to content
Snippets Groups Projects
Commit 230ad2ce authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Corrige l'ouverture/fermeture des nodes dans WaterfallPlainView

parent 811617ad
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@
const dispatch = createEventDispatcher()
let tab = $state("brut_to_disponible")
let decompositionByName = $state(
let decompositionByName = $derived(
buildDecompositionByNameFromCore(
billName === undefined
? decompositionCoreByName
......@@ -41,7 +41,7 @@
variableSummaryByNameByReformName[billName] ?? variableSummaryByName,
)
let waterfallsDecompositions = $derived(
let waterfallsDecompositions = $state(
waterfalls.map((waterfall) => ({
waterfall,
visibleDecompositions: buildVisibleDecompositionsWithoutValues(
......@@ -68,10 +68,44 @@
function zoomIn(decomposition: Decomposition) {
decompositionByName[decomposition.name].open = true
waterfallsDecompositions = waterfalls.map((waterfall) => ({
waterfall,
visibleDecompositions: buildVisibleDecompositionsWithoutValues(
decompositionByName,
variableSummaryByName,
waterfall,
year,
).filter(
({ decomposition }) =>
billVariableSummaryByName[decomposition.name] !== undefined &&
!billVariableSummaryByName[decomposition.name].input &&
getVariableLatestFormulaDate(
billVariableSummaryByName[decomposition.name],
) !== null,
),
}))
}
function zoomOut(decomposition: Decomposition) {
decompositionByName[decomposition.name].open = false
waterfallsDecompositions = waterfalls.map((waterfall) => ({
waterfall,
visibleDecompositions: buildVisibleDecompositionsWithoutValues(
decompositionByName,
variableSummaryByName,
waterfall,
year,
).filter(
({ decomposition }) =>
billVariableSummaryByName[decomposition.name] !== undefined &&
!billVariableSummaryByName[decomposition.name].input &&
getVariableLatestFormulaDate(
billVariableSummaryByName[decomposition.name],
) !== null,
),
}))
}
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment