Global

Members

(constant) AQI_COLORS

RGB colors corresponding to AQI categories 1 through 6.

Source:

(constant) AQI_THRESHOLDS

2024 NAAQS PM2.5 thresholds in µg/m³ for AQI categories.

Source:

Methods

dailyBarplotConfig(data)

Returns a daily barplot chart configuration.

Parameters:
Name Type Description
data Object
Properties
Name Type Attributes Description
daily_datetime Array.<DateTime>

Luxon DateTime[] in UTC.

daily_mean Array.<number>

Daily PM2.5 mean values.

locationName string

Label for chart title.

timezone string

IANA time zone string.

title string <optional>

Optional custom title.

Source:

dailyRangeBarplotConfig(data)

Returns a dailyRangeBarplot chart configuration.

Parameters:
Name Type Description
data Object
Properties
Name Type Attributes Description
daily_datetime Array.<DateTime>

Luxon DateTime[] in UTC.

daily_min Array.<number>

Daily PM2.5 minimum values.

daily_mean Array.<number>

Daily PM2.5 mean values.

daily_max Array.<number>

Daily PM2.5 maximum values.

locationName string

Label for chart title.

timezone string

IANA time zone string (e.g. "America/Los_Angeles").

title string <optional>

Optional override for chart title.

Source:

diurnalPlotConfig(data)

Returns a diurnalPlot chart configuration.

Parameters:
Name Type Description
data Object

The data required to create the chart.

Source:

hourlyBarplotConfig(data) → {Object}

Returns a Highcharts chart configuration for a full-sized hourly NowCast barplot.

Parameters:
Name Type Description
data Object
Properties
Name Type Attributes Description
datetime Array.<DateTime>

Array of Luxon DateTime objects (UTC).

pm25 Array.<number>

Raw hourly PM2.5 data.

nowcast Array.<number>

NowCast values.

locationName string

Label for the chart.

timezone string

IANA timezone for display.

title string <optional>

Optional custom title.

Source:
Returns:

Highcharts chart config object.

Type
Object

isValidPM25(value) → {boolean}

Returns true if the given value is a finite number.

Parameters:
Name Type Description
value *
Source:
Returns:
Type
boolean

pm25ToAQC(pm25) → {number|null}

Returns the Air Quality Category (AQC) level associated with a PM2.5 measurement. Categories range from 1 (Good) to 6 (Hazardous).

Parameters:
Name Type Description
pm25 number

PM2.5 concentration in µg/m³.

Source:
Returns:

AQC level (1–6), or null if input is invalid.

Type
number | null

pm25ToColor(pm25) → {string}

Returns the AQI color associated with a PM2.5 level.

Parameters:
Name Type Description
pm25 number

PM2.5 concentration in µg/m³.

Source:
Returns:

RGB color string.

Type
string

pm25ToYMax(pm25) → {number}

Returns the ymax value appropriate for a maximum PM2.5 level. Uses fixed breakpoints to prevent charts from autoscaling too wildly.

Parameters:
Name Type Description
pm25 number

Maximum PM2.5 value in µg/m³.

Source:
Returns:

Suggested y-axis maximum.

Type
number

pm25_AQILines(widthopt) → {Array.<Object>}

Returns an array of plotLine objects for overlaying AQI thresholds on a Highcharts yAxis.

Parameters:
Name Type Attributes Default Description
width number <optional>
2

Line width in pixels.

Source:
Returns:

Highcharts-compatible plotLines array.

Type
Array.<Object>

pm25_addAQIStackedBar(chart, widthopt)

Adds a colored AQI stacked bar to the left side of an existing Highcharts chart. Intended to provide a visual reference for AQI zones.

Parameters:
Name Type Attributes Default Description
chart Highcharts.Chart

A fully rendered Highcharts chart.

width number <optional>
6

Width of the AQI bar in pixels.

Source:

requireLuxonDateTime(dt, name)

Throws an error if the input is not a Luxon DateTime object.

Parameters:
Name Type Description
dt *

The value to validate.

name string

Name of the variable for clearer error messages.

Source:

requireLuxonDateTimeArray(arr, name)

Throws an error if any element in the array is not a Luxon DateTime object.

Parameters:
Name Type Description
arr Array

Array to validate.

name string

Name of the array for clearer error messages.

Source:

small_dailyBarplotConfig(data)

Returns a daily barplot chart configuration for small-multiples display.

Parameters:
Name Type Description
data Object

Same structure as dailyBarplotConfig.

Source:

small_dailyRangeBarplotConfig(data)

Returns a compact dailyRangeBarplot config for use in small-multiples display.

Parameters:
Name Type Description
data Object

See dailyRangeBarplotConfig for structure.

Source:

small_diurnalPlotConfig(data)

Returns a diurnalPlot chart configuration. The 'small' version of this plot has no legend or axis labeling and is appropriate for use in a display with "small multiples".

Parameters:
Name Type Description
data Object

The data required to create the chart.

Source:

small_hourlyBarplotConfig(data)

Returns a Highcharts config for a small-multiples-style hourly NowCast barplot.

Parameters:
Name Type Description
data Object

Same structure as for hourlyBarplotConfig.

Source:

small_timeseriesPlotConfig(data) → {Object}

Returns a simplified version of the timeseries plot configuration. This small variant disables legends and axis labels for use in small-multiples or compact visual displays.

Parameters:
Name Type Description
data Object

The data required to create the chart.

Properties
Name Type Attributes Description
datetime Array.<DateTime>

Array of Luxon DateTime objects in UTC.

pm25 Array.<number>

PM2.5 values aligned with datetime.

nowcast Array.<number>

NowCast values aligned with datetime.

locationName string

Site or label name.

timezone string

IANA timezone string for x-axis display.

title string <optional>

Optional custom chart title.

Source:
Returns:

Highcharts chart config.

Type
Object

timeseriesPlotConfig(data) → {Object}

Returns a timeseriesPlot chart configuration.

Parameters:
Name Type Description
data Object

The data required to create the chart.

Properties
Name Type Attributes Description
datetime Array.<DateTime>

Array of Luxon DateTime objects in UTC.

pm25 Array.<number>

PM2.5 values aligned with datetime.

nowcast Array.<number>

NowCast values aligned with datetime.

locationName string

Site or label name.

timezone string

IANA timezone string for x-axis display.

title string <optional>

Optional custom chart title.

Source:
Returns:

Highcharts chart config.

Type
Object

validatePlotArrays(datetime, pm25, nowcast)

Validate the input data arrays for hourly or time series plots.

Parameters:
Name Type Description
datetime Array.<DateTime>

Array of Luxon DateTime objects (assumed UTC).

pm25 Array.<(number|null)>

Array of PM2.5 values (finite or null).

nowcast Array.<(number|null)>

Array of NowCast values (finite or null).

Source:
Throws:

If input is invalid in structure or type.

Type
Error