rasterRenderers

require(["esri/rasterRenderers"], function(rasterRenderers) { /* code goes here */ });
Object: esri/rasterRenderers
Since: ArcGIS API for JavaScript 4.13

A convenience module for importing renderer classes that can be used to render ImageryLayer when developing with TypeScript. For example, rather than importing renderers one at a time like this:

import ClassBreaksRenderer from "esri/renderers/ClassBreaksRenderer";
import UniqueValueRenderer from "esri/renderers/UniqueValueRenderer";
import RasterStretchRenderer from "esri/renderers/RasterStretchRenderer";
import RasterColormapRenderer from "esri/renderers/RasterColormapRenderer";
import RasterShadedReliefRenderer from "esri/renderers/RasterShadedReliefRenderer";

You can use this module to import them on a single line:

import { ClassBreaksRenderer, UniqueValueRenderer, RasterColormapRenderer, RasterStretchRenderer, RasterShadedReliefRenderer } from "esri/rasterRenderers";

This module also allows you to implement type guards on renderers, making your code smarter.

import { Renderer } from "esri/rasterRenderers";

function logRenderer(renderer: RasterStretchRenderer): void {
 if (renderer.type == "raster-stretch") {
   // the compiler knows the renderer must be a RasterStretchRenderer
   console.log("renderer color ramp: ", renderer.colorRamp);
 }
}

Type Definitions

ClassBreaksRenderer ClassBreaksRenderer

ClassBreaksRenderer.

RasterColormapRenderer RasterColormapRenderer

RasterColormapRenderer.

RasterShadedReliefRenderer RasterShadedReliefRenderer

RasterShadedReliefRenderer.

RasterStretchRenderer RasterStretchRenderer

RasterStretchRenderer.

UniqueValueRenderer UniqueValueRenderer

UniqueValueRenderer.

VectorFieldRenderer VectorFieldRenderer

VectorFieldRenderer.