LegendLayer.setSubtitle¶
Summary¶
LegendLayer.setSubtitle sets the optional legend subtitle. An empty string hides the subtitle element.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
subtitle |
string |
Yes | Secondary heading, or empty string to hide it. |
Returns¶
this - The same instance for method chaining.
Type Details¶
The subtitle element is shown only for a non-empty value.
Example¶
const legend = wgpu.createOverlay.legend({
source: {
scaleTransform: { mode: "linear", domainMin: 0, domainMax: 100 },
colormap: "viridis",
},
});
legend.setSubtitle("Time-averaged");