Colormaps
The Colormap API
is a key feature of the Evo platform, providing a mechanism to create colour mappings and associate them to geoscience data via a colormap
.
colormaps
in the Evo platform serve as a powerful tool for data exploration and analysis. colormaps
contain a range of colours that map colours to data values, simplifying the identification of
patterns and trends in the data. By assigning specific colours to important data values, these values
can be emphasized for quick and effective interpretation, leading to more informed decision-making.
Additionally, a colormap
can be used to underscore unusual data values by assigning these values distinctive colours,
aiding in pinpointing potential anomalies that could be significant.
Applying the same colormap
across datasets within a workspace allows organizations to adopt a common
language for visual communication. This shared colour coding enables consistency in data interpretation and visualization,
and facilitates comparison of datasets in a standardized manner.
The Colormap API
supports three types of colour mappings:
Colormap Type | Description |
---|---|
Continuous | Used for numerical data that varies smoothly. Requires a minimum of two colours and corresponding attribute and gradient controls. |
Discrete | Used for numerical data that falls within specific ranges. Requires endpoint definitions and corresponding colours. |
Category | Used for non-numerical data. Requires a mapping between categories and colours. |
Note: You can visit the Colormaps API OpenAPI schema for a detailed description of how to interact with the API.
Colormap API colour format
Colours in the Colormap API are always defined in RGB order and are arrays of three integer values ranging from 0 to 255:
{
"colors": [
[255, 0, 0],
[0, 255, 0],
[0, 0, 255],
]
}
Colormap types
Continuous
A continuous colormap
is used for numerical data that changes gradually. These
require a minimum of two colours in the colors
array and corresponding attribute and gradient controls.
Each colour in the colormap
represents a range of data values, and the colours in the colors
field transition
smoothly from one to another across the range.
Here is an example of a continuous colormap
defined in JSON:
{
"name": "Example Continuous Colormap",
"colors": [
[0, 0, 255],
[255, 0, 0]
],
"attribute_controls": [0, 1],
"gradient_controls": [0, 1],
"dtype": "continuous"
}
In this example, the continuous colormap
transitions from the colours blue to red. The attribute controls
and gradient controls are both set to [0, 1]
, indicating a linear transition from the colour
blue at the lower end of the data range to the colour red at the higher end.
Value | Colour | Gradient Bar | Colour |
---|---|---|---|
0.20 | Blue | ##########---------------------------------------- | Red |
0.40 | Blue | ####################------------------------------ | Red |
0.60 | Blue | ##############################-------------------- | Red |
0.80 | Blue | ########################################---------- | Red |
1.00 | Blue | ################################################## | Red |
As seen above, colours transition smoothly between the colours in the colors
array.
Note: Continuous colormaps must have between 2 and 1024 colors.
Discrete
A discrete colormap
is used for numerical data that falls within specific ranges.
These require endpoint definitions and corresponding colours to be used within each range.
Each colour in the colormap
represents a specific range of data values. In this case,
colours within the colors
array are assigned to distinct data ranges, ensuring clear differentiation between the ranges.
Here is an example of a discrete colormap
defined in JSON:
{
"name": "Example Discrete Colormap",
"colors": [
[255, 0, 0],
[0, 255, 0],
[0, 0, 255]
],
"end_points": [0.33, 0.66],
"end_inclusive": [true, false],
"dtype": "discrete"
}
In this example, the colormap
has three colours (red, green, and blue) and two
endpoints (0.33 and 0.66). The first endpoint is inclusive, meaning values equal
to 0.33 are coloured red. Values greater than 0.33 and less than or equal to 0.66
are coloured green. Values greater than 0.66 are coloured blue.
Color | Inequality | Interval Notation | Interval Description |
---|---|---|---|
Red | -∞ < x ≤ 0.33 | (-∞, 0.33] | From negative infinity to 0.33 (inclusive) |
Green | 0.33 < x < 0.66 | (0.33, 0.66) | From 0.33 (exclusive) to 0.66 (exclusive) |
Blue | 0.66 ≤ x < ∞ | [0.66, ∞) | From 0.66 (inclusive) to positive infinity |
In a discrete colormap
, specific ranges of data values are assigned specific
colours (e.g., Red for values ≤ 0.33, Green for values > 0.33 and ≤ 0.66, Blue
for values > 0.66), as defined by the endpoints and colours in the colors
array.
Note: Discrete colormaps can have up to 1024 colors. The
end_points
andend_inclusive
arrays must each have a size of one less than the number of colors in thecolors
array.
Category
A category colormap
is used for non-numerical data. These require a mapping between categories and colours. Each category in a category colormap
is assigned a specific colour.
Here is an example of a category colormap
defined in JSON:
{
"name": "Example Category Colormap",
"colors": [
[255, 0, 0],
[0, 255, 0],
[0, 0, 255]
],
"map": ["Cat1", "Cat2", "Cat3"],
"dtype": "category"
}
In this example, the category colormap
has a list colors
which holds colours and a corresponding list of categories (map
). Each category in the map
is assigned a specific colour from the colors
list.
Cat1 | Cat2 | Cat3 |
---|---|---|
Red | Green | Blue |
In a category colormap
, each category (e.g., Cat1, Cat2, Cat3) is assigned a specific colour (e.g., Red, Green, Blue). This type of colour mapping allows for clear visual differentiation between categories, making it easier to interpret non-numerical data.
Note: Category colormaps can have up to 16,384 colors. The number of colors must match the number of categories in the
map
field exactly, as they are mapped in a one-to-one fashion.
Colormap associations
Associations in the Evo platform allow you to link a colormap
with geoscience object attributes.
Associations are defined by providing an attribute_id
and a colormap_id
.
This linkage ensures that there is a defined relationship between the attribute and the colormap
, which can be utilized by other components
of the platform.
Here is an example of an association:
{
"attribute_id": "00000000-0000-0000-0000-000000000000",
"colormap_id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
Note: The same colormap can be associated with many geoscience object attributes, promoting reuse and ensuring consistent color representation across different geoscience objects. By using a common colormap you can maintain a standardized visual language, making it easier to compare, interpret, and communicate the data.