LegendLayer.setOrientation¶
Summary¶
LegendLayer.setOrientation sets the legend orientation.
Accepted orientations are "vertical" and "horizontal".
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
orientation |
LegendOrientation |
Yes | Vertical or horizontal gradient layout. |
Returns¶
this - The same instance for method chaining.
Type Details¶
Example¶
const legend = wgpu.createOverlay.legend({
source: {
scaleTransform: { mode: "linear", domainMin: 0, domainMax: 100 },
colormap: "viridis",
},
});
legend.setOrientation("horizontal");