import sizeRange from "@arcgis/core/smartMapping/heuristics/sizeRange.js";
const sizeRange = await $arcgis.import("@arcgis/core/smartMapping/heuristics/sizeRange.js");
@arcgis/core/smartMapping/heuristics/sizeRange
Function for determining the suggested minSize and maxSize of a
scale-dependent size visual variable.
Known Limitations
- This function is not intended for use in 3D SceneViews.
Method Overview
| Name | Return Type | Summary | Function |
|---|---|---|---|
Generates a suggested size range (i.e. | sizeRange |
Method Details
-
sizeRange
MethodsizeRange(params){Promise<(SizeRangeResult|null|undefined)>} -
Generates a suggested size range (i.e. the
minSizeandmaxSizesize variables) for a scale-dependent size visual variable.Known Limitations
- This function is not intended for use in 3D SceneViews.
ParametersSpecificationparams ObjectSee the table below for details about parameters that may be passed to this function.
Specificationlayer FeatureLayer|SceneLayer|CSVLayer|OGCFeatureLayer|ParquetLayer|PointCloudLayer|GeoJSONLayer|WFSLayer|StreamLayer|OrientedImageryLayer|KnowledgeGraphSublayer|SubtypeGroupLayer|SubtypeSublayerThe layer for which to generate a suggested min/max size range based on scale for a size visual variable.
filter FeatureFilteroptionalSince 4.31 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
intersectsspatial relationship are supported. All other filter types (includingwhere) are ignored.forBinning BooleanoptionalIndicates whether the generated renderer is for a binning visualization.
signal AbortSignal|null|undefinedoptionalAllows for cancelable requests. If canceled, the promise will be rejected with an error named
AbortError. See also AbortController.ReturnsType Description Promise<(SizeRangeResult|null|undefined)> Resolves to an object containing the suggested minSizeandmaxSizeby scale for the layer's renderer.ExamplesizeRange({ layer: featureLayer, view: view }).then(function(response){ // update the minSize and maxSize of a size visual variable // on a layer's renderer to be scale-dependent const renderer = featureLayer.renderer.clone(); const sizeVariable = renderer.visualVariables.filter( vv => vv.type === "size")[0].clone(); sizeVariable.minSize = response.minSize; sizeVariable.maxSize = response.maxSize; renderer.visualVariables = [ sizeVariable ]; featureLayer.renderer = renderer; });
Type Definitions
-
The suggested
minSizeandmaxSizesize variables generated from the sizeRange() function to apply to the SizeVariable used for scale-dependent bounded proportional symbols.- Properties
-
minSize SizeVariable
The suggested sizes of the smallest symbols at various scales in a layer with a size visualization. Note that this must be a scale-dependent stops size variable according to the Size Variable documentation.
maxSize SizeVariableThe suggested sizes of the largest symbols at various scales in a layer with a size visualization. Note that this must be a scale-dependent stops size variable according to the Size Variable documentation.