new ShaderFilterVector(colorscale [, options])
Creates a new vector field visualization filter
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
colorscale |
ColorScale | Colorscale for magnitude mapping |
|
options |
ShaderFilterVector~Options |
<optional> |
Configuration options |
- Source:
Throws:
-
If inDomain is invalid (length !== 2 or min >= max)
- Type
- Error
Example
```javascript // Create with default options const filter = new ShaderFilterVector(colorscale, { inDomain: [0, 1], maxSteps: 256, arrowColor: [0, 0, 0, 1] }); ```
Extends
Methods
-
getSampler(name)
-
Finds a sampler by name
Parameters:
Name Type Description name
string Base sampler name
- Inherited From:
- Overrides:
- Source:
Returns:
Found sampler or undefined
- Type
- ShaderFilter~Sampler | undefined
-
setMode(mode, id)
-
Sets the active mode for the filter
Parameters:
Name Type Description mode
string Mode category to modify
id
string Specific mode ID to enable
- Inherited From:
- Overrides:
- Source:
Throws:
-
If shader not registered or mode doesn't exist
- Type
- Error
-
setUniform(name, value)
-
Sets a uniform variable value
Parameters:
Name Type Description name
string Base name of uniform variable
value
number | boolean | Array Value to set
- Inherited From:
- Overrides:
- Source:
Throws:
-
If shader not registered
- Type
- Error
Type Definitions
-
Modes
-
Available visualization modes
Type:
- Object
- Source:
Properties:
Name Type Description normalize
string Arrow normalization ('on'|'off')
arrow
string Arrow coloring mode ('mag'|'col')
field
string Background field visualization ('none'|'mag')
-
Options
-
Configuration options for vector field visualization
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description inDomain
Array.<number> <optional>
[] Input value range [min, max] for magnitude mapping
maxSteps
number <optional>
256 Number of discrete steps in the colormap texture
arrowColor
Array.<number> <optional>
[0.0, 0.0, 0.0, 1.0] RGBA color for arrows when using 'col' mode