-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4072304
commit f412dfe
Showing
26 changed files
with
31,840 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
data/ | ||
/.quarto/ | ||
*.html | ||
main_files/ | ||
.venv/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# ---------------- # | ||
# OJS file from ISD | ||
# ---------------- # | ||
|
||
library(tidyverse) | ||
|
||
# Import ------------------------------------------------------------------ | ||
df_isd_assemble <- | ||
read_rds(here::here("../../clients/drees/drees_isd/data/isd_assemble.rds")) | ||
|
||
# Cleaning ---------------------------------------------------------------- | ||
# national value | ||
df_isd_filter_ojs_nat <- df_isd_assemble |> | ||
mutate(value = round(value, 2)) |> | ||
filter(niv_geo %in% c("fr_ent") & | ||
annee >= 2009 & | ||
is_isd == TRUE & | ||
isd %in% c("C22", "C23", "C24")) |> | ||
select(-is_isd, -niv_geo, -code_geo) |> | ||
rename(value_nat = value) | ||
|
||
# build diff with national value | ||
df_isd_filter_ojs <- df_isd_assemble |> | ||
mutate( | ||
value = round(value, 1), | ||
value = if_else( | ||
annee == 2022 & | ||
code_geo == "972" & | ||
indicator == "part_accouch_20_24", | ||
16.8, | ||
value | ||
) | ||
) |> | ||
filter(niv_geo %in% c("dep") & | ||
annee >= 2009 & | ||
is_isd == TRUE & | ||
isd %in% c("C22", "C23", "C24")) |> | ||
select(-is_isd, -niv_geo) |> | ||
left_join(df_isd_filter_ojs_nat, by = join_by(annee, isd, indicator)) |> | ||
mutate( | ||
diff = value - value_nat, | ||
indicator = fct_recode( | ||
indicator, | ||
"Before 28 weeks" = "tx_tr_gde_prema_av28sa", | ||
"Before 32 weeks" = "tx_gde_prema_av32sa", | ||
"Before 37 weeks" = "tx_prema_av37sa", | ||
"Less than 1.5kg" = "part_nais_moins_1500g", | ||
"Less than 2.5kg" = "part_nais_moins_2500g", | ||
"Under 20 years old" = "part_accouch_m20", | ||
"20-24 years old" = "part_accouch_20_24", | ||
"25-29 years old" = "part_accouch_25_29", | ||
"30-34 years old" = "part_accouch_30_34", | ||
"35-39 years old" = "part_accouch_35_39", | ||
"40 years old and above" = "part_accouch_40p" | ||
), | ||
isd = fct_recode( | ||
isd, | ||
"Premature births by week of amenorrhea" = "C22", | ||
"Births according to child weight" = "C23", | ||
"Births according to mother age" = "C24" | ||
) | ||
) | ||
|
||
# grid OJS | ||
facet_data <- geofacet::fr_departements_grid1 |> | ||
as_tibble() |> | ||
left_join(df_isd_filter_ojs |> | ||
filter(annee == 2022), by = join_by(code == code_geo)) | ||
|
||
# Export ------------------------------------------------------------------ | ||
# only init version that need transpose | ||
ojs_define(data_init = df_isd_filter_ojs) | ||
|
||
ojs_define(data_grid_init = facet_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*-- scss:defaults --*/ | ||
|
||
|
||
/*-- scss:rules --*/ | ||
h1, h2, h3, h4, h5, h6 { | ||
text-shadow: -1px -1px 0 rgba(0, 0, 0, .3); | ||
} | ||
|
||
/* style value boxes */ | ||
.quarto-dashboard .bslib-value-box .value-box-value { | ||
font-size: clamp(.1em, 8cqw, 4em) !important; | ||
} | ||
|
||
.quarto-dashboard .bslib-value-box .value-box-title { | ||
display: none; | ||
} | ||
|
||
.quarto-dashboard .bslib-value-box .value-box-showcase .bi { | ||
font-size: clamp(.1em,max(8cqw,3.2cqh),4em) !important; | ||
} | ||
|
||
/* sidebar note */ | ||
.sidebar-note{ | ||
position: absolute; | ||
bottom: 0; | ||
color: grey; | ||
font-size: 9pt; | ||
} | ||
|
||
.sidebar-note > p > a { | ||
color: grey; | ||
} | ||
|
||
.sidebar-note-right{ | ||
position: absolute; | ||
right: 0; | ||
color: grey; | ||
font-size: 9pt; | ||
max-width: 3cm; | ||
} | ||
|
||
.sidebar-note-right > p > a { | ||
color: grey; | ||
} |
Oops, something went wrong.