<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Histogram Range Slider | Sample | ArcGIS Maps SDK for JavaScript</title>
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
<script type="module" src="https://js.arcgis.com/5.2/"></script>
font-size: var(--calcite-font-size);
color: var(--calcite-color-text-2);
font-size: var(--calcite-font-size-xl);
font-weight: var(--calcite-font-weight-light);
<body class="calcite-mode-dark">
basemap="dark-gray-vector"
camera-position="59.64726, -28.51922, 14625266"
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-navigation-toggle slot="top-left"></arcgis-navigation-toggle>
<arcgis-compass slot="top-left"></arcgis-compass>
<calcite-panel slot="top-right" expanded>
<calcite-block expanded label="Ecological Marine Units">
<div id="titleText">Ecological Marine Units</div>
<arcgis-expand slot="bottom-left" expand-icon="filter" expanded>
<div id="description">Surface Temperature (°C)</div>
<div id="outer-container">
<arcgis-slider-histogram-range
range-labels-placement="center"
></arcgis-slider-histogram-range>
const [FeatureLayer, histogram] = await $arcgis.import([
"@arcgis/core/layers/FeatureLayer.js",
"@arcgis/core/smartMapping/statistics/histogram.js",
const histogramRangeSlider = document.querySelector("arcgis-slider-histogram-range");
// Flash flood warnings layer
const layer = new FeatureLayer({
id: "fded240144c74ce988771a503a3a03d8",
// only display surface temperature data
definitionExpression: "UnitTop = 0",
// Get a reference to the Scene component
const viewElement = document.querySelector("arcgis-scene");
// Wait for the view to initialize fully
await viewElement.viewOnReady();
// Add the layer to the scene and retrieve its view
viewElement.map.layers.add(layer);
const layerView = await viewElement.whenLayerView(layer);
// create the histogram for the temperature field
const histogramResponse = await histogram({
// set the histogram properties
await histogramRangeSlider.updateFromHistogramResult(histogramResponse);
// when the slider values change, update the histogram and apply a feature effect
histogramRangeSlider.addEventListener("arcgisInput", async (event) => {
layerView.filter = { where: await histogramRangeSlider.generateWhereClause(field) };