Public
Edited
Jun 27, 2023
2 forks
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
resumeCountryAccessLegalAge = html`
${
_myCountryAccess === "Yes"
? chunkAccessYes
: _myCountryAccess === "Depends"
? chunkAccessDepends
: _myCountryAccess === "No"
? chunkAccessNo
: chunkAccessNotAvailable
}
`
Insert cell
chunkAccessYes = html`
${locale[_languageSelector].chunkAccessYes}
`
Insert cell
chunkAccessDepends = html`
${locale[_languageSelector].chunkAccessDepends}
`
Insert cell
chunkAccessNo = html`
${locale[_languageSelector].chunkAccessNo}
`
Insert cell
chunkAccessNotAvailable = html`
${locale[_languageSelector].chunkAccessNotAvailable}
`
Insert cell
Insert cell
Insert cell
Insert cell
viewof _myCountryIsUnable = Inputs.radio(["Yes", "No"], {value: "Yes"})
Insert cell
viewof _myCountryIsUnableAccessSubtechniques = Inputs.radio(["Yes", "No"], {
value: "Yes"
})
Insert cell
unableBlockLegalAge = html`<p class="unable-block" style="display: ${
_myCountryIsUnable === "Yes" ? "block" : "none"
};">
${locale[_languageSelector].unableBlock}
</p>`
Insert cell
Insert cell
Insert cell
ageLegalNotesExtra = html`

<div class="ART-note extra">

${
myCountryNotesVisibleScenario.length
? `<ul>
${myCountryNotesVisibleScenario
.map(
(d) => `<li><i>${
// General notes
d.category === "ALL" || d.category === ""
? `${locale[_languageSelector].noteGeneral}: <span>${
_languageSelector === "es"
? d.revised_notes_ES
: _languageSelector === "it"
? d.revised_notes_IT
: d.revised_notes
}</span>`
: // Specific notes
`${locale[_languageSelector].noteAbout} ${
locale[_languageSelector][d.category]
}: <span>${
_languageSelector === "es"
? d.revised_notes_ES
: _languageSelector === "it"
? d.revised_notes_IT
: d.revised_notes
}</span>`
}
</i></li>`
)
.join("")}
</ul>
`
: ""
}

</div>

`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
//filterFromBlackToColorNoAccess = "invert(0.4) sepia(1) saturate(4) hue-rotate(305deg)"
Insert cell
//filterFromBlackToColorAccess = "invert(0.5) sepia(1) saturate(4) hue-rotate(140deg)"
Insert cell
//filterFromBlackToDepends = "invert(0.7)"
//filterFromBlackToDepends = "invert(0.51) sepia(0.21) saturate(4.47) hue-rotate(253deg) brightness(0.93) contrast(0.89)"
Insert cell
Insert cell
Insert cell
// Adding date as parameter to avoid cache problems with any data update
dateId = new Date().getTime()
Insert cell
Insert cell
Insert cell
Insert cell
datasetGeneralRaw = await d3.csv(URLdataset_general, d3.autoType)
Insert cell
datasetGeneral = {
const data = await d3.csv(
URLdataset_general,
({
country_code,
country_name,
female_minAge,
female_maxAge,
male_minAge,
male_maxAge,
limited_byAge
}) => ({
country_code: country_code,
country_name: country_name,
female_minAge:
female_minAge === "No"
? 1
: female_minAge === "reproductive age" ||
female_minAge === "NotAvailable"
? female_minAge
: +female_minAge,
female_maxAge:
female_maxAge === "No"
? 100
: female_maxAge === "reproductive age" ||
female_maxAge === "NotAvailable"
? female_maxAge
: +female_maxAge,
male_minAge:
male_minAge === "No"
? 1
: male_minAge === "reproductive age" || male_minAge === "NotAvailable"
? male_minAge
: +male_minAge,
male_maxAge:
male_maxAge === "No"
? 100
: male_maxAge === "reproductive age" || male_maxAge === "NotAvailable"
? male_maxAge
: +male_maxAge,
limited_byAge: limited_byAge
})
);

// Sorting by country name alphabetically
return data
.filter((d) => d.country_code !== "")
.sort((a, b) => d3.ascending(a.country_name, b.country_name));
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
locale = ({
en: {
dontApply: "Don't apply",
notAvailable: "Not available",

femaleLimits: "FEMALE limits",
tooOld: "Too old",
tooYoung: "Too young",
noLimit: "No limit",
repAge: "Reprod. age",
maleLimits: "MALE limits",

chunkAccessYes: `<p class="resume-access-yes">In <span class="access-yes">${
_myCountryData["country_code"]
}: ${
localeCountries["en"].countries[_myCountryData["country_code"]]
}</span> the law <strong>${
_myCountryIsUnable === "Yes" ? "would allow" : "allows"
} you </strong> to undergo assisted reproduction techniques because of <strong><span class="avatar-result">your age</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessDepends: `<p class="resume-access-depends">In <span class="access-depends">${
_myCountryData["country_code"]
}: ${
localeCountries["en"].countries[_myCountryData["country_code"]]
}</span> the law <strong>${
_myCountryIsUnable === "Yes" ? "would allow" : "allows"
} you </strong> to undergo assisted reproduction techniques <strong><span class="avatar-result">if you are of reproductive age </span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNo: `<p class="resume-access-no">In <span class="access-no">${
_myCountryData["country_code"]
}: ${
localeCountries["en"].countries[_myCountryData["country_code"]]
}</span> the law <strong>does not allow you </strong> to undergo assisted reproduction techniques <strong><span class="avatar-result">your age</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNotAvailable: `<p class="resume-access-notAvailable">Information not available for <span class="access-notAvailable">${
_myCountryData["country_code"]
}: ${
localeCountries["en"].countries[_myCountryData["country_code"]]
}</span></p>`,

unableBlock: `❌ Remember that the law <strong>does not allow you</strong> to do so because of <strong><span class="avatar-result">your personal situation </span></strong> (previous step ↑ ). `,

noteGeneral: "(*) Note",
noteAbout: "(*) Note about",

female_maxAge: "female maximum age",
female_minAge: "female minimum age",
male_maxAge: "male maximum age",
male_minAge: "male minimum age"
},
es: {
dontApply: "No aplica",
notAvailable: "No disponible",

femaleLimits: "Límites MUJER",
tooOld: "Demasiado mayor",
tooYoung: "Demasiado joven",
noLimit: "Sin límite",
repAge: "Edad reprod.",
maleLimits: "Límites HOMBRE",

chunkAccessYes: `<p class="resume-access-yes">En <span class="access-yes">${
_myCountryData["country_code"]
}: ${
localeCountries["es"].countries[_myCountryData["country_code"]]
}</span> la ley <strong>te ${
_myCountryIsUnable === "Yes" ? "permitiría" : "permite"
}</strong> usar <strong>reproducción asistida</strong> en general por <strong><span class="avatar-result">tu edad</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessDepends: `<p class="resume-access-depends">En <span class="access-depends">${
_myCountryData["country_code"]
}: ${
localeCountries["es"].countries[_myCountryData["country_code"]]
}</span> la ley <strong>te ${
_myCountryIsUnable === "Yes" ? "permitiría" : "permite"
}</strong> usar <strong>reproducción asistida</strong> en general <strong> <span class="avatar-result">si estás en edad reproductiva</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNo: `<p class="resume-access-no">En <span class="access-no">${
_myCountryData["country_code"]
}: ${
localeCountries["es"].countries[_myCountryData["country_code"]]
}</span> la ley <strong>no te permite</strong> usar <strong> reproducción asistida</strong> en general por <strong><span class="avatar-result">tu edad</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNotAvailable: `<p class="resume-access-notAvailable">Información no disponible en <span class="access-notAvailable">${
_myCountryData["country_code"]
}: ${
localeCountries["es"].countries[_myCountryData["country_code"]]
}</span></p>`,

unableBlock: `❌ Recuerda que la ley <strong>no te permite</strong> acceder ni por lo público ni por lo privado por <strong><span class="avatar-result">tu situación personal </span></strong> (paso anterior ↑)`,

noteGeneral: "(*) Nota",
noteAbout: "(*) Nota sobre",

female_maxAge: "la edad máxima femenina",
female_minAge: "la edad mínima femenina",
male_maxAge: "la edad máxima masculina",
male_minAge: "la edad mínima masculina"
},
it: {
dontApply: "Non si applica",
notAvailable: "Non disponibili",

femaleLimits: "Limiti DONNE",
tooOld: "Troppo anziano/a",
tooYoung: "Troppo giovane",
noLimit: "Nessun limite",
repAge: "Età riproduttiva",
maleLimits: "Limiti UOMINI",

chunkAccessYes: `<p class="resume-access-yes">In <span class="access-yes">${
_myCountryData["country_code"]
}: ${
localeCountries["it"].countries[_myCountryData["country_code"]]
}</span> la legge <strong> ti ${
_myCountryIsUnable === "Yes" ? "permetterebbe" : "permette"
}</strong> di sottoporti <strong>riproduzione assistita</strong> per la <strong><span class="avatar-result">tua età</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessDepends: `<p class="resume-access-depends">In <span class="access-depends">${
_myCountryData["country_code"]
}: ${
localeCountries["it"].countries[_myCountryData["country_code"]]
}</span> la legge ti <strong>te ${
_myCountryIsUnable === "Yes" ? "permetterebbe" : "permette"
}</strong> di sottoporti a <strong>riproduzione assistita</strong><strong> <span class="avatar-result">se se in età riproduttiva</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNo: `<p class="resume-access-no"> In <span class="access-no">${
_myCountryData["country_code"]
}: ${
localeCountries["it"].countries[_myCountryData["country_code"]]
}</span> la legge <strong>non ti permette di sottoporti</strong> a <strong>riproduzione assistita</strong> per la <strong><span class="avatar-result">tua età</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNotAvailable: `<p class="resume-access-notAvailable">Informazioni non disponibili per <span class="access-notAvailable">${
_myCountryData["country_code"]
}: ${
localeCountries["it"].countries[_myCountryData["country_code"]]
}</span></p>`,

unableBlock: `❌ Ricorda che la legge <strong>non te lo permette</strong> a causa della <strong><span class="avatar-result">tua situazione personale</span></strong> (step precedente ↑ )`,

noteGeneral: "(*) Nota",
noteAbout: "(*) Nota riguardo",

female_maxAge: "età massima femminile",
female_minAge: "età minima femminile",
male_maxAge: "età massima maschile",
male_minAge: "età minima maschile"
},
fr: {
dontApply: "Ne pas appliquer",
notAvailable: "Informations non disponibles",

femaleLimits: "Limites FEMMES",
tooOld: "Trop âgée",
tooYoung: "Trop jeune",
noLimit: "Aucune limite",
repAge: "Âge de procréation",
maleLimits: "Limites HOMMES",

chunkAccessYes: `<p class="resume-access-yes">En <span class="access-yes">${
_myCountryData["country_code"]
}: ${
localeCountries["fr"].countries[_myCountryData["country_code"]]
}</span> la loi <strong>vous ${
_myCountryIsUnable === "Yes" ? "autorise" : "autorise"
}</strong> à vous somettre à un traitement de <strong>procréation assistée</strong> en raison de <strong><span class="avatar-result">votre âge</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessDepends: `<p class="resume-access-depends">En <span class="access-depends">${
_myCountryData["country_code"]
}: ${
localeCountries["fr"].countries[_myCountryData["country_code"]]
}</span> la loi <strong>vous ${
_myCountryIsUnable === "Yes" ? "autorise" : "autorise"
}</strong> a vous somettre à un traitement de <strong>procréation assistée</strong><strong> <span class="avatar-result">si vous êtes en âge de procréer</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNo: `<p class="resume-access-no">En <span class="access-no">${
_myCountryData["country_code"]
}: ${
localeCountries["fr"].countries[_myCountryData["country_code"]]
}</span> la loi <strong>ne vous autorise</strong> à vous soumettre à aucun type de traitement de <strong>procréation assistée</strong> en raison de <strong><span class="avatar-result">votre âge</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNotAvailable: `<p class="resume-access-notAvailable">Informations non disponibles pour <span class="access-notAvailable">${
_myCountryData["country_code"]
}: ${
localeCountries["fr"].countries[_myCountryData["country_code"]]
}</span></p>`,

unableBlock: `❌ N’oubliez pas que la loi <strong>ne vous y autorise pas</strong> en raison de votre<strong><span class="avatar-result"> situation personnelle</span></strong> (étape précédente ↑ ).`,

noteGeneral: "(*) Remarque",
noteAbout: "(*) Remarque au sujet de",

female_maxAge: "âge maximal pour les femmes",
female_minAge: "âge minimal pour les femmes",
male_maxAge: "âge maximal pour les hommes",
male_minAge: "âge minimal pour les hommes"
},
el: {
notAvailable: "Πληροφορίες μη διαθέσιμες",

femaleLimits: "Όρια ΓΥΝΑΙΚΩΝ",
tooOld: "Πολύ μεγάλη",
tooYoung: "Πολύ νέα",
noLimit: "Κανένα όριο",
repAge: "Αναπαραγωγική ηλικία",
maleLimits: "Όρια ΑΝΔΡΩΝ",
chunkAccessYes: `<p class="resume-access-yes">Στην <span class="access-yes">${
_myCountryData["country_code"]
}: ${
localeCountries["el"].countries[_myCountryData["country_code"]]
}</span> ο νόμος <strong> ${
_myCountryIsUnable === "Yes" ? "επιτρέπει " : "θα επέτρεπε"
}</strong> να υποβληθείτε <strong>σε υποβοηθούμενη</strong> <strong><span class="avatar-result">αναπαραγωγή </span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessDepends: `<p class="resume-access-depends">Στην <span class="access-depends">${
_myCountryData["country_code"]
}: ${
localeCountries["el"].countries[_myCountryData["country_code"]]
}</span> ο νόμος <strong> ${
_myCountryIsUnable === "Yes" ? "επιτρέπει" : "θα επέτρεπε "
}</strong> να υποβληθείτε <strong>σε υποβοηθούμενη </strong> αναπαραγωγή <strong><span class="avatar-result">εάν είστε σε αναπαραγωγική ηλικία</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,
chunkAccessNo: `<p class="resume-access-no">Στην <span class="access-no">${
_myCountryData["country_code"]
}: ${
localeCountries["el"].countries[_myCountryData["country_code"]]
}</span> ο νόμος <strong>δεν σας επιτρέπει</strong> να υποβληθείτε <strong> σε υποβοηθούμενη αναπαραγωγή</strong> <strong><span class="avatar-result">σε κανένα είδος</span></strong>
${myCountryNotes.length ? "(*)" : ""}
</p>`,

chunkAccessNotAvailable: `<p class="resume-access-notAvailable">Información no disponible en <span class="access-notAvailable">${
_myCountryData["country_code"]
}: ${
localeCountries["el"].countries[_myCountryData["country_code"]]
}</span></p>`,

unableBlock: `❌ Να θυμάστε ότι ο νόμος <strong>δεν σας επιτρέπει</strong> να το κάνετε λόγω της προσωπικής.
<strong><span class="avatar-result">σας κατάστασης </span></strong> (προηγούμενο βήμα ↑ )`,

noteGeneral: "(*) Σημείωση",
noteAbout: "(*) Σημείωση για:",

female_maxAge: "μέγιστη ηλικία γυναίκας",
female_minAge: "ελάχιστη ηλικία γυναίκας",
male_maxAge: "μέγιστη ηλικία άνδρα",
male_minAge: "ελάχιστη ηλικία άνδρα"
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more