Skip to main content
Sign in
Snippets Groups Projects
Commit 8c82bc31 authored by Toufic Batache's avatar Toufic Batache
Browse files

Temporaire : afficher les valeurs de l'impact budgétaire sans connexion

parent d937681a
No related branches found
No related tags found
1 merge request!158Bouton et modale simulation budget et autre évolution UI du budget
...@@ -48,7 +48,184 @@ ...@@ -48,7 +48,184 @@
$: console.log("budgetSimulation", budgetSimulation) $: console.log("budgetSimulation", budgetSimulation)
$: ({ amendement: amendment, base: law, plf: bill } = budgetSimulation.result) // TODO tgb: uncomment this
// $: ({
// amendement: amendment,
// base: law,
// plf: bill,
// } = budgetSimulation.result)
// TODO tgb: remove the `law` constant
const amendment = undefined
const bill = undefined
const law = {
state_budget: {
rfr: 1142231473743.643,
irpp: -86907398264.39226,
},
quantiles: [
{
quantile_num: 1,
fraction: 0.1,
count: 3981822,
rfr: 2264,
rfr_sum: 1069235083,
rfr_mean: 268.5291012506335,
rfr_min: 0,
rfr_max: 2264,
irpp: 0,
irpp_sum: 0,
irpp_mean: 0,
irpp_min: 0,
irpp_max: 0,
},
{
quantile_num: 2,
fraction: 0.2,
count: 3981823,
rfr: 8816,
rfr_sum: 23667669211,
rfr_mean: 5943.92799755288,
rfr_min: 2264,
rfr_max: 8816,
irpp: 0,
irpp_sum: 0,
irpp_mean: 0,
irpp_min: 0,
irpp_max: 0,
},
{
quantile_num: 3,
fraction: 0.30000000000000004,
count: 3981823,
rfr: 12854,
rfr_sum: 43576621785,
rfr_mean: 10943.887205684432,
rfr_min: 8816,
rfr_max: 12854,
irpp: 0,
irpp_sum: 0,
irpp_mean: 0,
irpp_min: 0,
irpp_max: 0,
},
{
quantile_num: 4,
fraction: 0.4,
count: 3981822,
rfr: 16199,
rfr_sum: 58390804988,
rfr_mean: 14664.343355378518,
rfr_min: 12854,
rfr_max: 16199,
irpp: -103999551.05239044,
irpp_sum: -103999551.05239044,
irpp_mean: -25.98684196899413,
irpp_min: -100,
irpp_max: 0,
},
{
quantile_num: 5,
fraction: 0.5,
count: 3981823,
rfr: 19450,
rfr_sum: 70800632956,
rfr_mean: 17780.959363587986,
rfr_min: 16199,
rfr_max: 19450,
irpp: -938771424.8982617,
irpp_sum: -938771424.8982617,
irpp_mean: -235.88862778725925,
irpp_min: -600,
irpp_max: 0,
},
{
quantile_num: 6,
fraction: 0.6000000000000001,
count: 3981823,
rfr: 23865,
rfr_sum: 85383203814,
rfr_mean: 21443.24441694169,
rfr_min: 19450,
rfr_max: 23865,
irpp: -1846908900.098038,
irpp_sum: -1846908900.098038,
irpp_mean: -469.5112143493312,
irpp_min: -1000,
irpp_max: 0,
},
{
quantile_num: 7,
fraction: 0.7000000000000001,
count: 3981822,
rfr: 30112,
rfr_sum: 107325704831,
rfr_mean: 26953.91828941625,
rfr_min: 23865,
rfr_max: 30112,
irpp: -3273826228.296066,
irpp_sum: -3273826228.296066,
irpp_mean: -834.5285517817265,
irpp_min: -2000,
irpp_max: 0,
},
{
quantile_num: 8,
fraction: 0.8,
count: 3981823,
rfr: 38713,
rfr_sum: 135809071429,
rfr_mean: 34107.25977247105,
rfr_min: 30112,
rfr_max: 38713,
irpp: -6363203706.776909,
irpp_sum: -6363203706.776909,
irpp_mean: -1616.3617695155492,
irpp_min: -4000,
irpp_max: 0,
},
{
quantile_num: 9,
fraction: 0.9,
count: 3981823,
rfr: 54548,
rfr_sum: 181489645465,
rfr_mean: 45579.53617350646,
rfr_min: 38713,
rfr_max: 54548,
irpp: -11982509094.55077,
irpp_sum: -11982509094.55077,
irpp_mean: -2991.4282191719544,
irpp_min: -8000,
irpp_max: 0,
},
{
quantile_num: 10,
fraction: 1,
count: 3981823,
rfr: 1000000000000000,
rfr_sum: 396160978027,
rfr_mean: 99492.36267583969,
rfr_min: 54548,
rfr_max: 1000000000000000,
irpp: -62398179358.719826,
irpp_sum: -62398179358.719826,
irpp_mean: -15755.3012994554,
irpp_min: -3280000,
irpp_max: 1000000000000000,
},
],
compare_before_after: {
total: 39818220,
non_zero_before: 19557516,
non_zero_after: 19557516,
above_after: 0,
lower_after: 0,
neutral: 39818220,
tolerance_factor_used: 1.05,
weight_factor: 1.0387458297329812,
},
}
$: ({ quantiles: amendmentQuantiles, state_budget: amendmentStateBudget } = $: ({ quantiles: amendmentQuantiles, state_budget: amendmentStateBudget } =
amendment ?? {}) amendment ?? {})
...@@ -62,6 +239,9 @@ ...@@ -62,6 +239,9 @@
$: showBill = bill !== undefined && Boolean(billQuantiles?.length) $: showBill = bill !== undefined && Boolean(billQuantiles?.length)
// Comme la valeur du contrefactuel se trouve dans "law",
// on ne peut pas facilement détecter qu'il est activé.
// On se dit alors que c'est le cas lorsqu'il y a une réforme (PLF).
$: showRevaluation = showBill $: showRevaluation = showBill
$: calculationsCount = 1 + (showBill ? 1 : 0) + (showAmendment ? 1 : 0) $: calculationsCount = 1 + (showBill ? 1 : 0) + (showAmendment ? 1 : 0)
... ...
......
...@@ -7,7 +7,180 @@ ...@@ -7,7 +7,180 @@
export let budgetSimulation: BudgetSimulation export let budgetSimulation: BudgetSimulation
$: ({ amendement: amendment, base: law, plf: bill } = budgetSimulation.result) // TODO tgb: uncomment this
// $: ({ amendement: amendment, base: law, plf: bill } = budgetSimulation.result)
// TODO tgb: remove the `law` constant
const amendment = undefined
const bill = undefined
const law = {
state_budget: {
rfr: 1142231473743.643,
irpp: -86907398264.39226,
},
quantiles: [
{
quantile_num: 1,
fraction: 0.1,
count: 3981822,
rfr: 2264,
rfr_sum: 1069235083,
rfr_mean: 268.5291012506335,
rfr_min: 0,
rfr_max: 2264,
irpp: 0,
irpp_sum: 0,
irpp_mean: 0,
irpp_min: 0,
irpp_max: 0,
},
{
quantile_num: 2,
fraction: 0.2,
count: 3981823,
rfr: 8816,
rfr_sum: 23667669211,
rfr_mean: 5943.92799755288,
rfr_min: 2264,
rfr_max: 8816,
irpp: 0,
irpp_sum: 0,
irpp_mean: 0,
irpp_min: 0,
irpp_max: 0,
},
{
quantile_num: 3,
fraction: 0.30000000000000004,
count: 3981823,
rfr: 12854,
rfr_sum: 43576621785,
rfr_mean: 10943.887205684432,
rfr_min: 8816,
rfr_max: 12854,
irpp: 0,
irpp_sum: 0,
irpp_mean: 0,
irpp_min: 0,
irpp_max: 0,
},
{
quantile_num: 4,
fraction: 0.4,
count: 3981822,
rfr: 16199,
rfr_sum: 58390804988,
rfr_mean: 14664.343355378518,
rfr_min: 12854,
rfr_max: 16199,
irpp: -103999551.05239044,
irpp_sum: -103999551.05239044,
irpp_mean: -25.98684196899413,
irpp_min: -100,
irpp_max: 0,
},
{
quantile_num: 5,
fraction: 0.5,
count: 3981823,
rfr: 19450,
rfr_sum: 70800632956,
rfr_mean: 17780.959363587986,
rfr_min: 16199,
rfr_max: 19450,
irpp: -938771424.8982617,
irpp_sum: -938771424.8982617,
irpp_mean: -235.88862778725925,
irpp_min: -600,
irpp_max: 0,
},
{
quantile_num: 6,
fraction: 0.6000000000000001,
count: 3981823,
rfr: 23865,
rfr_sum: 85383203814,
rfr_mean: 21443.24441694169,
rfr_min: 19450,
rfr_max: 23865,
irpp: -1846908900.098038,
irpp_sum: -1846908900.098038,
irpp_mean: -469.5112143493312,
irpp_min: -1000,
irpp_max: 0,
},
{
quantile_num: 7,
fraction: 0.7000000000000001,
count: 3981822,
rfr: 30112,
rfr_sum: 107325704831,
rfr_mean: 26953.91828941625,
rfr_min: 23865,
rfr_max: 30112,
irpp: -3273826228.296066,
irpp_sum: -3273826228.296066,
irpp_mean: -834.5285517817265,
irpp_min: -2000,
irpp_max: 0,
},
{
quantile_num: 8,
fraction: 0.8,
count: 3981823,
rfr: 38713,
rfr_sum: 135809071429,
rfr_mean: 34107.25977247105,
rfr_min: 30112,
rfr_max: 38713,
irpp: -6363203706.776909,
irpp_sum: -6363203706.776909,
irpp_mean: -1616.3617695155492,
irpp_min: -4000,
irpp_max: 0,
},
{
quantile_num: 9,
fraction: 0.9,
count: 3981823,
rfr: 54548,
rfr_sum: 181489645465,
rfr_mean: 45579.53617350646,
rfr_min: 38713,
rfr_max: 54548,
irpp: -11982509094.55077,
irpp_sum: -11982509094.55077,
irpp_mean: -2991.4282191719544,
irpp_min: -8000,
irpp_max: 0,
},
{
quantile_num: 10,
fraction: 1,
count: 3981823,
rfr: 1000000000000000,
rfr_sum: 396160978027,
rfr_mean: 99492.36267583969,
rfr_min: 54548,
rfr_max: 1000000000000000,
irpp: -62398179358.719826,
irpp_sum: -62398179358.719826,
irpp_mean: -15755.3012994554,
irpp_min: -3280000,
irpp_max: 1000000000000000,
},
],
compare_before_after: {
total: 39818220,
non_zero_before: 19557516,
non_zero_after: 19557516,
above_after: 0,
lower_after: 0,
neutral: 39818220,
tolerance_factor_used: 1.05,
weight_factor: 1.0387458297329812,
},
}
$: ({ $: ({
compare_before_after: amendmentPopulationComparison, compare_before_after: amendmentPopulationComparison,
... ...
......
...@@ -1286,52 +1286,12 @@ ...@@ -1286,52 +1286,12 @@
class:pb-24={$testCasesIndex.length === 1 && class:pb-24={$testCasesIndex.length === 1 &&
displayMode.parametersVariableName === undefined} displayMode.parametersVariableName === undefined}
> >
{#if displayMode.budget && displayMode.parametersVariableName !== undefined && budgetVariablesName.has(displayMode.parametersVariableName)}
{#if user === undefined}
<div class="mx-5 my-10 flex flex-col justify-center md:mx-10">
<h3 class="text-center text-xl text-black">
Vous êtes parlementaire* ? <br /><span class="font-bold"
>Identifiez-vous pour accéder aux impacts budgétaires&nbsp;:</span
>
</h3>
<div class="mb-10 mt-5 grow-0 place-self-center">
<a
class="rounded-lg bg-le-bleu px-4 py-2 text-center text-lg uppercase text-white drop-shadow-md hover:bg-blue-900"
data-sveltekit-reload
href={`/auth/login?redirect=${encodeURIComponent(
$page.url.toString(),
)}`}
title="Vers le simulateur budgétaire de l'impôt sur le revenu"
>
<iconify-icon
class="mr-1 align-[-0.4rem] text-2xl"
icon="ri-key-fill"
/>
Se&nbsp;connecter
</a>
</div>
<p class="text-sm text-black">
*Les simulations budgétaires LexImpact s’appuient sur des
données représentatives de la population française et
protégées. Seules les personnes habilitées peuvent avoir accès
à cette partie du simulateur. Pour plus d’informations,
veuillez consulter <a
class="link"
href="https://leximpact.an.fr/cgu"
title="Conditions générales d'utilisation de la partie en accès restreint du simulateur"
>nos conditions générales d’utilisation</a
>.
</p>
</div>
{/if}
{/if}
{#if displayMode.budget} {#if displayMode.budget}
{#if displayMode.parametersVariableName !== undefined} {#if displayMode.parametersVariableName !== undefined}
<div class="mb-6 flex flex-col px-2 lg:px-5 w-screen md:w-full"> <div class="mb-6 flex flex-col px-2 lg:px-5 w-screen md:w-full">
{#if $budgetSimulation === undefined} <!-- TODO tgb: remove `&& false` -->
{#if user !== undefined && displayMode.parametersVariableName !== undefined} {#if $budgetSimulation === undefined && false}
{#if displayMode.parametersVariableName !== undefined}
<div class="z-10 bg-le-jaune bg-opacity-20"> <div class="z-10 bg-le-jaune bg-opacity-20">
<Spinner /> <Spinner />
</div> </div>
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment