@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
59 lines (57 loc) • 2.75 kB
TypeScript
import type HeatmapColorStop from "../../../renderers/support/HeatmapColorStop.js";
import type SliderViewModel from "../../Slider/SliderViewModel.js";
import type SmartMappingSliderViewModel from "../SmartMappingSliderViewModel.js";
import type { GradientStopInfo } from "../types.js";
import type { SmartMappingSliderViewModelProperties } from "../SmartMappingSliderViewModel.js";
export interface HeatmapSliderViewModelProperties extends SmartMappingSliderViewModelProperties, Partial<Pick<HeatmapSliderViewModel, "stops">> {}
/**
* Provides the logic for the [HeatmapSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/smartMapping/HeatmapSlider/) widget.
*
* @since 4.12
* @see [HeatmapSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/smartMapping/HeatmapSlider/)
*/
export default class HeatmapSliderViewModel extends SmartMappingSliderViewModel<HeatmapColorStop> {
constructor(properties?: HeatmapSliderViewModelProperties);
/** The state of the view model. */
get state(): SliderViewModel["state"];
/**
* The color stops of the [HeatmapRenderer](https://developers.arcgis.com/javascript/latest/references/core/renderers/HeatmapRenderer/) to associate with the slider.
*
* @example
* slider.viewModel.stops = [
* { color: "rgba(63, 40, 102, 0)", ratio: 0 },
* { color: "#472b77", ratio: 0.083 },
* { color: "#4e2d87", ratio: 0.166 },
* { color: "#563098", ratio: 0.249 },
* { color: "#5d32a8", ratio: 0.332 },
* { color: "#6735be", ratio: 0.415 },
* { color: "#7139d4", ratio: 0.498 },
* { color: "#7b3ce9", ratio: 0.581 },
* { color: "#853fff", ratio: 0.664 },
* { color: "#a46fbf", ratio: 0.747 },
* { color: "#c29f80", ratio: 0.83 },
* { color: "#e0cf40", ratio: 0.913 },
* { color: "#ffff00", ratio: 1 }
* ];
* @example slider.viewModel.stops = layer.renderer.colorStops;
*/
accessor stops: HeatmapColorStop[];
/**
* The pixel ratio values associated with the thumb locations of the slider.
*
* @see [setValue()](https://developers.arcgis.com/javascript/latest/references/core/widgets/smartMapping/SmartMappingSliderViewModel/#setValue)
* @see [setValue()](https://developers.arcgis.com/javascript/latest/references/core/widgets/Slider/SliderViewModel/#setValue)
* @example
* const slider = new SliderVM({
* min: 20,
* max: 100, // data range of 80
* values: [50.4331],
* // thumb label will display 50.43
* // thumb value will maintain precision, so
* // value will remain at 50.4331
* });
*/
get values(): number[];
/** Generates the color ramp gradient rendered on the slider. */
getStopInfo(): GradientStopInfo[];
}