Skip to main content

ShapeIntervalColour

Graduated colour in equal intervals over a numeric field. The classes are worked out from min, max and the ramp's length, so a legend never disagrees with the map: values below min fall in the first class and values above max in the last.

This is an interface exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import type { ShapeIntervalColour } from "@mapcairn/core";

interface ShapeIntervalColour

Properties​

dashes​

readonly dashes?: readonly LineDash[];

Optional dashing, one per class, lowest first.

field​

readonly field: string;

The numeric field the classes are made from.

kind​

readonly kind: "intervals";

Tells an equal-interval rule from the other shape colour rules.

max​

readonly max: number;

The upper end of the range the classes divide. Values above it fall in the last class.

min​

readonly min: number;

The lower end of the range the classes divide. Values below it fall in the first class.

patterns​

readonly patterns?: readonly FillPattern[];

Optional marks, one per class (lowest first), so each class has a second signal.

ramp​

readonly ramp: readonly PaletteSlot[];

One ordered palette colour per class, lowest first. Two to seven classes.

unit​

readonly unit?: LayerTemplate;

Appended to the legend's numbers, such as people.

widths​

readonly widths?: readonly number[];

Optional stroke widths in pixels, one per class, lowest first.

See also​

Source: packages/core/src/layers/definition.ts:453