@deck.gl/carto 8.8.2 → 8.8.5
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/dist/dist.dev.js +298 -82
- package/dist/es5/api/layer-map.js +104 -17
- package/dist/es5/api/layer-map.js.map +1 -1
- package/dist/es5/api/maps-v3-client.js +191 -35
- package/dist/es5/api/maps-v3-client.js.map +1 -1
- package/dist/es5/api/parseMap.js +14 -4
- package/dist/es5/api/parseMap.js.map +1 -1
- package/dist/es5/config.js +11 -2
- package/dist/es5/config.js.map +1 -1
- package/dist/es5/layers/carto-layer.js +4 -17
- package/dist/es5/layers/carto-layer.js.map +1 -1
- package/dist/es5/style/color-bins-style.js.map +1 -1
- package/dist/es5/style/color-categories-style.js.map +1 -1
- package/dist/es5/style/color-continuous-style.js.map +1 -1
- package/dist/es5/style/utils.js +3 -1
- package/dist/es5/style/utils.js.map +1 -1
- package/dist/esm/api/layer-map.js +79 -14
- package/dist/esm/api/layer-map.js.map +1 -1
- package/dist/esm/api/maps-v3-client.js +90 -3
- package/dist/esm/api/maps-v3-client.js.map +1 -1
- package/dist/esm/api/parseMap.js +18 -4
- package/dist/esm/api/parseMap.js.map +1 -1
- package/dist/esm/config.js +10 -2
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/layers/carto-layer.js +4 -15
- package/dist/esm/layers/carto-layer.js.map +1 -1
- package/dist/esm/style/color-bins-style.js.map +1 -1
- package/dist/esm/style/color-categories-style.js.map +1 -1
- package/dist/esm/style/color-continuous-style.js.map +1 -1
- package/dist/esm/style/utils.js +3 -1
- package/dist/esm/style/utils.js.map +1 -1
- package/dist.min.js +138 -138
- package/package.json +9 -9
- package/src/api/layer-map.ts +76 -13
- package/src/api/maps-v3-client.ts +92 -4
- package/src/api/parseMap.ts +6 -2
- package/src/config.ts +12 -2
- package/src/layers/carto-layer.ts +9 -29
- package/src/style/color-bins-style.ts +25 -3
- package/src/style/color-categories-style.ts +28 -4
- package/src/style/color-continuous-style.ts +25 -3
- package/src/style/utils.ts +8 -4
- package/typed/api/layer-map.d.ts +12 -4
- package/typed/api/layer-map.d.ts.map +1 -1
- package/typed/api/maps-v3-client.d.ts.map +1 -1
- package/typed/config.d.ts +2 -0
- package/typed/config.d.ts.map +1 -1
- package/typed/layers/carto-layer.d.ts +2 -7
- package/typed/layers/carto-layer.d.ts.map +1 -1
- package/typed/style/color-bins-style.d.ts +22 -3
- package/typed/style/color-bins-style.d.ts.map +1 -1
- package/typed/style/color-categories-style.d.ts +24 -4
- package/typed/style/color-categories-style.d.ts.map +1 -1
- package/typed/style/color-continuous-style.d.ts +22 -3
- package/typed/style/color-continuous-style.d.ts.map +1 -1
- package/typed/style/utils.d.ts +3 -6
- package/typed/style/utils.d.ts.map +1 -1
package/typed/api/layer-map.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { scaleLinear, scaleOrdinal, scaleLog, scalePoint, scaleQuantile, scaleQuantize, scaleSqrt, scaleThreshold } from 'd3-scale';
|
|
2
2
|
import { Layer, _ConstructorOf as ConstructorOf } from '@deck.gl/core/typed';
|
|
3
|
+
import { MVTLayer } from '@deck.gl/geo-layers/typed';
|
|
4
|
+
import CartoTileLayer from '../layers/carto-tile-layer';
|
|
5
|
+
import H3TileLayer from '../layers/h3-tile-layer';
|
|
6
|
+
import QuadbinTileLayer from '../layers/quadbin-tile-layer';
|
|
3
7
|
declare const SCALE_FUNCS: {
|
|
4
8
|
linear: typeof scaleLinear;
|
|
5
9
|
ordinal: typeof scaleOrdinal;
|
|
@@ -27,6 +31,7 @@ export declare function getLayer(type: string, config: any, dataset: any): {
|
|
|
27
31
|
propMap: any;
|
|
28
32
|
defaultProps: any;
|
|
29
33
|
};
|
|
34
|
+
export declare function layerFromTileDataset(formatTiles: string | null | undefined, scheme: string): typeof CartoTileLayer | typeof H3TileLayer | typeof MVTLayer | typeof QuadbinTileLayer;
|
|
30
35
|
declare function domainFromValues(values: any, scaleType: SCALE_TYPE): any;
|
|
31
36
|
export declare function opacityToAlpha(opacity: any): number;
|
|
32
37
|
export declare function getColorValueAccessor({ name }: {
|
|
@@ -34,13 +39,16 @@ export declare function getColorValueAccessor({ name }: {
|
|
|
34
39
|
}, colorAggregation: any, data: any): any;
|
|
35
40
|
export declare function getColorAccessor({ name }: {
|
|
36
41
|
name: any;
|
|
37
|
-
}, scaleType: SCALE_TYPE, { colors, colorMap }: {
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
}, scaleType: SCALE_TYPE, { aggregation, range: { colors, colorMap } }: {
|
|
43
|
+
aggregation: any;
|
|
44
|
+
range: {
|
|
45
|
+
colors: any;
|
|
46
|
+
colorMap: any;
|
|
47
|
+
};
|
|
40
48
|
}, opacity: number | undefined, data: any): any;
|
|
41
49
|
export declare function getSizeAccessor({ name }: {
|
|
42
50
|
name: any;
|
|
43
|
-
}, scaleType: SCALE_TYPE, range: Iterable<Range>, data: any): any;
|
|
51
|
+
}, scaleType: SCALE_TYPE, aggregation: any, range: Iterable<Range>, data: any): any;
|
|
44
52
|
export declare function getTextAccessor({ name, type }: {
|
|
45
53
|
name: any;
|
|
46
54
|
type: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer-map.d.ts","sourceRoot":"","sources":["../../src/api/layer-map.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACf,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAC,KAAK,EAAE,cAAc,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"layer-map.d.ts","sourceRoot":"","sources":["../../src/api/layer-map.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACf,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAC,KAAK,EAAE,cAAc,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAiB,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAE7D,OAAO,cAAc,MAAM,4BAA4B,CAAC;AACxD,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAI5D,QAAA,MAAM,WAAW;;;;;;;;;CAShB,CAAC;AACF,oBAAY,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAIlD,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AA2DF,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,MAAM,KAAA,EACN,OAAO,KAAA,GACN;IAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC;IAAC,YAAY,EAAE,GAAG,CAAA;CAAC,CAmDhE;AAED,wBAAgB,oBAAoB,CAClC,WAAW,2BAAkC,EAC7C,MAAM,EAAE,MAAM,GACb,OAAO,cAAc,GAAG,OAAO,WAAW,GAAG,OAAO,QAAQ,GAAG,OAAO,gBAAgB,CAaxF;AA2CD,iBAAS,gBAAgB,CAAC,MAAM,KAAA,EAAE,SAAS,EAAE,UAAU,OActD;AA8BD,wBAAgB,cAAc,CAAC,OAAO,KAAA,UAErC;AAqBD,wBAAgB,qBAAqB,CAAC,EAAC,IAAI,EAAC;;CAAA,EAAE,gBAAgB,KAAA,EAAE,IAAI,EAAE,GAAG,OAIxE;AAED,wBAAgB,gBAAgB,CAC9B,EAAC,IAAI,EAAC;;CAAA,EACN,SAAS,EAAE,UAAU,EACrB,EAAC,WAAW,EAAE,KAAK,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAC;;;;;;CAAA,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,EAAE,GAAG,OAmCV;AAED,wBAAgB,eAAe,CAC7B,EAAC,IAAI,EAAC;;CAAA,EACN,SAAS,EAAE,UAAU,EACrB,WAAW,KAAA,EACX,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EACtB,IAAI,EAAE,GAAG,OAeV;AAUD,wBAAgB,eAAe,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC;;;CAAA,EAAE,IAAI,KAAA,OAMjD;AAED,wBAAgB,0BAA0B,CAAC,EAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAC;;;;CAAA,EAAE,MAAM,KAAA,qCAa3E;AAED,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps-v3-client.d.ts","sourceRoot":"","sources":["../../src/api/maps-v3-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"maps-v3-client.d.ts","sourceRoot":"","sources":["../../src/api/maps-v3-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAIL,sBAAsB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAIL,MAAM,EAGN,gBAAgB,EAChB,OAAO,EAEP,WAAW,EACX,UAAU,EAEX,MAAM,mBAAmB,CAAC;AA0F3B,aAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,sBAAsB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AA2CF,wBAAsB,gBAAgB,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,cAAc,EACd,mBAAmB,EACpB,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuBlD;AAsDD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AACD,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,WAAW,EACX,QAAQ,EACR,cAAc,EACd,mBAAmB,EACpB,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAoBtD;AAkMD,wBAAsB,QAAQ,CAAC,EAC7B,UAAU,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,SAAS,EACV,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;4BA8B6B,IAAI;;;;;;;;;GAiCjC"}
|
package/typed/config.d.ts
CHANGED
|
@@ -22,5 +22,7 @@ export interface CloudNativeCredentials {
|
|
|
22
22
|
export declare type Credentials = ClassicCredentials | CloudNativeCredentials;
|
|
23
23
|
export declare function setDefaultCredentials({ apiVersion, ...rest }: Partial<Credentials>): void;
|
|
24
24
|
export declare function getDefaultCredentials(): Credentials;
|
|
25
|
+
export declare type V3Endpoint = 'maps' | 'stats';
|
|
25
26
|
export declare function buildMapsUrlFromBase(apiBaseUrl: string): string;
|
|
27
|
+
export declare function buildStatsUrlFromBase(apiBaseUrl: string): string;
|
|
26
28
|
//# sourceMappingURL=config.d.ts.map
|
package/typed/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;CAEhC,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,WAAW,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AAKtE,wBAAgB,qBAAqB,CAAC,EAAC,UAAU,EAAE,GAAG,IAAI,EAAC,EAAE,OAAO,CAAC,WAAW,CAAC,QAchF;AAED,wBAAgB,qBAAqB,IAAI,WAAW,CAEnD;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;CAEhC,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,WAAW,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AAKtE,wBAAgB,qBAAqB,CAAC,EAAC,UAAU,EAAE,GAAG,IAAI,EAAC,EAAE,OAAO,CAAC,WAAW,CAAC,QAchF;AAED,wBAAgB,qBAAqB,IAAI,WAAW,CAEnD;AAED,oBAAY,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAW1C,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompositeLayer,
|
|
1
|
+
import { CompositeLayer, CompositeLayerProps, Layer, LayerProps, UpdateParameters } from '@deck.gl/core/typed';
|
|
2
2
|
import { MapType, TileFormat } from '../api/maps-api-common';
|
|
3
3
|
import { Credentials } from '../config';
|
|
4
4
|
/** All properties supported by CartoLayer. */
|
|
@@ -78,12 +78,7 @@ export default class CartoLayer<ExtraProps = {}> extends CompositeLayer<Required
|
|
|
78
78
|
initializeState(): void;
|
|
79
79
|
get isLoaded(): boolean;
|
|
80
80
|
_checkProps(props: CartoLayerProps): void;
|
|
81
|
-
updateState({ props, oldProps, changeFlags }:
|
|
82
|
-
props: CartoLayerProps;
|
|
83
|
-
oldProps: CartoLayerProps;
|
|
84
|
-
context: any;
|
|
85
|
-
changeFlags: ChangeFlags;
|
|
86
|
-
}): void;
|
|
81
|
+
updateState({ props, oldProps, changeFlags }: UpdateParameters<this>): void;
|
|
87
82
|
_updateData(): Promise<void>;
|
|
88
83
|
_getSubLayerAndProps(): [any, LayerProps];
|
|
89
84
|
renderLayers(): Layer | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carto-layer.d.ts","sourceRoot":"","sources":["../../src/layers/carto-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"carto-layer.d.ts","sourceRoot":"","sources":["../../src/layers/carto-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,UAAU,EAEV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAKvB,OAAO,EAIL,OAAO,EAEP,UAAU,EACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,WAAW,EAEZ,MAAM,WAAW,CAAC;AA4CnB,8CAA8C;AAC9C,oBAAY,eAAe,CAAC,KAAK,GAAG,GAAG,IAAI,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAEzF,sCAAsC;AACtC,aAAK,gBAAgB,GAAG;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;OAOG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAErC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,iHAAiH;IACjH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,UAAU,GAAG,EAAE,CAAE,SAAQ,cAAc,CACrE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,UAAU,CACxC;IACC,MAAM,CAAC,SAAS,SAAgB;IAChC,MAAM,CAAC,YAAY,MAAuB;IAE1C,eAAe,IAAI,IAAI;IAOvB,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAuCzC,WAAW,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAoB5D,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAuClC,oBAAoB,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC;IAuBzC,YAAY,IAAI,KAAK,GAAG,IAAI;CAqB7B"}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import { AccessorFunction } from '@deck.gl/core/typed';
|
|
2
|
+
import { Feature } from 'geojson';
|
|
1
3
|
import { Color } from './palette';
|
|
2
4
|
import { AttributeSelector } from './utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Helper function for quickly creating a color bins style based on `d3` `scaleThreshold`.
|
|
7
|
+
*
|
|
8
|
+
* Data values of each attribute are rounded down to the nearest value in the domain and are then
|
|
9
|
+
* styled with the corresponding color.
|
|
10
|
+
*
|
|
11
|
+
* @return accessor that maps objects to `Color` values
|
|
12
|
+
*/
|
|
13
|
+
export default function colorBins<DataT = Feature>({ attr, domain, colors, nullColor }: {
|
|
14
|
+
/** Attribute or column to symbolize by. */
|
|
15
|
+
attr: AttributeSelector<DataT, number>;
|
|
16
|
+
/** Category list. Must be a valid list of categories. */
|
|
5
17
|
domain: number[];
|
|
18
|
+
/**
|
|
19
|
+
* Color assigned to each domain value.
|
|
20
|
+
*
|
|
21
|
+
* Either Array of colors in RGBA or valid named CARTOColors palette.
|
|
22
|
+
* @default `PurpOr`
|
|
23
|
+
*/
|
|
6
24
|
colors?: string | Color[];
|
|
25
|
+
/** Color for null values. @default: [204, 204, 204] */
|
|
7
26
|
nullColor?: Color;
|
|
8
|
-
}):
|
|
27
|
+
}): AccessorFunction<DataT, Color>;
|
|
9
28
|
//# sourceMappingURL=color-bins-style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-bins-style.d.ts","sourceRoot":"","sources":["../../src/style/color-bins-style.ts"],"names":[],"mappings":"AACA,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"color-bins-style.d.ts","sourceRoot":"","sources":["../../src/style/color-bins-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,GAAG,OAAO,EAAE,EACjD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAWjC"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
+
import { AccessorFunction } from '@deck.gl/core/typed';
|
|
2
|
+
import { Feature } from 'geojson';
|
|
1
3
|
import { Color } from './palette';
|
|
2
4
|
import { AttributeSelector } from './utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Helper function for quickly creating a color category style.
|
|
7
|
+
*
|
|
8
|
+
* Data values of each attribute listed in the domain are mapped one to one
|
|
9
|
+
* with corresponding colors in the range.
|
|
10
|
+
*
|
|
11
|
+
* @return accessor that maps objects to `Color` values
|
|
12
|
+
*/
|
|
13
|
+
export default function colorCategories<DataT = Feature>({ attr, domain, colors, nullColor, othersColor }: {
|
|
14
|
+
/** Attribute or column to symbolize by */
|
|
15
|
+
attr: string | AttributeSelector<DataT, number | string>;
|
|
16
|
+
/** Category list. Must be a valid list of categories. */
|
|
17
|
+
domain: number[] | string[];
|
|
18
|
+
/**
|
|
19
|
+
* Color assigned to each domain value.
|
|
20
|
+
*
|
|
21
|
+
* Either Array of colors in RGBA or valid named CARTOColors palette.
|
|
22
|
+
* @default `PurpOr`
|
|
23
|
+
*/
|
|
6
24
|
colors: string | Color[];
|
|
25
|
+
/** Color for null values. @default: [204, 204, 204] */
|
|
7
26
|
nullColor?: Color;
|
|
27
|
+
/** Fallback color for a category not correctly assigned. @default: [119, 119, 119] */
|
|
8
28
|
othersColor?: Color;
|
|
9
|
-
}):
|
|
29
|
+
}): AccessorFunction<DataT, Color>;
|
|
10
30
|
//# sourceMappingURL=color-categories-style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-categories-style.d.ts","sourceRoot":"","sources":["../../src/style/color-categories-style.ts"],"names":[],"mappings":"AAAA,OAAmB,EAAC,KAAK,EAA4C,MAAM,WAAW,CAAC;AACvF,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"color-categories-style.d.ts","sourceRoot":"","sources":["../../src/style/color-categories-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA4C,MAAM,WAAW,CAAC;AACvF,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACtB,WAA0B,EAC3B,EAAE;IACD,0CAA0C;IAC1C,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAEzD,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAEzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB,sFAAsF;IACtF,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAgBjC"}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import { AccessorFunction } from '@deck.gl/core/typed';
|
|
2
|
+
import { Feature } from 'geojson';
|
|
1
3
|
import { Color } from './palette';
|
|
2
4
|
import { AttributeSelector } from './utils';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Helper function for quickly creating a color continuous style.
|
|
7
|
+
*
|
|
8
|
+
* Data values of each field are interpolated linearly across values in the domain and
|
|
9
|
+
* are then styled with a blend of the corresponding color in the range.
|
|
10
|
+
*
|
|
11
|
+
* @return accessor that maps objects to `Color` values
|
|
12
|
+
*/
|
|
13
|
+
export default function colorContinuous<DataT = Feature>({ attr, domain, colors, nullColor }: {
|
|
14
|
+
/** Attribute or column to symbolize by. */
|
|
15
|
+
attr: AttributeSelector<DataT, number>;
|
|
16
|
+
/** Attribute domain to define the data range. */
|
|
5
17
|
domain: number[];
|
|
18
|
+
/**
|
|
19
|
+
* Color assigned to each domain value.
|
|
20
|
+
*
|
|
21
|
+
* Either Array of colors in RGBA or valid named CARTOColors palette.
|
|
22
|
+
* @default `PurpOr`
|
|
23
|
+
*/
|
|
6
24
|
colors?: string | Color[];
|
|
25
|
+
/** Color for null values. @default: [204, 204, 204]*/
|
|
7
26
|
nullColor?: Color;
|
|
8
|
-
}):
|
|
27
|
+
}): AccessorFunction<DataT, Color>;
|
|
9
28
|
//# sourceMappingURL=color-continuous-style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-continuous-style.d.ts","sourceRoot":"","sources":["../../src/style/color-continuous-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color-continuous-style.d.ts","sourceRoot":"","sources":["../../src/style/color-continuous-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAUjC"}
|
package/typed/style/utils.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare type AttributeSelector = string | ((d: Row) => unknown);
|
|
5
|
-
export declare function getAttrValue(attr: AttributeSelector, d: Row): unknown;
|
|
1
|
+
import { Feature } from 'geojson';
|
|
2
|
+
export declare type AttributeSelector<DataT = Feature, OutT = any> = string | ((d: DataT) => OutT);
|
|
3
|
+
export declare function getAttrValue<DataT = Feature, OutT = any>(attr: string | AttributeSelector<DataT, OutT>, d: DataT): OutT;
|
|
6
4
|
export declare function assert(condition: any, message?: string): asserts condition;
|
|
7
|
-
export {};
|
|
8
5
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/style/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/style/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAIhC,oBAAY,iBAAiB,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;AAE3F,wBAAgB,YAAY,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,EACtD,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,EAC7C,CAAC,EAAE,KAAK,GACP,IAAI,CASN;AAED,wBAAgB,MAAM,CAAC,SAAS,KAAA,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,SAAS,CAIjE"}
|