From f22abcadea62c0305e63af57706051b09199e36f Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 6 Nov 2024 11:46:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20use=20fixed=20defaultGrapherConf?= =?UTF-8?q?ig=20in=20migrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1720600092980-MakeChartsInheritDefaults.ts | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/db/migration/1720600092980-MakeChartsInheritDefaults.ts b/db/migration/1720600092980-MakeChartsInheritDefaults.ts index 03a1633a4db..66da38979a3 100644 --- a/db/migration/1720600092980-MakeChartsInheritDefaults.ts +++ b/db/migration/1720600092980-MakeChartsInheritDefaults.ts @@ -1,6 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm" import { diffGrapherConfigs, mergeGrapherConfigs } from "@ourworldindata/utils" -import { defaultGrapherConfig } from "@ourworldindata/grapher" export class MakeChartsInheritDefaults1720600092980 implements MigrationInterface @@ -62,3 +61,77 @@ export class MakeChartsInheritDefaults1720600092980 ) } } + +const defaultGrapherConfig = { + $schema: "https://files.ourworldindata.org/schemas/grapher-schema.004.json", + map: { + projection: "World", + hideTimeline: false, + colorScale: { + equalSizeBins: true, + binningStrategy: "ckmeans", + customNumericColorsActive: false, + colorSchemeInvert: false, + binningStrategyBinCount: 5, + }, + toleranceStrategy: "closest", + tooltipUseCustomLabels: false, + time: "latest", + }, + maxTime: "latest", + yAxis: { + removePointsOutsideDomain: false, + scaleType: "linear", + canChangeScaleType: false, + facetDomain: "shared", + }, + tab: "chart", + matchingEntitiesOnly: false, + hasChartTab: true, + hideLegend: false, + hideLogo: false, + hideTimeline: false, + colorScale: { + equalSizeBins: true, + binningStrategy: "ckmeans", + customNumericColorsActive: false, + colorSchemeInvert: false, + binningStrategyBinCount: 5, + }, + scatterPointLabelStrategy: "year", + selectedFacetStrategy: "none", + invertColorScheme: false, + hideRelativeToggle: true, + logo: "owid", + entityType: "country or region", + facettingLabelByYVariables: "metric", + addCountryMode: "add-country", + compareEndPointsOnly: false, + type: "LineChart", + hasMapTab: false, + stackMode: "absolute", + minTime: "earliest", + hideAnnotationFieldsInTitle: { + entity: false, + time: false, + changeInPrefix: false, + }, + xAxis: { + removePointsOutsideDomain: false, + scaleType: "linear", + canChangeScaleType: false, + facetDomain: "shared", + }, + hideConnectedScatterLines: false, + showNoDataArea: true, + zoomToSelection: false, + showYearLabels: false, + hideLinesOutsideTolerance: false, + hideTotalValueLabel: false, + hideScatterLabels: false, + sortBy: "total", + sortOrder: "desc", + hideFacetControl: true, + entityTypePlural: "countries and regions", + missingDataStrategy: "auto", +}