Skip to content
import { createRenderer } from "@arcgis/core/smartMapping/raster/renderers/flow.js";
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

FlowRenderer is only supported with ImageryTileLayer and ImageryLayer where the source type is Vector-UV or Vector-MagDir.

Functions

createRenderer

Function

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

Signature
createRenderer (parameters: FlowRendererParameters): Promise<FlowRendererResult>
Parameters
ParameterTypeDescriptionRequired
parameters

Input parameters for generating a flow visualization.

Returns
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

FlowRendererParameters

Type definition

flowRepresentation

Property
Type
FlowRenderer["flowRepresentation"] | null | undefined

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.

theme

Property
Type
"flow-line" | "wave-front" | null | undefined

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

ValueDescriptionExample
flow-lineRenders the uv and magnitude data as animated flow lines. This is ideal for representing wind and other atmospheric data.flow-line
wave-frontRenders UV and magnitude data in a wave-like animation. This theme works well for ocean data.above

Known Limitations

The wave-front flow theme is not supported in 3D SceneView.

Default value
"flow-line"

includeColorVariable

Property
Type
boolean | null | undefined

When true, the color of streamlines 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.

Default value
false

includeSizeVariable

Property
Type
boolean | null | undefined

When true, the width of streamlines 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.

Default value
false

includeOpacityVariable

Property
Type
boolean | null | undefined

When true, the opacity of streamlines 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.

Default value
false

legendOptions

Property
Type
RendererLegendOptionsProperties | null | undefined

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

flowScheme

Property
Type
FlowScheme | null | undefined

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

view

Property
Type
MapViewOrSceneView | null | undefined

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.

FlowRendererResult

Type definition

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

renderer

Property
Type
FlowRenderer

The FlowRenderer renderer to apply to the input layer.

flowScheme

Property
Type
FlowScheme

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

visualVariables

Property
Type
Exclude<VisualVariable, RotationVariable>[]

Visual variables included in the output renderer.

layerEffect

Property
Type
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.

Known Limitations

The layer effects are not supported in 3D SceneView.

statistics

Property
Type
SummaryStatisticsResult

Summary statistics of the raster layer.

basemapId

Property
Type
string | null | undefined

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

basemapTheme

Property
Type
string | null | undefined

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