UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

44 lines (42 loc) 1.99 kB
import type Color from "../../../Color.js"; import type OpacityStop from "../../../renderers/visualVariables/support/OpacityStop.js"; import type SmartMappingSliderViewModel from "../SmartMappingSliderViewModel.js"; import type { GradientStopInfo } from "../types.js"; import type { SmartMappingSliderViewModelProperties } from "../SmartMappingSliderViewModel.js"; export interface OpacitySliderViewModelProperties extends SmartMappingSliderViewModelProperties, Partial<Pick<OpacitySliderViewModel, "stops">> {} /** * Provides the logic for the [OpacitySlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/smartMapping/OpacitySlider/) widget. * * @since 4.12 * @see [OpacitySlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/smartMapping/OpacitySlider/) */ export default class OpacitySliderViewModel extends SmartMappingSliderViewModel<OpacityStop> { constructor(properties?: OpacitySliderViewModelProperties); /** * The opacity stops from the [OpacityVariable](https://developers.arcgis.com/javascript/latest/references/core/renderers/visualVariables/OpacityVariable/) * to link to the slider. The opacity values in these stops will be used * to render the gradient on the slider. They should match the opacity * rendered in the associated layer's opacity visual variable. * * @example * opacityVariableCreator.createContinuousRenderer({ * layer: featureLayer, * field: "fieldName", * basemap: "gray-vector" * }).then(function(opacityResponse){ * const slider = new OpacitySlider({ * viewModel: new OpacitySliderVM({ * stops: opacityResponse.visualVariable.stops * }), * container: "sliderDiv" * }); * }); */ accessor stops: OpacityStop[]; /** * Generates the opacity ramp gradient rendered on the slider. * * @param stopColor - The stop color. */ getStopInfo(stopColor: Color | null | undefined): GradientStopInfo[]; }