/layer/themes/graduated
The layer theme module exports a method for graduated themes.
- Source
Methods
(inner) graduated(theme, feature)
The graduated theme method assigns the style of the category which matches a numeric feature field value according to the theme's graduated_breaks. A value outside the category range is assigned the nearest category by value: the lowest category for greater_than and the highest category for less_than.
Parameters:
Properties| Name | Type | Description |
|---|---|---|
theme | Object | The theme configuration object. |
feature | Object | The feature object. |
| Name | Type | Attributes | Description |
|---|---|---|---|
theme.field | string | The field name used for determining the category. | |
theme.categories | Array | An array of category objects. | |
theme.graduated_breaks | string | The comparison operator ("less_than" or "greater_than"). | |
feature.properties | Object | The properties of the feature. | |
properties.features | Array | <optional> | An array of sub-features. |
- Source