require(["esri/smartMapping/raster/renderers/flow"], (flowRendererCreator) => { /* code goes here */ });
import * as flowRendererCreator from "@arcgis/core/smartMapping/raster/renderers/flow.js";
esri/smartMapping/raster/renderers/flow
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
orVector-MagDir
. - FlowRenderer is only supported in 2D MapView.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Promise<FlowRendererResult> | Generates a FlowRenderer to display raster data with stream lines. | flow |
Method Details
-
createRenderer
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.
ParametersSpecificationparams ObjectInput parameters for generating a flow visualization. See the table below for details of each parameter.
Specificationlayer ImageryLayer|ImageryTileLayerThe input layer for which the renderer is generated. The source type of the raster must be
Vector-UV
orVector-MagDir
.view MapViewoptionalThe 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 StringoptionalDefault 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. wave-front Renders UV and magnitude data in a wave-like animation. This theme works well for ocean data. Possible Values:"flow-line"|"wave-front"
includeColorVariable BooleanoptionalDefault Value: falseWhen
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 BooleanoptionalDefault Value: falseWhen
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 BooleanoptionalDefault Value: falseWhen
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 ObjectoptionalProvides options for setting a title to the renderer in the Legend.
flowScheme FlowSchemeoptionalThe flow scheme used to set colors and sizes to the flow lines.
renderingRule RasterFunctionoptionalDeprecated since 4.27. Use
rasterFunction
instead.rasterFunction RasterFunctionoptionalSpecifies 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'srasterFunction
.flowRepresentation StringoptionalDefines 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 AbortSignaloptionalAllows for cancelable requests. If canceled, the promise will be rejected with an error named
AbortError
. See also AbortController.ReturnsType Description Promise<FlowRendererResult> Resolves to an object containing a FlowRenderer that can be set on the input layer. Exampleconst { 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
-
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 FlowSchemeThe flow scheme used to set colors and sizes to the flow lines.
visualVariables VisualVariable[]Visual variables included in the output renderer.
statistics SummaryStatisticsResultSummary statistics of the raster layer.
basemapId StringThe ID of the basemap used to determine the optimal color of the flow lines.
basemapTheme StringIndicates whether the average color of the input view's basemap is
light
ordark
.layerEffect StringA suggested layer effect to apply to the input layer. When the
basemapTheme
is dark, a bloom is suggested to add to the layer.