import { getThemes, getSchemes, cloneScheme } from "@arcgis/core/smartMapping/symbology/size.js";const { getThemes, getSchemes, cloneScheme } = await $arcgis.import("@arcgis/core/smartMapping/symbology/size.js");- Since
- ArcGIS Maps SDK for JavaScript 4.2
Object containing helper methods for generating optimal symbols for data-driven size visualizations. The getSchemes() method is used to generate symbol properties best suited to the given geometry type and basemap.
Functions
| Name | Return Type | Object |
|---|---|---|
Theme[] | | |
SizeSchemes | null | undefined | | |
SizeScheme | null | undefined | | |
| |
getThemes
Returns metadata for the available themes. If a basemap is provided, returns themes that work best with the given basemap.
- Signature
-
getThemes (basemap?: Basemap | string | null | undefined): Theme[]
getSchemes
Returns a primary scheme and secondary schemes defining symbol properties for size-based
data-driven visualizations in
a FeatureLayer. The basemap parameter determines the color of the
graphics used to visualize each feature. The geometryType determines which type of symbol to return.
- Signature
-
getSchemes (params: GetSchemesParameters): SizeSchemes | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- SizeSchemes | null | undefined
Returns an object containing the optimal size scheme to use for the given basemap and secondary schemes that may also be used.
Example
// gets the primary scheme for the features of the given geometry type and basemaplet schemes = sizeSchemes.getSchemes({ basemap: map.basemap, geometryType: featureLayer.geometryType});
// the best default scheme for the layer and basemaplet primaryScheme = schemes.primaryScheme; cloneScheme
Clones a size scheme object.
- Signature
-
cloneScheme (scheme: SizeScheme | null | undefined): SizeScheme | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| scheme | SizeScheme | null | undefined | The SizeScheme object to clone. | |
- Returns
- SizeScheme | null | undefined
Returns a clone of the given size scheme object.
Example
// clones the primary scheme returned from the getSchemes() methodlet sizeScheme = primaryScheme.clone();Type definitions
GetSchemesParameters
basemap
The Esri basemap to pair with the visualization. This
value indicates the best symbol colors for visualizing features against the given basemap. If you have a
non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, then use the basemapTheme parameter
instead of this parameter.
geometryType
- Type
- "point" | "multipoint" | "polyline" | "polygon" | null
The geometry type of the features to visualize.
basemapTheme
- Type
- BasemapTheme | null | undefined
If you have a
non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, use this parameter to indicate
whether the background of the visualization is light or dark.