require(["esri/smartMapping/symbology/type"], (typeSchemes) => { /* code goes here */ });
import * as typeSchemes from "@arcgis/core/smartMapping/symbology/type.js";
esri/smartMapping/symbology/type
Object containing helper methods for getting optimal symbol themes used to create data-driven visualizations of unique values or types. The getSchemes() method is used to generate symbol properties best suited to the given basemap.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Clones a type scheme object. | type | ||
Returns a type scheme with the provided name. | type | ||
Returns a primary scheme and secondary schemes defining symbol properties for type-based data-driven visualizations in a Layer. | type | ||
Returns an array of type schemes with the provided tags. | type | ||
Returns metadata for the available themes. | type |
Method Details
-
cloneScheme
cloneScheme(scheme){TypeScheme}
-
Clones a type scheme object.
Parameterscheme TypeSchemeThe type scheme object to clone.
ReturnsType Description TypeScheme Returns a clone of the given type scheme object. Example// clones the primary scheme returned from the getSchemes() method let typeScheme = primaryScheme.clone();
-
getSchemeByName
getSchemeByName(params){TypeScheme}
Since: ArcGIS Maps SDK for JavaScript 4.12type since 4.4, getSchemeByName added at 4.12. -
Returns a type scheme with the provided name.
ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
Specificationname StringThe name of the scheme to retrieve.
optional The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap.
basemapTheme StringoptionalIf 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
ordark
.Possible Values:"light"|"dark"
geometryType StringThe geometry type of the features to visualize. | mesh
Possible Values:"point"|"multipoint"|"polyline"|"polygon"|"mesh"|"multipatch"
theme StringoptionalDefault Value: defaultDetermines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the
CLASS_CODE
field is driving the visualization in a PointCloudLayer), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types.Possible Values:"point-cloud-class"|"default"
numColors NumberoptionalSince 4.31 Indicates the number of colors to include in the color ramp within the scheme.
worldScale BooleanoptionalIndicates if the size units of the scheme will be in meters. This should be
true
when the scheme is intended for 3D volumetric symbology. Aview
must be provided if this property is set totrue
.view SceneViewoptionalThe SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols.
ReturnsType Description TypeScheme Returns the type scheme with the given name. Example// Returns the Pastel Dreams scheme let galaxyBerriesScheme = typeSchemes.getSchemeByName({ basemap: map.basemap, geometryType: featureLayer.geometryType, name: "Pastel Dreams" });
-
getSchemes
getSchemes(params){TypeSchemes}
-
Returns a primary scheme and secondary schemes defining symbol properties for type-based data-driven visualizations in a Layer. The
basemap
parameter determines the color of the graphics used to visualize each feature. ThegeometryType
determines which type of symbol to return.ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
Specificationoptional 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.basemapTheme StringoptionalIf 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
ordark
.Possible Values:"light"|"dark"
geometryType StringThe geometry type of the features to visualize. | mesh
Possible Values:"point"|"multipoint"|"polyline"|"polygon"|"mesh"|"multipatch"
theme StringoptionalDefault Value: defaultDetermines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the
CLASS_CODE
field is driving the visualization in a PointCloudLayer), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types.Possible Values:"point-cloud-class"|"default"
numColors NumberoptionalSince 4.31 Indicates the number of colors to include in the color ramp within the scheme.
worldScale BooleanoptionalIndicates if the size units of the scheme will be in meters. This should be
true
when the scheme is intended for 3D volumetric symbology. Aview
must be provided if this property is set totrue
.view SceneViewoptionalThe SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols.
ReturnsType Description TypeSchemes Returns an object containing the optimal type 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 basemap let schemes = typeSchemes.getSchemes({ basemap: map.basemap, geometryType: featureLayer.geometryType }); // the best default scheme for the layer and basemap let primaryScheme = schemes.primaryScheme;
-
getSchemesByTag
getSchemesByTag(params){TypeScheme[]}
Since: ArcGIS Maps SDK for JavaScript 4.12type since 4.4, getSchemesByTag added at 4.12. -
Returns an array of type schemes with the provided tags. These schemes define symbol properties for data-driven visualizations in any layer that can be rendered with a UniqueValueRenderer.
ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
Specificationoptional When provided, only schemes containing all the matching tags will be returned.
Known Tags: light | dark | reds | yellows | oranges | greens | blues | purples | pinks | browns | grays | bright | subdued | deuteranopia | protanopia | tritanopia | grayscale | types | dot-density
optional When provided, only schemes missing all the provided tags will be returned.
Known Tags: light | dark | reds | yellows | oranges | greens | blues | purples | pinks | browns | grays | bright | subdued | deuteranopia | protanopia | tritanopia | grayscale | types | dot-density
optional The basemap to pair with the visualization. This value indicates the best symbol color for visualizing features with the given basemap.
basemapTheme StringoptionalIf 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
ordark
.Possible Values:"light"|"dark"
geometryType StringThe geometry type of the features to visualize. | mesh
Possible Values:"point"|"multipoint"|"polyline"|"polygon"|"mesh"|"multipatch"
theme StringoptionalDefault Value: defaultDetermines whether to return a standardized unique value scheme for point cloud class renderers (i.e. when the
CLASS_CODE
field is driving the visualization in a PointCloudLayer), or to return the other default primary schemes used in other unique value renderers generated for non-point cloud layer types.Possible Values:"point-cloud-class"|"default"
numColors NumberoptionalSince 4.31 Indicates the number of colors to include in the color ramp within the scheme.
worldScale BooleanoptionalIndicates if the size units of the scheme will be in meters. This should be
true
when the scheme is intended for 3D volumetric symbology. Aview
must be provided if this property is set totrue
.view SceneViewoptionalThe SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols.
ReturnsType Description TypeScheme[] Returns an array of type schemes either including or excluding the provided tags. Example// Returns all the red type schemes that are subdued let schemes = typeSchemes.getSchemesByTag({ basemap: map.basemap, geometryType: featureLayer.geometryType, includedTags: [ "types", "subdued" ] });
-
Returns metadata for the available themes. If a basemap is provided, returns themes that work best with the given basemap.
Parameteroptional The Esri basemap string or object that will be used with the returned theme(s).
Returns
Type Definitions
-
TypeScheme
TypeScheme TypeSchemeForPoint |TypeSchemeForPolyline |TypeSchemeForPolygon |TypeSchemeForMesh
-
Properties defining the symbology scheme used to visualize features with attribute data-driven types.
-
Properties defining the symbology scheme used to visualize mesh features driven by type-based attribute data.
- Properties
-
Properties defining the symbology scheme used to visualize point features driven by type-based attribute data.
- Properties
-
name String
The unique name of the scheme.
Tags associated with the scheme.
The fill colors of the point symbols comprising the theme.
noDataColor ColorThe color of the point symbol used to indicate features with no data.
outline ObjectProperties for defining the outline of the marker symbol.
size NumberThe default size of the point symbol in pixels, points, or real-world units.
opacity NumberThe opacity of the point symbol.
-
Properties defining the symbology scheme used to visualize polygon features driven by type-based attribute data.
- Properties
-
name String
The unique name of the scheme.
Tags associated with the scheme.
The fill colors of the symbols comprising the theme.
noDataColor ColorThe color of the fill symbol used to indicate features with no data.
outline ObjectProperties for defining the outline of the fill symbol.
opacity NumberThe opacity of the symbol (0 - 1).
-
Properties defining the symbology scheme used to visualize polyline features driven by type-based attribute data.
- Properties
-
name String
The unique name of the scheme.
Tags associated with the scheme.
The colors of the line symbols comprising the theme.
noDataColor ColorThe color of the line symbol used to indicate features with no data and features that are out of range.
width NumberThe default width of the line symbol in pixels or points.
opacity NumberThe opacity of the line symbol (0 - 1).
-
The return object of the getSchemes() method.
- Properties
-
primaryScheme TypeScheme
The type scheme best suited for the given basemap and geometry type.
secondarySchemes TypeScheme[]Additional type schemes that may be used to visualize data of the given geometry type overlaid on the given basemap.
basemapId StringThe ID of the basemap associated with the given schemes.
basemapTheme StringIndicates whether the average basemap color is
light
ordark
.