Home Reference Source

References

summary
private

F ensureDataIds(param: *)

Ensure dataId prop is present on the object, otherwise load dataId from store The dataId prop is added permanently to the object, so that we don't have to reload it again and again.

public

Find an assessment by its ID.

public

Find an assessment by its slug.

public

F findAssessmentForRegionById(region: Object, assessmentId: string): Object

Find a specific assessment by ID and include the observation for the given region.

public

F findGoalForRegionById(region: Object, goalId: string): Object

Find a specific goal by assessment ID and include the observation for the given region.

public

Find an indicator by its ID.

public

Find an indicator by its slug.

public

F findIndicatorForRegionById(region: Object, indicatorId: string): Object

Find a specific indicator by ID and include the observation for the given region.

public

F findIndicatorForRegionBySlug(region: Object, indicatorSlug: string): Object

Find a specific indicator by slug and include the observation for the given region.

public

Get the leave-no-one-behind assessment.

public

Get the leave-no-one-behind assessment, including the observation for the given region.

public

Find the observation for the given region and assessment.

public

Get the overall SDG Index assessment.

public

Get the overall SDG Index assessment, including the observation for the given region.

public

Find a region by its ID.

public

Find a region by its slug.

public

F findRegionWithAssessmentById(assessment: Object, regionId: string): Object

Find a specific region by ID and include the observation for the given assessment.

public

Get the spillover index assessment.

public

Get the spillover index assessment, including the observation for the given region.

public

Find the timeseries for a specific region and assessment.

public

Find the timeseries for a specific region and indicator.

public

Get all assessments from the store.

public

Get all goal assessments from the store.

public

Get all goal assessments from the store, each including the respective observation for the given region.

public

Get all indicators from the store.

public

Get all indicators for the given goal from the store.

public

Get all indicators for the given lnob dimension from the store.

public

Get all indicators from the store, each including the respective observation for the given region.

public

Get all indicators for the given goal from the store, each including the respective observation for the given region.

public

Get all indicators for the given lnob dimension from the store, each including the respective observation for the given region.

public

Get all LNOB assessments from the store.

public

Get all lnob assessments from the store, each including the respective observation for the given region.

public

Get all regions from the store.

public

Get all regions from the store of a given type.

public

Get all regions from the store, each including the respective observation for the given assessment.

public

Get all regions from the store, each including the respective timeseries values for the given assessment.

public

Get all trend indicators from the store.

public

F isDataLoaded(options: Object): boolean

Check if all datasets have already been loaded into the store.

public

F loadData(options: Object): Promise

Loads data (assessments, regions, observations, ...) into store.

private

F loadDataset(dataset: Object): Promise

Load a single dataset into the store.

public

Use any @sdgindex/data functions in a React component.

public

V store: {}

public

The status of the store.

assessments

summary
public

F isGlobalOnly(assessment: Object): bool

Check whether the given assessment is a global-only indicator (used only to assess non-OECD countries).

public

F isGoal(assessment: Object): bool

Check if the given assessment is a goal.

public

F isIndicator(assessment: Object): bool

Check if the given assessment is an indicator.

public

F isLnobAssessment(assessment: Object): bool

Check if the given assessment is the leave-no-one-behind performance.

public

F isLnobDimension(assessment: Object): bool

Check if the given assessment is a LNOB dimension.

public

F isOecdOnly(assessment: Object): bool

Check whether the given assessment is an OECD-only indicator (used only to assess OECD countries).

public

F isOverallAssessment(assessment: Object): bool

Check if the given assessment is the overall SDG Index performance.

public

F isRelevantIndicatorForRegion(assessment: Object, region: Object): bool

Check whether the given assessment is a relevant indicator for the region.

public

F isSpilloverAssessment(assessment: Object): bool

Check if the given assessment is the overall spillover index performance.

public

F isTrendIndicator(assessment: Object): bool

Check if the given assessment is a trend indicator.

observations

summary
public

F getRank(observation: Object): number

Get the numeric rank for the given observation.

public

F getRankAsText(observation: Object, fallback: string): String

Get the text rank for a given observation.

public

F getRating(observation: Object): String

Get the rating for a given observation (green, yellow, orange, etc...).

public

F getScore(observation: Object)

Get the numeric score for the given observation.

public

F getScoreAsText(observation: Object, precision: number, fallback: string): String

Get the text score for a given observation, with the given level of decimal precision.

public

F getTrend(observation: Object): string

Get the trend (e.g., "↑", "➚", etc...) for the given observation.

public

F getValue(observation: Object): number

Get the numeric, raw value for the given observation.

public

F getValueAsText(observation: Object, precision: number, fallback: string): String

Get the text raw value for a given observation, with the given level of decimal precision.

public

F getYear(observation: Object): number

Get the numeric year for the given observation.

public

F getYearAsText(observation: Object, fallback: string): String

Get the text year for a given observation.

public

F isImputed(observation: Object): bool

Check if the given observation is imputed.

parse

summary
private

F addAssessment(assessment: Object): Object

Add an assessment to the store.

public

F addGoal(params: Object): Object

Add a goal to the store.

public

F addGoals(options: Object): Object[]

Add all goals to the store.

public

F addIndicator(indicator: Object): Object

Add an indicator to the store

public

Add the spillover assessment to the store

public

Add a LNOB to the store.

public

Add all lnobs to the store.

public

F addObservation(observation: Object): Object

Add an observation to the store

public

Add the overall assessment to the store

public

F addRegion(region: Object): Object

Add a region to the store

public

Add the spillover assessment to the store

public

F addTimeseries(timeseries: Object): Object

Add timeseries to the store.

public

Convert score to rating color.

public

F excelToJson(param: Object): Array

Convert a sheet in an Excel file into JSON format.

public

Extract the unit from an indicator label.

public

Remove the unit from the indicator label.

public

F roundNumber(number: string | number, precision: number): number

Round a number to a given level of precision.

public

Write the store to a series of human-readable and minified JSON files.

regions

summary
public

F isCountry(region: Object): bool

Check if the given region is a country.

public

F isOecd(region: Object): bool

Check whether the given region is a member of the OECD.

sdgs

summary
public

F getColor(sdgNumber: number): String

Get the color for an SDG with the given number.

public

F getLabel(sdgNumber: number): String

Get the label/title for an SDG with the given number.

public

F getLnobDimension(dimNumber: number): Object

Get the label & description for a LNOB dimension with the given number.

public

F getSdg(sdgNumber: number): Object

Get the label and the color for an SDG with the given number.

timeseries

summary
public

F getFirstYear(timeseries: Object): number

Get the first year where the timeseries has a non-null value.

public

F getLastYear(timeseries: Object): number

Get the last year where the timeseries has a non-null value.

public

F getTimeseriesValue(timeseries: Object, year: Number): number

Get timeseries value for the given year.

public

F hasTimeseries(timeseries: Object): bool

Check if the given object has timeseries values.

utilities

summary
private

F decodeObject(array: Array, encoding: Array): Object

Decode the given array back into an object structure, based on the provided encoding.

private

Determine object encoding by counting the number of times each property/key appears in the objects.

private

F encodeObject(object: Object, encoding: Array): Array

Convert the given object into array, which requires less space and is faster to load.