Skip to content

Commit

Permalink
🔨 use fixed defaultGrapherConfig in migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Nov 6, 2024
1 parent 2560d30 commit 74e230c
Showing 1 changed file with 74 additions and 1 deletion.
75 changes: 74 additions & 1 deletion db/migration/1720600092980-MakeChartsInheritDefaults.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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",
}

0 comments on commit 74e230c

Please sign in to comment.