require(["esri/renderers/smartMapping/symbology/dotDensity"], function(dotDensitySchemes) { /* code goes here */ });
Object: esri/renderers/smartMapping/symbology/dotDensity
Since: ArcGIS API for JavaScript 4.12

Object containing helper methods for getting optimal symbol schemes used to create dot density visualizations. The getSchemes() returns color schemes best suited to the given basemap for this visualization style.

Method Overview

NameReturn TypeSummaryObject
DotDensityScheme

Clones a dot density scheme object.

more details
more detailsdotDensity
DotDensityScheme

Returns a dot density scheme with the provided name.

more details
more detailsdotDensity
DotDensitySchemes

Returns a primary scheme and secondary schemes defining symbol properties for dot density-based data-driven visualizations in a Layer.

more details
more detailsdotDensity
DotDensityScheme[]

Returns an array of dot density schemes with the provided tags.

more details
more detailsdotDensity

Method Details

cloneScheme(scheme){DotDensityScheme}

Clones a dot density scheme object.

Parameter:

The dot density scheme object to clone.

Returns:
TypeDescription
DotDensitySchemeReturns a clone of the given dot density scheme object.
Example:
// clones the primary scheme returned from the getSchemes() method
const dotDensityScheme = primaryScheme.clone();
getSchemeByName(params){DotDensityScheme}

Returns a dot density 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 color 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

numColors Number

The number of colors to visualize.

Returns:
TypeDescription
DotDensitySchemeReturns the dot density scheme with the given name.
Example:
// Returns the Galaxy Berries scheme
var galaxyBerriesScheme = dotDensitySchemes.getSchemeByName({
  basemap: map.basemap,
  numColors: 3,
  name: "Galaxy Berries"
});
getSchemes(params){DotDensitySchemes}

Returns a primary scheme and secondary schemes defining symbol properties for dot density-based data-driven visualizations in a Layer. The basemap parameter determines the color of the dots used to visualize each attribute. 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

numColors Number

The number of colors to visualize.

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

// the best default scheme for the layer and basemap
const primaryScheme = schemes.primaryScheme;
getSchemesByTag(params){DotDensityScheme[]}

Returns an array of dot density schemes with the provided tags. These schemes define symbol properties for dot density visualizations in any layer that can be rendered with a DotDensityRenderer.

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 color 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

numColors Number

The number of colors to visualize.

Returns:
TypeDescription
DotDensityScheme[]Returns an array of dot density schemes either including or excluding the provided tags.
Example:
// Returns all the red dot density schemes
var schemes = dotDensitySchemes.getSchemesByTag({
  basemap: map.basemap,
  numColors: 2,
  includedTags: [ "reds", "dot-density" ]
});

Type Definitions

DotDensityScheme

Properties defining the symbology scheme used to visualize predominance for polygon features.

Properties:
name String

The unique name of the scheme.

Tags associated with the scheme.

colors Color[]

The dot color for each attribute.

outline Object

Properties for defining the outline of the symbol.

Specification:
color Color

The outline color of the symbol.

width Number

The width of the symbol's outline in points.

opacity Number

The opacity of the symbol (0 - 1).

DotDensitySchemes

The return object of the getSchemes() method.

Properties:
primaryScheme DotDensityScheme

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

secondarySchemes DotDensityScheme[]

Additional dot density 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...