GrapherProgrammaticInterface¶
A Grapher config plus options that aren't part of the persisted config
schema: they control how a chart is embedded and which parts of its
interface are shown, rather than what the chart shows. Authors never set
these in the chart editor; developers pass them in code, e.g. as the
config of a GrapherLoader.
Extends¶
Properties¶
| Property | Type | Description |
|---|---|---|
sortBy? |
SortBy |
- |
sortOrder? |
SortOrder |
- |
sortColumnSlug? |
string |
- |
$schema? |
string |
- |
chartTypes? |
( | "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell")[] |
- |
id? |
number |
- |
version? |
number |
- |
slug? |
string |
- |
title? |
string |
- |
subtitle? |
string |
- |
sourceDesc? |
string |
- |
note? |
string |
- |
hideAnnotationFieldsInTitle? |
AnnotationFieldsInTitle |
- |
minTime? |
number | TimeBoundValueStr |
- |
maxTime? |
number | TimeBoundValueStr |
- |
timelineMinTime? |
number | TimeBoundValueStr |
- |
timelineMaxTime? |
number | TimeBoundValueStr |
- |
dimensions? |
OwidChartDimensionInterface[] |
- |
addCountryMode? |
EntitySelectionMode |
- |
comparisonLines? |
ComparisonLineConfig[] |
- |
stackMode? |
StackMode |
- |
showNoDataArea? |
boolean |
- |
hideSeriesLabels? |
boolean |
- |
logo? |
LogoOption |
- |
hideLogo? |
boolean |
- |
hideRelativeToggle? |
boolean |
- |
entityType? |
string |
- |
entityTypePlural? |
string |
- |
hideTimeline? |
boolean |
- |
zoomToSelection? |
boolean |
- |
showYearLabels? |
boolean |
- |
hasMapTab? |
boolean |
- |
tab? |
| "table" | "map" | "chart" | "line" | "scatter" | "stacked-area" | "discrete-bar" | "stacked-discrete-bar" | "slope" | "stacked-bar" | "marimekko" | "dumbbell" |
- |
relatedQuestions? |
RelatedQuestionsConfig[] |
- |
details? |
DetailDictionary |
- |
internalNotes? |
string |
- |
variantName? |
string |
- |
originUrl? |
string |
- |
license? |
LicenseOption |
- |
isPublished? |
boolean |
- |
baseColorScheme? |
ColorSchemeName |
- |
invertColorScheme? |
boolean |
- |
hideConnectedScatterLines? |
boolean |
- |
hideScatterLabels? |
boolean |
- |
scatterPointLabelStrategy? |
ScatterPointLabelStrategy |
- |
compareEndPointsOnly? |
boolean |
- |
matchingEntitiesOnly? |
boolean |
- |
hideTotalValueLabel? |
boolean |
- |
excludedEntityNames? |
string[] |
- |
includedEntityNames? |
string[] |
- |
inapplicableEntityNames? |
string[] |
- |
selectedEntityNames? |
string[] |
- |
selectedEntityColors? |
SelectedEntityColors |
- |
focusedSeriesNames? |
string[] |
- |
peerCountryStrategy? |
PeerCountryStrategy |
- |
missingDataStrategy? |
MissingDataStrategy |
- |
hideFacetControl? |
boolean |
- |
facettingLabelByYVariables? |
string |
- |
selectedFacetStrategy? |
FacetStrategy |
- |
xAxis? |
Partial<AxisConfigInterface> |
- |
yAxis? |
Partial<AxisConfigInterface> |
- |
colorScale? |
Partial<ColorScaleConfigInterface> |
- |
map? |
Partial<MapConfigInterface> |
- |
dumbbell? |
Partial<DumbbellChartConfigInterface> |
- |
ySlugs? |
string |
- |
xSlug? |
string |
- |
sizeSlug? |
string |
- |
colorSlug? |
string |
- |
tableSlugs? |
string |
- |
queryStr? |
string |
Query string to initialise the chart's state from, in the same format as a grapher page URL, e.g. "?tab=map&time=2020". |
bakedGrapherURL? |
string |
Base URL that chart page links are derived from: published charts link to <bakedGrapherURL>/<slug>. Defaults to "/grapher". |
canonicalUrl? |
string | null |
The URL of the chart's own page, which the title and the "Explore the data" button link to and the share menu shares. Overrides the URL derived from bakedGrapherURL and slug. null means the chart has no such page: the title is plain text, and the "Explore the data" button and share menu are not shown. |
highlightedTimesInLineChart? |
number[] |
Times to mark in line charts, as if the cursor were hovering them. |
hideTitle? |
boolean |
Hide the title. |
hideSubtitle? |
boolean |
Hide the subtitle. |
hideNote? |
boolean |
Hide the note in the footer. |
hideOriginUrl? |
boolean |
Hide the origin URL next to the license in the footer. |
hideFullscreenButton? |
boolean |
Hide the full-screen button. |
hideDownloadButton? |
boolean |
Hide the download button. |
hideShareButton? |
boolean |
Hide the share button. |
hideDonateButton? |
boolean |
Hide the "Donate" button, which is shown when the chart is rendered inside an iframe. |
hideEntityControls? |
boolean |
Hide the controls for selecting entities (countries, regions, …), including selecting them on the map. |
hideControlsRow? |
boolean |
Hide the row of controls between the header and the chart (tabs, entity selection, settings). |
forceHideAnnotationFieldsInTitle? |
AnnotationFieldsInTitle |
Leave out the entity, time or "change in" annotations that are otherwise added to the title. |
hasTableTab? |
boolean |
Whether to offer the table tab. Defaults to true. |
hideExploreTheDataButton? |
boolean |
Whether to hide the "Explore the data" button, which links to the chart's own page. Defaults to true, except inside an iframe, where the button is always shown. Never shown without a canonicalUrl. |
hideRelatedQuestion? |
boolean |
Hide the related question link below the chart. |
enableMapSelection? |
boolean |
Allow selecting entities by clicking them on the map, even where the entity controls would otherwise disable that. |
enableKeyboardShortcuts? |
boolean |
Enable keyboard shortcuts and the command palette. |
bindUrlToWindow? |
boolean |
Keep the page URL's query string in sync with the chart's state. Only makes sense for a single chart that owns the page. |