diff --git a/adminSiteServer/mockSiteRouter.tsx b/adminSiteServer/mockSiteRouter.tsx index ee387e6b8ef..eb1d6883954 100644 --- a/adminSiteServer/mockSiteRouter.tsx +++ b/adminSiteServer/mockSiteRouter.tsx @@ -62,6 +62,7 @@ import { } from "./plainRouterHelpers.js" import { DEFAULT_LOCAL_BAKE_DIR } from "../site/SiteConstants.js" import { DATA_INSIGHTS_ATOM_FEED_NAME } from "../site/gdocs/utils.js" +import { renderMultiDimDataPageBySlug } from "../baker/MultiDimBaker.js" require("express-async-errors") @@ -201,15 +202,29 @@ getPlainRouteNonIdempotentWithRWTransaction( mockSiteRouter, "/grapher/:slug", async (req, res, trx) => { - const entity = await getChartConfigBySlug(trx, req.params.slug) - if (!entity) throw new JsonError("No such chart", 404) + const chartRow = await getChartConfigBySlug(trx, req.params.slug).catch( + console.error + ) + if (chartRow) { + // XXX add dev-prod parity for this + res.set("Access-Control-Allow-Origin", "*") - // XXX add dev-prod parity for this - res.set("Access-Control-Allow-Origin", "*") + const previewDataPageOrGrapherPage = + await renderPreviewDataPageOrGrapherPage(chartRow.config, trx) + res.send(previewDataPageOrGrapherPage) + return + } else { + const page = await renderMultiDimDataPageBySlug( + trx, + req.params.slug + ).catch(console.error) + if (page) { + res.send(page) + return + } + } - const previewDataPageOrGrapherPage = - await renderPreviewDataPageOrGrapherPage(entity.config, trx) - res.send(previewDataPageOrGrapherPage) + throw new JsonError("No such chart", 404) } ) diff --git a/baker/DatapageHelpers.ts b/baker/DatapageHelpers.ts index dd91ce95a46..411bb60ecde 100644 --- a/baker/DatapageHelpers.ts +++ b/baker/DatapageHelpers.ts @@ -9,14 +9,25 @@ import { getLastUpdatedFromVariable, getNextUpdateFromVariable, omitUndefinedValues, + partition, } from "@ourworldindata/utils" import { getGdocBaseObjectById, + getPublishedGdocBaseObjectBySlug, loadGdocFromGdocBase, } from "../db/model/Gdoc/GdocFactory.js" import { OwidGoogleAuth } from "../db/OwidGoogleAuth.js" -import { GrapherInterface, OwidGdocBaseInterface } from "@ourworldindata/types" +import { + EnrichedFaq, + FaqDictionary, + GrapherInterface, + OwidGdocBaseInterface, +} from "@ourworldindata/types" import { KnexReadWriteTransaction } from "../db/db.js" +import { parseFaqs } from "../db/model/Gdoc/rawToEnriched.js" +import { logErrorAndMaybeSendToBugsnag } from "../serverUtils/errorLog.js" +import { getSlugForTopicTag } from "./GrapherBakingUtils.js" +import { getShortPageCitation } from "../site/gdocs/utils.js" export const getDatapageDataV2 = async ( variableMetadata: OwidVariableWithSource, @@ -112,3 +123,101 @@ export const getDatapageGdoc = async ( return datapageGdoc } + +type EnrichedFaqLookupError = { + type: "error" + error: string +} + +type EnrichedFaqLookupSuccess = { + type: "success" + enrichedFaq: EnrichedFaq +} + +type EnrichedFaqLookupResult = EnrichedFaqLookupError | EnrichedFaqLookupSuccess + +export const fetchAndParseFaqs = async ( + knex: KnexReadWriteTransaction, // TODO: this transaction is only RW because somewhere inside it we fetch images + faqGdocIds: string[], + { isPreviewing }: { isPreviewing: boolean } +) => { + const gdocFetchPromises = faqGdocIds.map((gdocId) => + getDatapageGdoc(knex, gdocId, isPreviewing) + ) + const gdocs = await Promise.all(gdocFetchPromises) + const gdocIdToFragmentIdToBlock: Record = {} + gdocs.forEach((gdoc) => { + if (!gdoc) return + const faqs = parseFaqs( + ("faqs" in gdoc.content && gdoc.content?.faqs) ?? [], + gdoc.id + ) + gdocIdToFragmentIdToBlock[gdoc.id] = faqs.faqs + }) + + return gdocIdToFragmentIdToBlock +} + +export const resolveFaqsForVariable = ( + gdocIdToFragmentIdToBlock: Record, + variableMetadata: OwidVariableWithSource +) => { + const resolvedFaqResults: EnrichedFaqLookupResult[] = variableMetadata + .presentation?.faqs + ? variableMetadata.presentation.faqs.map((faq) => { + const enrichedFaq = gdocIdToFragmentIdToBlock[faq.gdocId]?.[ + faq.fragmentId + ] as EnrichedFaq | undefined + if (!enrichedFaq) + return { + type: "error", + error: `Could not find fragment ${faq.fragmentId} in gdoc ${faq.gdocId}`, + } + return { + type: "success", + enrichedFaq, + } + }) + : [] + + const [resolvedFaqs, errors] = partition( + resolvedFaqResults, + (result) => result.type === "success" + ) as [EnrichedFaqLookupSuccess[], EnrichedFaqLookupError[]] + + return { resolvedFaqs, errors } +} + +export const getPrimaryTopic = async ( + knex: KnexReadWriteTransaction, + firstTopicTag: string | undefined +) => { + if (!firstTopicTag) return undefined + + let topicSlug: string + try { + topicSlug = await getSlugForTopicTag(knex, firstTopicTag) + } catch (e) { + await logErrorAndMaybeSendToBugsnag( + `Data page is using "${firstTopicTag}" as its primary tag, which we are unable to resolve to a tag in the grapher DB` + ) + return undefined + } + + if (topicSlug) { + const gdoc = await getPublishedGdocBaseObjectBySlug( + knex, + topicSlug, + true + ) + if (gdoc) { + const citation = getShortPageCitation( + gdoc.content.authors, + gdoc.content.title ?? "", + gdoc?.publishedAt + ) + return { topicTag: firstTopicTag, citation } + } + } + return undefined +} diff --git a/baker/GrapherBaker.tsx b/baker/GrapherBaker.tsx index 78d3281e25f..0480f04b5fc 100644 --- a/baker/GrapherBaker.tsx +++ b/baker/GrapherBaker.tsx @@ -11,7 +11,6 @@ import { keyBy, mergePartialGrapherConfigs, compact, - partition, } from "@ourworldindata/utils" import fs from "fs-extra" import * as lodash from "lodash" @@ -37,11 +36,8 @@ import { DimensionProperty, OwidVariableWithSource, OwidChartDimensionInterface, - EnrichedFaq, FaqEntryData, - FaqDictionary, ImageMetadata, - OwidGdocBaseInterface, } from "@ourworldindata/types" import ProgressBar from "progress" import { @@ -49,17 +45,19 @@ import { getMergedGrapherConfigForVariable, getVariableOfDatapageIfApplicable, } from "../db/model/Variable.js" -import { getDatapageDataV2, getDatapageGdoc } from "./DatapageHelpers.js" +import { + fetchAndParseFaqs, + getDatapageDataV2, + getPrimaryTopic, + resolveFaqsForVariable, +} from "./DatapageHelpers.js" import { Image, getAllImages } from "../db/model/Image.js" import { logErrorAndMaybeSendToBugsnag } from "../serverUtils/errorLog.js" -import { parseFaqs } from "../db/model/Gdoc/rawToEnriched.js" -import { getShortPageCitation } from "../site/gdocs/utils.js" -import { getSlugForTopicTag, getTagToSlugMap } from "./GrapherBakingUtils.js" +import { getTagToSlugMap } from "./GrapherBakingUtils.js" import { knexRaw } from "../db/db.js" import { getRelatedChartsForVariable } from "../db/model/Chart.js" import pMap from "p-map" -import { getPublishedGdocBaseObjectBySlug } from "../db/model/Gdoc/GdocFactory.js" const renderDatapageIfApplicable = async ( grapher: GrapherInterface, @@ -114,18 +112,6 @@ export const renderDataPageOrGrapherPage = async ( return renderGrapherPage(grapher, knex) } -type EnrichedFaqLookupError = { - type: "error" - error: string -} - -type EnrichedFaqLookupSuccess = { - type: "success" - enrichedFaq: EnrichedFaq -} - -type EnrichedFaqLookupResult = EnrichedFaqLookupError | EnrichedFaqLookupSuccess - export async function renderDataPageV2( { variableId, @@ -158,45 +144,16 @@ export async function renderDataPageV2( ? mergePartialGrapherConfigs(grapherConfigForVariable, pageGrapher) : pageGrapher ?? {} - const faqDocs = compact( + const faqDocIds = compact( uniq(variableMetadata.presentation?.faqs?.map((faq) => faq.gdocId)) ) - const gdocFetchPromises = faqDocs.map((gdocId) => - getDatapageGdoc(knex, gdocId, isPreviewing) + + const faqGdocs = await fetchAndParseFaqs(knex, faqDocIds, { isPreviewing }) + + const { resolvedFaqs, errors: faqResolveErrors } = resolveFaqsForVariable( + faqGdocs, + variableMetadata ) - const gdocs = await Promise.all(gdocFetchPromises) - const gdocIdToFragmentIdToBlock: Record = {} - gdocs.forEach((gdoc) => { - if (!gdoc) return - const faqs = parseFaqs( - ("faqs" in gdoc.content && gdoc.content?.faqs) ?? [], - gdoc.id - ) - gdocIdToFragmentIdToBlock[gdoc.id] = faqs.faqs - }) - - const resolvedFaqsResults: EnrichedFaqLookupResult[] = variableMetadata - .presentation?.faqs - ? variableMetadata.presentation.faqs.map((faq) => { - const enrichedFaq = gdocIdToFragmentIdToBlock[faq.gdocId]?.[ - faq.fragmentId - ] as EnrichedFaq | undefined - if (!enrichedFaq) - return { - type: "error", - error: `Could not find fragment ${faq.fragmentId} in gdoc ${faq.gdocId}`, - } - return { - type: "success", - enrichedFaq, - } - }) - : [] - - const [resolvedFaqs, faqResolveErrors] = partition( - resolvedFaqsResults, - (result) => result.type === "success" - ) as [EnrichedFaqLookupSuccess[], EnrichedFaqLookupError[]] if (faqResolveErrors.length > 0) { for (const error of faqResolveErrors) { @@ -234,32 +191,7 @@ export async function renderDataPageV2( ) const firstTopicTag = datapageData.topicTagsLinks?.[0] - - let slug = "" - if (firstTopicTag) { - try { - slug = await getSlugForTopicTag(knex, firstTopicTag) - } catch (error) { - await logErrorAndMaybeSendToBugsnag( - `Datapage with variableId "${variableId}" and title "${datapageData.title.title}" is using "${firstTopicTag}" as its primary tag, which we are unable to resolve to a tag in the grapher DB` - ) - } - let gdoc: OwidGdocBaseInterface | undefined = undefined - if (slug) { - gdoc = await getPublishedGdocBaseObjectBySlug(knex, slug, true) - } - if (gdoc) { - const citation = getShortPageCitation( - gdoc.content.authors, - gdoc.content.title ?? "", - gdoc?.publishedAt - ) - datapageData.primaryTopic = { - topicTag: firstTopicTag, - citation, - } - } - } + datapageData.primaryTopic = await getPrimaryTopic(knex, firstTopicTag) // Get the charts this variable is being used in (aka "related charts") // and exclude the current chart to avoid duplicates diff --git a/baker/MultiDimBaker.tsx b/baker/MultiDimBaker.tsx new file mode 100644 index 00000000000..79de92fd0b9 --- /dev/null +++ b/baker/MultiDimBaker.tsx @@ -0,0 +1,277 @@ +import yaml from "yaml" +import fs from "fs-extra" +import path from "path" +import findProjectBaseDir from "../settings/findBaseDir.js" +import { + IndicatorEntryBeforePreProcessing, + IndicatorsAfterPreProcessing, + MultiDimDataPageConfigPreProcessed, + MultiDimDataPageConfigRaw, + MultiDimDataPageProps, + FaqEntryKeyedByGdocIdAndFragmentId, +} from "@ourworldindata/types" +import { + MultiDimDataPageConfig, + JsonError, + keyBy, + mapValues, + OwidVariableWithSource, + pick, +} from "@ourworldindata/utils" +import * as db from "../db/db.js" +import { renderToHtmlPage } from "./siteRenderers.js" +import { MultiDimDataPage } from "../site/multiDim/MultiDimDataPage.js" +import React from "react" +import { BAKED_BASE_URL } from "../settings/clientSettings.js" +import { getTagToSlugMap } from "./GrapherBakingUtils.js" +import { + getVariableIdsByCatalogPath, + getVariableMetadata, +} from "../db/model/Variable.js" +import pMap from "p-map" +import { + fetchAndParseFaqs, + getPrimaryTopic, + resolveFaqsForVariable, +} from "./DatapageHelpers.js" +import { logErrorAndMaybeSendToBugsnag } from "../serverUtils/errorLog.js" + +// TODO Make this dynamic +const baseDir = findProjectBaseDir(__dirname) +if (!baseDir) throw new Error("Could not find project base directory") +const MULTI_DIM_CONFIG_DIR = path.join(baseDir, "public/multi-dim") + +const readMultiDimConfig = (filename: string) => + yaml.parse( + fs.readFileSync(path.join(MULTI_DIM_CONFIG_DIR, filename), "utf8") + ) + +const MULTI_DIM_SITES_BY_SLUG: Record = { + "mdd-causes-of-death": readMultiDimConfig("causes-of-death.yml"), + "mdd-energy": readMultiDimConfig("energy.yml"), + "mdd-mixed": readMultiDimConfig("mixed.yml"), + "mdd-life-expectancy": readMultiDimConfig("life-expectancy.json"), + "mdd-plastic": readMultiDimConfig("plastic.json"), + "mdd-poverty": readMultiDimConfig("poverty.yml"), +} + +const resolveMultiDimDataPageCatalogPathsToIndicatorIds = async ( + knex: db.KnexReadonlyTransaction, + rawConfig: MultiDimDataPageConfigRaw +): Promise => { + const allCatalogPaths = rawConfig.views + .flatMap((view) => + Object.values(view.indicators ?? {}).flatMap( + (indicatorOrIndicators) => + Array.isArray(indicatorOrIndicators) + ? indicatorOrIndicators + : [indicatorOrIndicators] + ) + ) + .filter((indicator) => typeof indicator === "string") + + const catalogPathToIndicatorIdMap = await getVariableIdsByCatalogPath( + allCatalogPaths, + knex + ) + + const missingCatalogPaths = new Set( + allCatalogPaths.filter( + (indicator) => !catalogPathToIndicatorIdMap.has(indicator) + ) + ) + + if (missingCatalogPaths.size > 0) { + console.warn( + `Could not find the following catalog paths for MDD ${rawConfig.title} in the database: ${Array.from( + missingCatalogPaths + ).join(", ")}` + ) + } + + const resolveSingleField = ( + indicator: IndicatorEntryBeforePreProcessing + ) => { + if (typeof indicator === "string") { + const indicatorId = catalogPathToIndicatorIdMap.get(indicator) + return indicatorId ?? undefined + } else { + return indicator + } + } + + const resolveField = ( + indicator: + | IndicatorEntryBeforePreProcessing + | IndicatorEntryBeforePreProcessing[] + ) => { + if (Array.isArray(indicator)) { + return indicator.map(resolveSingleField) + } else { + return resolveSingleField(indicator) + } + } + + for (const view of rawConfig.views) { + if (view.indicators) + view.indicators = mapValues( + view.indicators, + resolveField + ) as IndicatorsAfterPreProcessing + + // Ensure that `indicators.y` exists and is a (possibly empty) array + if (!view.indicators?.y) view.indicators = { ...view.indicators, y: [] } + else if (!Array.isArray(view.indicators.y)) + view.indicators.y = [view.indicators.y] + } + + return rawConfig as MultiDimDataPageConfigPreProcessed +} + +const getRelevantVariableIds = (config: MultiDimDataPageConfigPreProcessed) => { + // A "relevant" variable id is the first y indicator of each view + const allIndicatorIds = config.views + .map((view) => view.indicators.y?.[0]) + .filter((id) => id !== undefined) + + return new Set(allIndicatorIds) +} + +const getRelevantVariableMetadata = async ( + config: MultiDimDataPageConfigPreProcessed +) => { + const variableIds = getRelevantVariableIds(config) + const metadata = await pMap( + variableIds, + async (id) => { + return getVariableMetadata(id) + }, + { concurrency: 10 } + ) + + return keyBy(metadata, (m) => m.id) +} + +const getFaqEntries = async ( + knex: db.KnexReadWriteTransaction, // TODO: this transaction is only RW because somewhere inside it we fetch images + config: MultiDimDataPageConfigPreProcessed, + variableMetadataDict: Record +): Promise => { + const faqDocIds = new Set( + Object.values(variableMetadataDict) + .flatMap((metadata) => + metadata.presentation?.faqs?.map((faq) => faq.gdocId) + ) + .filter((id) => id !== undefined) + ) + + const faqGdocs = await fetchAndParseFaqs(knex, Array.from(faqDocIds), { + isPreviewing: false, + }) + + Object.values(variableMetadataDict).forEach((metadata) => { + const { errors: faqResolveErrors } = resolveFaqsForVariable( + faqGdocs, + metadata + ) + + if (faqResolveErrors.length > 0) { + for (const error of faqResolveErrors) { + void logErrorAndMaybeSendToBugsnag( + new JsonError( + `MDD baking error for page "${config.title}" in finding FAQs for variable ${metadata.id}: ${error.error}` + ) + ) + } + } + }) + + const faqContentsByGdocIdAndFragmentId = Object.values( + variableMetadataDict + ).reduce( + (acc, metadata) => { + metadata.presentation?.faqs?.forEach((faq) => { + if (!faq.gdocId || !faq.fragmentId) return + if (!acc[faq.gdocId]) acc[faq.gdocId] = {} + if (!acc[faq.gdocId][faq.fragmentId]) { + const faqContent = + faqGdocs[faq.gdocId]?.[faq.fragmentId]?.content + if (faqContent) acc[faq.gdocId][faq.fragmentId] = faqContent + } + }) + return acc + }, + {} as FaqEntryKeyedByGdocIdAndFragmentId["faqs"] + ) + + return { + faqs: faqContentsByGdocIdAndFragmentId, + } +} + +export const renderMultiDimDataPageBySlug = async ( + knex: db.KnexReadWriteTransaction, + slug: string +) => { + const rawConfig = MULTI_DIM_SITES_BY_SLUG[slug] + if (!rawConfig) throw new Error(`No multi-dim site found for slug: ${slug}`) + + // TAGS + const tagToSlugMap = await getTagToSlugMap(knex) + // Only embed the tags that are actually used by the datapage, instead of the complete JSON object with ~240 properties + const minimalTagToSlugMap = pick(tagToSlugMap, rawConfig.topicTags ?? []) + + // PRE-PROCESS CONFIG + const preProcessedConfig = + await resolveMultiDimDataPageCatalogPathsToIndicatorIds(knex, rawConfig) + const config = MultiDimDataPageConfig.fromObject(preProcessedConfig) + + // FAQs + const variableMetaDict = + await getRelevantVariableMetadata(preProcessedConfig) + const faqEntries = await getFaqEntries( + knex, + preProcessedConfig, + variableMetaDict + ) + + // PRIMARY TOPIC + const primaryTopic = await getPrimaryTopic( + knex, + preProcessedConfig.topicTags?.[0] + ) + + const props = { + configObj: config.config, + tagToSlugMap: minimalTagToSlugMap, + faqEntries, + primaryTopic, + } + + return renderMultiDimDataPage(props) +} + +export const renderMultiDimDataPage = async (props: MultiDimDataPageProps) => { + return renderToHtmlPage( + + ) +} + +export const bakeMultiDimDataPage = async ( + knex: db.KnexReadWriteTransaction, + bakedSiteDir: string, + slug: string +) => { + const renderedHtml = await renderMultiDimDataPageBySlug(knex, slug) + const outPath = path.join(bakedSiteDir, `grapher/${slug}.html`) + await fs.writeFile(outPath, renderedHtml) +} + +export const bakeAllMultiDimDataPages = async ( + knex: db.KnexReadWriteTransaction, + bakedSiteDir: string +) => { + for (const slug of Object.keys(MULTI_DIM_SITES_BY_SLUG)) { + await bakeMultiDimDataPage(knex, bakedSiteDir, slug) + } +} diff --git a/baker/SiteBaker.tsx b/baker/SiteBaker.tsx index ed49183ad42..4c0b0e1b75e 100644 --- a/baker/SiteBaker.tsx +++ b/baker/SiteBaker.tsx @@ -9,6 +9,7 @@ import { BASE_DIR, GDOCS_DETAILS_ON_DEMAND_ID, BAKED_GRAPHER_URL, + FEATURE_FLAGS, } from "../settings/serverSettings.js" import { @@ -88,6 +89,7 @@ import { import { BAKED_BASE_URL, BAKED_GRAPHER_EXPORTS_BASE_URL, + FeatureFlagFeature, } from "../settings/clientSettings.js" import pMap from "p-map" import { GdocDataInsight } from "../db/model/Gdoc/GdocDataInsight.js" @@ -105,6 +107,7 @@ import { getBakePath } from "@ourworldindata/components" import { GdocAuthor, getMinimalAuthors } from "../db/model/Gdoc/GdocAuthor.js" import { DATA_INSIGHTS_ATOM_FEED_NAME } from "../site/gdocs/utils.js" import { getRedirectsFromDb } from "../db/model/Redirect.js" +import { bakeAllMultiDimDataPages } from "./MultiDimBaker.js" type PrefetchedAttachments = { linkedAuthors: LinkedAuthor[] @@ -134,6 +137,7 @@ const nonWordpressSteps = [ "countryProfiles", "explorers", "charts", + "multiDimPages", "gdocPosts", "gdriveImages", "dods", @@ -752,6 +756,20 @@ export class SiteBaker { this.progressBar.tick({ name: "✅ validated grapher dods" }) } + private async bakeMultiDimPages(knex: db.KnexReadWriteTransaction) { + if (!this.bakeSteps.has("multiDimPages")) return + if (!FEATURE_FLAGS.has(FeatureFlagFeature.MultiDimDataPage)) { + console.log( + "Skipping baking multi-dim pages because feature flag is not set" + ) + return + } + + await bakeAllMultiDimDataPages(knex, this.bakedSiteDir) + + this.progressBar.tick({ name: "✅ baked multi-dim pages" }) + } + private async bakeDetailsOnDemand(knex: db.KnexReadonlyTransaction) { if (!this.bakeSteps.has("dods")) return if (!GDOCS_DETAILS_ON_DEMAND_ID) { @@ -1059,6 +1077,7 @@ export class SiteBaker { name: "✅ bakeAllChangedGrapherPagesVariablesPngSvgAndDeleteRemovedGraphers", }) } + await this.bakeMultiDimPages(knex) await this.bakeDetailsOnDemand(knex) await this.validateGrapherDodReferences(knex) await this.bakeGDocPosts(knex) diff --git a/functions/grapher/[slug].ts b/functions/grapher/[slug].ts index 9c43031f55b..17d6d24563a 100644 --- a/functions/grapher/[slug].ts +++ b/functions/grapher/[slug].ts @@ -92,7 +92,11 @@ export const onRequestGet: PagesFunction = async (context) => { element: (element) => { const canonicalUrl = element.getAttribute("content") element.setAttribute("content", canonicalUrl + url.search) - origin = new URL(canonicalUrl).origin + try { + origin = new URL(canonicalUrl).origin + } catch (e) { + console.error("Error parsing canonical URL", e) + } }, }) .on('meta[property="og:image"]', { diff --git a/packages/@ourworldindata/types/src/domainTypes/Various.ts b/packages/@ourworldindata/types/src/domainTypes/Various.ts index 946339baa14..fb634a03334 100644 --- a/packages/@ourworldindata/types/src/domainTypes/Various.ts +++ b/packages/@ourworldindata/types/src/domainTypes/Various.ts @@ -27,6 +27,7 @@ export enum SiteFooterContext { gdocsDocument = "gdocsDocument", // the rendered version (on the site) grapherPage = "grapherPage", dataPageV2 = "dataPageV2", + multiDimDataPage = "multiDimDataPage", dynamicCollectionPage = "dynamicCollectionPage", explorerPage = "explorerPage", default = "default", diff --git a/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts b/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts index d9b4e66bf9c..fc0e0a2e7b8 100644 --- a/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts +++ b/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts @@ -136,6 +136,7 @@ export interface DataPageV2ContentFields { tagToSlugMap: Record imageMetadata: Record } + export interface DisplaySource { label: string description?: string diff --git a/packages/@ourworldindata/types/src/index.ts b/packages/@ourworldindata/types/src/index.ts index 62ff0f05ca8..557996d2119 100644 --- a/packages/@ourworldindata/types/src/index.ts +++ b/packages/@ourworldindata/types/src/index.ts @@ -648,3 +648,17 @@ export { type DbEnrichedLatestWork, parseLatestWork, } from "./domainTypes/Author.js" + +export type { + IndicatorEntryBeforePreProcessing, + IndicatorsAfterPreProcessing, + MultiDimDataPageConfigPreProcessed, + MultiDimDataPageConfigRaw, + MultiDimDataPageProps, + FaqEntryKeyedByGdocIdAndFragmentId, + Choice, + ChoicesEnriched, + DimensionEnriched, + MultiDimDimensionChoices, + View, +} from "./siteTypes/MultiDimDataPage.js" diff --git a/packages/@ourworldindata/types/src/siteTypes/MultiDimDataPage.ts b/packages/@ourworldindata/types/src/siteTypes/MultiDimDataPage.ts new file mode 100644 index 00000000000..f3636baf233 --- /dev/null +++ b/packages/@ourworldindata/types/src/siteTypes/MultiDimDataPage.ts @@ -0,0 +1,90 @@ +import { OwidEnrichedGdocBlock } from "../gdocTypes/ArchieMlComponents.js" +import { PrimaryTopic } from "../gdocTypes/Datapage.js" +import { IndicatorTitleWithFragments } from "../OwidVariable.js" + +// Indicator ID, catalog path, or maybe an array of those +export type IndicatorEntryBeforePreProcessing = string | number | undefined +export type IndicatorEntryAfterPreProcessing = number | undefined // catalog paths have been resolved to indicator IDs + +interface MultiDimDataPageConfigType< + IndicatorType extends Record, +> { + title: IndicatorTitleWithFragments + defaultSelection?: string[] + topicTags?: string[] + // commonIndicatorPathPrefix?: string + dimensions: Dimension[] + views: View[] +} + +export type MultiDimDataPageConfigRaw = + MultiDimDataPageConfigType + +export type MultiDimDataPageConfigPreProcessed = + MultiDimDataPageConfigType + +export interface Dimension { + slug: string + name: string + group?: string + description?: string + multi_select?: boolean + choices: Choice[] +} + +export interface ChoicesEnriched { + choices: Choice[] + choicesBySlug: Record + choicesByGroup: Record +} + +export type DimensionEnriched = Dimension & ChoicesEnriched + +export interface Choice { + slug: string + name: string + description?: string + // multi_select?: boolean +} + +export interface IndicatorsBeforePreProcessing { + y: IndicatorEntryBeforePreProcessing | IndicatorEntryBeforePreProcessing[] + x?: IndicatorEntryBeforePreProcessing + size?: IndicatorEntryBeforePreProcessing + color?: IndicatorEntryBeforePreProcessing +} + +export interface IndicatorsAfterPreProcessing { + y: IndicatorEntryAfterPreProcessing[] + x?: IndicatorEntryAfterPreProcessing + size?: IndicatorEntryAfterPreProcessing + color?: IndicatorEntryAfterPreProcessing +} + +export interface View> { + dimensions: MultiDimDimensionChoices + indicators: IndicatorsType + config?: Config +} + +export interface Config { + title?: string + subtitle?: string +} + +export type MultiDimDimensionChoices = Record // Keys: dimension slugs, values: choice slugs + +export type FaqEntryKeyedByGdocIdAndFragmentId = { + faqs: Record> +} + +export interface MultiDimDataPageProps { + configObj: MultiDimDataPageConfigPreProcessed + tagToSlugMap?: Record + faqEntries?: FaqEntryKeyedByGdocIdAndFragmentId + primaryTopic?: PrimaryTopic | undefined + + initialQueryStr?: string + canonicalUrl?: string + isPreviewing?: boolean +} diff --git a/packages/@ourworldindata/utils/src/MultiDimDataPageConfig.test.ts b/packages/@ourworldindata/utils/src/MultiDimDataPageConfig.test.ts new file mode 100644 index 00000000000..07342b78f51 --- /dev/null +++ b/packages/@ourworldindata/utils/src/MultiDimDataPageConfig.test.ts @@ -0,0 +1,91 @@ +#! /usr/bin/env jest + +import { MultiDimDataPageConfigPreProcessed } from "@ourworldindata/types" +import { MultiDimDataPageConfig } from "./MultiDimDataPageConfig.js" + +it("fromObject", () => { + const config = MultiDimDataPageConfig.fromObject({ title: "Test" } as any) + expect(config.config.title).toBe("Test") +}) + +const CONFIG: MultiDimDataPageConfigPreProcessed = { + title: { + title: "Anything goes", + }, + dimensions: [ + { + slug: "view", + name: "View", + choices: [ + { + slug: "stunting", + name: "Stunting", + }, + { + slug: "poverty", + name: "Poverty", + }, + ], + }, + { + slug: "interval", + name: "Time interval", + choices: [ + { + slug: "yearly", + name: "Yearly", + }, + { + slug: "weekly", + name: "Weekly", + }, + ], + }, + ], + views: [ + { + dimensions: { + view: "stunting", + interval: "yearly", + }, + indicators: { + y: [111, 222], + }, + }, + { + dimensions: { + view: "poverty", + interval: "yearly", + }, + indicators: { + y: [819727], + }, + }, + ], +} + +describe("methods", () => { + const config = MultiDimDataPageConfig.fromObject(CONFIG) + + it("dimensions", () => { + expect(Object.keys(config.dimensions)).toEqual(["view", "interval"]) + expect(Object.keys(config.dimensions["view"].choicesBySlug)).toEqual([ + "stunting", + "poverty", + ]) + }) + + it("filterViewsByDimensions", () => { + const views = config.filterViewsByDimensions({ + view: "stunting", + }) + expect(views).toHaveLength(1) + }) + + it("findViewByDimensions", () => { + const view = config.findViewByDimensions({ + view: "stunting", + }) + expect(view).toBeDefined() + }) +}) diff --git a/packages/@ourworldindata/utils/src/MultiDimDataPageConfig.ts b/packages/@ourworldindata/utils/src/MultiDimDataPageConfig.ts new file mode 100644 index 00000000000..23d17f1e390 --- /dev/null +++ b/packages/@ourworldindata/utils/src/MultiDimDataPageConfig.ts @@ -0,0 +1,204 @@ +import { + Choice, + ChoicesEnriched, + DimensionEnriched, + IndicatorsAfterPreProcessing, + MultiDimDataPageConfigPreProcessed, + MultiDimDimensionChoices, + View, + QueryParams, + OwidChartDimensionInterface, + DimensionProperty, +} from "@ourworldindata/types" +import { groupBy, keyBy, pick } from "./Util.js" +import { Url } from "./urls/Url.js" + +interface FilterToAvailableResult { + selectedChoices: MultiDimDimensionChoices + dimensionsWithAvailableChoices: Record +} + +export class MultiDimDataPageConfig { + private constructor( + public readonly config: MultiDimDataPageConfigPreProcessed + ) {} + + static fromJson(jsonString: string): MultiDimDataPageConfig { + return new MultiDimDataPageConfig(JSON.parse(jsonString)) + } + + static fromObject( + obj: MultiDimDataPageConfigPreProcessed + ): MultiDimDataPageConfig { + return new MultiDimDataPageConfig(obj) + } + + private static getEnrichedChoicesFields( + choices: Choice[] + ): ChoicesEnriched { + return { + choices, + choicesBySlug: keyBy(choices, "slug"), + choicesByGroup: groupBy(choices, "group"), + } + } + + get dimensions(): Record { + const dimensionsEnriched = this.config.dimensions.map((dimension) => ({ + ...dimension, + ...MultiDimDataPageConfig.getEnrichedChoicesFields( + dimension.choices + ), + })) + return keyBy(dimensionsEnriched, "slug") + } + + filterViewsByDimensions( + dimensions: MultiDimDimensionChoices + ): View[] { + return this.config.views.filter((view) => { + for (const [dimensionSlug, choiceSlug] of Object.entries( + dimensions + )) { + if (view.dimensions[dimensionSlug] !== choiceSlug) return false + } + return true + }) + } + + // This'll only ever find one or zero views, and will throw an error + // if more than one matching views were found + findViewByDimensions( + dimensions: MultiDimDimensionChoices + ): View | undefined { + const matchingViews = this.filterViewsByDimensions(dimensions) + if (matchingViews.length === 0) return undefined + if (matchingViews.length > 1) { + throw new Error( + `Multiple views found for dimensions ${JSON.stringify( + dimensions + )}` + ) + } + return matchingViews[0] + } + + /** + * This checks if matching views are available for the selected choices, and otherwise + * adapts them in such a way that they are available, in the following way: + * - Go through the choices left-to-right. The current dimension we're looking at is called `cur`. + * - If there is at least one available view for choices[leftmost, ..., cur], continue. + * - Otherwise, for dimension `cur`, find the first choice that has at least one available view. + * + * The method returns two values: + * - `selectedChoices` is the updated version of the input `selectedChoices`, where choices have been adapted to make sure there are available views. It is fully-qualified, i.e. it has choices for all dimensions. + * - `dimensionsWithAvailableChoices` indicates for each dimension which choices are available, and excludes the ones that are excluded by choices left of it. + * + * - @marcelgerber, 2024-07-22 + */ + filterToAvailableChoices( + selectedChoices: MultiDimDimensionChoices + ): FilterToAvailableResult { + const updatedSelectedChoices: MultiDimDimensionChoices = {} + const dimensionsWithAvailableChoices: Record< + string, + DimensionEnriched + > = {} + for (const [currentDimSlug, currentDim] of Object.entries( + this.dimensions + )) { + const availableViewsBeforeSelection = this.filterViewsByDimensions( + updatedSelectedChoices + ) + if ( + selectedChoices[currentDimSlug] && + currentDim.choicesBySlug[selectedChoices[currentDimSlug]] + ) { + updatedSelectedChoices[currentDimSlug] = + selectedChoices[currentDimSlug] + } else { + updatedSelectedChoices[currentDimSlug] = + availableViewsBeforeSelection[0].dimensions[currentDimSlug] + } + + const availableViewsAfterSelection = this.filterViewsByDimensions( + updatedSelectedChoices + ) + if (availableViewsAfterSelection.length === 0) { + // If there are no views available after this selection, choose the first available view before this choice and update to its choice + updatedSelectedChoices[currentDimSlug] = + availableViewsBeforeSelection[0].dimensions[currentDimSlug] + } + + // Find all the available choices we can show for this dimension - these are all + // the ones that are possible for this dimension with all of the previous choices + // (i.e., left of this dimension) in mind. + const availableChoicesForDimension = Object.values( + currentDim.choices + ).filter((choice) => + availableViewsBeforeSelection.some( + (view) => view.dimensions[currentDimSlug] === choice.slug + ) + ) + dimensionsWithAvailableChoices[currentDimSlug] = { + ...currentDim, + ...MultiDimDataPageConfig.getEnrichedChoicesFields( + availableChoicesForDimension + ), + } + } + + return { + selectedChoices: updatedSelectedChoices, + dimensionsWithAvailableChoices, + } + } + + static viewToDimensionsConfig( + view: View | undefined + ): OwidChartDimensionInterface[] { + if (!view?.indicators) return [] + + return Object.entries(view.indicators) + .flatMap(([property, variableIdOrIds]) => { + if (Array.isArray(variableIdOrIds)) { + return variableIdOrIds.map((variableId) => ({ + property: property as DimensionProperty, + variableId, + })) + } else { + return [ + { + property: property as DimensionProperty, + variableId: variableIdOrIds, + }, + ] + } + }) + .filter((dim) => dim.variableId !== undefined) + } +} + +// Helpers to convert from and to query strings +export const multiDimStateToQueryStr = ( + grapherQueryParams: QueryParams, + dimensionChoices: MultiDimDimensionChoices +): string => { + return Url.fromQueryParams(grapherQueryParams).updateQueryParams( + dimensionChoices + ).queryStr +} + +export const extractMultiDimChoicesFromQueryStr = ( + queryStr: string, + config: MultiDimDataPageConfig +): MultiDimDimensionChoices => { + const queryParams = Url.fromQueryStr(queryStr).queryParams + const dimensions = config.dimensions + const dimensionChoices = pick( + queryParams, + Object.keys(dimensions) + ) as MultiDimDimensionChoices + + return dimensionChoices +} diff --git a/packages/@ourworldindata/utils/src/index.ts b/packages/@ourworldindata/utils/src/index.ts index 03827a2eeb0..0a0f2413777 100644 --- a/packages/@ourworldindata/utils/src/index.ts +++ b/packages/@ourworldindata/utils/src/index.ts @@ -330,3 +330,9 @@ export { } from "./DonateUtils.js" export { isAndroid, isIOS } from "./BrowserUtils.js" + +export { + MultiDimDataPageConfig, + extractMultiDimChoicesFromQueryStr, + multiDimStateToQueryStr, +} from "./MultiDimDataPageConfig.js" diff --git a/public/multi-dim/causes-of-death.yml b/public/multi-dim/causes-of-death.yml new file mode 100644 index 00000000000..f5056dac729 --- /dev/null +++ b/public/multi-dim/causes-of-death.yml @@ -0,0 +1,4026 @@ +title: + title: Causes of death + titleVariant: by cause and age group +defaultSelection: + - World + - Europe + - Asia +dimensions: + - choices: + - description: See all causes side by side + name: All causes + slug: all + - description: null + name: Cardiovascular diseases + slug: Cardiovascular diseases + - description: null + name: Neoplasms + slug: Neoplasms + - description: null + name: Chronic respiratory diseases + slug: Chronic respiratory diseases + - description: null + name: Digestive diseases + slug: Digestive diseases + - description: null + name: Lower respiratory infections + slug: Lower respiratory infections + - description: null + name: Neonatal disorders + slug: Neonatal disorders + - description: null + name: Alzheimer's disease and other dementias + slug: Alzheimer's disease and other dementias + - description: null + name: Diabetes mellitus + slug: Diabetes mellitus + - description: null + name: Diarrheal diseases + slug: Diarrheal diseases + - description: null + name: Meningitis + slug: Meningitis + - description: null + name: Parkinson's disease + slug: Parkinson's disease + - description: null + name: Nutritional deficiencies + slug: Nutritional deficiencies + - description: null + name: Malaria + slug: Malaria + - description: null + name: Drowning + slug: Drowning + - description: null + name: Interpersonal violence + slug: Interpersonal violence + - description: null + name: Maternal disorders + slug: Maternal disorders + - description: null + name: HIV/AIDS + slug: HIV/AIDS + - description: null + name: Drug use disorders + slug: Drug use disorders + - description: null + name: Tuberculosis + slug: Tuberculosis + - description: null + name: Alcohol use disorders + slug: Alcohol use disorders + - description: null + name: Self-harm + slug: Self-harm + - description: null + name: Exposure to forces of nature + slug: Exposure to forces of nature + - description: null + name: Environmental heat and cold exposure + slug: Environmental heat and cold exposure + - description: null + name: Conflict and terrorism + slug: Conflict and terrorism + - description: null + name: Chronic kidney disease + slug: Chronic kidney disease + - description: null + name: Poisonings + slug: Poisonings + - description: null + name: Road injuries + slug: Road injuries + - description: null + name: Fire, heat, and hot substances + slug: Fire, heat, and hot substances + - description: null + name: Acute hepatitis + slug: Acute hepatitis + - description: null + name: COVID-19 + slug: COVID-19 + name: Cause of death + slug: cause + - choices: + - description: null + name: 15-49 years + slug: 15-49 years + - description: null + name: 5-14 years + slug: 5-14 years + - description: null + name: 50-69 years + slug: 50-69 years + - description: null + name: 70+ years + slug: 70+ years + - description: null + name: <5 years + slug: <5 years + - description: null + name: All ages + slug: All ages + - description: null + name: Age-standardized + slug: Age-standardized + name: Age group + slug: age + - choices: + - description: null + name: Number + slug: Number + - description: null + name: Percent + slug: Percent + - description: null + name: Rate + slug: Rate + name: Metric + slug: metric +dimensions_title: by cause +name: Causes of death +views: + - dimensions: + age: 15-49 years + cause: Cardiovascular diseases + metric: Number + indicators: + y: 917705 + - dimensions: + age: 15-49 years + cause: Neoplasms + metric: Number + indicators: + y: 918245 + - dimensions: + age: 15-49 years + cause: Chronic respiratory diseases + metric: Number + indicators: + y: 917770 + - dimensions: + age: 15-49 years + cause: Digestive diseases + metric: Number + indicators: + y: 917862 + - dimensions: + age: 15-49 years + cause: Lower respiratory infections + metric: Number + indicators: + y: 918135 + - dimensions: + age: 15-49 years + cause: Alzheimer's disease and other dementias + metric: Number + indicators: + y: 917635 + - dimensions: + age: 15-49 years + cause: Diabetes mellitus + metric: Number + indicators: + y: 917846 + - dimensions: + age: 15-49 years + cause: Diarrheal diseases + metric: Number + indicators: + y: 917856 + - dimensions: + age: 15-49 years + cause: Meningitis + metric: Number + indicators: + y: 918186 + - dimensions: + age: 15-49 years + cause: Parkinson's disease + metric: Number + indicators: + y: 918482 + - dimensions: + age: 15-49 years + cause: Nutritional deficiencies + metric: Number + indicators: + y: 918302 + - dimensions: + age: 15-49 years + cause: Malaria + metric: Number + indicators: + y: 918139 + - dimensions: + age: 15-49 years + cause: Drowning + metric: Number + indicators: + y: 917874 + - dimensions: + age: 15-49 years + cause: Interpersonal violence + metric: Number + indicators: + y: 918052 + - dimensions: + age: 15-49 years + cause: Maternal disorders + metric: Number + indicators: + y: 918163 + - dimensions: + age: 15-49 years + cause: HIV/AIDS + metric: Number + indicators: + y: 917997 + - dimensions: + age: 15-49 years + cause: Drug use disorders + metric: Number + indicators: + y: 917880 + - dimensions: + age: 15-49 years + cause: Tuberculosis + metric: Number + indicators: + y: 918679 + - dimensions: + age: 15-49 years + cause: Alcohol use disorders + metric: Number + indicators: + y: 917621 + - dimensions: + age: 15-49 years + cause: Self-harm + metric: Number + indicators: + y: 918578 + - dimensions: + age: 15-49 years + cause: Exposure to forces of nature + metric: Number + indicators: + y: 917931 + - dimensions: + age: 15-49 years + cause: Environmental heat and cold exposure + metric: Number + indicators: + y: 917923 + - dimensions: + age: 15-49 years + cause: Conflict and terrorism + metric: Number + indicators: + y: 917804 + - dimensions: + age: 15-49 years + cause: Chronic kidney disease + metric: Number + indicators: + y: 917733 + - dimensions: + age: 15-49 years + cause: Poisonings + metric: Number + indicators: + y: 918524 + - dimensions: + age: 15-49 years + cause: Road injuries + metric: Number + indicators: + y: 918569 + - dimensions: + age: 15-49 years + cause: Fire, heat, and hot substances + metric: Number + indicators: + y: 917954 + - dimensions: + age: 15-49 years + cause: Acute hepatitis + metric: Number + indicators: + y: 917583 + - dimensions: + age: 15-49 years + cause: COVID-19 + metric: Number + indicators: + y: 917697 + - dimensions: + age: 15-49 years + cause: all + metric: Number + indicators: + y: + - 917583 + - 917621 + - 917635 + - 917697 + - 917705 + - 917733 + - 917770 + - 917804 + - 917846 + - 917856 + - 917862 + - 917874 + - 917880 + - 917923 + - 917931 + - 917954 + - 917997 + - 918052 + - 918135 + - 918139 + - 918163 + - 918186 + - 918245 + - 918302 + - 918482 + - 918524 + - 918569 + - 918578 + - 918679 + - dimensions: + age: 15-49 years + cause: Cardiovascular diseases + metric: Percent + indicators: + y: 923608 + - dimensions: + age: 15-49 years + cause: Neoplasms + metric: Percent + indicators: + y: 923878 + - dimensions: + age: 15-49 years + cause: Chronic respiratory diseases + metric: Percent + indicators: + y: 923642 + - dimensions: + age: 15-49 years + cause: Digestive diseases + metric: Percent + indicators: + y: 923691 + - dimensions: + age: 15-49 years + cause: Lower respiratory infections + metric: Percent + indicators: + y: 923825 + - dimensions: + age: 15-49 years + cause: Alzheimer's disease and other dementias + metric: Percent + indicators: + y: 923573 + - dimensions: + age: 15-49 years + cause: Diabetes mellitus + metric: Percent + indicators: + y: 923681 + - dimensions: + age: 15-49 years + cause: Diarrheal diseases + metric: Percent + indicators: + y: 923686 + - dimensions: + age: 15-49 years + cause: Meningitis + metric: Percent + indicators: + y: 923849 + - dimensions: + age: 15-49 years + cause: Parkinson's disease + metric: Percent + indicators: + y: 923995 + - dimensions: + age: 15-49 years + cause: Nutritional deficiencies + metric: Percent + indicators: + y: 923904 + - dimensions: + age: 15-49 years + cause: Malaria + metric: Percent + indicators: + y: 923823 + - dimensions: + age: 15-49 years + cause: Drowning + metric: Percent + indicators: + y: 923696 + - dimensions: + age: 15-49 years + cause: Interpersonal violence + metric: Percent + indicators: + y: 923781 + - dimensions: + age: 15-49 years + cause: Maternal disorders + metric: Percent + indicators: + y: 923836 + - dimensions: + age: 15-49 years + cause: HIV/AIDS + metric: Percent + indicators: + y: 923753 + - dimensions: + age: 15-49 years + cause: Drug use disorders + metric: Percent + indicators: + y: 923699 + - dimensions: + age: 15-49 years + cause: Tuberculosis + metric: Percent + indicators: + y: 924091 + - dimensions: + age: 15-49 years + cause: Alcohol use disorders + metric: Percent + indicators: + y: 923568 + - dimensions: + age: 15-49 years + cause: Self-harm + metric: Percent + indicators: + y: 924041 + - dimensions: + age: 15-49 years + cause: Exposure to forces of nature + metric: Percent + indicators: + y: 923724 + - dimensions: + age: 15-49 years + cause: Environmental heat and cold exposure + metric: Percent + indicators: + y: 923720 + - dimensions: + age: 15-49 years + cause: Conflict and terrorism + metric: Percent + indicators: + y: 923659 + - dimensions: + age: 15-49 years + cause: Chronic kidney disease + metric: Percent + indicators: + y: 923623 + - dimensions: + age: 15-49 years + cause: Poisonings + metric: Percent + indicators: + y: 924013 + - dimensions: + age: 15-49 years + cause: Road injuries + metric: Percent + indicators: + y: 924038 + - dimensions: + age: 15-49 years + cause: Fire, heat, and hot substances + metric: Percent + indicators: + y: 923733 + - dimensions: + age: 15-49 years + cause: Acute hepatitis + metric: Percent + indicators: + y: 923549 + - dimensions: + age: 15-49 years + cause: COVID-19 + metric: Percent + indicators: + y: 923603 + - dimensions: + age: 15-49 years + cause: all + metric: Percent + indicators: + y: + - 923549 + - 923568 + - 923573 + - 923603 + - 923608 + - 923623 + - 923642 + - 923659 + - 923681 + - 923686 + - 923691 + - 923696 + - 923699 + - 923720 + - 923724 + - 923733 + - 923753 + - 923781 + - 923823 + - 923825 + - 923836 + - 923849 + - 923878 + - 923904 + - 923995 + - 924013 + - 924038 + - 924041 + - 924091 + - dimensions: + age: 15-49 years + cause: Cardiovascular diseases + metric: Rate + indicators: + y: 926847 + - dimensions: + age: 15-49 years + cause: Neoplasms + metric: Rate + indicators: + y: 927118 + - dimensions: + age: 15-49 years + cause: Chronic respiratory diseases + metric: Rate + indicators: + y: 926880 + - dimensions: + age: 15-49 years + cause: Digestive diseases + metric: Rate + indicators: + y: 926928 + - dimensions: + age: 15-49 years + cause: Lower respiratory infections + metric: Rate + indicators: + y: 927061 + - dimensions: + age: 15-49 years + cause: Alzheimer's disease and other dementias + metric: Rate + indicators: + y: 926811 + - dimensions: + age: 15-49 years + cause: Diabetes mellitus + metric: Rate + indicators: + y: 926916 + - dimensions: + age: 15-49 years + cause: Diarrheal diseases + metric: Rate + indicators: + y: 926922 + - dimensions: + age: 15-49 years + cause: Meningitis + metric: Rate + indicators: + y: 927088 + - dimensions: + age: 15-49 years + cause: Parkinson's disease + metric: Rate + indicators: + y: 927235 + - dimensions: + age: 15-49 years + cause: Nutritional deficiencies + metric: Rate + indicators: + y: 927145 + - dimensions: + age: 15-49 years + cause: Malaria + metric: Rate + indicators: + y: 927063 + - dimensions: + age: 15-49 years + cause: Drowning + metric: Rate + indicators: + y: 926933 + - dimensions: + age: 15-49 years + cause: Interpersonal violence + metric: Rate + indicators: + y: 927021 + - dimensions: + age: 15-49 years + cause: Maternal disorders + metric: Rate + indicators: + y: 927078 + - dimensions: + age: 15-49 years + cause: HIV/AIDS + metric: Rate + indicators: + y: 926991 + - dimensions: + age: 15-49 years + cause: Drug use disorders + metric: Rate + indicators: + y: 926935 + - dimensions: + age: 15-49 years + cause: Tuberculosis + metric: Rate + indicators: + y: 927335 + - dimensions: + age: 15-49 years + cause: Alcohol use disorders + metric: Rate + indicators: + y: 926804 + - dimensions: + age: 15-49 years + cause: Self-harm + metric: Rate + indicators: + y: 927280 + - dimensions: + age: 15-49 years + cause: Exposure to forces of nature + metric: Rate + indicators: + y: 926960 + - dimensions: + age: 15-49 years + cause: Environmental heat and cold exposure + metric: Rate + indicators: + y: 926956 + - dimensions: + age: 15-49 years + cause: Conflict and terrorism + metric: Rate + indicators: + y: 926896 + - dimensions: + age: 15-49 years + cause: Chronic kidney disease + metric: Rate + indicators: + y: 926861 + - dimensions: + age: 15-49 years + cause: Poisonings + metric: Rate + indicators: + y: 927255 + - dimensions: + age: 15-49 years + cause: Road injuries + metric: Rate + indicators: + y: 927277 + - dimensions: + age: 15-49 years + cause: Fire, heat, and hot substances + metric: Rate + indicators: + y: 926971 + - dimensions: + age: 15-49 years + cause: Acute hepatitis + metric: Rate + indicators: + y: 926786 + - dimensions: + age: 15-49 years + cause: COVID-19 + metric: Rate + indicators: + y: 926842 + - dimensions: + age: 15-49 years + cause: all + metric: Rate + indicators: + y: + - 926786 + - 926804 + - 926811 + - 926842 + - 926847 + - 926861 + - 926880 + - 926896 + - 926916 + - 926922 + - 926928 + - 926933 + - 926935 + - 926956 + - 926960 + - 926971 + - 926991 + - 927021 + - 927061 + - 927063 + - 927078 + - 927088 + - 927118 + - 927145 + - 927235 + - 927255 + - 927277 + - 927280 + - 927335 + - dimensions: + age: 5-14 years + cause: Cardiovascular diseases + metric: Number + indicators: + y: 918855 + - dimensions: + age: 5-14 years + cause: Neoplasms + metric: Number + indicators: + y: 919321 + - dimensions: + age: 5-14 years + cause: Chronic respiratory diseases + metric: Number + indicators: + y: 918900 + - dimensions: + age: 5-14 years + cause: Digestive diseases + metric: Number + indicators: + y: 918980 + - dimensions: + age: 5-14 years + cause: Lower respiratory infections + metric: Number + indicators: + y: 919219 + - dimensions: + age: 5-14 years + cause: Diabetes mellitus + metric: Number + indicators: + y: 918961 + - dimensions: + age: 5-14 years + cause: Diarrheal diseases + metric: Number + indicators: + y: 918970 + - dimensions: + age: 5-14 years + cause: Meningitis + metric: Number + indicators: + y: 919268 + - dimensions: + age: 5-14 years + cause: Nutritional deficiencies + metric: Number + indicators: + y: 919350 + - dimensions: + age: 5-14 years + cause: Malaria + metric: Number + indicators: + y: 919224 + - dimensions: + age: 5-14 years + cause: Drowning + metric: Number + indicators: + y: 918991 + - dimensions: + age: 5-14 years + cause: Interpersonal violence + metric: Number + indicators: + y: 919160 + - dimensions: + age: 5-14 years + cause: Maternal disorders + metric: Number + indicators: + y: 919243 + - dimensions: + age: 5-14 years + cause: HIV/AIDS + metric: Number + indicators: + y: 919102 + - dimensions: + age: 5-14 years + cause: Drug use disorders + metric: Number + indicators: + y: 918996 + - dimensions: + age: 5-14 years + cause: Tuberculosis + metric: Number + indicators: + y: 919679 + - dimensions: + age: 5-14 years + cause: Alcohol use disorders + metric: Number + indicators: + y: 918798 + - dimensions: + age: 5-14 years + cause: Self-harm + metric: Number + indicators: + y: 919600 + - dimensions: + age: 5-14 years + cause: Exposure to forces of nature + metric: Number + indicators: + y: 919043 + - dimensions: + age: 5-14 years + cause: Environmental heat and cold exposure + metric: Number + indicators: + y: 919038 + - dimensions: + age: 5-14 years + cause: Conflict and terrorism + metric: Number + indicators: + y: 918920 + - dimensions: + age: 5-14 years + cause: Chronic kidney disease + metric: Number + indicators: + y: 918881 + - dimensions: + age: 5-14 years + cause: Poisonings + metric: Number + indicators: + y: 919543 + - dimensions: + age: 5-14 years + cause: Road injuries + metric: Number + indicators: + y: 919589 + - dimensions: + age: 5-14 years + cause: Fire, heat, and hot substances + metric: Number + indicators: + y: 919063 + - dimensions: + age: 5-14 years + cause: Acute hepatitis + metric: Number + indicators: + y: 918764 + - dimensions: + age: 5-14 years + cause: COVID-19 + metric: Number + indicators: + y: 918843 + - dimensions: + age: 5-14 years + cause: all + metric: Number + indicators: + y: + - 918764 + - 918798 + - 918843 + - 918855 + - 918881 + - 918900 + - 918920 + - 918961 + - 918970 + - 918980 + - 918991 + - 918996 + - 919038 + - 919043 + - 919063 + - 919102 + - 919160 + - 919219 + - 919224 + - 919243 + - 919268 + - 919321 + - 919350 + - 919543 + - 919589 + - 919600 + - 919679 + - dimensions: + age: 5-14 years + cause: Cardiovascular diseases + metric: Percent + indicators: + y: 924180 + - dimensions: + age: 5-14 years + cause: Neoplasms + metric: Percent + indicators: + y: 924410 + - dimensions: + age: 5-14 years + cause: Chronic respiratory diseases + metric: Percent + indicators: + y: 924202 + - dimensions: + age: 5-14 years + cause: Digestive diseases + metric: Percent + indicators: + y: 924241 + - dimensions: + age: 5-14 years + cause: Lower respiratory infections + metric: Percent + indicators: + y: 924360 + - dimensions: + age: 5-14 years + cause: Diabetes mellitus + metric: Percent + indicators: + y: 924233 + - dimensions: + age: 5-14 years + cause: Diarrheal diseases + metric: Percent + indicators: + y: 924237 + - dimensions: + age: 5-14 years + cause: Meningitis + metric: Percent + indicators: + y: 924385 + - dimensions: + age: 5-14 years + cause: Nutritional deficiencies + metric: Percent + indicators: + y: 924424 + - dimensions: + age: 5-14 years + cause: Malaria + metric: Percent + indicators: + y: 924363 + - dimensions: + age: 5-14 years + cause: Drowning + metric: Percent + indicators: + y: 924247 + - dimensions: + age: 5-14 years + cause: Interpersonal violence + metric: Percent + indicators: + y: 924330 + - dimensions: + age: 5-14 years + cause: Maternal disorders + metric: Percent + indicators: + y: 924373 + - dimensions: + age: 5-14 years + cause: HIV/AIDS + metric: Percent + indicators: + y: 924302 + - dimensions: + age: 5-14 years + cause: Drug use disorders + metric: Percent + indicators: + y: 924249 + - dimensions: + age: 5-14 years + cause: Tuberculosis + metric: Percent + indicators: + y: 924590 + - dimensions: + age: 5-14 years + cause: Alcohol use disorders + metric: Percent + indicators: + y: 924151 + - dimensions: + age: 5-14 years + cause: Self-harm + metric: Percent + indicators: + y: 924548 + - dimensions: + age: 5-14 years + cause: Exposure to forces of nature + metric: Percent + indicators: + y: 924273 + - dimensions: + age: 5-14 years + cause: Environmental heat and cold exposure + metric: Percent + indicators: + y: 924270 + - dimensions: + age: 5-14 years + cause: Conflict and terrorism + metric: Percent + indicators: + y: 924212 + - dimensions: + age: 5-14 years + cause: Chronic kidney disease + metric: Percent + indicators: + y: 924192 + - dimensions: + age: 5-14 years + cause: Poisonings + metric: Percent + indicators: + y: 924521 + - dimensions: + age: 5-14 years + cause: Road injuries + metric: Percent + indicators: + y: 924544 + - dimensions: + age: 5-14 years + cause: Fire, heat, and hot substances + metric: Percent + indicators: + y: 924283 + - dimensions: + age: 5-14 years + cause: Acute hepatitis + metric: Percent + indicators: + y: 924134 + - dimensions: + age: 5-14 years + cause: COVID-19 + metric: Percent + indicators: + y: 924175 + - dimensions: + age: 5-14 years + cause: all + metric: Percent + indicators: + y: + - 924134 + - 924151 + - 924175 + - 924180 + - 924192 + - 924202 + - 924212 + - 924233 + - 924237 + - 924241 + - 924247 + - 924249 + - 924270 + - 924273 + - 924283 + - 924302 + - 924330 + - 924360 + - 924363 + - 924373 + - 924385 + - 924410 + - 924424 + - 924521 + - 924544 + - 924548 + - 924590 + - dimensions: + age: 5-14 years + cause: Cardiovascular diseases + metric: Rate + indicators: + y: 927421 + - dimensions: + age: 5-14 years + cause: Neoplasms + metric: Rate + indicators: + y: 927650 + - dimensions: + age: 5-14 years + cause: Chronic respiratory diseases + metric: Rate + indicators: + y: 927442 + - dimensions: + age: 5-14 years + cause: Digestive diseases + metric: Rate + indicators: + y: 927481 + - dimensions: + age: 5-14 years + cause: Lower respiratory infections + metric: Rate + indicators: + y: 927600 + - dimensions: + age: 5-14 years + cause: Diabetes mellitus + metric: Rate + indicators: + y: 927473 + - dimensions: + age: 5-14 years + cause: Diarrheal diseases + metric: Rate + indicators: + y: 927477 + - dimensions: + age: 5-14 years + cause: Meningitis + metric: Rate + indicators: + y: 927625 + - dimensions: + age: 5-14 years + cause: Nutritional deficiencies + metric: Rate + indicators: + y: 927664 + - dimensions: + age: 5-14 years + cause: Malaria + metric: Rate + indicators: + y: 927602 + - dimensions: + age: 5-14 years + cause: Drowning + metric: Rate + indicators: + y: 927487 + - dimensions: + age: 5-14 years + cause: Interpersonal violence + metric: Rate + indicators: + y: 927571 + - dimensions: + age: 5-14 years + cause: Maternal disorders + metric: Rate + indicators: + y: 927614 + - dimensions: + age: 5-14 years + cause: HIV/AIDS + metric: Rate + indicators: + y: 927542 + - dimensions: + age: 5-14 years + cause: Drug use disorders + metric: Rate + indicators: + y: 927489 + - dimensions: + age: 5-14 years + cause: Tuberculosis + metric: Rate + indicators: + y: 927828 + - dimensions: + age: 5-14 years + cause: Alcohol use disorders + metric: Rate + indicators: + y: 927394 + - dimensions: + age: 5-14 years + cause: Self-harm + metric: Rate + indicators: + y: 927787 + - dimensions: + age: 5-14 years + cause: Exposure to forces of nature + metric: Rate + indicators: + y: 927513 + - dimensions: + age: 5-14 years + cause: Environmental heat and cold exposure + metric: Rate + indicators: + y: 927510 + - dimensions: + age: 5-14 years + cause: Conflict and terrorism + metric: Rate + indicators: + y: 927453 + - dimensions: + age: 5-14 years + cause: Chronic kidney disease + metric: Rate + indicators: + y: 927434 + - dimensions: + age: 5-14 years + cause: Poisonings + metric: Rate + indicators: + y: 927761 + - dimensions: + age: 5-14 years + cause: Road injuries + metric: Rate + indicators: + y: 927783 + - dimensions: + age: 5-14 years + cause: Fire, heat, and hot substances + metric: Rate + indicators: + y: 927523 + - dimensions: + age: 5-14 years + cause: Acute hepatitis + metric: Rate + indicators: + y: 927376 + - dimensions: + age: 5-14 years + cause: COVID-19 + metric: Rate + indicators: + y: 927417 + - dimensions: + age: 5-14 years + cause: all + metric: Rate + indicators: + y: + - 927376 + - 927394 + - 927417 + - 927421 + - 927434 + - 927442 + - 927453 + - 927473 + - 927477 + - 927481 + - 927487 + - 927489 + - 927510 + - 927513 + - 927523 + - 927542 + - 927571 + - 927600 + - 927602 + - 927614 + - 927625 + - 927650 + - 927664 + - 927761 + - 927783 + - 927787 + - 927828 + - dimensions: + age: 50-69 years + cause: Cardiovascular diseases + metric: Number + indicators: + y: 919878 + - dimensions: + age: 50-69 years + cause: Neoplasms + metric: Number + indicators: + y: 920418 + - dimensions: + age: 50-69 years + cause: Chronic respiratory diseases + metric: Number + indicators: + y: 919944 + - dimensions: + age: 50-69 years + cause: Digestive diseases + metric: Number + indicators: + y: 920040 + - dimensions: + age: 50-69 years + cause: Lower respiratory infections + metric: Number + indicators: + y: 920313 + - dimensions: + age: 50-69 years + cause: Alzheimer's disease and other dementias + metric: Number + indicators: + y: 919811 + - dimensions: + age: 50-69 years + cause: Diabetes mellitus + metric: Number + indicators: + y: 920019 + - dimensions: + age: 50-69 years + cause: Diarrheal diseases + metric: Number + indicators: + y: 920029 + - dimensions: + age: 50-69 years + cause: Meningitis + metric: Number + indicators: + y: 920367 + - dimensions: + age: 50-69 years + cause: Parkinson's disease + metric: Number + indicators: + y: 920651 + - dimensions: + age: 50-69 years + cause: Nutritional deficiencies + metric: Number + indicators: + y: 920471 + - dimensions: + age: 50-69 years + cause: Malaria + metric: Number + indicators: + y: 920317 + - dimensions: + age: 50-69 years + cause: Drowning + metric: Number + indicators: + y: 920052 + - dimensions: + age: 50-69 years + cause: Interpersonal violence + metric: Number + indicators: + y: 920230 + - dimensions: + age: 50-69 years + cause: Maternal disorders + metric: Number + indicators: + y: 920341 + - dimensions: + age: 50-69 years + cause: HIV/AIDS + metric: Number + indicators: + y: 920168 + - dimensions: + age: 50-69 years + cause: Drug use disorders + metric: Number + indicators: + y: 920057 + - dimensions: + age: 50-69 years + cause: Tuberculosis + metric: Number + indicators: + y: 920850 + - dimensions: + age: 50-69 years + cause: Alcohol use disorders + metric: Number + indicators: + y: 919799 + - dimensions: + age: 50-69 years + cause: Self-harm + metric: Number + indicators: + y: 920748 + - dimensions: + age: 50-69 years + cause: Exposure to forces of nature + metric: Number + indicators: + y: 920103 + - dimensions: + age: 50-69 years + cause: Environmental heat and cold exposure + metric: Number + indicators: + y: 920096 + - dimensions: + age: 50-69 years + cause: Conflict and terrorism + metric: Number + indicators: + y: 919979 + - dimensions: + age: 50-69 years + cause: Chronic kidney disease + metric: Number + indicators: + y: 919909 + - dimensions: + age: 50-69 years + cause: Poisonings + metric: Number + indicators: + y: 920694 + - dimensions: + age: 50-69 years + cause: Road injuries + metric: Number + indicators: + y: 920741 + - dimensions: + age: 50-69 years + cause: Fire, heat, and hot substances + metric: Number + indicators: + y: 920123 + - dimensions: + age: 50-69 years + cause: Acute hepatitis + metric: Number + indicators: + y: 919760 + - dimensions: + age: 50-69 years + cause: COVID-19 + metric: Number + indicators: + y: 919872 + - dimensions: + age: 50-69 years + cause: all + metric: Number + indicators: + y: + - 919760 + - 919799 + - 919811 + - 919872 + - 919878 + - 919909 + - 919944 + - 919979 + - 920019 + - 920029 + - 920040 + - 920052 + - 920057 + - 920096 + - 920103 + - 920123 + - 920168 + - 920230 + - 920313 + - 920317 + - 920341 + - 920367 + - 920418 + - 920471 + - 920651 + - 920694 + - 920741 + - 920748 + - 920850 + - dimensions: + age: 50-69 years + cause: Cardiovascular diseases + metric: Percent + indicators: + y: 924687 + - dimensions: + age: 50-69 years + cause: Neoplasms + metric: Percent + indicators: + y: 924952 + - dimensions: + age: 50-69 years + cause: Chronic respiratory diseases + metric: Percent + indicators: + y: 924720 + - dimensions: + age: 50-69 years + cause: Digestive diseases + metric: Percent + indicators: + y: 924769 + - dimensions: + age: 50-69 years + cause: Lower respiratory infections + metric: Percent + indicators: + y: 924899 + - dimensions: + age: 50-69 years + cause: Alzheimer's disease and other dementias + metric: Percent + indicators: + y: 924654 + - dimensions: + age: 50-69 years + cause: Diabetes mellitus + metric: Percent + indicators: + y: 924758 + - dimensions: + age: 50-69 years + cause: Diarrheal diseases + metric: Percent + indicators: + y: 924765 + - dimensions: + age: 50-69 years + cause: Meningitis + metric: Percent + indicators: + y: 924926 + - dimensions: + age: 50-69 years + cause: Parkinson's disease + metric: Percent + indicators: + y: 925066 + - dimensions: + age: 50-69 years + cause: Nutritional deficiencies + metric: Percent + indicators: + y: 924979 + - dimensions: + age: 50-69 years + cause: Malaria + metric: Percent + indicators: + y: 924901 + - dimensions: + age: 50-69 years + cause: Drowning + metric: Percent + indicators: + y: 924774 + - dimensions: + age: 50-69 years + cause: Interpersonal violence + metric: Percent + indicators: + y: 924859 + - dimensions: + age: 50-69 years + cause: Maternal disorders + metric: Percent + indicators: + y: 924914 + - dimensions: + age: 50-69 years + cause: HIV/AIDS + metric: Percent + indicators: + y: 924829 + - dimensions: + age: 50-69 years + cause: Drug use disorders + metric: Percent + indicators: + y: 924777 + - dimensions: + age: 50-69 years + cause: Tuberculosis + metric: Percent + indicators: + y: 925165 + - dimensions: + age: 50-69 years + cause: Alcohol use disorders + metric: Percent + indicators: + y: 924647 + - dimensions: + age: 50-69 years + cause: Self-harm + metric: Percent + indicators: + y: 925115 + - dimensions: + age: 50-69 years + cause: Exposure to forces of nature + metric: Percent + indicators: + y: 924799 + - dimensions: + age: 50-69 years + cause: Environmental heat and cold exposure + metric: Percent + indicators: + y: 924794 + - dimensions: + age: 50-69 years + cause: Conflict and terrorism + metric: Percent + indicators: + y: 924737 + - dimensions: + age: 50-69 years + cause: Chronic kidney disease + metric: Percent + indicators: + y: 924700 + - dimensions: + age: 50-69 years + cause: Poisonings + metric: Percent + indicators: + y: 925089 + - dimensions: + age: 50-69 years + cause: Road injuries + metric: Percent + indicators: + y: 925111 + - dimensions: + age: 50-69 years + cause: Fire, heat, and hot substances + metric: Percent + indicators: + y: 924809 + - dimensions: + age: 50-69 years + cause: Acute hepatitis + metric: Percent + indicators: + y: 924630 + - dimensions: + age: 50-69 years + cause: COVID-19 + metric: Percent + indicators: + y: 924682 + - dimensions: + age: 50-69 years + cause: all + metric: Percent + indicators: + y: + - 924630 + - 924647 + - 924654 + - 924682 + - 924687 + - 924700 + - 924720 + - 924737 + - 924758 + - 924765 + - 924769 + - 924774 + - 924777 + - 924794 + - 924799 + - 924809 + - 924829 + - 924859 + - 924899 + - 924901 + - 924914 + - 924926 + - 924952 + - 924979 + - 925066 + - 925089 + - 925111 + - 925115 + - 925165 + - dimensions: + age: 50-69 years + cause: Cardiovascular diseases + metric: Rate + indicators: + y: 927925 + - dimensions: + age: 50-69 years + cause: Neoplasms + metric: Rate + indicators: + y: 928192 + - dimensions: + age: 50-69 years + cause: Chronic respiratory diseases + metric: Rate + indicators: + y: 927959 + - dimensions: + age: 50-69 years + cause: Digestive diseases + metric: Rate + indicators: + y: 928006 + - dimensions: + age: 50-69 years + cause: Lower respiratory infections + metric: Rate + indicators: + y: 928139 + - dimensions: + age: 50-69 years + cause: Alzheimer's disease and other dementias + metric: Rate + indicators: + y: 927893 + - dimensions: + age: 50-69 years + cause: Diabetes mellitus + metric: Rate + indicators: + y: 927996 + - dimensions: + age: 50-69 years + cause: Diarrheal diseases + metric: Rate + indicators: + y: 928001 + - dimensions: + age: 50-69 years + cause: Meningitis + metric: Rate + indicators: + y: 928166 + - dimensions: + age: 50-69 years + cause: Parkinson's disease + metric: Rate + indicators: + y: 928308 + - dimensions: + age: 50-69 years + cause: Nutritional deficiencies + metric: Rate + indicators: + y: 928220 + - dimensions: + age: 50-69 years + cause: Malaria + metric: Rate + indicators: + y: 928141 + - dimensions: + age: 50-69 years + cause: Drowning + metric: Rate + indicators: + y: 928013 + - dimensions: + age: 50-69 years + cause: Interpersonal violence + metric: Rate + indicators: + y: 928096 + - dimensions: + age: 50-69 years + cause: Maternal disorders + metric: Rate + indicators: + y: 928154 + - dimensions: + age: 50-69 years + cause: HIV/AIDS + metric: Rate + indicators: + y: 928066 + - dimensions: + age: 50-69 years + cause: Drug use disorders + metric: Rate + indicators: + y: 928015 + - dimensions: + age: 50-69 years + cause: Tuberculosis + metric: Rate + indicators: + y: 928405 + - dimensions: + age: 50-69 years + cause: Alcohol use disorders + metric: Rate + indicators: + y: 927886 + - dimensions: + age: 50-69 years + cause: Self-harm + metric: Rate + indicators: + y: 928355 + - dimensions: + age: 50-69 years + cause: Exposure to forces of nature + metric: Rate + indicators: + y: 928036 + - dimensions: + age: 50-69 years + cause: Environmental heat and cold exposure + metric: Rate + indicators: + y: 928032 + - dimensions: + age: 50-69 years + cause: Conflict and terrorism + metric: Rate + indicators: + y: 927975 + - dimensions: + age: 50-69 years + cause: Chronic kidney disease + metric: Rate + indicators: + y: 927941 + - dimensions: + age: 50-69 years + cause: Poisonings + metric: Rate + indicators: + y: 928328 + - dimensions: + age: 50-69 years + cause: Road injuries + metric: Rate + indicators: + y: 928351 + - dimensions: + age: 50-69 years + cause: Fire, heat, and hot substances + metric: Rate + indicators: + y: 928045 + - dimensions: + age: 50-69 years + cause: Acute hepatitis + metric: Rate + indicators: + y: 927868 + - dimensions: + age: 50-69 years + cause: COVID-19 + metric: Rate + indicators: + y: 927922 + - dimensions: + age: 50-69 years + cause: all + metric: Rate + indicators: + y: + - 927868 + - 927886 + - 927893 + - 927922 + - 927925 + - 927941 + - 927959 + - 927975 + - 927996 + - 928001 + - 928006 + - 928013 + - 928015 + - 928032 + - 928036 + - 928045 + - 928066 + - 928096 + - 928139 + - 928141 + - 928154 + - 928166 + - 928192 + - 928220 + - 928308 + - 928328 + - 928351 + - 928355 + - 928405 + - dimensions: + age: 70+ years + cause: Cardiovascular diseases + metric: Number + indicators: + y: 921053 + - dimensions: + age: 70+ years + cause: Neoplasms + metric: Number + indicators: + y: 921522 + - dimensions: + age: 70+ years + cause: Chronic respiratory diseases + metric: Number + indicators: + y: 921121 + - dimensions: + age: 70+ years + cause: Digestive diseases + metric: Number + indicators: + y: 921200 + - dimensions: + age: 70+ years + cause: Lower respiratory infections + metric: Number + indicators: + y: 921445 + - dimensions: + age: 70+ years + cause: Alzheimer's disease and other dementias + metric: Number + indicators: + y: 920987 + - dimensions: + age: 70+ years + cause: Diabetes mellitus + metric: Number + indicators: + y: 921184 + - dimensions: + age: 70+ years + cause: Diarrheal diseases + metric: Number + indicators: + y: 921195 + - dimensions: + age: 70+ years + cause: Meningitis + metric: Number + indicators: + y: 921469 + - dimensions: + age: 70+ years + cause: Parkinson's disease + metric: Number + indicators: + y: 921744 + - dimensions: + age: 70+ years + cause: Nutritional deficiencies + metric: Number + indicators: + y: 921570 + - dimensions: + age: 70+ years + cause: Malaria + metric: Number + indicators: + y: 921454 + - dimensions: + age: 70+ years + cause: Drowning + metric: Number + indicators: + y: 921206 + - dimensions: + age: 70+ years + cause: Interpersonal violence + metric: Number + indicators: + y: 921373 + - dimensions: + age: 70+ years + cause: HIV/AIDS + metric: Number + indicators: + y: 921316 + - dimensions: + age: 70+ years + cause: Drug use disorders + metric: Number + indicators: + y: 921213 + - dimensions: + age: 70+ years + cause: Tuberculosis + metric: Number + indicators: + y: 921942 + - dimensions: + age: 70+ years + cause: Alcohol use disorders + metric: Number + indicators: + y: 920975 + - dimensions: + age: 70+ years + cause: Self-harm + metric: Number + indicators: + y: 921835 + - dimensions: + age: 70+ years + cause: Exposure to forces of nature + metric: Number + indicators: + y: 921253 + - dimensions: + age: 70+ years + cause: Environmental heat and cold exposure + metric: Number + indicators: + y: 921246 + - dimensions: + age: 70+ years + cause: Conflict and terrorism + metric: Number + indicators: + y: 921155 + - dimensions: + age: 70+ years + cause: Chronic kidney disease + metric: Number + indicators: + y: 921086 + - dimensions: + age: 70+ years + cause: Poisonings + metric: Number + indicators: + y: 921779 + - dimensions: + age: 70+ years + cause: Road injuries + metric: Number + indicators: + y: 921828 + - dimensions: + age: 70+ years + cause: Fire, heat, and hot substances + metric: Number + indicators: + y: 921276 + - dimensions: + age: 70+ years + cause: Acute hepatitis + metric: Number + indicators: + y: 920936 + - dimensions: + age: 70+ years + cause: COVID-19 + metric: Number + indicators: + y: 921048 + - dimensions: + age: 70+ years + cause: all + metric: Number + indicators: + y: + - 920936 + - 920975 + - 920987 + - 921048 + - 921053 + - 921086 + - 921121 + - 921155 + - 921184 + - 921195 + - 921200 + - 921206 + - 921213 + - 921246 + - 921253 + - 921276 + - 921316 + - 921373 + - 921445 + - 921454 + - 921469 + - 921522 + - 921570 + - 921744 + - 921779 + - 921828 + - 921835 + - 921942 + - dimensions: + age: 70+ years + cause: Cardiovascular diseases + metric: Percent + indicators: + y: 925266 + - dimensions: + age: 70+ years + cause: Neoplasms + metric: Percent + indicators: + y: 925498 + - dimensions: + age: 70+ years + cause: Chronic respiratory diseases + metric: Percent + indicators: + y: 925299 + - dimensions: + age: 70+ years + cause: Digestive diseases + metric: Percent + indicators: + y: 925340 + - dimensions: + age: 70+ years + cause: Lower respiratory infections + metric: Percent + indicators: + y: 925461 + - dimensions: + age: 70+ years + cause: Alzheimer's disease and other dementias + metric: Percent + indicators: + y: 925232 + - dimensions: + age: 70+ years + cause: Diabetes mellitus + metric: Percent + indicators: + y: 925330 + - dimensions: + age: 70+ years + cause: Diarrheal diseases + metric: Percent + indicators: + y: 925336 + - dimensions: + age: 70+ years + cause: Meningitis + metric: Percent + indicators: + y: 925470 + - dimensions: + age: 70+ years + cause: Parkinson's disease + metric: Percent + indicators: + y: 925605 + - dimensions: + age: 70+ years + cause: Nutritional deficiencies + metric: Percent + indicators: + y: 925523 + - dimensions: + age: 70+ years + cause: Malaria + metric: Percent + indicators: + y: 925463 + - dimensions: + age: 70+ years + cause: Drowning + metric: Percent + indicators: + y: 925343 + - dimensions: + age: 70+ years + cause: Interpersonal violence + metric: Percent + indicators: + y: 925420 + - dimensions: + age: 70+ years + cause: HIV/AIDS + metric: Percent + indicators: + y: 925394 + - dimensions: + age: 70+ years + cause: Drug use disorders + metric: Percent + indicators: + y: 925344 + - dimensions: + age: 70+ years + cause: Tuberculosis + metric: Percent + indicators: + y: 925704 + - dimensions: + age: 70+ years + cause: Alcohol use disorders + metric: Percent + indicators: + y: 925225 + - dimensions: + age: 70+ years + cause: Self-harm + metric: Percent + indicators: + y: 925652 + - dimensions: + age: 70+ years + cause: Exposure to forces of nature + metric: Percent + indicators: + y: 925363 + - dimensions: + age: 70+ years + cause: Environmental heat and cold exposure + metric: Percent + indicators: + y: 925359 + - dimensions: + age: 70+ years + cause: Conflict and terrorism + metric: Percent + indicators: + y: 925316 + - dimensions: + age: 70+ years + cause: Chronic kidney disease + metric: Percent + indicators: + y: 925281 + - dimensions: + age: 70+ years + cause: Poisonings + metric: Percent + indicators: + y: 925624 + - dimensions: + age: 70+ years + cause: Road injuries + metric: Percent + indicators: + y: 925648 + - dimensions: + age: 70+ years + cause: Fire, heat, and hot substances + metric: Percent + indicators: + y: 925374 + - dimensions: + age: 70+ years + cause: Acute hepatitis + metric: Percent + indicators: + y: 925206 + - dimensions: + age: 70+ years + cause: COVID-19 + metric: Percent + indicators: + y: 925260 + - dimensions: + age: 70+ years + cause: all + metric: Percent + indicators: + y: + - 925206 + - 925225 + - 925232 + - 925260 + - 925266 + - 925281 + - 925299 + - 925316 + - 925330 + - 925336 + - 925340 + - 925343 + - 925344 + - 925359 + - 925363 + - 925374 + - 925394 + - 925420 + - 925461 + - 925463 + - 925470 + - 925498 + - 925523 + - 925605 + - 925624 + - 925648 + - 925652 + - 925704 + - dimensions: + age: 70+ years + cause: Cardiovascular diseases + metric: Rate + indicators: + y: 928507 + - dimensions: + age: 70+ years + cause: Neoplasms + metric: Rate + indicators: + y: 928737 + - dimensions: + age: 70+ years + cause: Chronic respiratory diseases + metric: Rate + indicators: + y: 928539 + - dimensions: + age: 70+ years + cause: Digestive diseases + metric: Rate + indicators: + y: 928581 + - dimensions: + age: 70+ years + cause: Lower respiratory infections + metric: Rate + indicators: + y: 928700 + - dimensions: + age: 70+ years + cause: Alzheimer's disease and other dementias + metric: Rate + indicators: + y: 928473 + - dimensions: + age: 70+ years + cause: Diabetes mellitus + metric: Rate + indicators: + y: 928573 + - dimensions: + age: 70+ years + cause: Diarrheal diseases + metric: Rate + indicators: + y: 928580 + - dimensions: + age: 70+ years + cause: Meningitis + metric: Rate + indicators: + y: 928710 + - dimensions: + age: 70+ years + cause: Parkinson's disease + metric: Rate + indicators: + y: 928844 + - dimensions: + age: 70+ years + cause: Nutritional deficiencies + metric: Rate + indicators: + y: 928762 + - dimensions: + age: 70+ years + cause: Malaria + metric: Rate + indicators: + y: 928703 + - dimensions: + age: 70+ years + cause: Drowning + metric: Rate + indicators: + y: 928585 + - dimensions: + age: 70+ years + cause: Interpersonal violence + metric: Rate + indicators: + y: 928663 + - dimensions: + age: 70+ years + cause: HIV/AIDS + metric: Rate + indicators: + y: 928636 + - dimensions: + age: 70+ years + cause: Drug use disorders + metric: Rate + indicators: + y: 928588 + - dimensions: + age: 70+ years + cause: Tuberculosis + metric: Rate + indicators: + y: 928941 + - dimensions: + age: 70+ years + cause: Alcohol use disorders + metric: Rate + indicators: + y: 928467 + - dimensions: + age: 70+ years + cause: Self-harm + metric: Rate + indicators: + y: 928889 + - dimensions: + age: 70+ years + cause: Exposure to forces of nature + metric: Rate + indicators: + y: 928605 + - dimensions: + age: 70+ years + cause: Environmental heat and cold exposure + metric: Rate + indicators: + y: 928602 + - dimensions: + age: 70+ years + cause: Conflict and terrorism + metric: Rate + indicators: + y: 928558 + - dimensions: + age: 70+ years + cause: Chronic kidney disease + metric: Rate + indicators: + y: 928521 + - dimensions: + age: 70+ years + cause: Poisonings + metric: Rate + indicators: + y: 928862 + - dimensions: + age: 70+ years + cause: Road injuries + metric: Rate + indicators: + y: 928886 + - dimensions: + age: 70+ years + cause: Fire, heat, and hot substances + metric: Rate + indicators: + y: 928616 + - dimensions: + age: 70+ years + cause: Acute hepatitis + metric: Rate + indicators: + y: 928448 + - dimensions: + age: 70+ years + cause: COVID-19 + metric: Rate + indicators: + y: 928503 + - dimensions: + age: 70+ years + cause: all + metric: Rate + indicators: + y: + - 928448 + - 928467 + - 928473 + - 928503 + - 928507 + - 928521 + - 928539 + - 928558 + - 928573 + - 928580 + - 928581 + - 928585 + - 928588 + - 928602 + - 928605 + - 928616 + - 928636 + - 928663 + - 928700 + - 928703 + - 928710 + - 928737 + - 928762 + - 928844 + - 928862 + - 928886 + - 928889 + - 928941 + - dimensions: + age: <5 years + cause: Cardiovascular diseases + metric: Number + indicators: + y: 922101 + - dimensions: + age: <5 years + cause: Neoplasms + metric: Number + indicators: + y: 922390 + - dimensions: + age: <5 years + cause: Chronic respiratory diseases + metric: Number + indicators: + y: 922135 + - dimensions: + age: <5 years + cause: Digestive diseases + metric: Number + indicators: + y: 922190 + - dimensions: + age: <5 years + cause: Lower respiratory infections + metric: Number + indicators: + y: 922335 + - dimensions: + age: <5 years + cause: Neonatal disorders + metric: Number + indicators: + y: 922375 + - dimensions: + age: <5 years + cause: Diabetes mellitus + metric: Number + indicators: + y: 922177 + - dimensions: + age: <5 years + cause: Diarrheal diseases + metric: Number + indicators: + y: 922185 + - dimensions: + age: <5 years + cause: Meningitis + metric: Number + indicators: + y: 922352 + - dimensions: + age: <5 years + cause: Nutritional deficiencies + metric: Number + indicators: + y: 922411 + - dimensions: + age: <5 years + cause: Malaria + metric: Number + indicators: + y: 922336 + - dimensions: + age: <5 years + cause: Drowning + metric: Number + indicators: + y: 922200 + - dimensions: + age: <5 years + cause: Interpersonal violence + metric: Number + indicators: + y: 922306 + - dimensions: + age: <5 years + cause: HIV/AIDS + metric: Number + indicators: + y: 922263 + - dimensions: + age: <5 years + cause: Drug use disorders + metric: Number + indicators: + y: 922202 + - dimensions: + age: <5 years + cause: Tuberculosis + metric: Number + indicators: + y: 922639 + - dimensions: + age: <5 years + cause: Alcohol use disorders + metric: Number + indicators: + y: 922058 + - dimensions: + age: <5 years + cause: Exposure to forces of nature + metric: Number + indicators: + y: 922229 + - dimensions: + age: <5 years + cause: Environmental heat and cold exposure + metric: Number + indicators: + y: 922227 + - dimensions: + age: <5 years + cause: Conflict and terrorism + metric: Number + indicators: + y: 922147 + - dimensions: + age: <5 years + cause: Chronic kidney disease + metric: Number + indicators: + y: 922120 + - dimensions: + age: <5 years + cause: Poisonings + metric: Number + indicators: + y: 922551 + - dimensions: + age: <5 years + cause: Road injuries + metric: Number + indicators: + y: 922582 + - dimensions: + age: <5 years + cause: Fire, heat, and hot substances + metric: Number + indicators: + y: 922244 + - dimensions: + age: <5 years + cause: Acute hepatitis + metric: Number + indicators: + y: 922018 + - dimensions: + age: <5 years + cause: COVID-19 + metric: Number + indicators: + y: 922096 + - dimensions: + age: <5 years + cause: all + metric: Number + indicators: + y: + - 922018 + - 922058 + - 922096 + - 922101 + - 922120 + - 922135 + - 922147 + - 922177 + - 922185 + - 922190 + - 922200 + - 922202 + - 922227 + - 922229 + - 922244 + - 922263 + - 922306 + - 922335 + - 922336 + - 922352 + - 922375 + - 922390 + - 922411 + - 922551 + - 922582 + - 922639 + - dimensions: + age: <5 years + cause: Cardiovascular diseases + metric: Percent + indicators: + y: 925785 + - dimensions: + age: <5 years + cause: Neoplasms + metric: Percent + indicators: + y: 925977 + - dimensions: + age: <5 years + cause: Chronic respiratory diseases + metric: Percent + indicators: + y: 925806 + - dimensions: + age: <5 years + cause: Digestive diseases + metric: Percent + indicators: + y: 925844 + - dimensions: + age: <5 years + cause: Lower respiratory infections + metric: Percent + indicators: + y: 925941 + - dimensions: + age: <5 years + cause: Neonatal disorders + metric: Percent + indicators: + y: 925970 + - dimensions: + age: <5 years + cause: Diabetes mellitus + metric: Percent + indicators: + y: 925836 + - dimensions: + age: <5 years + cause: Diarrheal diseases + metric: Percent + indicators: + y: 925842 + - dimensions: + age: <5 years + cause: Meningitis + metric: Percent + indicators: + y: 925951 + - dimensions: + age: <5 years + cause: Nutritional deficiencies + metric: Percent + indicators: + y: 925992 + - dimensions: + age: <5 years + cause: Malaria + metric: Percent + indicators: + y: 925944 + - dimensions: + age: <5 years + cause: Drowning + metric: Percent + indicators: + y: 925851 + - dimensions: + age: <5 years + cause: Interpersonal violence + metric: Percent + indicators: + y: 925920 + - dimensions: + age: <5 years + cause: HIV/AIDS + metric: Percent + indicators: + y: 925893 + - dimensions: + age: <5 years + cause: Drug use disorders + metric: Percent + indicators: + y: 925853 + - dimensions: + age: <5 years + cause: Tuberculosis + metric: Percent + indicators: + y: 926143 + - dimensions: + age: <5 years + cause: Alcohol use disorders + metric: Percent + indicators: + y: 925761 + - dimensions: + age: <5 years + cause: Exposure to forces of nature + metric: Percent + indicators: + y: 925869 + - dimensions: + age: <5 years + cause: Environmental heat and cold exposure + metric: Percent + indicators: + y: 925866 + - dimensions: + age: <5 years + cause: Conflict and terrorism + metric: Percent + indicators: + y: 925814 + - dimensions: + age: <5 years + cause: Chronic kidney disease + metric: Percent + indicators: + y: 925795 + - dimensions: + age: <5 years + cause: Poisonings + metric: Percent + indicators: + y: 926082 + - dimensions: + age: <5 years + cause: Road injuries + metric: Percent + indicators: + y: 926103 + - dimensions: + age: <5 years + cause: Fire, heat, and hot substances + metric: Percent + indicators: + y: 925879 + - dimensions: + age: <5 years + cause: Acute hepatitis + metric: Percent + indicators: + y: 925743 + - dimensions: + age: <5 years + cause: COVID-19 + metric: Percent + indicators: + y: 925781 + - dimensions: + age: <5 years + cause: all + metric: Percent + indicators: + y: + - 925743 + - 925761 + - 925781 + - 925785 + - 925795 + - 925806 + - 925814 + - 925836 + - 925842 + - 925844 + - 925851 + - 925853 + - 925866 + - 925869 + - 925879 + - 925893 + - 925920 + - 925941 + - 925944 + - 925951 + - 925970 + - 925977 + - 925992 + - 926082 + - 926103 + - 926143 + - dimensions: + age: <5 years + cause: Cardiovascular diseases + metric: Rate + indicators: + y: 929021 + - dimensions: + age: <5 years + cause: Neoplasms + metric: Rate + indicators: + y: 929214 + - dimensions: + age: <5 years + cause: Chronic respiratory diseases + metric: Rate + indicators: + y: 929043 + - dimensions: + age: <5 years + cause: Digestive diseases + metric: Rate + indicators: + y: 929080 + - dimensions: + age: <5 years + cause: Lower respiratory infections + metric: Rate + indicators: + y: 929177 + - dimensions: + age: <5 years + cause: Neonatal disorders + metric: Rate + indicators: + y: 929206 + - dimensions: + age: <5 years + cause: Diabetes mellitus + metric: Rate + indicators: + y: 929070 + - dimensions: + age: <5 years + cause: Diarrheal diseases + metric: Rate + indicators: + y: 929075 + - dimensions: + age: <5 years + cause: Meningitis + metric: Rate + indicators: + y: 929188 + - dimensions: + age: <5 years + cause: Nutritional deficiencies + metric: Rate + indicators: + y: 929229 + - dimensions: + age: <5 years + cause: Malaria + metric: Rate + indicators: + y: 929180 + - dimensions: + age: <5 years + cause: Drowning + metric: Rate + indicators: + y: 929086 + - dimensions: + age: <5 years + cause: Interpersonal violence + metric: Rate + indicators: + y: 929155 + - dimensions: + age: <5 years + cause: HIV/AIDS + metric: Rate + indicators: + y: 929126 + - dimensions: + age: <5 years + cause: Drug use disorders + metric: Rate + indicators: + y: 929089 + - dimensions: + age: <5 years + cause: Tuberculosis + metric: Rate + indicators: + y: 929378 + - dimensions: + age: <5 years + cause: Alcohol use disorders + metric: Rate + indicators: + y: 929000 + - dimensions: + age: <5 years + cause: Exposure to forces of nature + metric: Rate + indicators: + y: 929103 + - dimensions: + age: <5 years + cause: Environmental heat and cold exposure + metric: Rate + indicators: + y: 929101 + - dimensions: + age: <5 years + cause: Conflict and terrorism + metric: Rate + indicators: + y: 929051 + - dimensions: + age: <5 years + cause: Chronic kidney disease + metric: Rate + indicators: + y: 929030 + - dimensions: + age: <5 years + cause: Poisonings + metric: Rate + indicators: + y: 929318 + - dimensions: + age: <5 years + cause: Road injuries + metric: Rate + indicators: + y: 929339 + - dimensions: + age: <5 years + cause: Fire, heat, and hot substances + metric: Rate + indicators: + y: 929114 + - dimensions: + age: <5 years + cause: Acute hepatitis + metric: Rate + indicators: + y: 928982 + - dimensions: + age: <5 years + cause: COVID-19 + metric: Rate + indicators: + y: 929017 + - dimensions: + age: <5 years + cause: all + metric: Rate + indicators: + y: + - 928982 + - 929000 + - 929017 + - 929021 + - 929030 + - 929043 + - 929051 + - 929070 + - 929075 + - 929080 + - 929086 + - 929089 + - 929101 + - 929103 + - 929114 + - 929126 + - 929155 + - 929177 + - 929180 + - 929188 + - 929206 + - 929214 + - 929229 + - 929318 + - 929339 + - 929378 + - dimensions: + age: All ages + cause: Cardiovascular diseases + metric: Number + indicators: + y: 922787 + - dimensions: + age: All ages + cause: Neoplasms + metric: Number + indicators: + y: 923200 + - dimensions: + age: All ages + cause: Chronic respiratory diseases + metric: Number + indicators: + y: 922835 + - dimensions: + age: All ages + cause: Digestive diseases + metric: Number + indicators: + y: 922902 + - dimensions: + age: All ages + cause: Lower respiratory infections + metric: Number + indicators: + y: 923105 + - dimensions: + age: All ages + cause: Neonatal disorders + metric: Number + indicators: + y: 923189 + - dimensions: + age: All ages + cause: Alzheimer's disease and other dementias + metric: Number + indicators: + y: 922732 + - dimensions: + age: All ages + cause: Diabetes mellitus + metric: Number + indicators: + y: 922886 + - dimensions: + age: All ages + cause: Diarrheal diseases + metric: Number + indicators: + y: 922894 + - dimensions: + age: All ages + cause: Meningitis + metric: Number + indicators: + y: 923145 + - dimensions: + age: All ages + cause: Parkinson's disease + metric: Number + indicators: + y: 923379 + - dimensions: + age: All ages + cause: Nutritional deficiencies + metric: Number + indicators: + y: 923241 + - dimensions: + age: All ages + cause: Malaria + metric: Number + indicators: + y: 923108 + - dimensions: + age: All ages + cause: Drowning + metric: Number + indicators: + y: 922910 + - dimensions: + age: All ages + cause: Interpersonal violence + metric: Number + indicators: + y: 923046 + - dimensions: + age: All ages + cause: Maternal disorders + metric: Number + indicators: + y: 923125 + - dimensions: + age: All ages + cause: HIV/AIDS + metric: Number + indicators: + y: 922998 + - dimensions: + age: All ages + cause: Drug use disorders + metric: Number + indicators: + y: 922913 + - dimensions: + age: All ages + cause: Tuberculosis + metric: Number + indicators: + y: 923509 + - dimensions: + age: All ages + cause: Alcohol use disorders + metric: Number + indicators: + y: 922723 + - dimensions: + age: All ages + cause: Self-harm + metric: Number + indicators: + y: 923453 + - dimensions: + age: All ages + cause: Exposure to forces of nature + metric: Number + indicators: + y: 922951 + - dimensions: + age: All ages + cause: Environmental heat and cold exposure + metric: Number + indicators: + y: 922943 + - dimensions: + age: All ages + cause: Conflict and terrorism + metric: Number + indicators: + y: 922858 + - dimensions: + age: All ages + cause: Chronic kidney disease + metric: Number + indicators: + y: 922808 + - dimensions: + age: All ages + cause: Poisonings + metric: Number + indicators: + y: 923410 + - dimensions: + age: All ages + cause: Road injuries + metric: Number + indicators: + y: 923449 + - dimensions: + age: All ages + cause: Fire, heat, and hot substances + metric: Number + indicators: + y: 922968 + - dimensions: + age: All ages + cause: Acute hepatitis + metric: Number + indicators: + y: 922696 + - dimensions: + age: All ages + cause: COVID-19 + metric: Number + indicators: + y: 922779 + - dimensions: + age: All ages + cause: all + metric: Number + indicators: + y: + - 922696 + - 922723 + - 922732 + - 922779 + - 922787 + - 922808 + - 922835 + - 922858 + - 922886 + - 922894 + - 922902 + - 922910 + - 922913 + - 922943 + - 922951 + - 922968 + - 922998 + - 923046 + - 923105 + - 923108 + - 923125 + - 923145 + - 923189 + - 923200 + - 923241 + - 923379 + - 923410 + - 923449 + - 923453 + - 923509 + - dimensions: + age: All ages + cause: Cardiovascular diseases + metric: Percent + indicators: + y: 926241 + - dimensions: + age: All ages + cause: Neoplasms + metric: Percent + indicators: + y: 926523 + - dimensions: + age: All ages + cause: Chronic respiratory diseases + metric: Percent + indicators: + y: 926274 + - dimensions: + age: All ages + cause: Digestive diseases + metric: Percent + indicators: + y: 926320 + - dimensions: + age: All ages + cause: Lower respiratory infections + metric: Percent + indicators: + y: 926459 + - dimensions: + age: All ages + cause: Neonatal disorders + metric: Percent + indicators: + y: 926515 + - dimensions: + age: All ages + cause: Alzheimer's disease and other dementias + metric: Percent + indicators: + y: 926207 + - dimensions: + age: All ages + cause: Diabetes mellitus + metric: Percent + indicators: + y: 926311 + - dimensions: + age: All ages + cause: Diarrheal diseases + metric: Percent + indicators: + y: 926317 + - dimensions: + age: All ages + cause: Meningitis + metric: Percent + indicators: + y: 926486 + - dimensions: + age: All ages + cause: Parkinson's disease + metric: Percent + indicators: + y: 926642 + - dimensions: + age: All ages + cause: Nutritional deficiencies + metric: Percent + indicators: + y: 926550 + - dimensions: + age: All ages + cause: Malaria + metric: Percent + indicators: + y: 926462 + - dimensions: + age: All ages + cause: Drowning + metric: Percent + indicators: + y: 926327 + - dimensions: + age: All ages + cause: Interpersonal violence + metric: Percent + indicators: + y: 926418 + - dimensions: + age: All ages + cause: Maternal disorders + metric: Percent + indicators: + y: 926473 + - dimensions: + age: All ages + cause: HIV/AIDS + metric: Percent + indicators: + y: 926386 + - dimensions: + age: All ages + cause: Drug use disorders + metric: Percent + indicators: + y: 926329 + - dimensions: + age: All ages + cause: Tuberculosis + metric: Percent + indicators: + y: 926745 + - dimensions: + age: All ages + cause: Alcohol use disorders + metric: Percent + indicators: + y: 926200 + - dimensions: + age: All ages + cause: Self-harm + metric: Percent + indicators: + y: 926692 + - dimensions: + age: All ages + cause: Exposure to forces of nature + metric: Percent + indicators: + y: 926353 + - dimensions: + age: All ages + cause: Environmental heat and cold exposure + metric: Percent + indicators: + y: 926350 + - dimensions: + age: All ages + cause: Conflict and terrorism + metric: Percent + indicators: + y: 926290 + - dimensions: + age: All ages + cause: Chronic kidney disease + metric: Percent + indicators: + y: 926255 + - dimensions: + age: All ages + cause: Poisonings + metric: Percent + indicators: + y: 926662 + - dimensions: + age: All ages + cause: Road injuries + metric: Percent + indicators: + y: 926687 + - dimensions: + age: All ages + cause: Fire, heat, and hot substances + metric: Percent + indicators: + y: 926364 + - dimensions: + age: All ages + cause: Acute hepatitis + metric: Percent + indicators: + y: 926180 + - dimensions: + age: All ages + cause: COVID-19 + metric: Percent + indicators: + y: 926236 + - dimensions: + age: All ages + cause: all + metric: Percent + indicators: + y: + - 926180 + - 926200 + - 926207 + - 926236 + - 926241 + - 926255 + - 926274 + - 926290 + - 926311 + - 926317 + - 926320 + - 926327 + - 926329 + - 926350 + - 926353 + - 926364 + - 926386 + - 926418 + - 926459 + - 926462 + - 926473 + - 926486 + - 926515 + - 926523 + - 926550 + - 926642 + - 926662 + - 926687 + - 926692 + - 926745 + - dimensions: + age: All ages + cause: Cardiovascular diseases + metric: Rate + indicators: + y: 930083 + - dimensions: + age: All ages + cause: Neoplasms + metric: Rate + indicators: + y: 930366 + - dimensions: + age: All ages + cause: Chronic respiratory diseases + metric: Rate + indicators: + y: 930116 + - dimensions: + age: All ages + cause: Digestive diseases + metric: Rate + indicators: + y: 930164 + - dimensions: + age: All ages + cause: Lower respiratory infections + metric: Rate + indicators: + y: 930303 + - dimensions: + age: All ages + cause: Neonatal disorders + metric: Rate + indicators: + y: 930358 + - dimensions: + age: All ages + cause: Alzheimer's disease and other dementias + metric: Rate + indicators: + y: 930047 + - dimensions: + age: All ages + cause: Diabetes mellitus + metric: Rate + indicators: + y: 930153 + - dimensions: + age: All ages + cause: Diarrheal diseases + metric: Rate + indicators: + y: 930159 + - dimensions: + age: All ages + cause: Meningitis + metric: Rate + indicators: + y: 930329 + - dimensions: + age: All ages + cause: Parkinson's disease + metric: Rate + indicators: + y: 930486 + - dimensions: + age: All ages + cause: Nutritional deficiencies + metric: Rate + indicators: + y: 930394 + - dimensions: + age: All ages + cause: Malaria + metric: Rate + indicators: + y: 930306 + - dimensions: + age: All ages + cause: Drowning + metric: Rate + indicators: + y: 930170 + - dimensions: + age: All ages + cause: Interpersonal violence + metric: Rate + indicators: + y: 930262 + - dimensions: + age: All ages + cause: Maternal disorders + metric: Rate + indicators: + y: 930316 + - dimensions: + age: All ages + cause: HIV/AIDS + metric: Rate + indicators: + y: 930229 + - dimensions: + age: All ages + cause: Drug use disorders + metric: Rate + indicators: + y: 930172 + - dimensions: + age: All ages + cause: Tuberculosis + metric: Rate + indicators: + y: 930540 + - dimensions: + age: All ages + cause: Alcohol use disorders + metric: Rate + indicators: + y: 930041 + - dimensions: + age: All ages + cause: Self-harm + metric: Rate + indicators: + y: 930514 + - dimensions: + age: All ages + cause: Exposure to forces of nature + metric: Rate + indicators: + y: 930198 + - dimensions: + age: All ages + cause: Environmental heat and cold exposure + metric: Rate + indicators: + y: 930194 + - dimensions: + age: All ages + cause: Conflict and terrorism + metric: Rate + indicators: + y: 930132 + - dimensions: + age: All ages + cause: Chronic kidney disease + metric: Rate + indicators: + y: 930097 + - dimensions: + age: All ages + cause: Poisonings + metric: Rate + indicators: + y: 930500 + - dimensions: + age: All ages + cause: Road injuries + metric: Rate + indicators: + y: 930512 + - dimensions: + age: All ages + cause: Fire, heat, and hot substances + metric: Rate + indicators: + y: 930209 + - dimensions: + age: All ages + cause: Acute hepatitis + metric: Rate + indicators: + y: 930023 + - dimensions: + age: All ages + cause: COVID-19 + metric: Rate + indicators: + y: 930079 + - dimensions: + age: All ages + cause: all + metric: Rate + indicators: + y: + - 930023 + - 930041 + - 930047 + - 930079 + - 930083 + - 930097 + - 930116 + - 930132 + - 930153 + - 930159 + - 930164 + - 930170 + - 930172 + - 930194 + - 930198 + - 930209 + - 930229 + - 930262 + - 930303 + - 930306 + - 930316 + - 930329 + - 930358 + - 930366 + - 930394 + - 930486 + - 930500 + - 930512 + - 930514 + - 930540 + - dimensions: + age: Age-standardized + cause: all + metric: Number + indicators: {} + - dimensions: + age: Age-standardized + cause: all + metric: Percent + indicators: {} + - dimensions: + age: Age-standardized + cause: Cardiovascular diseases + metric: Rate + indicators: + y: 929478 + - dimensions: + age: Age-standardized + cause: Neoplasms + metric: Rate + indicators: + y: 929758 + - dimensions: + age: Age-standardized + cause: Chronic respiratory diseases + metric: Rate + indicators: + y: 929510 + - dimensions: + age: Age-standardized + cause: Digestive diseases + metric: Rate + indicators: + y: 929557 + - dimensions: + age: Age-standardized + cause: Lower respiratory infections + metric: Rate + indicators: + y: 929695 + - dimensions: + age: Age-standardized + cause: Neonatal disorders + metric: Rate + indicators: + y: 929751 + - dimensions: + age: Age-standardized + cause: Alzheimer's disease and other dementias + metric: Rate + indicators: + y: 929443 + - dimensions: + age: Age-standardized + cause: Diabetes mellitus + metric: Rate + indicators: + y: 929547 + - dimensions: + age: Age-standardized + cause: Diarrheal diseases + metric: Rate + indicators: + y: 929553 + - dimensions: + age: Age-standardized + cause: Meningitis + metric: Rate + indicators: + y: 929721 + - dimensions: + age: Age-standardized + cause: Parkinson's disease + metric: Rate + indicators: + y: 929879 + - dimensions: + age: Age-standardized + cause: Nutritional deficiencies + metric: Rate + indicators: + y: 929786 + - dimensions: + age: Age-standardized + cause: Malaria + metric: Rate + indicators: + y: 929697 + - dimensions: + age: Age-standardized + cause: Drowning + metric: Rate + indicators: + y: 929564 + - dimensions: + age: Age-standardized + cause: Interpersonal violence + metric: Rate + indicators: + y: 929653 + - dimensions: + age: Age-standardized + cause: Maternal disorders + metric: Rate + indicators: + y: 929710 + - dimensions: + age: Age-standardized + cause: HIV/AIDS + metric: Rate + indicators: + y: 929621 + - dimensions: + age: Age-standardized + cause: Drug use disorders + metric: Rate + indicators: + y: 929565 + - dimensions: + age: Age-standardized + cause: Tuberculosis + metric: Rate + indicators: + y: 929981 + - dimensions: + age: Age-standardized + cause: Alcohol use disorders + metric: Rate + indicators: + y: 929434 + - dimensions: + age: Age-standardized + cause: Self-harm + metric: Rate + indicators: + y: 929928 + - dimensions: + age: Age-standardized + cause: Exposure to forces of nature + metric: Rate + indicators: + y: 929591 + - dimensions: + age: Age-standardized + cause: Environmental heat and cold exposure + metric: Rate + indicators: + y: 929587 + - dimensions: + age: Age-standardized + cause: Conflict and terrorism + metric: Rate + indicators: + y: 929527 + - dimensions: + age: Age-standardized + cause: Chronic kidney disease + metric: Rate + indicators: + y: 929492 + - dimensions: + age: Age-standardized + cause: Poisonings + metric: Rate + indicators: + y: 929899 + - dimensions: + age: Age-standardized + cause: Road injuries + metric: Rate + indicators: + y: 929924 + - dimensions: + age: Age-standardized + cause: Fire, heat, and hot substances + metric: Rate + indicators: + y: 929601 + - dimensions: + age: Age-standardized + cause: Acute hepatitis + metric: Rate + indicators: + y: 929415 + - dimensions: + age: Age-standardized + cause: COVID-19 + metric: Rate + indicators: + y: 929474 + - dimensions: + age: Age-standardized + cause: all + metric: Rate + indicators: + y: + - 929415 + - 929434 + - 929443 + - 929474 + - 929478 + - 929492 + - 929510 + - 929527 + - 929547 + - 929553 + - 929557 + - 929564 + - 929565 + - 929587 + - 929591 + - 929601 + - 929621 + - 929653 + - 929695 + - 929697 + - 929710 + - 929721 + - 929751 + - 929758 + - 929786 + - 929879 + - 929899 + - 929924 + - 929928 + - 929981 diff --git a/public/multi-dim/energy.yml b/public/multi-dim/energy.yml new file mode 100644 index 00000000000..09729ea118d --- /dev/null +++ b/public/multi-dim/energy.yml @@ -0,0 +1,271 @@ +title: + title: Energy use + titleVariant: by energy source +defaultSelection: + - World + - Europe + - Mexico +topicTags: + - Energy +dimensions: + - slug: source + name: Energy source + choices: + - slug: all + name: All sources + group: Aggregates + description: Total energy use + - slug: fossil + name: Fossil fuels + group: Aggregates + description: The sum of coal, oil and gas + - slug: coal + name: Coal + group: Fossil fuels + - slug: oil + name: Oil + group: Fossil fuels + - slug: gas + name: Gas + group: Fossil fuels + - slug: low-carbon + name: Low-carbon + group: Aggregates + description: The sum of nuclear and renewable sources + - slug: nuclear + name: Nuclear + group: Low-carbon & renewables + - slug: renewable + name: Renewables (all) + group: Aggregates + description: Includes energy from hydropower, solar, wind, geothermal, wave and tidal, and bioenergy. + - slug: hydro + name: Hydropower + group: Low-carbon & renewables + - slug: solar-wind + name: Solar and wind + group: Low-carbon & renewables + - slug: solar + name: Solar + group: Low-carbon & renewables + - slug: wind + name: Wind + group: Low-carbon & renewables + - slug: metric + name: Metric + choices: + - slug: total + name: Total consumption + description: The amount of energy consumed nationally per year + - slug: per_capita + name: Consumption per capita + description: The average amount of energy each person consumes per year + - slug: share_total + name: Share of total + description: The share of total energy consumption that this source contributes + - slug: proportional_change + name: Proportional change + description: The percentage change from the previous year + - slug: absolute_change + name: Absolute change + description: The absolute change from the previous year +views: + - dimensions: + source: all + metric: total + indicators: + y: grapher/energy/2024-05-08/primary_energy_consumption/primary_energy_consumption#primary_energy_consumption__twh + - dimensions: + source: all + metric: per_capita + indicators: + y: grapher/energy/2024-05-08/primary_energy_consumption/primary_energy_consumption#primary_energy_consumption_per_capita__kwh + - dimensions: + source: all + metric: share_total + - dimensions: + source: all + metric: proportional_change + indicators: + y: grapher/energy/2024-05-08/primary_energy_consumption/primary_energy_consumption#annual_change_in_primary_energy_consumption__pct + - dimensions: + source: all + metric: absolute_change + indicators: + y: grapher/energy/2024-05-08/primary_energy_consumption/primary_energy_consumption#annual_change_in_primary_energy_consumption__twh + + - dimensions: + source: fossil + metric: total + - dimensions: + source: fossil + metric: per_capita + - dimensions: + source: fossil + metric: share_total + - dimensions: + source: fossil + metric: proportional_change + - dimensions: + source: fossil + metric: absolute_change + + - dimensions: + source: coal + metric: total + - dimensions: + source: coal + metric: per_capita + - dimensions: + source: coal + metric: share_total + - dimensions: + source: coal + metric: proportional_change + - dimensions: + source: coal + metric: absolute_change + + - dimensions: + source: oil + metric: total + - dimensions: + source: oil + metric: per_capita + - dimensions: + source: oil + metric: share_total + - dimensions: + source: oil + metric: proportional_change + - dimensions: + source: oil + metric: absolute_change + + - dimensions: + source: gas + metric: total + - dimensions: + source: gas + metric: per_capita + - dimensions: + source: gas + metric: share_total + - dimensions: + source: gas + metric: proportional_change + - dimensions: + source: gas + metric: absolute_change + + - dimensions: + source: low-carbon + metric: total + - dimensions: + source: low-carbon + metric: per_capita + - dimensions: + source: low-carbon + metric: share_total + - dimensions: + source: low-carbon + metric: proportional_change + - dimensions: + source: low-carbon + metric: absolute_change + + - dimensions: + source: nuclear + metric: total + - dimensions: + source: nuclear + metric: per_capita + - dimensions: + source: nuclear + metric: share_total + - dimensions: + source: nuclear + metric: proportional_change + - dimensions: + source: nuclear + metric: absolute_change + + - dimensions: + source: renewable + metric: total + - dimensions: + source: renewable + metric: per_capita + - dimensions: + source: renewable + metric: share_total + - dimensions: + source: renewable + metric: proportional_change + - dimensions: + source: renewable + metric: absolute_change + + - dimensions: + source: hydro + metric: total + - dimensions: + source: hydro + metric: per_capita + - dimensions: + source: hydro + metric: share_total + - dimensions: + source: hydro + metric: proportional_change + - dimensions: + source: hydro + metric: absolute_change + + - dimensions: + source: solar-wind + metric: total + - dimensions: + source: solar-wind + metric: per_capita + - dimensions: + source: solar-wind + metric: share_total + - dimensions: + source: solar-wind + metric: proportional_change + - dimensions: + source: solar-wind + metric: absolute_change + + - dimensions: + source: solar + metric: total + - dimensions: + source: solar + metric: per_capita + - dimensions: + source: solar + metric: share_total + - dimensions: + source: solar + metric: proportional_change + - dimensions: + source: solar + metric: absolute_change + + - dimensions: + source: wind + metric: total + - dimensions: + source: wind + metric: per_capita + - dimensions: + source: wind + metric: share_total + - dimensions: + source: wind + metric: proportional_change + - dimensions: + source: wind + metric: absolute_change diff --git a/public/multi-dim/life-expectancy.json b/public/multi-dim/life-expectancy.json new file mode 100644 index 00000000000..130cfa5f282 --- /dev/null +++ b/public/multi-dim/life-expectancy.json @@ -0,0 +1,198 @@ +{ + "title": { + "title": "Life expectancy", + "titleVariant": "by age and sex" + }, + "name": "Life expectancy", + "dimensions_title": "by age and sex", + "defaultSelection": ["World", "Europe", "Asia"], + "dimensions": [ + { + "slug": "age", + "name": "Age", + "description": "The age at which the life expectancy is measured.", + "multi_select": true, + "choices": [ + { + "slug": "0", + "name": "At birth" + }, + { + "slug": "15", + "name": "At age 15", + "description": "The expected age a 15-year-old would reach if current mortality rates continue." + } + ], + "_hidden_choices": [ + { + "slug": "65", + "name": "At age 65", + "description": "The expected age a 65-year-old would reach if current mortality rates continue." + }, + { + "slug": "80", + "name": "At age 80", + "description": "The expected age a 80-year-old would reach if current mortality rates continue. This number will always be higher than 80." + } + ] + }, + { + "slug": "sex", + "name": "Sex", + "choices": [ + { + "slug": "both", + "name": "Both sexes" + }, + { + "slug": "female", + "name": "Female" + }, + { + "slug": "male", + "name": "Male" + } + ] + }, + { + "slug": "projection", + "name": "Projection", + "description": "The UNWPP projection scenario to use", + "choices": [ + { + "slug": "none", + "name": "No projection (estimates only)", + "description": "Only historical data, no projections into the future." + }, + { + "slug": "medium", + "name": "Medium projection scenario", + "description": "Projections into the future based on UNWPP's medium-fertility scenario." + } + ] + } + ], + "views": [ + { + "dimensions": { "age": "0", "sex": "both", "projection": "none" }, + "indicators": { "y": 520369 }, + "config": { + "title": "Life expectancy at birth", + "hasMapTab": true + } + }, + { + "dimensions": { "age": "0", "sex": "both", "projection": "medium" }, + "indicators": { "y": 520370 }, + "config": { + "title": "Life expectancy at birth, medium projection", + "hasMapTab": true + } + }, + + { + "dimensions": { "age": "0", "sex": "male", "projection": "none" }, + "indicators": { "y": 520349 }, + "config": { + "title": "Male life expectancy at birth", + "hasMapTab": true + } + }, + { + "dimensions": { "age": "0", "sex": "male", "projection": "medium" }, + "indicators": { "y": 520350 }, + "config": { + "title": "Male life expectancy at birth, medium projection", + "hasMapTab": true + } + }, + + { + "dimensions": { "age": "0", "sex": "female", "projection": "none" }, + "indicators": { "y": 520329 }, + "config": { + "title": "Female life expectancy at birth", + "hasMapTab": true + } + }, + { + "dimensions": { + "age": "0", + "sex": "female", + "projection": "medium" + }, + "indicators": { "y": 520330 }, + "config": { + "title": "Female life expectancy at birth, medium projection", + "hasMapTab": true + } + }, + + { + "dimensions": { "age": "15", "sex": "both", "projection": "none" }, + "indicators": { "y": 520379 }, + "config": { + "title": "Life expectancy at age 15", + "hasMapTab": true + } + }, + { + "dimensions": { + "age": "15", + "sex": "both", + "projection": "medium" + }, + "indicators": { "y": 520380 }, + "config": { + "title": "Life expectancy at age 15, medium projection", + "hasMapTab": true + } + }, + + { + "dimensions": { "age": "15", "sex": "male", "projection": "none" }, + "indicators": { "y": 520359 }, + "config": { + "title": "Male life expectancy at age 15", + "hasMapTab": true + } + }, + { + "dimensions": { + "age": "15", + "sex": "male", + "projection": "medium" + }, + "indicators": { "y": 520360 }, + "config": { + "title": "Male life expectancy at age 15, medium projection", + "hasMapTab": true + } + }, + + { + "dimensions": { + "age": "15", + "sex": "female", + "projection": "none" + }, + "indicators": { "y": 520338 }, + "config": { + "title": "Female life expectancy at age 15", + "hasMapTab": true + } + }, + { + "dimensions": { + "age": "15", + "sex": "female", + "projection": "medium" + }, + "indicators": { "y": 520340 }, + "config": { + "title": "Female life expectancy at age 15, medium projection", + "hasMapTab": true + } + } + ] +} diff --git a/public/multi-dim/mixed.yml b/public/multi-dim/mixed.yml new file mode 100644 index 00000000000..3c9542a4c46 --- /dev/null +++ b/public/multi-dim/mixed.yml @@ -0,0 +1,30 @@ +title: + title: Anything goes + +dimensions: + - slug: view + name: View + choices: + - slug: stunting + name: Stunting + - slug: poverty + name: Poverty + - slug: interval + name: Time interval + choices: + - slug: yearly + name: Yearly + - slug: weekly + name: Weekly + +views: + - dimensions: + view: stunting + interval: yearly + indicators: + y: grapher/worldbank_wdi/2024-05-20/wdi/wdi#sh_sta_stnt_zs + - dimensions: + view: poverty + interval: yearly + indicators: + y: 819727 diff --git a/public/multi-dim/plastic.json b/public/multi-dim/plastic.json new file mode 100644 index 00000000000..a230f1e3411 --- /dev/null +++ b/public/multi-dim/plastic.json @@ -0,0 +1,97 @@ +{ + "title": { + "title": "Plastic waste and pollution" + }, + "defaultSelection": ["World", "Europe", "Asia"], + "dimensions": [ + { + "slug": "metric", + "name": "Metric", + "multi_select": true, + "choices": [ + { + "slug": "waste_gen", + "name": "Plastic waste generation", + "description": "The amount of plastic waste generated. Prior to management, i.e. this also includes waste that is properly incinerated or recycled." + }, + { + "slug": "waste_mismanaged", + "name": "Mismanaged waste", + "description": "Mismanaged plastic waste includes materials burned in open pits, dumped into seas or open waters, or disposed of in unsanitary landfills and dumpsites." + }, + { + "slug": "emitted_to_ocean", + "name": "Plastic emitted to ocean", + "description": "This is an annual estimate of plastic emissions. A country's total does not include waste that is exported overseas, which may be at higher risk of entering the ocean." + }, + { + "slug": "trade_exports", + "name": "Trade: exports", + "description": "Plastic waste that is exported by all modes of transport in a given year." + }, + { + "slug": "trade_imports", + "name": "Trade: imports", + "description": "Plastic waste that is imported by all modes of transport in a given year." + }, + { + "slug": "trade_net_exports", + "name": "Trade: net exports", + "description": "Net exports of plastic waste are calculated as a country's plastic waste exports minus its imports." + } + ] + }, + { + "slug": "measurement", + "name": "Measurement", + "choices": [ + { + "slug": "per_capita", + "name": "Per capita", + "description": "Per capita values are calculated by dividing the total amount by the population of the country." + }, + { + "slug": "total", + "name": "Total" + }, + { + "slug": "share_of_world", + "name": "Share of world total", + "description": "The share of the world total is calculated by dividing the country's total by the global total." + } + ] + } + ], + "views": [ + { + "dimensions": { "metric": "waste_gen", "measurement": "total" }, + "indicators": { "y": 97679 }, + "config": { + "title": "Plastic waste generation", + "subtitle": "This measures total plastic waste generation prior to management and therefore does not represent the quantity of plastic at risk of polluting waterways, rivers and the ocean environment." + } + }, + { + "dimensions": { + "metric": "waste_gen", + "measurement": "per_capita" + }, + "indicators": { "y": 65358 }, + "config": { + "title": "Plastic waste generation per capita", + "subtitle": "This measures total plastic waste generation prior to management and therefore does not represent the quantity of plastic at risk of polluting waterways, rivers and the ocean environment." + } + }, + { + "dimensions": { + "metric": "waste_gen", + "measurement": "share_of_world" + }, + "indicators": { "y": 146456 }, + "config": { + "title": "Plastic waste generation", + "subtitle": "This measures total plastic waste generation prior to management and therefore does not represent the quantity of plastic at risk of polluting waterways, rivers and the ocean environment." + } + } + ] +} diff --git a/public/multi-dim/poverty.yml b/public/multi-dim/poverty.yml new file mode 100644 index 00000000000..76287bb4d0d --- /dev/null +++ b/public/multi-dim/poverty.yml @@ -0,0 +1,232 @@ +title: + title: Poverty + titleVariant: by poverty line +defaultSelection: + - World + - Europe + - Asia +dimensions: + - slug: povertyLine + name: Poverty line + description: The poverty line to display, in 2017 international $ + choices: + - slug: "2.15" + name: 2.15 int.$ + - slug: "3.65" + name: 3.65 int.$ + - slug: "6.85" + name: 6.85 int.$ + - slug: "10" + name: 10 int.$ + - slug: "20" + name: 20 int.$ + - slug: "20" + name: 20 int.$ + - slug: "30" + name: 30 int.$ + - slug: "40" + name: 40 int.$ + - slug: all + name: all + description: show all poverty lines at the same time + - slug: metric + name: Metric + choices: + - slug: absolute + name: Number of people + - slug: share + name: Share of population + - slug: shareVsGdp + name: Share of population VS GDP per capita +views: + - dimensions: + povertyLine: "2.15" + metric: share + config: + hasMapTab: true + indicators: + y: 819727 + - dimensions: + povertyLine: "3.65" + metric: share + indicators: + y: 819729 + config: + hasMapTab: true + - dimensions: + povertyLine: "6.85" + metric: share + indicators: + y: 819731 + config: + hasMapTab: true + - dimensions: + povertyLine: "10" + metric: share + indicators: + y: 819725 + config: + hasMapTab: true + - dimensions: + povertyLine: "20" + metric: share + indicators: + y: 819726 + config: + hasMapTab: true + - dimensions: + povertyLine: "30" + metric: share + indicators: + y: 819728 + config: + hasMapTab: true + - dimensions: + povertyLine: "40" + metric: share + indicators: + y: 819730 + config: + hasMapTab: true + - dimensions: + povertyLine: "2.15" + metric: shareVsGdp + indicators: + y: 819727 + x: 539760 + config: + hasMapTab: true + type: ScatterPlot + xAxis: + scaleType: log + - dimensions: + povertyLine: "3.65" + metric: shareVsGdp + indicators: + y: 819729 + x: 539760 + config: + hasMapTab: true + type: ScatterPlot + xAxis: + scaleType: log + - dimensions: + povertyLine: "6.85" + metric: shareVsGdp + indicators: + y: 819731 + x: 539760 + config: + hasMapTab: true + type: ScatterPlot + xAxis: + scaleType: log + - dimensions: + povertyLine: "10" + metric: shareVsGdp + indicators: + y: 819725 + x: 539760 + config: + hasMapTab: true + type: ScatterPlot + xAxis: + scaleType: log + - dimensions: + povertyLine: "20" + metric: shareVsGdp + indicators: + y: 819726 + x: 539760 + config: + hasMapTab: true + type: ScatterPlot + xAxis: + scaleType: log + - dimensions: + povertyLine: "30" + metric: shareVsGdp + indicators: + y: 819728 + x: 539760 + config: + hasMapTab: true + type: ScatterPlot + xAxis: + scaleType: log + - dimensions: + povertyLine: "40" + metric: shareVsGdp + indicators: + y: 819730 + x: 539760 + config: + hasMapTab: true + type: ScatterPlot + xAxis: + scaleType: log + - dimensions: + povertyLine: "2.15" + metric: absolute + indicators: + y: 819719 + config: + hasMapTab: true + - dimensions: + povertyLine: "3.65" + metric: absolute + indicators: + y: 819721 + config: + hasMapTab: true + - dimensions: + povertyLine: "6.85" + metric: absolute + indicators: + y: 819723 + config: + hasMapTab: true + - dimensions: + povertyLine: "10" + metric: absolute + indicators: + y: 819717 + config: + hasMapTab: true + - dimensions: + povertyLine: "20" + metric: absolute + indicators: + y: 819718 + config: + hasMapTab: true + - dimensions: + povertyLine: "30" + metric: absolute + indicators: + y: 819720 + config: + hasMapTab: true + - dimensions: + povertyLine: "40" + metric: absolute + indicators: + y: 819722 + config: + hasMapTab: true + - dimensions: + povertyLine: all + metric: share + indicators: + y: + - 819811 + - 819826 + - 819824 + - 819822 + - 819820 + - 819818 + - 819816 + - 819815 + config: + type: StackedArea + hasMapTab: true diff --git a/settings/clientSettings.ts b/settings/clientSettings.ts index 7e54564fdc2..750d1dc4b8c 100644 --- a/settings/clientSettings.ts +++ b/settings/clientSettings.ts @@ -90,3 +90,17 @@ export const GDOCS_DETAILS_ON_DEMAND_ID: string = process.env.GDOCS_DETAILS_ON_DEMAND_ID ?? "" export const PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm" + +// Feature flags: FEATURE_FLAGS is a comma-separated list of flags, and they need to be part of this enum to be considered +export enum FeatureFlagFeature { + MultiDimDataPage = "MultiDimDataPage", +} +const featureFlagsRaw = + (typeof process.env.FEATURE_FLAGS === "string" && + process.env.FEATURE_FLAGS.trim()?.split(",")) || + [] +export const FEATURE_FLAGS: Set = new Set( + Object.keys(FeatureFlagFeature).filter((key) => + featureFlagsRaw.includes(key) + ) as FeatureFlagFeature[] +) diff --git a/settings/serverSettings.ts b/settings/serverSettings.ts index c6f3c42cbf2..02771ed1b3c 100644 --- a/settings/serverSettings.ts +++ b/settings/serverSettings.ts @@ -173,6 +173,8 @@ export const IMAGE_HOSTING_R2_REGION: string = export const DATA_API_URL: string = clientSettings.DATA_API_URL +export const FEATURE_FLAGS = clientSettings.FEATURE_FLAGS + export const BUILDKITE_API_ACCESS_TOKEN: string = serverSettings.BUILDKITE_API_ACCESS_TOKEN ?? "" export const BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG: string = diff --git a/site/hooks.ts b/site/hooks.ts index 87f8761962d..85baca9ef12 100644 --- a/site/hooks.ts +++ b/site/hooks.ts @@ -14,6 +14,7 @@ import { throttle, } from "@ourworldindata/utils" import { useResizeObserver } from "usehooks-ts" +import { reaction } from "mobx" export const useTriggerWhenClickOutside = ( container: RefObject, @@ -136,3 +137,26 @@ export const useElementBounds = ( return bounds } + +// Transforms Mobx state into a functional React state, by setting up +// a listener with Mobx's `reaction` and updating the React state. +// Make sure that the `mobxStateGetter` function is wrapped in `useCallback`, +// otherwise the listener will be set up on every render, causing +// an infinite loop. +export const useMobxStateToReactState = ( + mobxStateGetter: () => T, + enabled: boolean = true +) => { + const [state, setState] = useState(() => + enabled ? mobxStateGetter() : undefined + ) + + useEffect(() => { + if (!enabled) return + const disposer = reaction(() => mobxStateGetter(), setState, { + fireImmediately: true, + }) + return disposer + }, [enabled, mobxStateGetter]) + return state +} diff --git a/site/multiDim/MultiDimDataPage.tsx b/site/multiDim/MultiDimDataPage.tsx new file mode 100644 index 00000000000..7b97e13cae8 --- /dev/null +++ b/site/multiDim/MultiDimDataPage.tsx @@ -0,0 +1,76 @@ +import React from "react" +import { Head } from "../Head.js" +import { IFrameDetector } from "../IframeDetector.js" +import { SiteHeader } from "../SiteHeader.js" +import { OWID_DATAPAGE_CONTENT_ROOT_ID } from "../DataPageV2Content.js" +import { SiteFooter } from "../SiteFooter.js" +import { SiteFooterContext, serializeJSONForHTML } from "@ourworldindata/utils" +import { MultiDimDataPageProps } from "@ourworldindata/types" + +export const MultiDimDataPage = (props: { + baseUrl: string + multiDimProps: MultiDimDataPageProps +}) => { + const { multiDimProps } = props + + const canonicalUrl = "" // TODO + const baseUrl = props.baseUrl // TODO + + return ( + + + {/* + */} + + + + + + +
+