@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
113 lines (111 loc) • 4.15 kB
TypeScript
import type UniqueValueClass from "./UniqueValueClass.js";
import type { ClonableMixin } from "../../core/Clonable.js";
import type { JSONSupport } from "../../core/JSONSupport.js";
import type { UniqueValueClassProperties } from "./UniqueValueClass.js";
export interface UniqueValueGroupProperties extends Partial<Pick<UniqueValueGroup, "heading">> {
/**
* Specifies the classes (or unique categories) to group under a [heading](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueGroup/#heading). Classes may be included without a
* heading when representing multiple values with a single symbol.
*
* @example
* commercialGroup.classes = [{
* label: "C-2 | Community Commercial",
* symbol: {
* type: "simple-fill",
* color: [255,179,219]
* },
* values: ["C-1", "C-2"]
* }, {
* label: "C-3 | Major Commercial",
* symbol: {
* type: "simple-fill",
* color: 255,0,0
* },
* values: "C-3"
* }];
*/
classes?: UniqueValueClassProperties[] | null;
}
/**
* UniqueValueGroup represents a group of [unique value classes](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueClass/)
* (i.e. categories). This is used to group a subset of categories under a heading.
*
* At least one group must also be used if you want to represent multiple unique values with a single symbol.
*
* @since 4.25
* @see [UniqueValueRenderer.uniqueValueGroups](https://developers.arcgis.com/javascript/latest/references/core/renderers/UniqueValueRenderer/#uniqueValueGroups)
* @example
* // This example groups categories under three headings:
* // Commercial, Residential, and Other
* layer.renderer = {
* type: "unique-value",
* field: "zonecode",
* uniqueValueGroups: [{
* heading: "Commercial",
* classes: [{
* label: "C-2 | Community Commercial",
* symbol: createSymbol([255,179,219]),
* values: ["C-1", "C-2"]
* }, {
* label: "C-3 | Major Commercial",
* symbol: createSymbol([255,0,0]),
* values: "C-3"
* }]
* }, {
* heading: "Residential",
* classes: [{
* label: "R-1 | Low-Density Residential",
* symbol: createSymbol([255,255,224]),
* values: "R-1"
* }, {
* label: "R-3 | Limited High-Density Residential",
* symbol: createSymbol([255,214,0]),
* values: "R-3"
* }, {
* label: "R-4 | High-Density Residential",
* symbol: createSymbol([255,166,0]),
* values: "R-4",
* }]
* }, {
* heading: "Other",
* classes: [{
* label: "S | Special Area",
* symbol: createSymbol([161,237,237]),
* values: ["S-DW", "S-DR", "S-RP", "S-JW", "S-RN", "S-WS"]
* }]
* }]
* };
*/
export default class UniqueValueGroup extends UniqueValueGroupSuperclass {
constructor(properties?: UniqueValueGroupProperties);
/**
* Specifies the classes (or unique categories) to group under a [heading](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueGroup/#heading). Classes may be included without a
* heading when representing multiple values with a single symbol.
*
* @example
* commercialGroup.classes = [{
* label: "C-2 | Community Commercial",
* symbol: {
* type: "simple-fill",
* color: [255,179,219]
* },
* values: ["C-1", "C-2"]
* }, {
* label: "C-3 | Major Commercial",
* symbol: {
* type: "simple-fill",
* color: 255,0,0
* },
* values: "C-3"
* }];
*/
get classes(): UniqueValueClass[] | null | undefined;
set classes(value: UniqueValueClassProperties[] | null | undefined);
/**
* The heading to be displayed for the group of unique classes in the [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/).
*
* @example commercialGroup.heading = "Commercial";
*/
accessor heading: string | null | undefined;
}
declare const UniqueValueGroupSuperclass: typeof JSONSupport & typeof ClonableMixin