import { getThemes, getSchemes, getSchemeByName, getSchemesByTag, cloneScheme } from "@arcgis/core/smartMapping/symbology/relationship.js";const { getThemes, getSchemes, getSchemeByName, getSchemesByTag, cloneScheme } = await $arcgis.import("@arcgis/core/smartMapping/symbology/relationship.js");- Since
- ArcGIS Maps SDK for JavaScript 4.9
Object containing helper methods for getting optimal symbol schemes used to create relationship (bivariate choropleth) visualizations. The getSchemes() returns color schemes best suited to the given basemap for this visualization style.
Functions
| Name | Return Type | Object |
|---|---|---|
Theme[] | | |
| | ||
| | ||
| | ||
| | ||
| | |
| | |
| |
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): Theme[]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| basemap | The Esri basemap string or object that will be used with the returned theme(s). | |
- Returns
- Theme[]
Returns an object containing information about the available themes for the given basemap.
getSchemes
Returns a primary scheme and secondary schemes defining symbol properties for relationship-based (bivariate choropleth)
data-driven visualizations in a Layer. The basemap parameter determines the color of the
symbols used to visualize each feature. The geometryType determines which type of symbol to return.
- Signature
-
getSchemes (params: GetSchemesParameters): RelationshipSchemes | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- RelationshipSchemes | null | undefined
Returns an object containing the optimal relationship color scheme to use for the given basemap; it also contains secondary schemes.
Example
// gets the primary scheme for the features of the given geometry type and basemapconst schemes = relationshipSchemes.getSchemes({ basemap: map.basemap, geometryType: featureLayer.geometryType});
// the best default scheme for the layer and basemapconst primaryScheme = schemes.primaryScheme; getSchemeByName
- Since
- ArcGIS Maps SDK for JavaScript 4.12
Returns a relationship scheme with the provided name.
- Signature
-
getSchemeByName (params: GetSchemesByNameParameters): RelationshipScheme | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- RelationshipScheme | null | undefined
Returns the relationship scheme with the given name.
Example
// Returns the Blueberry Parfait schemelet blueberryScheme = relationshipSchemes.getSchemeByName({ basemap: map.basemap, geometryType: featureLayer.geometryType, name: "Blueberry Parfait"}); getSchemesByTag
- Since
- ArcGIS Maps SDK for JavaScript 4.12
Returns an array of relationship schemes with the provided tags. These schemes define symbol properties for relationship visualizations.
- Signature
-
getSchemesByTag (params: GetSchemesByTagParameters): RelationshipScheme[]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- RelationshipScheme[]
Returns an array of relationship schemes either including or excluding the provided tags.
Example
let schemes = relationshipSchemes.getSchemesByTag({ basemap: map.basemap, geometryType: featureLayer.geometryType, includedTags: [ "tritanopia" ], excludedTags: [ "grayscale" ]}); cloneScheme
Clones a relationship (bivariate color) scheme object.
- Signature
-
cloneScheme (scheme: RelationshipScheme | null | undefined): RelationshipScheme | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| scheme | The relationship scheme object to clone. | |
- Returns
- RelationshipScheme | null | undefined
Returns a clone of the given relationship scheme object.
Example
// clones the primary scheme returned from the getSchemes() methodconst relationshipScheme = 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" | "mesh" | "multipatch" | 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.
GetSchemesByTagParameters
- Supertypes
- GetSchemesParameters