flow

AMD: require(["esri/smartMapping/raster/renderers/flow"], (flowRendererCreator) => { /* code goes here */ });
ESM: import * as flowRendererCreator from "@arcgis/core/smartMapping/raster/renderers/flow.js";
Object: esri/smartMapping/raster/renderers/flow
Since: ArcGIS Maps SDK for JavaScript 4.23

This object contains helper methods for generating a FlowRenderer for a Vector-UV or Vector-MagDir ImageryLayer or ImageryTileLayer.

The createRenderer method in this module generates a renderer that may be applied directly to the input layer.

Known Limitations

Method Overview

Name Return Type Summary Object

Generates a FlowRenderer to display raster data with stream lines.

flow

Method Details

createRenderer

Method
createRenderer(params){Promise<FlowRendererResult>}

Generates a FlowRenderer to display raster data with stream lines. This renderer is often used for visualizing flow direction and magnitude information in meteorology and oceanography raster data.

Parameters
Specification
params Object

Input parameters for generating a flow visualization. See the table below for details of each parameter.

Specification

The input layer for which the renderer is generated. The source type of the raster must be Vector-UV or Vector-MagDir.

view MapView
optional

The view where the input layer is rendered. This method inspects the view's background (i.e. basemap, web map background, or view container) to determine optimal colors for the output renderer. This parameter should always be set in practice, but if not provided this method will assume the generated renderer will display on a light background.

theme String
optional
Default Value: "flow-line"

Determines how flow lines will render. Possible values are listed below.

Value Description Example
flow-line Renders the uv and magnitude data as animated flow lines. This is ideal for representing wind and other atmospheric data. flow-line
wave-front Renders UV and magnitude data in a wave-like animation. This theme works well for ocean data. above

Possible Values:"flow-line"|"wave-front"

includeColorVariable Boolean
optional
Default Value: false

When true, the color of stream lines will vary depending on the magnitude of the data. Flow lines with stronger magnitude values will have bright colors on dark backgrounds and dark colors on light backgrounds, giving them more prominence.

includeSizeVariable Boolean
optional
Default Value: false

When true, the width of stream lines will vary depending on the magnitude of the data. Flow lines with stronger magnitude values will be wider than lines with weaker magnitude values, giving them more prominence.

includeOpacityVariable Boolean
optional
Default Value: false

When true, the opacity of stream lines will vary depending on the magnitude of the data. Flow lines with stronger magnitude values will be more opaque than lines with weaker magnitude values, giving them more prominence.

legendOptions Object
optional

Provides options for setting a title to the renderer in the Legend.

Specification
title String
optional

The title used to represent the data in the Legend.

flowScheme FlowScheme
optional

The flow scheme used to set colors and sizes to the flow lines.

renderingRule RasterFunction
optional

Deprecated since 4.27. Use rasterFunction instead.

rasterFunction RasterFunction
optional

Specifies the function for how the requested image should be processed. When rasterFunction is applied, the server returns updated service information that reflects custom processing as defined by the raster function. If not provided, the output renderer is created using the layer's rasterFunction.

flowRepresentation String
optional

Defines the flow direction of the data. This can be modified to display meteorological (the direction it is flowing from) or oceanographic data (the direction it is flowing to). See FlowRenderer.flowRepresentation for more information.

Possible Values:"flow-from"|"flow-to"

signal AbortSignal
optional

Allows for cancelable requests. If canceled, the promise will be rejected with an error named AbortError. See also AbortController.

Returns
Type Description
Promise<FlowRendererResult> Resolves to an object containing a FlowRenderer that can be set on the input layer.
Example
const { renderer } = await flowRendererCreator.createRenderer({
  layer,
  view,
  theme: "wave-front",
  flowRepresentation: "flow-to"
});

// renders animated wave-like lines on the raster
layer.renderer = renderer;

Type Definitions

FlowRendererResult

Type Definition
FlowRendererResult

The result object of the createRenderer() method. See the table below for details of each property.

Properties
renderer FlowRenderer

The FlowRenderer renderer to apply to the input layer.

flowScheme FlowScheme

The flow scheme used to set colors and sizes to the flow lines.

visualVariables VisualVariable[]

Visual variables included in the output renderer.

Summary statistics of the raster layer.

basemapId String

The ID of the basemap used to determine the optimal color of the flow lines.

basemapTheme String

Indicates whether the average color of the input view's basemap is light or dark.

layerEffect String

A suggested layer effect to apply to the input layer. When the basemapTheme is dark, a bloom is suggested to add to the layer.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.