GlyphField.scaleTransform¶
Summary¶
GlyphField.scaleTransform reads the current scaleTransform value from this GlyphField instance. Use it to inspect runtime state without mutating resources.
Syntax¶
Parameters¶
This API does not take parameters.
Returns¶
ScaleTransform - Normalized scale-transform snapshot currently active on this object.
Type Details¶
ScaleTransform¶
type ScaleTransform = {
mode: ScaleMode;
clampMode: ScaleClampMode;
valueMode: ScaleValueMode;
componentCount: number;
componentIndex: number;
stride: number;
offset: number;
domainMin: number;
domainMax: number;
clampMin: number;
clampMax: number;
percentileLow: number;
percentileHigh: number;
logBase: number;
symlogLinThresh: number;
gamma: number;
invert: boolean;
};
ScaleTransform Fields¶
| Name | Type | Required | Description |
|---|---|---|---|
mode |
ScaleMode |
Yes | Mode selector controlling behavior for this operation or descriptor. |
clampMode |
ScaleClampMode |
Yes | Clamping mode used by scale transforms. |
valueMode |
ScaleValueMode |
Yes | Value extraction mode used when mapping source data into scale inputs. |
componentCount |
number |
Yes | Numeric input controlling componentCount for this operation. |
componentIndex |
number |
Yes | Numeric input controlling componentIndex for this operation. |
stride |
number |
Yes | Numeric input controlling stride for this operation. |
offset |
number |
Yes | Numeric input controlling offset for this operation. |
domainMin |
number |
Yes | Numeric input controlling domainMin for this operation. |
domainMax |
number |
Yes | Numeric input controlling domainMax for this operation. |
clampMin |
number |
Yes | Numeric input controlling clampMin for this operation. |
clampMax |
number |
Yes | Numeric input controlling clampMax for this operation. |
percentileLow |
number |
Yes | Numeric input controlling percentileLow for this operation. |
ScaleMode¶
ScaleClampMode¶
ScaleValueMode¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const glyphField = wgpu.createGlyphField({ instanceCount: 1, positions: new Float32Array([0, 0, 0, 0]), rotations: new Float32Array([0, 0, 0, 1]), scales: new Float32Array([1, 1, 1, 0]), attributes: new Float32Array([0.5, 0, 0, 0]), scaleTransform: { mode: "linear", domainMin: 0, domainMax: 1 } });
const value = glyphField.scaleTransform;
console.log(value);
See Also¶
- GlyphField.applyScaleStats
- GlyphField.colormap
- GlyphField.colormapStops
- GlyphField.colorMode
- GlyphField.computeBoundsFromCPUData
- GlyphField.destroy
- GlyphField.dirtyUniforms
- GlyphField.getAttributeRecord
- GlyphField.getBounds
- GlyphField.getColormapForBinding
- GlyphField.getColormapKey
- GlyphField.getLocalBounds