UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

43 lines (41 loc) 3.18 kB
import type BinParametersBase from "./BinParametersBase.js"; import type { BinParametersBaseProperties } from "./BinParametersBase.js"; export interface FixedBoundariesBinParametersProperties extends BinParametersBaseProperties, Partial<Pick<FixedBoundariesBinParameters, "boundaries">> {} /** * FixedBoundariesBinParameters specifies [AttributeBinsQuery.binParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/#binParameters) on [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/) object. * For the [FixedBoundariesBinParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FixedBoundariesBinParameters/), the bins strictly follow the specified [input values](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FixedBoundariesBinParameters/#boundaries). The first item in the array specifies * the lower boundary of the first bin, while the last item specifies the upper boundary of the last bin. Intermediate values represent the lower boundaries of each bin. * The fixed boundaries binning works with numeric fields and fields of the `date` type only. It does not support `timestamp-offset`, `date-only`, or `time-only` field types. * * If you have census data on the median income of households in a city and want to categorize this data into specific income groups to analyze income distribution, * you could use the income boundaries array [0, 12500, 48000, 85000, 120000, 20000]. Based on these boundaries, the bins are defined as follows: * * ```js * // Query bins with fixed boundaries bin parameters based on field "income2022" with the specified income boundaries. * // Show the median income distribution of households in the city. * const binQuery = new AttributeBinsQuery({ * binParameters: new FixedBoundariesBinParameters({ * boundaries: [0, 12500, 48000, 85000, 120000, 20000], // the boundaries of each bin * field: "income2022" // the field to bin, containing the median income data for individual households * }) * }); * ``` * * <figure> * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/rest/binQuery/fixed-boundaries-bin.png" alt="color-blend" style="width:400px;"/> * <figcaption>2022 median household income distribution with each bin representing an income group defined by the fixed boundaries bin as shown above.</figcaption> * </figure> * * @since 4.32 * @see [AttributeBinsQuery](https://developers.arcgis.com/javascript/latest/references/core/rest/support/AttributeBinsQuery/) */ export default class FixedBoundariesBinParameters extends BinParametersBase { constructor(properties?: FixedBoundariesBinParametersProperties); /** * Array of values representing bin boundaries. The first item in the array specifies the start of the range, and the last item specifies the end, * both inclusively. Intermediate values represent the lower boundaries of each bin. */ accessor boundaries: number[] | Date[]; /** The type of bin parameters. */ readonly type: "fixed-boundaries"; }