Skip to content
Snippets Groups Projects
Commit f3768441 authored by sandcha's avatar sandcha
Browse files

Set one PLF activation mode for all components

parent 59794905
No related branches found
No related tags found
1 merge request!5Désactive le PLF 2022
Pipeline #3280 passed
......@@ -17,10 +17,11 @@
export let title: string | undefined = undefined
export let description: string | undefined = undefined
export let year: string | undefined = undefined
export let variablesToDraw: string[] | undefined = undefined
export let dataJson: ApiResponse | undefined = undefined
export let year: string | undefined = undefined
export let activatePlf: boolean | undefined = undefined
//TODO Or use dataJson content and check if there is a dataJson.result.plf
//but check default value at first display.
......@@ -342,7 +343,7 @@
(updatingHistogram == true) on reform calculation -->
<Spinner />
{:else}
<VerticalHistogram data={updateHistogram(dataJson)} />
<VerticalHistogram {activatePlf} data={updateHistogram(dataJson)} />
{/if}
</div>
<div class="px-5 ">
......
......@@ -4,9 +4,6 @@
const { data, xGet, y, yGet, yRange, xScale, yScale } =
getContext("LayerCake")
const ACTIVATE_PLF = false
const LAWS_COUNT = ACTIVATE_PLF ? 3 : 2
$: columnWidth = (d) => {
const vals = $xGet(d)
return Math.max(0, vals[1] - vals[0])
......@@ -29,10 +26,12 @@
*/
export let stroke = ""
export let strokeWidth = 0
export let activatePlf: boolean | undefined = undefined
const gray = "#CCD3E7"
const red = "#ff6b6b"
const yellow = "#ded500"
const LAWS_COUNT = activatePlf ? 3 : 2
$: lawColor = (law) => {
return law == "plf" ? red : law == "amendement" ? yellow : gray
......
......@@ -23,8 +23,9 @@
// PROPERTIES & FUNCTIONS
// ----------------------
export let activatePlf: boolean | undefined = undefined
export let data = undefined
let displayPlf: boolean = true
let displayAmendement: boolean = true
function getColumnsMaxValue(data): [number, number] {
......@@ -41,7 +42,7 @@
columnsValues.push(
quantileY.base,
displayPlf ? plfValue : 0,
activatePlf ? plfValue : 0,
displayAmendement ? amendementValue : 0,
)
})
......@@ -65,7 +66,7 @@
{data}
>
<ScaledSvg>
<Column />
<Column {activatePlf} />
</ScaledSvg>
<Html>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment