@carto/api-client 0.5.31 → 0.5.32-alpha.02a4470.133
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/CHANGELOG.md +3 -0
- package/build/api-client.cjs +527 -3
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +42 -5
- package/build/api-client.d.ts +42 -5
- package/build/api-client.js +520 -3
- package/build/api-client.js.map +1 -1
- package/package.json +2 -2
- package/src/fetch-map/layer-map.ts +48 -0
- package/src/fetch-map/parse-map.ts +133 -10
- package/src/fetch-map/pattern-atlas.ts +461 -0
- package/src/fetch-map/patterns/checker-large.png +0 -0
- package/src/fetch-map/patterns/checker-large.svg +1 -0
- package/src/fetch-map/patterns/checker-medium.png +0 -0
- package/src/fetch-map/patterns/checker-medium.svg +1 -0
- package/src/fetch-map/patterns/checker-small.png +0 -0
- package/src/fetch-map/patterns/checker-small.svg +1 -0
- package/src/fetch-map/patterns/cross-hatch-large.png +0 -0
- package/src/fetch-map/patterns/cross-hatch-large.svg +1 -0
- package/src/fetch-map/patterns/cross-hatch-medium.png +0 -0
- package/src/fetch-map/patterns/cross-hatch-medium.svg +1 -0
- package/src/fetch-map/patterns/cross-hatch-small.png +0 -0
- package/src/fetch-map/patterns/cross-hatch-small.svg +1 -0
- package/src/fetch-map/patterns/diag-left-large.png +0 -0
- package/src/fetch-map/patterns/diag-left-large.svg +1 -0
- package/src/fetch-map/patterns/diag-left-medium.png +0 -0
- package/src/fetch-map/patterns/diag-left-medium.svg +1 -0
- package/src/fetch-map/patterns/diag-left-small.png +0 -0
- package/src/fetch-map/patterns/diag-left-small.svg +1 -0
- package/src/fetch-map/patterns/diag-right-large.png +0 -0
- package/src/fetch-map/patterns/diag-right-large.svg +1 -0
- package/src/fetch-map/patterns/diag-right-medium.png +0 -0
- package/src/fetch-map/patterns/diag-right-medium.svg +1 -0
- package/src/fetch-map/patterns/diag-right-small.png +0 -0
- package/src/fetch-map/patterns/diag-right-small.svg +1 -0
- package/src/fetch-map/patterns/dots-large.png +0 -0
- package/src/fetch-map/patterns/dots-large.svg +1 -0
- package/src/fetch-map/patterns/dots-medium.png +0 -0
- package/src/fetch-map/patterns/dots-medium.svg +1 -0
- package/src/fetch-map/patterns/dots-small.png +0 -0
- package/src/fetch-map/patterns/dots-small.svg +1 -0
- package/src/fetch-map/patterns/hlines-large.png +0 -0
- package/src/fetch-map/patterns/hlines-large.svg +1 -0
- package/src/fetch-map/patterns/hlines-medium.png +0 -0
- package/src/fetch-map/patterns/hlines-medium.svg +1 -0
- package/src/fetch-map/patterns/hlines-small.png +0 -0
- package/src/fetch-map/patterns/hlines-small.svg +1 -0
- package/src/fetch-map/patterns/solid.png +0 -0
- package/src/fetch-map/patterns/solid.svg +1 -0
- package/src/fetch-map/patterns/vlines-large.png +0 -0
- package/src/fetch-map/patterns/vlines-large.svg +1 -0
- package/src/fetch-map/patterns/vlines-medium.png +0 -0
- package/src/fetch-map/patterns/vlines-medium.svg +1 -0
- package/src/fetch-map/patterns/vlines-small.png +0 -0
- package/src/fetch-map/patterns/vlines-small.svg +1 -0
- package/src/fetch-map/types.ts +44 -0
- package/src/global.d.ts +10 -0
package/src/fetch-map/types.ts
CHANGED
|
@@ -28,6 +28,12 @@ export type VisualChannels = {
|
|
|
28
28
|
strokeColorField?: VisualChannelField;
|
|
29
29
|
strokeColorScale?: ScaleType;
|
|
30
30
|
|
|
31
|
+
lineStyleField?: VisualChannelField;
|
|
32
|
+
lineStyleScale?: ScaleType;
|
|
33
|
+
|
|
34
|
+
fillPatternField?: VisualChannelField;
|
|
35
|
+
fillPatternScale?: ScaleType;
|
|
36
|
+
|
|
31
37
|
heightField?: VisualChannelField;
|
|
32
38
|
heightScale?: ScaleType;
|
|
33
39
|
|
|
@@ -52,6 +58,28 @@ export type CustomMarkersRange = {
|
|
|
52
58
|
othersMarker?: string;
|
|
53
59
|
};
|
|
54
60
|
|
|
61
|
+
// Per-category mapping for by-column stroke styles. `dashArray` is the [dash, gap]
|
|
62
|
+
// tuple that flows to deck.gl's `getDashArray`.
|
|
63
|
+
export type LineStyleRange = {
|
|
64
|
+
dashArrayMap: {
|
|
65
|
+
value: string;
|
|
66
|
+
dashArray: [number, number];
|
|
67
|
+
}[];
|
|
68
|
+
othersDashArray?: [number, number];
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Per-category mapping for by-column fill patterns. `pattern` is the base pattern name
|
|
72
|
+
// (e.g. 'hlines') or the density-agnostic 'solid' / 'none'; density is applied uniformly
|
|
73
|
+
// from `visConfig.fillPatternDensity`, so the resolved atlas key is `${pattern}-${density}`
|
|
74
|
+
// (or the bare 'solid' / 'none').
|
|
75
|
+
export type FillPatternRange = {
|
|
76
|
+
patternMap: {
|
|
77
|
+
value: string;
|
|
78
|
+
pattern: string;
|
|
79
|
+
}[];
|
|
80
|
+
othersPattern?: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
55
83
|
export type ColorBand = 'red' | 'green' | 'blue' | 'alpha';
|
|
56
84
|
|
|
57
85
|
export type RasterLayerConfigColorBand = {
|
|
@@ -95,6 +123,22 @@ export type VisConfig = {
|
|
|
95
123
|
strokeColorAggregationDomain?: [number, number];
|
|
96
124
|
strokeOpacity?: number;
|
|
97
125
|
strokeColorRange?: ColorRange;
|
|
126
|
+
stroked?: boolean;
|
|
127
|
+
|
|
128
|
+
// `dashArray` is [dash, gap] relative to stroke width. Dotted is [0, gap] + lineCapRounded.
|
|
129
|
+
lineStyle?: 'solid' | 'dashed' | 'dotted';
|
|
130
|
+
dashArray?: [number, number];
|
|
131
|
+
lineStyleRange?: LineStyleRange | null;
|
|
132
|
+
|
|
133
|
+
// Fill pattern (Phase 2). `fillPatternEnabled` is the Solid|Pattern master toggle the
|
|
134
|
+
// (always-attached) FillStyleExtension reads. The pattern is tinted by the existing
|
|
135
|
+
// `fillColor` — there is no separate pattern-color field. `fillPatternSize` maps to
|
|
136
|
+
// deck.gl's getFillPatternScale (1 = 100%).
|
|
137
|
+
fillPatternEnabled?: boolean;
|
|
138
|
+
fillPattern?: string;
|
|
139
|
+
fillPatternDensity?: 'small' | 'medium' | 'large';
|
|
140
|
+
fillPatternSize?: number;
|
|
141
|
+
fillPatternRange?: FillPatternRange | null;
|
|
98
142
|
|
|
99
143
|
heightRange?: number[];
|
|
100
144
|
heightAggregation?: string;
|
package/src/global.d.ts
CHANGED
|
@@ -3,3 +3,13 @@ declare const deck: {VERSION: string | undefined} | undefined;
|
|
|
3
3
|
|
|
4
4
|
/** Defined by tsup. */
|
|
5
5
|
declare const TSUP_FORMAT: 'esm' | 'cjs';
|
|
6
|
+
|
|
7
|
+
/** Pattern assets imported as inline data URLs (tsup `dataurl` loader). */
|
|
8
|
+
declare module '*.png' {
|
|
9
|
+
const dataUrl: string;
|
|
10
|
+
export default dataUrl;
|
|
11
|
+
}
|
|
12
|
+
declare module '*.svg' {
|
|
13
|
+
const dataUrl: string;
|
|
14
|
+
export default dataUrl;
|
|
15
|
+
}
|