Skip To ContentArcGIS for DevelopersSign In Dashboard
require(["esri/renderers/smartMapping/symbology/relationship"], function(relationshipSchemes) { /* code goes here */ });
Object: esri/renderers/smartMapping/symbology/relationship
Since: ArcGIS API 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.

Method Overview

NameReturn TypeSummaryObject
RelationshipScheme

Clones a relationship (bivariate color) scheme object.

more details
more detailsrelationship
RelationshipScheme

Returns a relationship scheme with the provided name.

more details
more detailsrelationship
RelationshipSchemes

Returns a primary scheme and secondary schemes defining symbol properties for relationship-based (bivariate choropleth) data-driven visualizations in a Layer.

more details
more detailsrelationship
RelationshipScheme[]

Returns an array of relationship schemes with the provided tags.

more details
more detailsrelationship
Theme[]

Returns metadata for the available themes.

more details
more detailsrelationship

Method Details

cloneScheme(scheme){RelationshipScheme}

Clones a relationship (bivariate color) scheme object.

Parameter:

The relationship scheme object to clone.

Returns:
TypeDescription
RelationshipSchemeReturns a clone of the given relationship scheme object.
Example:
// clones the primary scheme returned from the getSchemes() method
const relationshipScheme = primaryScheme.clone();
getSchemeByName(params){RelationshipScheme}
Since: ArcGIS API for JavaScript 4.12

Returns a relationship scheme with the provided name.

Parameters:
Specification:
params Object

See the table below for details of each parameter that may be passed to this function.

Specification:
name String

The name of the scheme to retrieve.

basemap String|Basemap
optional

The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features with the given basemap.

basemapTheme String
optional

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.

Possible Values: light | dark

geometryType String

The geometry type of the features to visualize.

Possible Values: point | multipoint | polyline | polygon | mesh

theme String
optional
Default Value: default

Determines which set of primary and secondary color schemes to return

Possible Values: default

worldScale Boolean
optional

Indicates if the size units of the scheme will be in meters. This should be true when the scheme is intended for 3D volumetric symbology. A view must be provided if this property is set to true.

optional

The 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.

Returns:
TypeDescription
RelationshipSchemeReturns the relationship scheme with the given name.
Example:
// Returns the Blueberry Parfait scheme
var blueberryScheme = relationshipSchemes.getSchemeByName({
  basemap: map.basemap,
  geometryType: featureLayer.geometryType,
  name: "Blueberry Parfait"
});
getSchemes(params){RelationshipSchemes}

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.

Parameters:
Specification:
params Object

See the table below for details of each parameter that may be passed to this function.

Specification:
basemap String|Basemap
optional

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 String
optional

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.

Possible Values: light | dark

geometryType String

The geometry type of the features to visualize.

Possible Values: point | multipoint | polyline | polygon | mesh

theme String
optional
Default Value: default

Determines which set of primary and secondary color schemes to return

Possible Values: default

worldScale Boolean
optional

Indicates if the size units of the scheme will be in meters. This should be true when the scheme is intended for 3D volumetric symbology. A view must be provided if this property is set to true.

optional

The 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.

Returns:
TypeDescription
RelationshipSchemesReturns 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 basemap
const schemes = relationshipSchemes.getSchemes({
  basemap: map.basemap,
  geometryType: featureLayer.geometryType
});

// the best default scheme for the layer and basemap
const primaryScheme = schemes.primaryScheme;
getSchemesByTag(params){RelationshipScheme[]}
Since: ArcGIS API for JavaScript 4.12

Returns an array of relationship schemes with the provided tags. These schemes define symbol properties for relationship visualizations.

Parameters:
Specification:
params Object

See the table below for details of each parameter that may be passed to this function.

Specification:
includedTags String[]
optional

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

excludedTags String[]
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

basemap String|Basemap
optional

The basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features with the given basemap.

basemapTheme String
optional

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.

Possible Values: light | dark

geometryType String

The geometry type of the features to visualize.

Possible Values: point | multipoint | polyline | polygon | mesh

theme String
optional
Default Value: default

Determines which set of primary and secondary color schemes to return

Possible Values: default

worldScale Boolean
optional

