GrapherState¶
Implements¶
AxisManagerTooltipManagerCaptionedChartManagerChartManagerDiscreteBarChartManagerScatterPlotManagerMarimekkoChartManagerMapChartManagerSlopeChartManagerDataTableManagerFacetChartManagerTimelineManagerSettingsMenuManagerEntitySelectorModalManagerDownloadModalManagerSourcesModalManagerEmbedModalManagerShareMenuManagerLegacyDimensionsManager
Properties¶
| Property | Type | Description |
|---|---|---|
$schema |
string | undefined |
Url of the concrete schema version to use to validate this document |
id |
number | undefined |
Internal database id |
version |
number |
Chart config version |
slug |
string | undefined |
Slug of the chart on Our World In Data |
title |
string | undefined |
Big title text of the chart |
subtitle |
string | undefined |
The longer subtitle text to show beneath the title |
isPublished |
boolean | undefined |
Indicates if the chart is published on Our World In Data or still in draft |
originUrl |
string | undefined |
The page containing this chart where more context can be found |
license |
LicenseOption | undefined |
The license the chart is published under, linked in the chart footer |
sourceDesc |
string | undefined |
Short comma-separated list of source names |
note |
string | undefined |
Note displayed in the footer of the chart |
internalNotes |
string | undefined |
Additional text used internally to differentiate charts with the same title |
variantName |
string | undefined |
Optional internal variant name for distinguishing charts with the same title |
dimensions |
ChartDimension[] |
List of dimensions and their mapping to variables |
selectedEntityNames |
string[] |
The initial selection of entities |
focusedSeriesNames |
string[] |
The initially focused chart elements. Is either a list of entity or variable names. Only works for line and slope charts for now. |
excludedEntityNames |
string[] | undefined |
Entities that should be excluded (opposite of includedEntityNames) |
includedEntityNames |
string[] | undefined |
Entities that should be included (opposite of excludedEntityNames). If empty, all available entities are used. If set, all entities not specified here are excluded. excludedEntityNames are evaluated afterwards and can still remove entities even if they were included before. |
inapplicableEntityNames |
string[] | undefined |
Entities the indicator's data can't apply to by construction, e.g. Mexico for "Where do Mexican emigrants live?" |
selectedEntityColors |
{ [entityName: string]: string | undefined; } |
Colors for selected entities |
peerCountryStrategy |
PeerCountryStrategy | undefined |
Strategy for selecting peer countries for comparison |
addCountryMode |
EntitySelectionMode |
Whether the user can change countries, add additional ones or neither |
entityType |
string |
Display string for naming the primary entities of the data. The default is 'country or region', but you can specify a different one such as 'state' or 'region' |
entityTypePlural |
string |
Plural of the entity type (e.g. when entityType is 'country' this would be 'countries') |
facettingLabelByYVariables |
string |
Display string that replaces 'metric' in the 'Split by metric' label in facet controls (e.g. 'product' displays 'Split by product') |
chartTypes |
( | "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell")[] |
Which chart types should be shown |
hasMapTab |
boolean |
Indicates if the map tab should be shown |
tab |
| "table" | "map" | "chart" | "line" | "scatter" | "stacked-area" | "discrete-bar" | "stacked-discrete-bar" | "slope" | "stacked-bar" | "marimekko" | "dumbbell" |
The tab that is shown initially |
xAxis |
AxisConfig |
Configuration of the x-axis |
yAxis |
AxisConfig |
Configuration of the y-axis |
colorScale |
ColorScaleConfig |
Color scale definition |
map |
MapConfig |
Configuration of the world map chart |
dumbbell |
DumbbellChartConfig |
Configuration of the dumbbell chart |
baseColorScheme |
ColorSchemeName | undefined |
One of the predefined base color schemes. If not provided, a default is automatically chosen based on the chart type. |
invertColorScheme |
boolean | undefined |
Reverse the order of colors in the color scheme |
logo |
LogoOption | undefined |
Which logo to show on the upper right side |
hideSeriesLabels |
boolean | undefined |
Whether to hide the inline series labels drawn at the end of each series. Applies to line, slope, and stacked area charts |
hideLogo |
boolean | undefined |
Whether to hide the logo |
hideRelativeToggle |
boolean | undefined |
Whether to hide the relative mode UI toggle |
hideConnectedScatterLines |
boolean | undefined |
Whether to hide connecting lines on scatter plots when a time range is selected |
hideScatterLabels |
boolean | undefined |
Hide entity names in Scatter plots |
hideTotalValueLabel |
boolean | undefined |
Whether to hide the total value label (used on stacked discrete bar charts) |
hideFacetControl |
boolean |
Whether to hide the faceting control |
hideAnnotationFieldsInTitle |
AnnotationFieldsInTitle | undefined |
Whether to hide any automatically added title annotations like the selected year |
minTime |
number | undefined |
Start point of the initially selected time span |
maxTime |
number | undefined |
End point of the initially selected time span |
timelineMinTime |
number | undefined |
The lowest year to show in the timeline. If this is set then the user is not able to see any data before this year. If set to "earliest", then the earliest year in the data is used. |
timelineMaxTime |
number | undefined |
The highest year to show in the timeline. If this is set then the user is not able to see any data after this year. If set to "latest", then the latest year in the data is used. |
hideTimeline |
boolean | undefined |
Whether to hide the timeline from the user. If it is hidden then the user can't change the time |
stackMode |
StackMode |
Stack mode |
zoomToSelection |
boolean | undefined |
Whether to zoom to the selected data points |
showYearLabels |
boolean | undefined |
Whether to show year labels in bar charts |
showNoDataArea |
boolean |
Whether to show an area for entities that have no data (used in marimekko charts) |
compareEndPointsOnly |
boolean | undefined |
Drops in between points in scatter plots |
matchingEntitiesOnly |
boolean | undefined |
Exclude entities that do not belong in any color group |
missingDataStrategy |
MissingDataStrategy | undefined |
The desired strategy for handling entities with missing data |
scatterPointLabelStrategy |
ScatterPointLabelStrategy | undefined |
When a user hovers over a connected series line in a ScatterPlot we show a label for each point. By default that value will be from the "year" column but by changing this option the column used for the x or y axis could be used instead. |
selectedFacetStrategy |
FacetStrategy | undefined |
The desired facetting strategy (none for no facetting) |
sortBy |
SortBy | undefined |
Sort criterion (used by stacked bar charts and marimekko) |
sortOrder |
SortOrder | undefined |
Sort order (used by stacked bar charts and marimekko) |
sortColumnSlug |
string | undefined |
Sort column if sortBy is column (used by stacked bar charts and marimekko) |
comparisonLines |
ComparisonLineConfig[] | undefined |
List of comparison lines to draw |
relatedQuestions |
RelatedQuestionsConfig[] | undefined |
Links to related questions |
base |
RefObject<HTMLDivElement | null> |
Reference to the root DOM element containing the grapher |
initialOptions |
GrapherProgrammaticInterface |
Initial options passed when creating the GrapherState instance |
_inputTable |
OwidTable |
The complete data table for the chart |
additionalDataLoaderFn |
AdditionalGrapherDataFetchFn | undefined |
Optional custom function for fetching additional data beyond the main table |
legacyConfigAsAuthored |
Partial<LegacyGrapherInterface> |
The original config as authored, used to detect user changes from authored defaults |
externalQueryParams |
QueryParams |
Query parameters that don't correspond to standard Grapher parameters (like tab, time, etc.) |
isConfigReady |
boolean | undefined |
- |
isDataReady |
boolean | undefined |
- |
ySlugs |
string | undefined |
- |
xSlug |
string | undefined |
- |
colorSlug |
string | undefined |
- |
sizeSlug |
string | undefined |
- |
tableSlugs |
string | undefined |
- |
bakedGrapherURL |
string | undefined |
- |
adminBaseUrl |
string | undefined |
- |
isEmbeddedInAnOwidPage? |
boolean |
- |
isEmbeddedInADataPage? |
boolean |
- |
useNewDatapageMetadataLayout? |
boolean |
- |
archiveContext? |
ArchiveContext |
- |
narrativeChartInfo? |
MinimalNarrativeChartInfo |
- |
analytics |
GrapherAnalytics |
- |
tooltip? |
ObservableValue<TooltipProps | undefined> |
- |
variant |
GrapherVariant |
- |
hideLegend |
boolean | undefined |
Whether to hide a chart's legends |
useMinimalLabeling |
boolean |
Minimal labeling is used in search when a thumbnail is embedded alongside a complementary table because the table already provides a lot of information, which is why the chart can be simplified to avoid redundancy and visual clutter |
staticBounds |
Bounds |
- |
_externalBounds |
Bounds | undefined |
- |
selection |
SelectionArray |
- |
focusArray |
FocusArray |
- |
dataTableConfig |
DataTableConfig |
- |
entitySelectorState |
Partial<EntitySelectorState> |
- |
highlightedTimesInLineChart? |
number[] |
Used to highlight particular times in a line chart. The sparkline in map tooltips makes use of this. |
timelineController |
TimelineController |
- |
globeController |
GlobeController |
- |
seriesColorMap |
SeriesColorMap |
Keeps a running cache of series colors at the Grapher level. |
isEntitySelectorModalOrDrawerOpen |
boolean |
- |
activeModal? |
GrapherModal |
- |
activeDownloadModalTab |
DownloadModalTabName |
- |
isShareMenuActive |
boolean |
- |
isCommandPaletteOpen |
boolean |
- |
isTimelineAnimationPlaying |
boolean |
- |
isTimelineAnimationActive |
boolean |
True if the timeline animation is either playing or paused but not finished |
disableChartRowAnimation |
boolean |
- |
animationStartTime |
number | undefined |
- |
areHandlesOnSameTimeBeforeAnimation |
boolean | undefined |
- |
timelineDragTarget |
TimelineDragTarget | undefined |
Which timeline element is currently being dragged |
frozenToleranceNotice |
| { notice: string | undefined; } | undefined |
The tolerance notice as of the start of a timeline interaction |
hasTableTab |
boolean |
- |
hideTitle |
boolean |
- |
hideSubtitle |
boolean |
- |
hideNote |
boolean |
- |
hideOriginUrl |
boolean |
- |
hideFullscreenButton |
boolean |
- |
hideDownloadButton |
boolean |
- |
hideEntityControls |
boolean |
- |
hideShareButton |
boolean |
- |
hideExploreTheDataButton |
boolean |
- |
hideControlsRow |
boolean |
- |
hideRelatedQuestion |
boolean |
- |
canHideExternalControlsInEmbed |
boolean |
- |
recommendedIframeEmbedHeight? |
number |
- |
hideExternalControlsInEmbedUrl |
boolean |
- |
forceHideAnnotationFieldsInTitle |
AnnotationFieldsInTitle |
- |
enableMapSelection |
boolean |
Whether to allow entity selection via map interactions |
isExportingToSvgOrPng |
boolean |
- |
isWikimediaExport |
boolean |
- |
shouldIncludeDetailsInStaticExport |
boolean |
- |
_baseFontSize |
number |
Base font size for responsive scaling of chart elements |
_isInFullScreenMode |
boolean |
- |
windowInnerWidth |
number | undefined |
- |
windowInnerHeight |
number | undefined |
- |
screenHeight |
number | undefined |
- |
enableKeyboardShortcuts |
boolean |
- |
bindUrlToWindow |
boolean |
- |
slideShow |
SlideShowController<any> | undefined |
- |
disposers |
() => void[] |
- |
rasterize |
GrapherRasterizeFn |
- |
Accessors¶
object¶
Get Signature¶
Returns an object ready to be serialized to JSON
Returns¶
inputTable¶
Get Signature¶
The complete, unfiltered data table for the chart.
This is the raw input data provided to the Grapher. This table is the starting point for all data transformations in the pipeline. It contains all entities and all time periods present in the data before any filtering or chart-specific transforms are applied.
Returns¶
Set Signature¶
Parameters¶
| Parameter | Type |
|---|---|
table |
OwidTable |
Returns¶
void
tableAfterColorAndSizeToleranceApplication¶
Get Signature¶
Input table with color and size tolerance applied.
This happens before applying the author's timeline filter to avoid accidentally dropping all color values before applying tolerance. This is especially important for scatter plots and Marimekko charts, where color and size columns are often transformed with infinite tolerance.
Line and discrete bar charts also support a color dimension, but their tolerance transformations run in their respective transformTable functions since it's more efficient to run them on a table that has been filtered by selected entities.
Returns¶
tableAfterAuthorTimelineAndEntityFilter¶
Get Signature¶
Table after author-specified entity and timeline filters have been applied.
This is the earliest filtering step in the pipeline. The author can configure entity include/exclude patterns (includedEntityNames, excludedEntityNames) and timeline bounds (timelineMinTime, timelineMaxTime). These filters are applied before any chart-specific transforms, so to the charts it appears as if the filtered times and entities do not exist in the data.
Returns¶
table¶
Get Signature¶
The base data table after author-configured filters have been applied
Returns¶
Implementation of¶
tableAfterAuthorTimelineAndActiveChartTransform¶
Get Signature¶
Table after the active chart type's transformation has been applied.
Different chart types (line, bar, scatter, etc.) have different data requirements and transformations. This property applies the chart-specific transformTable() method to prepare the data for that chart type's rendering. This happens before any user-selected time range filtering (startTime/endTime).
Returns¶
Implementation of¶
transformedTable¶
Get Signature¶
The final transformed table ready for chart rendering
Returns¶
Implementation of¶
tableForSelection¶
Get Signature¶
Table used to determine which entities can be selected in the entity selector
Returns¶
Implementation of¶
tableForDisplayBeforeEntityFilter¶
Get Signature¶
Base table for the data table tab
Returns¶
Implementation of¶
tableForDisplay¶
Get Signature¶
Table for display in the data table tab
Returns¶
Implementation of¶
tableForDownload¶
Get Signature¶
Table used for downloading when the user requests a data download of the complete data set
Returns¶
Implementation of¶
filteredTableForDownload¶
Get Signature¶
Table used for downloading when the user requests a data download of the currently displayed data.
Returns¶
Implementation of¶
dataTableSlugs¶
Get Signature¶
Returns¶
string[]
Implementation of¶
activeTab¶
Get Signature¶
get activeTab():
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| "Table"
| "WorldMap";
Returns¶
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| "Table"
| "WorldMap"
Implementation of¶
activeChartType¶
Get Signature¶
get activeChartType():
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| undefined;
Returns¶
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| undefined
Implementation of¶
chartType¶
Get Signature¶
get chartType():
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| undefined;
Returns¶
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| undefined
hasChartTab¶
Get Signature¶
Returns¶
boolean
isOnChartTab¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isOnMapTab¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isOnTableTab¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isOnChartOrMapTab¶
Get Signature¶
Returns¶
boolean
Implementation of¶
yAxisConfig¶
Get Signature¶
Returns¶
Readonly<AxisConfigInterface>
Implementation of¶
xAxisConfig¶
Get Signature¶
Returns¶
Readonly<AxisConfigInterface>
Implementation of¶
showSeriesLabels¶
Get Signature¶
Returns¶
boolean
Implementation of¶
showLegend¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isOnArchivalPage¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasArchivedPage¶
Get Signature¶
Returns¶
boolean
Implementation of¶
shouldShowSelectionOnlyInDataTable¶
Get Signature¶
We only show the selected entities in the data table if entity selection is disabled – unless there is a view that displays all data points, like a map or a scatter plot.
Returns¶
boolean
Implementation of¶
dataTableSelection¶
Get Signature¶
Selection used in Grapher's data table.
If a map selection is set, it is preferred over the chart selection.
Returns¶
SelectionArray
Implementation of¶
chartState¶
Get Signature¶
Returns¶
ChartState
facetChartInstance¶
Get Signature¶
Returns¶
FacetChart | undefined
chartStateExceptMap¶
Get Signature¶
Returns¶
ChartState
focusableSeriesNames¶
Get Signature¶
Returns¶
string[]
isStatic¶
Get Signature¶
Returns¶
boolean
Implementation of¶
editUrl¶
Get Signature¶
Returns¶
string | undefined
Implementation of¶
createNarrativeChartUrl¶
Get Signature¶
Returns¶
string | undefined
Implementation of¶
isAdmin¶
Get Signature¶
Returns¶
boolean
Implementation of¶
showAdminControls¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasData¶
Get Signature¶
Returns¶
boolean
isReady¶
Get Signature¶
Ready to go if we have retrieved data for every variable associated with the chart or the config and data are marked as ready
Returns¶
boolean
Implementation of¶
whatAreWeWaitingFor¶
Get Signature¶
Returns¶
string
newSlugs¶
Get Signature¶
Returns¶
string[]
isInIFrame¶
Get Signature¶
Returns¶
boolean
Implementation of¶
times¶
Get Signature¶
Returns¶
number[]
Implementation of¶
startHandleTimeBound¶
Get Signature¶
Returns¶
number
Set Signature¶
Parameters¶
| Parameter | Type |
|---|---|
value |
number |
Returns¶
void
Implementation of¶
closestTimelineMinTime¶
Get Signature¶
Returns¶
number | undefined
Implementation of¶
closestTimelineMaxTime¶
Get Signature¶
Returns¶
number | undefined
Implementation of¶
startTime¶
Get Signature¶
Returns¶
number | undefined
Implementation of¶
endTime¶
Get Signature¶
Returns¶
number | undefined
Implementation of¶
isSingleTimeScatterAnimationActive¶
Get Signature¶
Returns¶
boolean
Implementation of¶
onlyTimeRangeSelectionPossible¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isSingleTimeSelectionActive¶
Get Signature¶
Returns¶
boolean
Implementation of¶
shouldLinkToOwid¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasOWIDLogo¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasFatalErrors¶
Get Signature¶
Returns¶
boolean
entitySelector¶
Get Signature¶
Returns¶
EntitySelector
originUrlWithProtocol¶
Get Signature¶
Returns¶
string
Implementation of¶
timelineHandleTimeBounds¶
Get Signature¶
Returns¶
TimeBounds
Set Signature¶
Parameters¶
| Parameter | Type |
|---|---|
value |
TimeBounds |
Returns¶
void
dimensionSlots¶
Get Signature¶
Dimension slots appropriate for the given chart types
Returns¶
DimensionSlot[]
filledDimensions¶
Get Signature¶
Returns¶
ChartDimension[]
Implementation of¶
defaultSlug¶
Get Signature¶
Returns¶
string
displaySlug¶
Get Signature¶
Returns¶
string
Implementation of¶
detailsOrderedByReference¶
Get Signature¶
Returns¶
string[]
Implementation of¶
detailsMarkerInSvg¶
Get Signature¶
Returns¶
DetailsMarker
Implementation of¶
detailRenderers¶
Get Signature¶
Returns¶
MarkdownTextWrap[]
Implementation of¶
hasProjectedData¶
Get Signature¶
Returns¶
boolean
projectionColumnInfoBySlug¶
Get Signature¶
Returns¶
Map<string, ProjectionColumnInfo>
Implementation of¶
validChartTypes¶
Get Signature¶
get validChartTypes(): (
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell")[];
Returns¶
(
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell")[]
validChartTypeSet¶
Get Signature¶
get validChartTypeSet(): Set<
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell">;
Returns¶
Set<
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell">
availableTabs¶
Get Signature¶
get availableTabs(): (
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| "Table"
| "WorldMap")[];
Returns¶
(
| "LineChart"
| "ScatterPlot"
| "StackedArea"
| "DiscreteBar"
| "StackedDiscreteBar"
| "SlopeChart"
| "StackedBar"
| "Marimekko"
| "Dumbbell"
| "Table"
| "WorldMap")[]
Implementation of¶
hasMultipleChartTypes¶
Get Signature¶
Returns¶
boolean
effectiveSubtitle¶
Get Signature¶
Effective subtitle resolved from authored subtitle or fallback description
Returns¶
string
Implementation of¶
toleranceNotice¶
Get Signature¶
Explains that some of the values on screen aren't from the time the chart is labelled with, because tolerance was applied.
Returns¶
string | undefined
isTimelineInteractionActive¶
Get Signature¶
Whether the timeline is being dragged or is playing an animation
Returns¶
boolean
effectiveNote¶
Get Signature¶
Effective note resolved from the authored note, with the tolerance notice appended when tolerance was applied to something on screen
Returns¶
string | undefined
Implementation of¶
shouldAddEntitySuffixToTitle¶
Get Signature¶
Returns¶
boolean
shouldAddTimeSuffixToTitle¶
Get Signature¶
Returns¶
boolean
shouldAddChangeInPrefixToTitle¶
Get Signature¶
Returns¶
boolean
effectiveTitle¶
Get Signature¶
Effective title resolved from authored title or default title derived from metadata
Returns¶
string
mainTitle¶
Get Signature¶
The main line of the chart title, without the entity/time annotation, but including the "Change in" prefix and the x-indicator label where applicable.
Returns¶
string
Implementation of¶
titleAnnotation¶
Get Signature¶
The entity/time annotation of the chart title, e.g. "World, 2020"
Returns¶
string | undefined
Implementation of¶
fullTitle¶
Get Signature¶
The complete chart title: the main title plus the entity/time annotation
Returns¶
string
Implementation of¶
hasTimeline¶
Get Signature¶
Uses some explicit and implicit information to decide whether a timeline is shown.
Returns¶
boolean
Implementation of¶
mapColumnSlug¶
Get Signature¶
Returns¶
string
Implementation of¶
yColumnsFromDimensions¶
Get Signature¶
Returns¶
CoreColumn<CoreTable<CoreRow, CoreColumnDef>, CoreColumnDef>[]
yColumnSlugs¶
Get Signature¶
Y column slugs used by the active tab
Returns¶
string[]
Implementation of¶
yColumnSlug¶
Get Signature¶
Y column slug used by the active tab
Returns¶
string | undefined
Implementation of¶
colorColumnSlug¶
Get Signature¶
Color column slug used by the active tab
Returns¶
string | undefined
Implementation of¶
xColumnSlug¶
Get Signature¶
X column slug used by the active tab
Returns¶
string | undefined
Implementation of¶
sizeColumnSlug¶
Get Signature¶
Size column slug used by the active tab
Returns¶
string | undefined
Implementation of¶
sourcesLine¶
Get Signature¶
Returns¶
string
Implementation of¶
inputColumnSlugs¶
Get Signature¶
All column slugs configured by the author (y, x, size, color)
Returns¶
string[]
Implementation of¶
inputColumnsWithSources¶
Get Signature¶
Returns¶
CoreColumn<CoreTable<CoreRow, CoreColumnDef>, CoreColumnDef>[]
Implementation of¶
baseFontSize¶
Get Signature¶
Returns¶
number
Set Signature¶
Parameters¶
| Parameter | Type |
|---|---|
val |
number |
Returns¶
void
yColumnsFromDimensionsOrSlugsOrAuto¶
Get Signature¶
get yColumnsFromDimensionsOrSlugsOrAuto(): CoreColumn<CoreTable<CoreRow, CoreColumnDef>, CoreColumnDef>[];
Returns¶
CoreColumn<CoreTable<CoreRow, CoreColumnDef>, CoreColumnDef>[]
Implementation of¶
defaultTitle¶
Get Signature¶
Returns¶
string
isLineChart¶
Get Signature¶
Returns¶
boolean
isScatter¶
Get Signature¶
Returns¶
boolean
isStackedArea¶
Get Signature¶
Returns¶
boolean
isSlopeChart¶
Get Signature¶
Returns¶
boolean
isDiscreteBar¶
Get Signature¶
Returns¶
boolean
isStackedBar¶
Get Signature¶
Returns¶
boolean
isMarimekko¶
Get Signature¶
Returns¶
boolean
isStackedDiscreteBar¶
Get Signature¶
Returns¶
boolean
isDumbbell¶
Get Signature¶
Returns¶
boolean
isOnLineChartTab¶
Get Signature¶
Returns¶
boolean
isOnScatterTab¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isOnStackedAreaTab¶
Get Signature¶
Returns¶
boolean
isOnSlopeChartTab¶
Get Signature¶
Returns¶
boolean
isOnDiscreteBarTab¶
Get Signature¶
Returns¶
boolean
isOnStackedBarTab¶
Get Signature¶
Returns¶
boolean
isOnMarimekkoTab¶
Get Signature¶
Returns¶
boolean
isOnStackedDiscreteBarTab¶
Get Signature¶
Returns¶
boolean
isOnDumbbellTab¶
Get Signature¶
Returns¶
boolean
hasLineChart¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasSlopeChart¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasDiscreteBar¶
Get Signature¶
Returns¶
boolean
hasMarimekko¶
Get Signature¶
Returns¶
boolean
hasScatter¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasStackedArea¶
Get Signature¶
Returns¶
boolean
hasStackedBar¶
Get Signature¶
Returns¶
boolean
hasStackedDiscreteBar¶
Get Signature¶
Returns¶
boolean
hasDumbbellChart¶
Get Signature¶
Returns¶
boolean
supportsMultipleYColumns¶
Get Signature¶
Returns¶
boolean
xOverrideTime¶
Get Signature¶
Overrides the x axis dimension to target a special year
Returns¶
number | undefined
Set Signature¶
Parameters¶
| Parameter | Type |
|---|---|
value |
number | undefined |
Returns¶
void
Implementation of¶
defaultBounds¶
Get Signature¶
Returns¶
Bounds
staticBoundsWithDetails¶
Get Signature¶
Returns¶
Bounds
Implementation of¶
mapConfig¶
Get Signature¶
Returns¶
MapConfig
Implementation of¶
relativeToggleLabel¶
Get Signature¶
Returns¶
string
Implementation of¶
isRelativeMode¶
Get Signature¶
Returns¶
boolean
Implementation of¶
canToggleRelativeMode¶
Get Signature¶
Returns¶
boolean
Implementation of¶
externalBounds¶
Get Signature¶
externalBounds should be set to the available plotting area for a Grapher that resizes itself to fit. When this area changes, externalBounds should be updated. Updating externalBounds can trigger a bunch of somewhat expensive recalculations so it might be worth debouncing updates (e.g. when drag-resizing)
Returns¶
Bounds
Set Signature¶
Parameters¶
| Parameter | Type |
|---|---|
bounds |
Bounds |
Returns¶
void
isPortrait¶
Get Signature¶
Returns¶
boolean
hideFullScreenButton¶
Get Signature¶
Returns¶
boolean
Implementation of¶
frameBounds¶
Get Signature¶
Bounds of the entire Grapher frame including the chart area and entity selector panel
Returns¶
Bounds
Implementation of¶
activeBounds¶
Get Signature¶
Returns¶
Bounds
captionedChartBounds¶
Get Signature¶
Bounds of the CaptionedChart that renders the header, chart area and footer
Returns¶
Bounds
Implementation of¶
chartAreaPadding¶
Get Signature¶
Returns¶
number
Implementation of¶
chartAreaBounds¶
Get Signature¶
Bounds of the chart area if no CaptionedChart is rendered
Returns¶
Bounds
sidePanelBounds¶
Get Signature¶
Bounds of the entity selector if rendered into the side panel
Returns¶
Bounds | undefined
Implementation of¶
containerElement¶
Get Signature¶
Returns¶
HTMLDivElement | undefined
analyticsContext¶
Get Signature¶
Returns¶
GrapherAnalyticsContext
timeColumn¶
Get Signature¶
Returns¶
| TimeColumn<CoreTable<CoreRow, CoreColumnDef>, CoreColumnDef>
| undefined
Implementation of¶
availableEntityNames¶
Get Signature¶
Returns¶
string[]
regionGroups¶
Get Signature¶
Returns¶
RegionGroup[]
Implementation of¶
entitiesByRegionGroup¶
Get Signature¶
Returns¶
EntitiesByRegionGroup
Implementation of¶
_sortConfig¶
Get Signature¶
Returns¶
Readonly<SortConfig$1>
sortConfig¶
Get Signature¶
Returns¶
SortConfig$1
Implementation of¶
hasMultipleYColumns¶
Get Signature¶
Returns¶
boolean
availableFacetStrategies¶
Get Signature¶
Returns¶
FacetStrategy[]
Implementation of¶
isFaceted¶
Get Signature¶
Returns¶
boolean
Implementation of¶
hasMultipleSeriesPerFacet¶
Get Signature¶
Returns¶
boolean
availableSortKeysAcrossChartTypes¶
Get Signature¶
Returns¶
SortBy[]
isInFullScreenMode¶
Get Signature¶
Returns¶
boolean
Set Signature¶
Parameters¶
| Parameter | Type |
|---|---|
newValue |
boolean |
Returns¶
void
Implementation of¶
isModalOpen¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isServerSideDownloadAvailable¶
Get Signature¶
Returns¶
boolean
Implementation of¶
useBaseFontSize¶
Get Signature¶
Returns¶
boolean
Implementation of¶
fontSize¶
Get Signature¶
Returns¶
number
Implementation of¶
isNarrow¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isSemiNarrow¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isSmall¶
Get Signature¶
Small charts are typically rendered into 6 or 7 columns in a 12-column grid layout (e.g. side-by-side charts or charts in the All Charts block)
Returns¶
boolean
Implementation of¶
isMedium¶
Get Signature¶
Medium charts are typically rendered into 8 columns in a 12-column grid layout (e.g. stand-alone charts in the main text of an article)
Returns¶
boolean
Implementation of¶
isStaticAndSmall¶
Get Signature¶
Returns¶
boolean
Implementation of¶
isExportingForWikimedia¶
Get Signature¶
Returns¶
boolean
Implementation of¶
shouldPinTooltipToBottom¶
Get Signature¶
Returns¶
boolean
Implementation of¶
showRelatedQuestion¶
Get Signature¶
Returns¶
boolean
Implementation of¶
overlayParam¶
Get Signature¶
Returns¶
string | undefined
areSelectedEntitiesDifferentThanAuthors¶
Get Signature¶
Returns¶
boolean
areFocusedSeriesNamesDifferentThanAuthors¶
Get Signature¶
Returns¶
boolean
changedParams¶
Get Signature¶
Autocomputed url params to reflect difference between current grapher state and original config state
Returns¶
Partial<GrapherQueryParams>
authorsVersion¶
Get Signature¶
Useful to compare current state against the published grapher
Returns¶
GrapherState
queryStr¶
Get Signature¶
Returns¶
string
Implementation of¶
baseUrl¶
Get Signature¶
Static root URL of the chart, e.g. https://ourworldindata.org/grapher/life-expectancy
Returns¶
string | undefined
Implementation of¶
canonicalUrl¶
Get Signature¶
Full URL representing the canonical location of this grapher state, e.g. https://ourworldindata.org/grapher/life-expectancy?tab=map
Returns¶
string | undefined
Implementation of¶
isOnCanonicalUrl¶
Get Signature¶
Returns¶
boolean
Implementation of¶
embedUrl¶
Get Signature¶
Returns¶
string | undefined
Implementation of¶
embedArchivedUrl¶
Get Signature¶
Returns¶
string | undefined
Implementation of¶
hasUserChangedTimeHandles¶
Get Signature¶
Returns¶
boolean
timeParam¶
Get Signature¶
Returns¶
string | undefined
disablePlay¶
Get Signature¶
Returns¶
boolean
Implementation of¶
animationEndTime¶
Get Signature¶
Returns¶
number
Implementation of¶
canSelectMultipleEntities¶
Get Signature¶
Returns¶
boolean
Implementation of¶
canChangeEntity¶
Get Signature¶
Returns¶
boolean
Implementation of¶
canAddEntities¶
Get Signature¶
Returns¶
boolean
Implementation of¶
canHighlightEntities¶
Get Signature¶
Returns¶
boolean
Implementation of¶
canChangeAddOrHighlightEntities¶
Get Signature¶
Returns¶
boolean
Implementation of¶
shouldShowEntitySelectorAs¶
Get Signature¶
Returns¶
GrapherWindowType
Implementation of¶
isEntitySelectorModalOpen¶
Get Signature¶
Returns¶
boolean
isEntitySelectorDrawerOpen¶
Get Signature¶
Returns¶
boolean
isMapSelectionEnabled¶
Get Signature¶
Returns¶
boolean
Implementation of¶
Methods¶
updateFromObject()¶
Parameters¶
| Parameter | Type |
|---|---|
obj? |
GrapherProgrammaticInterface |
Returns¶
void
toObject()¶
Returns¶
populateFromQueryParams()¶
Populates grapher state from URL query parameters
Parameters¶
| Parameter | Type |
|---|---|
params |
GrapherQueryParams |
Returns¶
void
setTimeFromTimeQueryParam()¶
Parameters¶
| Parameter | Type |
|---|---|
time |
string |
Returns¶
void
setAuthoredVersion()¶
Parameters¶
| Parameter | Type |
|---|---|
config |
Partial<LegacyGrapherInterface> |
Returns¶
void
updateAuthoredVersion()¶
Parameters¶
| Parameter | Type |
|---|---|
config |
Partial<LegacyGrapherInterface> |
Returns¶
void
resetToDefaultTab()¶
Returns¶
void
createPerformanceMeasurement()¶
Parameters¶
| Parameter | Type |
|---|---|
name |
string |
startMark |
number |
Returns¶
void
setTab()¶
Parameters¶
| Parameter | Type |
|---|---|
newTab |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
Returns¶
void
Implementation of¶
ensureTimeHandlesAreSensibleForTab()¶
Parameters¶
| Parameter | Type |
|---|---|
tab |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
Returns¶
void
adjustStateForTab()¶
Parameters¶
| Parameter | Type |
|---|---|
tab |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
Returns¶
void
syncEntitySelectionBetweenChartAndMap()¶
Parameters¶
| Parameter | Type |
|---|---|
oldTab |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
newTab |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
Returns¶
void
onTabChange()¶
Parameters¶
| Parameter | Type |
|---|---|
oldTab |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
newTab |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
Returns¶
void
Implementation of¶
addDimension()¶
Parameters¶
| Parameter | Type |
|---|---|
config |
OwidChartDimensionInterface |
Returns¶
void
setDimensionsForProperty()¶
Parameters¶
| Parameter | Type |
|---|---|
property |
DimensionProperty |
newConfigs |
OwidChartDimensionInterface[] |
Returns¶
void
setDimensionsFromConfigs()¶
Parameters¶
| Parameter | Type |
|---|---|
configs |
OwidChartDimensionInterface[] |
Returns¶
void
setToleranceNoticeFrozen()¶
Parameters¶
| Parameter | Type |
|---|---|
isFrozen |
boolean |
Returns¶
void
generateStaticSvg()¶
Parameters¶
| Parameter | Type |
|---|---|
renderToHtmlString |
(element) => string |
Returns¶
Promise<string>
logEntitySelectorEvent()¶
Parameters¶
| Parameter | Type |
|---|---|
action |
EntitySelectorEvent |
target? |
string |
Returns¶
void
Implementation of¶
logImageDownloadEvent()¶
Parameters¶
| Parameter | Type |
|---|---|
action |
GrapherImageDownloadEvent |
Returns¶
void
Implementation of¶
logGrapherInteractionEvent()¶
Parameters¶
| Parameter | Type |
|---|---|
action |
GrapherInteractionEvent |
target? |
string |
Returns¶
void
Implementation of¶
setHideExternalControlsInEmbedUrl()¶
Parameters¶
| Parameter | Type |
|---|---|
value |
boolean |
Returns¶
void
Implementation of¶
computeBaseFontSizeFromWidth()¶
Parameters¶
| Parameter | Type |
|---|---|
bounds |
Bounds |
Returns¶
number
clearSelection()¶
Returns¶
void
clearQueryParams()¶
Returns¶
void
reset()¶
Resets the Grapher to a blank slate, so that if you updateFromObject and the object contains some blanks, those blanks won't overwrite defaults.
Returns¶
void
onTimelineClick()¶
Returns¶
void
Implementation of¶
onSelectEntity()¶
Parameters¶
| Parameter | Type |
|---|---|
entityName |
string |
Returns¶
void
Implementation of¶
onDeselectEntity()¶
Parameters¶
| Parameter | Type |
|---|---|
entityName |
string |
Returns¶
void
Implementation of¶
onClearEntities()¶
Returns¶
void
Implementation of¶
isEntityMutedInSelector()¶
Parameters¶
| Parameter | Type |
|---|---|
entityName |
string |
Returns¶
boolean
Implementation of¶
mapGrapherTabToQueryParam()¶
Parameters¶
| Parameter | Type |
|---|---|
tabName |
| "LineChart" | "ScatterPlot" | "StackedArea" | "DiscreteBar" | "StackedDiscreteBar" | "SlopeChart" | "StackedBar" | "Marimekko" | "Dumbbell" | "Table" | "WorldMap" |
Returns¶
string