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

Fix quantiles rates. Homogeneize Ir & Csg views

parent 91b4fb69
No related branches found
No related tags found
No related merge requests found
Pipeline #7616 passed
......@@ -54,12 +54,12 @@
$: ({ quantiles: lawQuantiles, state_budget: lawStateBudget } = law)
$: useAmendment =
$: showAmendment =
amendment !== undefined && Boolean(amendmentQuantiles?.length)
$: showBill = bill !== undefined && Boolean(billQuantiles?.length)
$: calculationsCount = 1 + (showBill ? 1 : 0) + (useAmendment ? 1 : 0)
$: calculationsCount = 1 + (showBill ? 1 : 0) + (showAmendment ? 1 : 0)
$: amendmentQuantile = amendmentQuantiles?.[quantileIndex]
......@@ -74,7 +74,7 @@
if (showBill) {
quantileByCalculationName.bill = billQuantiles[index]
}
if (useAmendment) {
if (showAmendment) {
quantileByCalculationName.amendment = amendmentQuantiles[index]
}
return quantileByCalculationName
......@@ -230,7 +230,7 @@
legend
unitName="currency-EUR"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? -amendmentStateBudget.csg_deductible_salaire -
amendmentStateBudget.csg_imposable_salaire
: undefined,
......@@ -278,7 +278,7 @@
/>CSG PLFSS
</div>
{/if}
{#if useAmendment}
{#if showAmendment}
<div class="flex items-center">
<iconify-icon
class="ml-1 text-le-jaune"
......@@ -303,7 +303,8 @@
référence.
</span>
</Popover>
<div class="mt-6 h-64 overflow-hidden">
<div class="mt-4 h-64 overflow-hidden">
<LayerCake
data={quantileByCalculationNameArray}
let:width
......@@ -342,7 +343,7 @@
y={yFromQuantile(bill)}
/>
{/if}
{#if useAmendment}
{#if showAmendment}
<Column
fill="#ded500"
on:click={() => changeQuantileIndex(index)}
......@@ -355,17 +356,21 @@
{/if}
{/each}
</Html>
<Svg pointerEvents={false}>
<AxisY
formatTick={(value) => euroAmountCompactFormatter.format(value)}
/>
</Svg>
<Html pointerEvents={false}>
<div class="h-12 bg-gradient-to-b from-white" />
</Html>
<Html pointerEvents={false}>
<div class="fond h-6" />
</Html>
<Html pointerEvents={false}>
<div class="flex justify-end">
<button
......@@ -398,6 +403,7 @@
</div>
</div>
<!--Onglets-->
<div class="mx-4 grid grid-cols-10 justify-between justify-items-stretch">
{#each lawQuantiles as { }, index}
<button on:click={() => changeQuantileIndex(index)}>
......@@ -421,12 +427,12 @@
<div class="p-4">
<div class="flex items-start justify-between gap-2">
<div class="w-1/5">
<h4 class="mb-2 text-lg font-bold text-le-bleu">
<h4 class="text-lg font-bold text-le-bleu">
{formatLongOrdinal(quantileIndex + 1)} décile
</h4>
</div>
<div class="w-4/5">
<p class="text-sm leading-5 text-gray-600">
<p class="mt-1 text-sm leading-5 text-gray-600">
Les 10% des foyers fiscaux situés dans le {formatLongOrdinal(
quantileIndex + 1,
)} décile, ont un revenu fiscal de référence situé entre
......@@ -441,8 +447,10 @@
</div>
<div class="mt-4 flex justify-between gap-6">
<div class="flex w-1/2 items-start">
<div class="w-1/3 sm:w-1/6 md:w-1/3 xl:w-1/6">
<PictoBudgetDecileIr />
<div>
</div>
<div class="w-2/3 sm:w-5/6 md:w-2/3 xl:w-5/6">
<p class="text-base leading-5">
Ce décile contribue pour
<span class="text-xl font-bold"
......@@ -451,7 +459,7 @@
inline
unitName="currency-EUR"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? yFromQuantile(amendmentQuantile)
: undefined,
bill: showBill ? yFromQuantile(billQuantile) : undefined,
......@@ -466,7 +474,7 @@
inline
unitName="/1"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? -yFromQuantile(amendmentQuantile) /
(amendmentStateBudget.csg_deductible_salaire +
amendmentStateBudget.csg_imposable_salaire)
......@@ -487,8 +495,10 @@
</div>
</div>
<div class="flex w-1/2 items-start">
<div class="w-1/3 sm:w-1/6 md:w-1/3 xl:w-1/6">
<PictoBudgetDecileIrFoyer />
<div>
</div>
<div class="w-2/3 sm:w-5/6 md:w-2/3 xl:w-5/6">
<p class="text-base leading-5">
En moyenne, un foyer est prélevé de <span
class="text-xl font-bold"
......@@ -496,7 +506,7 @@
inline
unitName="currency-EUR"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? -amendmentQuantile.csg_deductible_salaire_mean -
amendmentQuantile.csg_imposable_salaire_mean
: undefined,
......@@ -517,20 +527,20 @@
inline
unitName="/1"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? (-amendmentQuantile.csg_deductible_salaire_mean -
amendmentQuantile.csg_imposable_salaire_mean) /
amendmentStateBudget.rfr
amendmentQuantile.rfr_mean
: undefined,
bill: showBill
? (-billQuantile.csg_deductible_salaire_mean -
billQuantile.csg_imposable_salaire_mean) /
billStateBudget.rfr
billQuantile.rfr_mean
: undefined,
law:
(-lawQuantile.csg_deductible_salaire_mean -
lawQuantile.csg_imposable_salaire_mean) /
lawStateBudget.rfr,
lawQuantile.rfr_mean,
}}
/></span
> du RFR moyen des foyers du décile.
......@@ -540,6 +550,7 @@
</div>
</div>
</div>
<div class="px-4 py-2">
<p class="text-right text-xs font-bold text-gray-600">
Données sources&nbsp;:
......
......@@ -54,12 +54,12 @@
$: ({ quantiles: lawQuantiles, state_budget: lawStateBudget } = law)
$: useAmendment =
$: showAmendment =
amendment !== undefined && Boolean(amendmentQuantiles?.length)
$: showBill = bill !== undefined && Boolean(billQuantiles?.length)
$: calculationsCount = 1 + (showBill ? 1 : 0) + (useAmendment ? 1 : 0)
$: calculationsCount = 1 + (showBill ? 1 : 0) + (showAmendment ? 1 : 0)
$: amendmentQuantile = amendmentQuantiles?.[quantileIndex]
......@@ -74,7 +74,7 @@
if (showBill) {
quantileByCalculationName.bill = billQuantiles[index]
}
if (useAmendment) {
if (showAmendment) {
quantileByCalculationName.amendment = amendmentQuantiles[index]
}
return quantileByCalculationName
......@@ -230,19 +230,17 @@
legend
unitName="currency-EUR"
valueByCalculationName={{
amendment: useAmendment ? -amendmentStateBudget.irpp : undefined,
amendment: showAmendment ? -amendmentStateBudget.irpp : undefined,
bill: showBill ? -billStateBudget.irpp : undefined,
law: -lawStateBudget.irpp,
}}
/>
</div>
<div class="mt-10 flex flex-col items-center justify-between sm:flex-row">
<h4>
<span class="text-lg text-gray-700">
<h4 class="text-lg text-gray-700">
Recettes par <span
class="underline decoration-dotted hover:text-black"
id="infos-explication-deciles-ir">déciles de RFR :</span
></span
>
</h4>
<div class="flex gap-2 text-xs text-gray-500">
......@@ -272,7 +270,7 @@
/>IR PLF
</div>
{/if}
{#if useAmendment}
{#if showAmendment}
<div class="flex items-center">
<iconify-icon
class="ml-1 text-le-jaune"
......@@ -337,7 +335,7 @@
y={yFromQuantile(bill)}
/>
{/if}
{#if useAmendment}
{#if showAmendment}
<Column
fill="#ded500"
on:click={() => changeQuantileIndex(index)}
......@@ -453,7 +451,7 @@
inline
unitName="currency-EUR"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? yFromQuantile(amendmentQuantile)
: undefined,
bill: showBill ? yFromQuantile(billQuantile) : undefined,
......@@ -468,14 +466,13 @@
inline
unitName="/1"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? -yFromQuantile(amendmentQuantile) /
amendmentStateBudget.irpp
: undefined,
bill:
bill === undefined
? undefined
: -yFromQuantile(billQuantile) / billStateBudget.irpp,
bill: showBill
? -yFromQuantile(billQuantile) / billStateBudget.irpp
: undefined,
law: -yFromQuantile(lawQuantile) / lawStateBudget.irpp,
}}
/></span
......@@ -495,7 +492,7 @@
inline
unitName="currency-EUR"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? -amendmentQuantile.irpp_mean
: undefined,
bill: showBill ? -billQuantile.irpp_mean : undefined,
......@@ -510,14 +507,13 @@
inline
unitName="/1"
valueByCalculationName={{
amendment: useAmendment
amendment: showAmendment
? -amendmentQuantile.irpp_mean /
amendmentQuantile.rfr_mean
: undefined,
bill:
bill === undefined
? undefined
: -billQuantile.irpp_mean / billQuantile.rfr_mean,
bill: showBill
? -billQuantile.irpp_mean / billQuantile.rfr_mean
: undefined,
law: -lawQuantile.irpp_mean / lawQuantile.rfr_mean,
}}
/></span
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment