Legend Geometry
Creates a legend of colors with geometric representation
Overview
Creates a legend of colors with geometric representation
Inputs (3)
- Color Legend (Generic): Legend data from analysis components
- Base Point (Point): Base point for legend placement
- Scale (Number): Scale factor for legend geometry
Outputs (5)
- Legend Rectangles (Curve): Rectangle curves for legend
- Legend Labels (Text): Text labels for legend
- Label Positions (Point): Positions for text labels
- Legend Colors (Colour): Colors for legend elements
- Info (Text): Component information and interpretation
Method, assumptions and simplifications
The same notes appear in the component's Info output.
Method
- Reads a legend payload from Color Legend: the standard JSON string (Title, Type, Colors, Labels, SubLabels) from analysis components, or two older object formats (slope threshold and height range).
- Gradient legends: a strip 1 × Scale wide and 0.5 × Scale high is split into 10 to 40 swatches (4 per colour stop) coloured by linear interpolation between all stops; the first and last Labels go at the left and right ends and the first SubLabel below the centre.
- Blocks, Binary and Discrete legends: one swatch per colour. With one label more than colours, labels sit on the band edges; with one label per colour (more than 2 colours for Blocks, any number for Binary and Discrete) they sit under each block, staggered on two rows; otherwise the first and last labels go at the ends. Binary and Discrete legends also show their first SubLabel below.
- Outputs the swatch rectangles, labels, label points and colours, and previews filled swatches with Arial text 0.2 × Scale high. The title sits above the strip at Base Point.
Assumptions
- Legend is drawn in the World XY plane at Base Point; Scale is in model units.
- Other legend types are not drawn: only the title appears.
Simplifications and limits
- Text is a viewport preview only; the Labels and Label Positions outputs are needed to bake text.
- If the JSON cannot be parsed a single error label is returned.
Workflow
- Dashboard Data or Color Legend output of an analysis component (Terrain Slope, wind, streamlines, etc.) -> Color Legend.