require(["esri/dijit/ClassedColorSlider"], function(ClassedColorSlider) { /* code goes here */ });
Description
(Added at v3.13)
A widget to assist with managing a renderer used for visualizing features by their class and color.
Samples
Search for
samples that use this class.
Class hierarchy
esri/dijit/RendererSlider
|_esri/dijit/ClassedColorSlider
Constructors
CSS
esri/dijit/ClassedColorSlider | Download source
NumberTextBoxContainer | None |
bottomLabelNode | None |
esriRendererSlider | None |
handler | None |
handlerLabel | None |
handlerTick | None |
handlerTickBottom | None |
handlerTickTop | None |
moveable | None |
sliderArea | None |
sliderAreaRight | None |
sliderNode | None |
topLabelNode | None |
Properties
Methods
startup() | None | Finalizes the creation of the widget. |
Events
[ On Style Events | Connect Style Event ]
All On Style event listeners receive a single event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
Constructor Details
Creates a new ClassedColorSlider
widget.
Parameters:
<Object > params |
Required |
Set of parameters used to specify the ClassedColorSlider widget options. |
<Node | String > srcNodeRef |
Required |
Reference or ID of the HTMLElement where the widget should be rendered. |
params
properties:
<Object > breakInfos |
Required |
Data map containing renderer information. Access this from the esri.renderers.smartMapping.createClassedColorRenderer response.
[
{minValue: 0, maxValue: 20},
{minValue: 20, maxValue: 80},
{minValue: 80, maxValue: 100}
] |
<String > classificationMethod |
Optional |
Indicates the classification method used to divide the range of values into bins. The following methods are supported:
Known values are: natural-breaks | equal-interval | quantile | standard-deviation | geometrical-interval |
<Number[] > handles |
Required |
Required: Handles identified by their index values within the stops array. |
<Object > histogram |
Optional |
Represents the histogram data object. Access this from the FeatureLayerStatistics.getHistogram response. |
<Number > histogramWidth |
Optional |
Width of the histogram in pixels. Default value is 100 . |
<String > normalizationType |
Optional |
Indicates how data values are normalized. The following types are supported:
- field
- log
- percent-of-total
|
<Number > primaryHandle |
Optional |
Handle identified by its index value within the stops array. This value must also be in handles array. |
<Number > rampWidth |
Optional |
Width of the widget ramp in pixels. Default value is 26 . |
<Boolean > showHandles |
Optional |
Displays slider handles when true . Default is true . |
<Boolean > showHistogram |
Optional |
Displays the histogram when true . Default is true . |
<Boolean > showLabels |
Optional |
Displays slider labels when true . Default is true . |
<Boolean > showTicks |
Optional |
Displays ticks on slider when true . Default is true . |
<Object > statistics |
Optional |
Represents the statistics data object. Access this from the esri.renderers.smartMapping.createClassedColorRenderer response. |
Sample:
require(["esri/layers/FeatureLayer", "esri/renderers/smartMapping", "esri/dijit/ClassedColorSlider",], function (FeatureLayer, smartMapping, ClassedColorSlider) {
var layer = new FeatureLayer("//services.arcgis.com/Ywxx29kRZEPq7K5N/arcgis/rest/services/co2percapita_geog30970/FeatureServer/0", {
outFields: ["*"]
});
layer.on("load", function(){
smartMapping.createClassedColorRenderer({
layer: layer,
field: "yr2009",
basemap: map.getBasemap(),
classificationMethod: "natural-breaks"
}).then(function(response){
slider7 = new ClassedColorSlider({
breakInfos: response.renderer.infos,
}, "classedColorSliderDiv");
classedColorSliderDiv.startup();
}); //end createClassedColorRenderer
}); //end load
}
Property Details
Default value: [{minValue: 0, maxValue: 20}, {minValue: 20, maxValue: 80}, {minValue: 80, maxValue: 100}]
Optional: Indicates the classification method used to divide the range of values into bins. The following methods are supported:
Known values are: natural-breaks | equal-interval | quantile | standard-deviation | geometrical-interval
Default value: null
Required: Handles identified by their index values within the
stops
array.
Default value: []
Optional: The width of the histogram in pixels.
Known values: true | false
Default value: 100
Read Only. The absolute maximum value of the slider. This value overrides the
statistics max
property.
Default value: 100
Read Only. The absolute minimum value of the slider. This value overrides the
statistics min
property.
Default value: 0
Optional: Indicates how data values are normalized. The following types are supported:
- field
- log
- percent-of-total
Default value: null
Optional: The handle identified by its index value within the
stops
array. This value must also be in
handles
array.
Default value: null
Optional: Width of the widget ramp in pixels.
Default value: 26
Optional: Indicates whether to display handles.
Known values: true | false
Default value: true
Optional: Indicates whether to display the histogram
.
Known values: true | false
Default value: true
Optional: Indicates whether to display labels.
Known values: true | false
Default value: true
Optional: Indicates whether to display tick marks.
Known values: true | false
Default value: true
Required: Handle positions represented as numbers that fall between minimum
and maximum
.
Default value: [50]
Method Details
Finalizes the creation of the widget.
Event Details
[ On Style Events | Connect Style Event ]
Fires during slide and slide stop, and when a handle or the
minValue
or
maxValue
of the slider are updated via text box. Listen to this event only if the layer is rendered with WebGL. Otherwise, performance may be hampered.
(Added at v3.24) Event Object Properties:
<Object[] > breakInfos |
Returns the breakInfos of the slider. |
<Number > maxValue |
The maximum value of the slider. |
<Number > minValue |
The minimum value of the slider. |
Event Object Properties:
<Object > breakInfos |
Returns the breakInfos of the ClassedColorSlider object. |
<Number > maxValue |
The current maximum value of the ClassedColorSlider . |
<Number > minValue |
The current minimum value of the ClassedColorSlider . |
Fires on slide stop and when a handle is updated via textbox.