rendererUtils

ESM: import * as rendererUtils from "@arcgis/core/smartMapping/renderers/support/rendererUtils.js";
CDN: const rendererUtils = await $arcgis.import("@arcgis/core/smartMapping/renderers/support/rendererUtils.js");
Object: @arcgis/core/smartMapping/renderers/support/rendererUtils
Since: ArcGIS Maps SDK for JavaScript 4.31

This module provides a function for regenerating renderers based on the current state of the layer and view. This is useful when you want to update a renderer based on changes to the layer's data, the data visible in the view, binning configuration, or the view's scale.

See also

Method Overview

Name Return Type Summary Object
Promise<RendererUnion>

Regenerates the renderer for a layer based on the current state of the layer and view.

rendererUtils

Method Details

regenerateRenderer

Method
regenerateRenderer(params){Promise<RendererUnion>}

Regenerates the renderer for a layer based on the current state of the layer and view.

Parameters
Specification
params Object

An object containing the following properties.

Specification
layer FeatureLayer

The layer for which to regenerate the renderer.

view MapView

The view in which the layer is rendered.

renderer RendererUnion
optional

The renderer to update. If not provided, the renderer will be derived from the layer or feature reduction object.

forBinning Boolean
optional

Indicates whether to regenerate the binning renderer or the renderer set on the layer.

filter FeatureFilter
optional

When defined, only features included in the filter are considered in the attribute and spatial statistics calculations when determining the final renderer. This is useful when a lot of variation exists in the data that could result in undesired data ranges. A common use case would be to set a filter that only includes features in the current extent of the view where the data is most likely to be viewed. Currently, only geometry filters with an intersects spatial relationship are supported. All other filter types (including where) are ignored. This parameter is only supported when forBinning is false.

signal AbortSignal
optional

Since 4.33 An AbortSignal to cancel the request. If the request is aborted, the promise will be rejected with an AbortError.

includedParts String[]
optional

Since 4.33 An array of strings indicating which parts of the renderer to include in the regeneration. If not provided, all parts are included by default. The available options are:

  • color-variable: Only regenerate the color visual variable.
  • size-variable: Only regenerate the size visual variable.
  • class-breaks: Regenerate the class breaks for the renderer.
Returns
Type Description
Promise<RendererUnion> Returns a promise that resolves with the updated renderer.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.