A super module that collects available sub-modules.
- Source:
Classes
Members
(static, constant) CMOCEAN
Collection of color scales for the
layer styling
- Source:
Methods
(static) exports.colorScaleToWmsParams(scale, noValue) → {object}
Get the WMS query parameters for the the O2A color template styles
from the given color scale
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<object> | color scale array |
noValue |
object |
- Source:
Returns:
{env, styles}
- Type
- object
(static) exports.copyColorItem(item) → {object}
Copy a color item to remove original pointers to instances
Parameters:
Name | Type | Description |
---|---|---|
item |
object | color item |
- Source:
Returns:
copied color item
- Type
- object
(static) exports.copyColorScale(scale) → {Array.<object>}
Copy a color scale to remove original pointers to instances
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<object> | color scale |
- Source:
Returns:
copied color scale
- Type
- Array.<object>
(static) exports.generateCssGradient(scale, min, max)
Generate a CSS-gradient based on the
given color scale
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<object> | |
min |
number | custom minimum value (optional) |
max |
number | custom maximum value (optional) |
- Source:
(static) exports.getColorFromScale(scale, value, format)
Get the matching color from a given scale for a value with
linear interpolation
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<object> | |
value |
number | |
format |
string | "hexstring", "rgb", (default "hexstring") |
- Source:
(static) exports.invertColorScale(scale)
Invert the color scale value order
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<object> | color scale array |
- Source:
(static) exports.isHexColor(color) → {boolean}
Checks if a given string is a six digit hexadecimal color code
Parameters:
Name | Type | Description |
---|---|---|
color |
string | hex color code |
- Source:
Returns:
true if color is valid
- Type
- boolean
(static) exports.stretchColorScale(scale, min, max)
Stretch the color scale values linear with equal distance
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<object> | color scale array |
min |
number | |
max |
number |
- Source:
(static) exports.validateColorItem(item) → {object}
Validates a color item and throws error if it
has invalid properties.
exampleItem = {
"color": "#000000",
"value": 1
"opacity": 1
}
Parameters:
Name | Type | Description |
---|---|---|
item |
object | color item |
- Source:
Returns:
valid color item
- Type
- object
(static) exports.validateColorScale(colorScale) → {Array.<object>}
Validates a color scale and throws error if it
has invalid items.
Parameters:
Name | Type | Description |
---|---|---|
colorScale |
Array.<object> | color scale |
- Source:
Returns:
valid color scale
- Type
- Array.<object>
(static) exports.wmsParamsToColorScale() → {object}
Set the color scale based on the existing WMS query string
parameters of the O2A template styles.
- Source:
Returns:
color scale
- Type
- object