The FlowRenderer allows you to visualize your raster data with animated streamlines. This renderer can be used to visualize flow direction and magnitude information for meteorology and oceanography raster data.
To use this renderer, the source type of your raster dataset must be Vector-UV
or Vector-MagDir
.
The direction of the raster defines the direction of movement, and the magnitude defines the visible length of the streamline.
Known Limitations
- The FlowRenderer is only supported with ImageryTileLayer and ImageryLayer.
- The FlowRenderer is only supported in 2D MapView.
const renderer = new FlowRenderer({
density: 1, // visualization will have the maximum amount of streamlines
color: [50, 120, 240], // blue
flowSpeed: 10,
trailWidth: "2px"
});
Constructors
-
new FlowRenderer(properties)
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Examplelet renderer = { type: "flow", color: [50, 120, 240, 1] }
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
AuthoringInfo | Contains metadata about renderers generated from the flowRendererCreator.createRenderer() method, including information for setting UI elements such as sliders and themes. more details | FlowRenderer | |
Color | The color of the animated streamlines. more details | FlowRenderer | |
String | The name of the class. more details | Accessor | |
Number | The density of the streamlines. more details | FlowRenderer | |
String | Defines the flow direction of the data. more details | FlowRenderer | |
Number | The speed of the animated streamlines, relative to the simulation time. more details | FlowRenderer | |
Object | An object providing options for displaying the renderer in the Legend. more details | FlowRenderer | |
Number | The maximum path length streamlines will travel in points. more details | FlowRenderer | |
String | The front cap of the streamline. more details | FlowRenderer | |
Number | The approximate visible length of the streamline in points. more details | FlowRenderer | |
Number | The width of the streamline trail in points. more details | FlowRenderer | |
String | The type of Renderer. more details | FlowRenderer | |
VisualVariable[] | An array of VisualVariable objects. more details | FlowRenderer |
Property Details
-
authoringInfo AuthoringInfoautocast
-
Contains metadata about renderers generated from the flowRendererCreator.createRenderer() method, including information for setting UI elements such as sliders and themes. This allows the authoring clients to save specific overridable settings so user selections can be remembered the next time they are accessed via the UI.
-
color Color
-
The color of the animated streamlines.
- Default Value:[255, 255, 255, 1]
-
The name of the class. The declared class name is formatted as
esri.folder.className
.
-
density Number
-
The density of the streamlines. This will determine how many lines appear in the visualization. Accepted values are between
0
and1
. A value of0
means no lines will be rendered. A value of1
will render the maximum number of lines.density = 0.1
density = 0.5
density = 1
- Default Value:0.8
-
flowRepresentation String
-
Defines the flow direction of the data. This can be modified to display meteorological (the direction it is flowing from) or climatological data (the direction it is flowing to).
Value Description Example flow-from Flow from angle. flow-to Flow to angle. Possible Values:"flow-from"|"flow-to"
- Default Value:"flow-from"
-
flowSpeed Number
-
The speed of the animated streamlines, relative to the simulation time. This serves as a multiple of the magnitude from the raster layer. For instance, if the magnitude is 2ms, and the
flowSpeed
is 10, then the actual speed of the streamline will be 20 pts/s. A speed of 0 will result in no animation.- Default Value:10
-
legendOptions Object
-
An object providing options for displaying the renderer in the Legend.
- Property
-
title String
Describes the variable driving the visualization. This is displayed as the title of the corresponding renderer in the Legend.
Examplerenderer.legendOptions = { title: "Wind speed" };
-
The maximum path length streamlines will travel in points. Only a portion of the streamline will be visible at a time depending on the magnitude or UV coming from the raster layer and the defined trailLength. During the course of the animation, the visible streamline will travel to reach the path length defined here, then will restart. This value may be autocast with a string expressing size in points or pixels (e.g.
100px
).- Default Value:200
Examples// width in points flowRenderer.maxPathLength = 100;
// width in pixels flowRenderer.maxPathLength = "200px";
// width in points flowRenderer.maxPathLength = "100pt";
-
trailCap StringSince: ArcGIS Maps SDK for JavaScript 4.24
-
The front cap of the streamline. A round cap will only be applied if trailWidth is greater than
4px
or3pt
.Possible Values:"butt"|"round"
- Default Value:"butt"
-
trailLength Number
-
The approximate visible length of the streamline in points. The streamlines will appear shorter when the trailLength is a smaller number, since they will start to fade before they reach the full maxPathLength.
trailLength = 20
trailLength = 100
trailLength = 250
- Default Value:100
-
The width of the streamline trail in points. This value may be autocast with a string expressing size in points or pixels (e.g.
3px
).- Default Value:1.5
Examples// width in points flowRenderer.trailWidth = 4;
// width in pixels flowRenderer.trailWidth = "2px";
// width in points flowRenderer.trailWidth = "4pt";
-
type Stringreadonly
-
The type of Renderer.
For FlowRenderer the type is always "flow".
-
visualVariables VisualVariable[]autocast
-
An array of VisualVariable objects. Each object must indicate the type of visual variable to apply (e.g. ColorVisualVariable), the numeric field from which to drive the visualization, and the visual values to map to the data. The following list identifies each visual variable type that is supported with the
FlowRenderer
and provides a link to the specification table of each: ColorVisualVariable, OpacityVisualVariable, and SizeVisualVariable.SizeVisualVariable
will update the trailWidth property.When setting fields for the visual variables set on the FlowRenderer, use the
Magnitude
field.Magnitude
will return pixel values from the first band. If the data represents u (zonal) and v (meridional) speed components, values are automatically converted toMagnitude
andDirection
.- See also
Exampleconst renderer = new FlowRenderer({ visualVariables: [{ type: "color", field: "Magnitude", stops: [ { value: 3, color: "#0080FF" }, { value: 15, color: "#00FF00" } ] }, { type: "opacity", field: "Magnitude", stops: [ { value: 1, opacity: 0.5 }, { value: 8, opacity: 1 } ] }] });
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. more details | Accessor | ||
FlowRenderer | Creates a deep clone of the renderer. more details | FlowRenderer | |
* | Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. more details | FlowRenderer | |
Boolean | Returns true if a named group of handles exist. more details | Accessor | |
Removes a group of handles owned by the object. more details | Accessor | ||
Object | Converts an instance of this class to its ArcGIS portal JSON representation. more details | FlowRenderer |
Method Details
-
addHandles(handleOrHandles, groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 4.25
-
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
clone(){FlowRenderer}
-
Creates a deep clone of the renderer.
ReturnsType Description FlowRenderer Example// Creates a deep clone of the first layer's renderer let renderer = view.map.layers.getItemAt(0).renderer.clone();
-
fromJSON(json){*}static
-
Creates a new instance of this class and initializes it with values from a JSON object generated from an ArcGIS product. The object passed into the input
json
parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameterjson ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
ReturnsType Description * Returns a new instance of this class.
-
Since: ArcGIS Maps SDK for JavaScript 4.25
-
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
removeHandles(groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 4.25
-
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");
-
toJSON(){Object}
-
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
ReturnsType Description Object The ArcGIS portal JSON representation of an instance of this class.