new ShaderFilterVectorGlyph(colorscale, glyphsUrl [, options])
Creates a new glyph-based vector field visualization filter
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
colorscale |
ColorScale | Colorscale for magnitude mapping |
|
glyphsUrl |
string | URL to SVG sprite sheet containing glyphs |
|
options |
ShaderFilterVectorGlyph~Options |
<optional> |
Configuration options |
- Source:
Throws:
-
If inDomain is invalid or glyphsUrl is empty
- Type
- Error
Example
```javascript
// Create with custom options
const filter = new ShaderFilterVectorGlyph(colorscale, 'glyphs.svg', {
inDomain: [0, 1],
glyphsSize: [304, 64],
glyphsStride: 80,
glyphColor: [0, 0, 0, 1]
});
```
Extends
Methods
-
getSampler(name)
-
Finds a sampler by name
Parameters:
Name Type Description namestring 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 modestring Mode category to modify
idstring 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 namestring Base name of uniform variable
valuenumber | 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 normalizestring Glyph size normalization ('on'|'off')
glyphstring Glyph coloring mode ('mag'|'col')
fieldstring Background field visualization ('none'|'mag')
-
Options
-
Configuration options for glyph-based vector field visualization
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description inDomainArray.<number> <optional>
[] Input value range [min, max] for magnitude mapping
maxStepsnumber <optional>
256 Number of discrete steps in the colormap texture
glyphColorArray.<number> <optional>
[0.0, 0.0, 0.0, 1.0] RGBA color for glyphs when using 'col' mode
glyphsStridenumber <optional>
80 Horizontal spacing between glyphs in the sprite sheet
glyphsSizeArray.<number> <optional>
[304, 64] Dimensions of the glyph sprite sheet [width, height]