@maptiler/sdk 1.2.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -0
- package/dist/maptiler-sdk.css +1 -1
- package/dist/maptiler-sdk.d.ts +171 -240
- package/dist/maptiler-sdk.min.mjs +3 -3
- package/dist/maptiler-sdk.mjs +462 -458
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/package.json +3 -3
- package/readme.md +16 -1
- package/CHANGELOG.md +0 -168
- package/colorramp.md +0 -93
- package/dist/maptiler-sdk.umd.js +0 -7702
- package/dist/maptiler-sdk.umd.js.map +0 -1
- package/dist/maptiler-sdk.umd.min.js +0 -582
- package/src/AttributionControl.ts +0 -13
- package/src/CanvasSource.ts +0 -13
- package/src/FullscreenControl.ts +0 -13
- package/src/GeoJSONSource.ts +0 -13
- package/src/GeolocateControl.ts +0 -13
- package/src/ImageSource.ts +0 -13
- package/src/LogoControl.ts +0 -13
- package/src/Map.ts +0 -1352
- package/src/MaptilerGeolocateControl.ts +0 -207
- package/src/MaptilerLogoControl.ts +0 -58
- package/src/MaptilerNavigationControl.ts +0 -69
- package/src/MaptilerTerrainControl.ts +0 -72
- package/src/Marker.ts +0 -13
- package/src/Minimap.ts +0 -373
- package/src/NavigationControl.ts +0 -13
- package/src/Point.ts +0 -334
- package/src/Popup.ts +0 -13
- package/src/RasterDEMTileSource.ts +0 -13
- package/src/RasterTileSource.ts +0 -13
- package/src/ScaleControl.ts +0 -13
- package/src/Style.ts +0 -13
- package/src/TerrainControl.ts +0 -13
- package/src/VectorTileSource.ts +0 -13
- package/src/VideoSource.ts +0 -13
- package/src/colorramp.ts +0 -1216
- package/src/config.ts +0 -96
- package/src/converters/index.ts +0 -1
- package/src/converters/xml.ts +0 -681
- package/src/defaults.ts +0 -20
- package/src/helpers/index.ts +0 -27
- package/src/helpers/stylehelper.ts +0 -395
- package/src/helpers/vectorlayerhelpers.ts +0 -1511
- package/src/index.ts +0 -201
- package/src/language.ts +0 -183
- package/src/mapstyle.ts +0 -46
- package/src/style/style_template.css +0 -146
- package/src/style/svg/v6-compass.svg +0 -12
- package/src/style/svg/v6-fullscreen-off.svg +0 -7
- package/src/style/svg/v6-fullscreen.svg +0 -7
- package/src/style/svg/v6-geolocate-active-error.svg +0 -10
- package/src/style/svg/v6-geolocate-active.svg +0 -7
- package/src/style/svg/v6-geolocate-background.svg +0 -8
- package/src/style/svg/v6-geolocate-disabled.svg +0 -10
- package/src/style/svg/v6-geolocate.svg +0 -7
- package/src/style/svg/v6-terrain-on.svg +0 -7
- package/src/style/svg/v6-terrain.svg +0 -7
- package/src/style/svg/v6-zoom-minus.svg +0 -7
- package/src/style/svg/v6-zoom-plus.svg +0 -7
- package/src/tools.ts +0 -171
- package/src/unit.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
|
|
5
5
|
"module": "dist/maptiler-sdk.mjs",
|
|
6
6
|
"types": "dist/maptiler-sdk.d.ts",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"xmldom": "^0.6.0"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@maptiler/client": "^1.8.
|
|
77
|
+
"@maptiler/client": "^1.8.1",
|
|
78
78
|
"events": "^3.3.0",
|
|
79
79
|
"js-base64": "^3.7.4",
|
|
80
|
-
"maplibre-gl": "
|
|
80
|
+
"maplibre-gl": "4.1.2",
|
|
81
81
|
"uuid": "^9.0.0"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/readme.md
CHANGED
|
@@ -22,6 +22,8 @@ The **MapTiler SDK JS** extends MapLibre GL JS, exposes all its features, and ad
|
|
|
22
22
|
In addition, the MapTiler SDK JS provides well-documented and easy-to-use wrapper functions to the [MapTiler Cloud API services](https://docs.maptiler.com/cloud/api) such as: geocoding, static maps, geolocation, as well as a search engine for coordinate reference systems and transforming coordinates from one CRS to another.
|
|
23
23
|
> 📣 *__Note:__* If you need <ins>only the API Client library</ins> to use in a headless fashion and without any map display, check out [MapTiler Client JS](https://github.com/maptiler/maptiler-client-js) library for browser and NodeJS.
|
|
24
24
|
|
|
25
|
+

|
|
26
|
+
|
|
25
27
|
# Install
|
|
26
28
|
```shell
|
|
27
29
|
npm install --save @maptiler/sdk
|
|
@@ -51,7 +53,7 @@ const map = new maptilersdk.Map({
|
|
|
51
53
|
});
|
|
52
54
|
```
|
|
53
55
|
|
|
54
|
-
Alternativelly, the `apiKey` can be set as Map option intead of in the `config` object. Yet, this will still internally propagate to the `config`
|
|
56
|
+
Alternativelly, the `apiKey` can be set as Map option intead of in the `config` object. Yet, this will still internally propagate to the `config` object:
|
|
55
57
|
```ts
|
|
56
58
|
import * as maptilersdk from '@maptiler/sdk';
|
|
57
59
|
|
|
@@ -172,6 +174,9 @@ Here is the full list:
|
|
|
172
174
|
- `MapStyle.DATAVIZ`, the perfect style for data visualization, with very little noise
|
|
173
175
|
- `MapStyle.DATAVIZ.DARK` (variant)
|
|
174
176
|
- `MapStyle.DATAVIZ.LIGHT` (variant)
|
|
177
|
+
- `MapStyle.BACKDROP`, great style for data visualization when hillshading matters!
|
|
178
|
+
- `MapStyle.BACKDROP.DARK` (variant)
|
|
179
|
+
- `MapStyle.BACKDROP.LIGHT` (variant)
|
|
175
180
|
- `MapStyle.BASIC` reference style for minimalist design and general purpose
|
|
176
181
|
- `MapStyle.BASIC.DARK` (variant)
|
|
177
182
|
- `MapStyle.BASIC.LIGHT` (variant)
|
|
@@ -856,6 +861,16 @@ Turning off *zoom compensation* allows for more accurate adjustments to the visu
|
|
|
856
861
|
|
|
857
862
|
All the other options are documented on a [our reference page](https://docs.maptiler.com/sdk-js/api/map/) and more examples are available [here](https://docs.maptiler.com/sdk-js/examples/).
|
|
858
863
|
|
|
864
|
+
# Caching
|
|
865
|
+
Starting from v2, MapTiler SDK introduced the **caching** of tiles and fonts served by MapTiler Cloud, which can represent a large chunk of the data being fetched when browsing a map. This caching leverages modern browsers caching API so it's well-managed and there is no risk of bloating! When we update **MapTiler Planet** or our **official styles**, the caching logic will detect it and automatically invalidate older versions of the tiles that were previously cached.
|
|
866
|
+
|
|
867
|
+
Caching greatly improves the performance at load time and positively impact the user experience, for this reason, it is **enabled by default**. If for debugging purposes or a for a very specific use-case caching needs to be disabled, then it possible:
|
|
868
|
+
|
|
869
|
+
```ts
|
|
870
|
+
import { config } from "@maptiler/sdk";
|
|
871
|
+
|
|
872
|
+
config.caching = false;
|
|
873
|
+
```
|
|
859
874
|
|
|
860
875
|
# Easy access to MapTiler Cloud API
|
|
861
876
|
Our map SDK is not only about maps! We also provide plenty of wrapper to our API calls!
|
package/CHANGELOG.md
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# MapTiler SDK Changelog
|
|
2
|
-
|
|
3
|
-
## DEVEL
|
|
4
|
-
### New Features
|
|
5
|
-
### Bug Fixes
|
|
6
|
-
### Others
|
|
7
|
-
|
|
8
|
-
## 1.2.1
|
|
9
|
-
### New Features
|
|
10
|
-
- Elevation lookup at `maptilersdk.elevation` with the function `.at()`, `.batch()` and for geojson payloads. From the update of the MapTiler Client library
|
|
11
|
-
- the new `ready` event. Called only once after `load` and wait for all the controls managed by the Map constructor to be dealt with (as one relies on async logic)
|
|
12
|
-
- the new Map lifecycle method `.onReadyAsync()` corresponding to a promise-based equivalent of the the `ready` event.
|
|
13
|
-
### Bug Fixes
|
|
14
|
-
- The index now exposes the geocoding option types from the Client library
|
|
15
|
-
### Others
|
|
16
|
-
- Update of the Maptiler Client library to v1.8.0 that brings the elevation and math module
|
|
17
|
-
- Update with the last version of MapLibre GL JS (v3.6.2)
|
|
18
|
-
|
|
19
|
-
## 1.2.0
|
|
20
|
-
### New Features
|
|
21
|
-
- Added the Minimap control https://github.com/maptiler/maptiler-sdk-js/pull/54
|
|
22
|
-
- Added vector layer helpers to create easier:
|
|
23
|
-
- point layer (https://github.com/maptiler/maptiler-sdk-js/pull/61)
|
|
24
|
-
- heatmap layer (https://github.com/maptiler/maptiler-sdk-js/pull/61)
|
|
25
|
-
- polyline layer, including parsing from GPX/KML (https://github.com/maptiler/maptiler-sdk-js/pull/51)
|
|
26
|
-
- polygon layer (https://github.com/maptiler/maptiler-sdk-js/pull/56)
|
|
27
|
-
- Add the `ColorRamp` class to create and customize color ramps, as well as `ColorRampCollection` with many predefined ones (as part of https://github.com/maptiler/maptiler-sdk-js/pull/61)
|
|
28
|
-
- Improved the language management for increased compatibility with [MapTiler Customize](https://cloud.maptiler.com/maps/editor/) (https://github.com/maptiler/maptiler-sdk-js/pull/58)
|
|
29
|
-
### Bug Fixes
|
|
30
|
-
- Fixed type export (https://github.com/maptiler/maptiler-sdk-js/pull/47)
|
|
31
|
-
### Others
|
|
32
|
-
- Upgrade to MapLibre v3.5.2 (https://github.com/maptiler/maptiler-sdk-js/pull/63)
|
|
33
|
-
- Update of TypeScript configuration `moduleResolution` to `Bundler` (https://github.com/maptiler/maptiler-sdk-js/pull/62)
|
|
34
|
-
|
|
35
|
-
## 1.1.2
|
|
36
|
-
### Bug Fixes
|
|
37
|
-
- Now using a fixed version of MapLibre GL. No longer use `^` because this caused issues as MapLibre made minor/patch update that were not backward compatible
|
|
38
|
-
|
|
39
|
-
## 1.1.1
|
|
40
|
-
### Others
|
|
41
|
-
- Update to `maplibre-gl@3.1.0`
|
|
42
|
-
|
|
43
|
-
## 1.1.0
|
|
44
|
-
### New Features
|
|
45
|
-
- Bringing back Map's `options.transformRequest` and `.setTransformRequest()`
|
|
46
|
-
### Bug Fixes
|
|
47
|
-
- Fixed the MapTiler logo rel name and its nofollow feature
|
|
48
|
-
- Made the few necessary changes acording to updating the ML v3. No braking change for SDK API
|
|
49
|
-
### Others
|
|
50
|
-
- Updated from `maplibre-gl@3.0.0-pre.4` to `maplibre-gl@3.0.1` (this includes the switch to WebGL2)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## 1.0.12
|
|
54
|
-
### New Features
|
|
55
|
-
- Added a new language flag `Language.STYLE_LOCK` to force keep the language form the style and prevent any further update. Can be at a sigle map instance level (via constuctor option `language`) or via global config (`config.primaryLanguage`)
|
|
56
|
-
### Bug Fixes
|
|
57
|
-
- The fallback language was `{name:latin}`, it is now replaced by `{name}`, which is for the local name (present by default for many places while `latin` is less frequent).
|
|
58
|
-
|
|
59
|
-
## 1.0.11
|
|
60
|
-
### Bug Fixes
|
|
61
|
-
- Now exporting `MaptilerNavigationControl`
|
|
62
|
-
### Others
|
|
63
|
-
- Documentation update for `Map`'s `option.maptilerLogo` that was a bit unclear
|
|
64
|
-
|
|
65
|
-
## 1.0.10
|
|
66
|
-
### New Features
|
|
67
|
-
- Terrain growing animation on enabling/disabling
|
|
68
|
-
- Added `Map` custom event `loadWithTerrain`
|
|
69
|
-
- Added `Map` lifecycle methods `.onLoadAsync()` and `.onLoadWithTerrainAsync()`
|
|
70
|
-
### Others
|
|
71
|
-
- Readme section was added about the event an methods above
|
|
72
|
-
- Updated from `maplibre-gl@3.0.0-pre.3` to `maplibre-gl@3.0.0-pre.4`
|
|
73
|
-
- Updated from `typedoc@0.23.21` to `typedoc@0.24.4`, which changes slightly the look of the reference documentation.
|
|
74
|
-
- Updated from `typescript@4.8.4` to `typescript@5.0.4`
|
|
75
|
-
- Updated from `rollup@2.79.0` to `rollup@3.20.6` as well as all the Rollup plugins
|
|
76
|
-
|
|
77
|
-
## 1.0.9
|
|
78
|
-
### New Features
|
|
79
|
-
- Added new styles:
|
|
80
|
-
- `MapStyle.STREETS.NIGHT`
|
|
81
|
-
- `MapStyle.WINTER.DARK`
|
|
82
|
-
- `MapStyle.OUTDOOR.DARK`
|
|
83
|
-
### Bug Fixes
|
|
84
|
-
- If the geolocate option is missing from `Map` constructor, then it's considered `false`
|
|
85
|
-
- The instance types for the following MapLibre classes are now fully exported:
|
|
86
|
-
- `NavigationControl`
|
|
87
|
-
- `GeolocateControl`
|
|
88
|
-
- `AttributionControl`
|
|
89
|
-
- `LogoControl`
|
|
90
|
-
- `ScaleControl`
|
|
91
|
-
- `FullscreenControl`
|
|
92
|
-
- `TerrainControl`
|
|
93
|
-
- `Popup`
|
|
94
|
-
- `Marker`
|
|
95
|
-
- `Style`
|
|
96
|
-
- `LngLat`
|
|
97
|
-
- `LngLatBounds`
|
|
98
|
-
- `MercatorCoordinate`
|
|
99
|
-
- `Evented`
|
|
100
|
-
- `AJAXError`
|
|
101
|
-
- `CanvasSource`
|
|
102
|
-
- `GeoJSONSource`
|
|
103
|
-
- `ImageSource`
|
|
104
|
-
- `RasterDEMTileSource`
|
|
105
|
-
- `RasterTileSource`
|
|
106
|
-
- `VectorTileSource`
|
|
107
|
-
- `VideoSource`
|
|
108
|
-
- `MapMLGL`
|
|
109
|
-
- The following class have been extended to provide greater compatibility with SDK,s MapL
|
|
110
|
-
- `Popup`
|
|
111
|
-
- `Marker`
|
|
112
|
-
- `Style`
|
|
113
|
-
- `CanvasSource`
|
|
114
|
-
- `GeoJSONSource`
|
|
115
|
-
- `ImageSource`
|
|
116
|
-
- `RasterDEMTileSource`
|
|
117
|
-
- `RasterTileSource`
|
|
118
|
-
- `VectorTileSource`
|
|
119
|
-
- `VideoSource`
|
|
120
|
-
- `NavigationControl`
|
|
121
|
-
- `GeolocateControl`
|
|
122
|
-
- `AttributionControl`
|
|
123
|
-
- `LogoControl`
|
|
124
|
-
- `ScaleControl`
|
|
125
|
-
- `FullscreenControl`
|
|
126
|
-
- `TerrainControl`
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
## 1.0.8
|
|
130
|
-
### Bug Fixes
|
|
131
|
-
- Since v1.0.7, the `Map` primary language (when custom) was no longer persistant on style update.
|
|
132
|
-
|
|
133
|
-
## 1.0.7
|
|
134
|
-
### New Features
|
|
135
|
-
- The `apiKey` can now be specified in the `Map` constructor (will propagate to `config`)
|
|
136
|
-
- The `language` can now be speficifed in the `Map` constructo (will **not** propagete to `config` and will apply only to this specific instance)
|
|
137
|
-
- `Map` now has the method `.getSdkConfig()` to retrieve the config object.
|
|
138
|
-
- `Map` now has the method `.getMaptilerSessionId()` to retrieve the MapTiler session ID
|
|
139
|
-
Both `.getSdkConfig()` and `.getMaptilerSessionId()` are handy for layers or control built outside of the SDK that still need some of the configuration to interact with the server. Those components do not always have access to the internal of the SDK (especially that the config is scoped) but can access to the `Map` instance to which they are added with the implementation of the `.onAdd()` method.
|
|
140
|
-
|
|
141
|
-
## 1.0.6
|
|
142
|
-
### New Features
|
|
143
|
-
- Now exposing `MaptilerGeolocateControl` for external initialization if needed
|
|
144
|
-
- Now exposing `MaptilerTerrain` for external initialization if needed
|
|
145
|
-
|
|
146
|
-
## 1.0.5
|
|
147
|
-
### New Features
|
|
148
|
-
- Terrain elevation is now using MapTiler's `terrain-rgb-v2`
|
|
149
|
-
|
|
150
|
-
## 1.0.4
|
|
151
|
-
### Others
|
|
152
|
-
- Improved the geolocate control behavior by not zooming out
|
|
153
|
-
|
|
154
|
-
## 1.0.3
|
|
155
|
-
### Bug Fixes
|
|
156
|
-
- Fixed the usage of relative path style JSON (in `Map` constructor and `.setStyle()`)
|
|
157
|
-
|
|
158
|
-
## 1.0.2
|
|
159
|
-
### Bug Fixes
|
|
160
|
-
- Fixed the dependency scheme of MapLibre import.
|
|
161
|
-
|
|
162
|
-
## 1.0.1
|
|
163
|
-
### Others
|
|
164
|
-
- Reducing the NPM size by ignoring documentation images
|
|
165
|
-
|
|
166
|
-
## 1.0.0
|
|
167
|
-
### Others
|
|
168
|
-
- First public version!
|
package/colorramp.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# ColorRamps resampling
|
|
2
|
-
`ColorRamps` in the SDK, whether they are built-in (`ColorRampCollection`) or custom made (`new ColorRamp()`) can be resampled in a non linear fashion. Such resampling can serve different purposes, for instance:
|
|
3
|
-
- the data to visualize follows a non-linear function
|
|
4
|
-
- the goal of the visualization is to specificaly emphasize difference towards the lower or upper bound of the range
|
|
5
|
-
|
|
6
|
-
Creating a non linear color ramp can be a bit difficult, so resampling an existing one that has been originaly created as linear is easier. At the moment, the SDK provides four methods to resample a color ramp with the `.resample()` function:
|
|
7
|
-
- folowing a square function: `"ease-in-square"`
|
|
8
|
-
- folowing a square function: `"ease-out-square"`
|
|
9
|
-
- following a square root: `"ease-in-sqrt"`
|
|
10
|
-
- following a square root: `"ease-out-sqrt"`
|
|
11
|
-
- folowing an exponential function: `"ease-in-exp"`
|
|
12
|
-
- folowing an exponential function: `"ease-in-exp"`
|
|
13
|
-
|
|
14
|
-
Note: the *ease-out* equivalent of *ease-in-square* is technically *ease-out-square* and the *ease-in* equivalent of *ease-out-sqrt* is technically *ease-in-sqrt* but after some tests, it appeared that `"ease-in-square"` and `"ease-out-sqrt"` where a better pairing so this is why we decided to focus mainly on those two.
|
|
15
|
-
|
|
16
|
-
Terminology:
|
|
17
|
-
- an function is said **ease in** when its acceleration is fairly low at the begining and much higher towards the end
|
|
18
|
-
- an function is said **ease out** when its acceleration is quite high at begining and much lower towards the end
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Linear logic
|
|
22
|
-
All the built-in color ramps are defined in a range of `(0, 1)`. Even though they can be scaled (`.scale(min, max)`) or custom ones can be created on a diferent interval, the range of (0, 1) is the most convenient to visualize how things work. Also, to keep it simple we are using a linear gray color ramp going from `(R:0, G:0, B:0)` to `(R:255, G:255, B:255)`. You can find this specific one as `ColorRampCollection.GRAY`.
|
|
23
|
-
|
|
24
|
-

|
|
25
|
-
|
|
26
|
-
- along the `x` axis (horizontal), the input number. This can be the intensity or any real-worl metric
|
|
27
|
-
- along the `y` axis (vertical), the output color
|
|
28
|
-
|
|
29
|
-
As we can see:
|
|
30
|
-
- an input of `0` will yied the color `(R:0, G:0, B:0)`
|
|
31
|
-
- an input of `0.5` will yied the color `(R:127, G:127, B:127)`
|
|
32
|
-
- an input of `1` will yied the color `(R:255, G:255, B:255)`
|
|
33
|
-
|
|
34
|
-
The original linear GRAY color ramp looks like this:
|
|
35
|
-
|
|
36
|
-

|
|
37
|
-
|
|
38
|
-
## *ease-out-sqrt* method
|
|
39
|
-
To resample a color ramp with the *square root* method, simply do:
|
|
40
|
-
```ts
|
|
41
|
-
const graySqrt = ColorRampCollection.GRAY.resample("ease-out-sqrt");
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Note: this will **not** modify the origin `ColorRampCollection.GRAY`.
|
|
45
|
-
|
|
46
|
-
There are multiple ways to visualize the effect of such resampling. The simplest is probably to do as above (*linear logic*), but using a *square root* function:
|
|
47
|
-
|
|
48
|
-

|
|
49
|
-
|
|
50
|
-
This will yield the following color ramp:
|
|
51
|
-
|
|
52
|
-

|
|
53
|
-
|
|
54
|
-
If we compare with the linear GRAY from above, we can see that the lower part (the darkest) is sort of compressed, while the upper part (the lightest) looks stretched.
|
|
55
|
-
|
|
56
|
-
As a result:
|
|
57
|
-
- an input of `0` will yied the color `(R:0, G:0, B:0)`
|
|
58
|
-
- an input of `0.5` will yied the color `(R:180, G:180, B:180)`
|
|
59
|
-
- an input of `1` will yied the color `(R:255, G:255, B:255)`
|
|
60
|
-
|
|
61
|
-
Another way to look at the *ease-out-sqrt-resampled* GRAY color ramp is by using it along the `y` axis and addressing it with data that are following a linear rule:
|
|
62
|
-

|
|
63
|
-
|
|
64
|
-
This can be convenient to do if the purpose is to emphasize the change of values on the lower-end, say in the range `(0, 0.4)` as the color response will be faster-changing than with a linear scale.
|
|
65
|
-
|
|
66
|
-
## *ease-in-square* method
|
|
67
|
-
To resample a color ramp with the *square* method, simply do:
|
|
68
|
-
```ts
|
|
69
|
-
const graySquare = ColorRampCollection.GRAY.resample("ease-in-square");
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Note: this will **not** modify the origin `ColorRampCollection.GRAY`.
|
|
73
|
-
|
|
74
|
-
Let's visualize it, using the original linear gradient along the `y` axis:
|
|
75
|
-
|
|
76
|
-

|
|
77
|
-
|
|
78
|
-
This will yield the following color ramp:
|
|
79
|
-
|
|
80
|
-

|
|
81
|
-
|
|
82
|
-
As we can see, compared to the linear ramping, the change is color is slower towards the lower end and faster towards the end of the range.
|
|
83
|
-
|
|
84
|
-
As a result:
|
|
85
|
-
- an input of `0` will yied the color `(R:0, G:0, B:0)`
|
|
86
|
-
- an input of `0.5` will yied the color `(R:64, G:64, B:64)`
|
|
87
|
-
- an input of `1` will yied the color `(R:255, G:255, B:255)`
|
|
88
|
-
|
|
89
|
-
Again, we can visualize a *ease-in-square-resampled* color ramp by using it alongside the `y` axis, with linear data:
|
|
90
|
-
|
|
91
|
-

|
|
92
|
-
|
|
93
|
-
Contrary to the *ease-out-sqrt* method, the *ease-in-square* will yield faster changing colors on the upper bound of the input range.
|