Indicates if the size units of the scheme will be in meters. This should be true when the scheme is intended for 3D volumetric symbology. A view must be provided if this property is set to true.

optional

The 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.

Returns:
TypeDescription
RelationshipScheme[]Returns an array of relationship schemes either including or excluding the provided tags.
Example:
var schemes = relationshipSchemes.getSchemesByTag({
  basemap: map.basemap,
  geometryType: featureLayer.geometryType,
  includedTags: [ "tritanopia" ],
  excludedTags: [ "grayscale" ]
});
getThemes(basemap){Theme[]}

Returns metadata for the available themes. If a basemap is provided, returns themes that work best with the given basemap.

Parameter:
basemap String|Basemap
optional

The Esri basemap string or object that will be used with the returned theme(s).

Returns:
TypeDescription
Theme[]Returns an object containing information about the available themes for the given basemap.

Type Definitions

Defines the symbology scheme used to visualize relationship renderers (bivariate color) based on the layer's geometry type.

RelationshipSchemeForMesh

Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for mesh features.

Properties:
name String

The unique name of the scheme.

Tags associated with the scheme.

The ID uniquely identifying the color scheme.

colorsForClassBreaks Object[]

Defines the colors to use in each bin of the relationship visualization.

Specification:
colors Color[][]

The colors of the fill symbols used for each bin in the relationship visualization.

numClasses Number

The number of breaks (rows/columns) for each variable in the relationship visualization.

noDataColor Color

The color of the fill symbol used to indicate features with no data.

opacity Number

The opacity of the fill symbol (0 - 1).

RelationshipSchemeForPoint

Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for point features.

Properties:
name String

The unique name of the scheme.

Tags associated with the scheme.

The ID uniquely identifying the color scheme.

colorsForClassBreaks Object[]

Defines the colors to use in each bin of the relationship visualization.

Specification:
colors Color[][]

The fill colors of the point symbols used for each bin in the relationship visualization.

numClasses Number

The number of breaks (rows/columns) for each variable in the relationship visualization.

noDataColor Color

The color of the point symbol used to indicate features with no data.

outline Object

Properties for defining the outline of the marker symbol.

Specification:
color Color

The outline color of the marker symbol.

width Number

The width of the outline in points.

opacity Number

The opacity of the point symbol (0 - 1).

size Number

The size of the point symbol in points.

RelationshipSchemeForPolygon

Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for polygon features.

Properties:
name String

The unique name of the scheme.

Tags associated with the scheme.

The ID uniquely identifying the color scheme.

colorsForClassBreaks Object[]

Defines the colors to use in each bin of the relationship visualization.

Specification:
colors Color[][]

The colors of the fill symbols used for each bin in the relationship visualization.

numClasses Number

The number of breaks (rows/columns) for each variable in the relationship visualization.

noDataColor Color

The color of the fill symbol used to indicate features with no data.

outline Object

Properties for defining the outline of the fill symbol.

Specification:
color Color

The outline color of the fill symbol.

width Number

The width of the outline in points.

opacity Number

The opacity of the fill symbol (0 - 1).

RelationshipSchemeForPolyline

Properties defining the symbology scheme used to visualize relationship renderers (bivariate color) for polyline features.

Properties:
name String

The unique name of the scheme.

Tags associated with the scheme.

The ID uniquely identifying the color scheme.

colorsForClassBreaks Object[]

Defines the colors to use in each bin of the relationship visualization.

Specification:
colors Color[][]

The colors of the line symbols used for each bin in the relationship visualization.

numClasses Number

The number of breaks (rows/columns) for each variable in the relationship visualization.

noDataColor Color

The color of the line symbol used to indicate features with no data.

opacity Number

The opacity of the line symbol (0 - 1).

width Number

The width of the line symbol in points.

RelationshipSchemes

The return object of the getSchemes() method.

Properties:
primaryScheme RelationshipScheme

The relationship scheme best suited for the given basemap and geometry type.

secondarySchemes RelationshipScheme[]

Additional relationship schemes that may be used to visualize data of the given geometry type overlaid on the given basemap.

basemapId String

The ID of the basemap associated with the given schemes.

basemapTheme String

Indicates whether the average basemap color is light or dark.

API Reference search results

NameTypeModule
Loading...