import type CIMSymbol from "../../symbols/CIMSymbol.js"; import type { JSONSupport } from "../../core/JSONSupport.js"; import type { CIMSymbolProperties } from "../../symbols/CIMSymbol.js"; import type { SymbolUnion } from "../../symbols/types.js"; import type { WebStyleSymbolProperties } from "../../symbols/WebStyleSymbol.js"; import type { PolygonSymbol3DProperties } from "../../symbols/PolygonSymbol3D.js"; import type { PointSymbol3DProperties } from "../../symbols/PointSymbol3D.js"; import type { MeshSymbol3DProperties } from "../../symbols/MeshSymbol3D.js"; import type { LineSymbol3DProperties } from "../../symbols/LineSymbol3D.js"; import type { LabelSymbol3DProperties } from "../../symbols/LabelSymbol3D.js"; import type { TextSymbolProperties } from "../../symbols/TextSymbol.js"; import type { SimpleMarkerSymbolProperties } from "../../symbols/SimpleMarkerSymbol.js"; import type { SimpleLineSymbolProperties } from "../../symbols/SimpleLineSymbol.js"; import type { SimpleFillSymbolProperties } from "../../symbols/SimpleFillSymbol.js"; import type { PictureMarkerSymbolProperties } from "../../symbols/PictureMarkerSymbol.js"; import type { PictureFillSymbolProperties } from "../../symbols/PictureFillSymbol.js"; export interface UniqueValueInfoProperties extends Partial> { /** * Defines alternate [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/)s used to represent features with the provided [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value) * at different scales. The CIMSymbol provided must have a `minScale` or `maxScale` defined. * * > Alternate symbols are only supported in 2D. * > To properly support scale-based symbology, the [symbol](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#symbol) property should also be a [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/) with a `minScale` or `maxScale` defined. * * @since 5.1 * @example * ```js * uniqueValueRenderer.uniqueValueInfos = [ * { * value: "Interstate", * // this symbol will be used when the view's scale is less than 5,000,000 * symbol: new CIMSymbol({ * data: { * type: "CIMSymbolReference", * minScale: 5000000, * maxScale: 0, * symbol: { ... } // symbol definition * } * }), * alternateSymbols: [ * // this symbol will be used when the view's scale is greater than 5,000,000 * new CIMSymbol({ * data: { * type: "CIMSymbolReference", * minScale: 0, * maxScale: 5000000, * symbol: { ... } // symbol definition * } * }) * } * ] * ``` */ alternateSymbols?: (CIMSymbolProperties | CIMSymbolProperties)[] | null; /** * Defines the symbol used to render features with the provided [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value). * * @see [Guide - Esri color ramps](https://developers.arcgis.com/javascript/latest/esri-color-ramps/) * @see [Guide - Visualization best practices](https://developers.arcgis.com/javascript/latest/visualization-best-practices/) */ symbol?: (((PictureFillSymbolProperties & { type: "picture-fill" }) | (PictureMarkerSymbolProperties & { type: "picture-marker" }) | (SimpleFillSymbolProperties & { type: "simple-fill" }) | (SimpleLineSymbolProperties & { type: "simple-line" }) | (SimpleMarkerSymbolProperties & { type: "simple-marker" }) | (TextSymbolProperties & { type: "text" }) | (CIMSymbolProperties & { type: "cim" })) | ((LabelSymbol3DProperties & { type: "label-3d" }) | (LineSymbol3DProperties & { type: "line-3d" }) | (MeshSymbol3DProperties & { type: "mesh-3d" }) | (PointSymbol3DProperties & { type: "point-3d" }) | (PolygonSymbol3DProperties & { type: "polygon-3d" })) | (WebStyleSymbolProperties & { type: "web-style" })) | null; } /** * Defines the categories of a [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/UniqueValueRenderer/). * Each unique value info defines a [symbol](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#symbol) that should be used to represent features * with a specific [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value). * * The [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/UniqueValueRenderer/) * determines the field or expression containing categorical data used for the rendering. Each * feature is categorized with a symbol based on the value of its field as defined in the * unique value info object. * * @since 4.0 * @see [UniqueValueRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/UniqueValueRenderer/) * @see [Guide - Esri color ramps](https://developers.arcgis.com/javascript/latest/esri-color-ramps/) * @see [Guide - Visualization best practices](https://developers.arcgis.com/javascript/latest/visualization-best-practices/) */ export default class UniqueValueInfo extends JSONSupport { constructor(properties?: UniqueValueInfoProperties); /** * Defines alternate [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/)s used to represent features with the provided [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value) * at different scales. The CIMSymbol provided must have a `minScale` or `maxScale` defined. * * > Alternate symbols are only supported in 2D. * > To properly support scale-based symbology, the [symbol](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#symbol) property should also be a [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/) with a `minScale` or `maxScale` defined. * * @since 5.1 * @example * ```js * uniqueValueRenderer.uniqueValueInfos = [ * { * value: "Interstate", * // this symbol will be used when the view's scale is less than 5,000,000 * symbol: new CIMSymbol({ * data: { * type: "CIMSymbolReference", * minScale: 5000000, * maxScale: 0, * symbol: { ... } // symbol definition * } * }), * alternateSymbols: [ * // this symbol will be used when the view's scale is greater than 5,000,000 * new CIMSymbol({ * data: { * type: "CIMSymbolReference", * minScale: 0, * maxScale: 5000000, * symbol: { ... } // symbol definition * } * }) * } * ] * ``` */ get alternateSymbols(): CIMSymbol[] | null | undefined; set alternateSymbols(value: (CIMSymbolProperties | CIMSymbolProperties)[] | null | undefined); /** * Describes the [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value) represented by the [symbol](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#symbol). This label will appear in the * [Legend](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-legend/) next to the symbol representing the value. * If no label is provided, then the raw [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value) is displayed in the legend. */ accessor label: string | null | undefined; /** * Defines the symbol used to render features with the provided [value](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#value). * * @see [Guide - Esri color ramps](https://developers.arcgis.com/javascript/latest/esri-color-ramps/) * @see [Guide - Visualization best practices](https://developers.arcgis.com/javascript/latest/visualization-best-practices/) */ get symbol(): SymbolUnion | null | undefined; set symbol(value: (((PictureFillSymbolProperties & { type: "picture-fill" }) | (PictureMarkerSymbolProperties & { type: "picture-marker" }) | (SimpleFillSymbolProperties & { type: "simple-fill" }) | (SimpleLineSymbolProperties & { type: "simple-line" }) | (SimpleMarkerSymbolProperties & { type: "simple-marker" }) | (TextSymbolProperties & { type: "text" }) | (CIMSymbolProperties & { type: "cim" })) | ((LabelSymbol3DProperties & { type: "label-3d" }) | (LineSymbol3DProperties & { type: "line-3d" }) | (MeshSymbol3DProperties & { type: "mesh-3d" }) | (PointSymbol3DProperties & { type: "point-3d" }) | (PolygonSymbol3DProperties & { type: "polygon-3d" })) | (WebStyleSymbolProperties & { type: "web-style" })) | null | undefined); /** Features with this value will be rendered with the given [symbol](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/UniqueValueInfo/#symbol). */ accessor value: string | number; /** * Creates a deep clone of the unique value info object. * * @returns A deep clone of the unique value info object * that invoked this method. * @example * // Creates a deep clone of the first unique value info in the renderer * let firstInfo = renderer.uniqueValueInfos[0].clone(); */ clone(): UniqueValueInfo; }