@antv/l7-layers 2.22.2 → 2.22.3
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.
|
@@ -234,9 +234,11 @@ export default class FeatureScalePlugin {
|
|
|
234
234
|
}
|
|
235
235
|
// 生成Scale 默认配置
|
|
236
236
|
createScaleConfig(type, field, scaleOption, data) {
|
|
237
|
-
const cfg = {
|
|
237
|
+
const cfg = _objectSpread(_objectSpread({}, scaleOption), {}, {
|
|
238
238
|
type
|
|
239
|
-
};
|
|
239
|
+
});
|
|
240
|
+
if (cfg !== null && cfg !== void 0 && cfg.domain) return cfg;
|
|
241
|
+
|
|
240
242
|
// quantile domain 需要根据ID 进行去重
|
|
241
243
|
let values = [];
|
|
242
244
|
if (type === ScaleTypes.QUANTILE) {
|
|
@@ -249,9 +251,7 @@ export default class FeatureScalePlugin {
|
|
|
249
251
|
} else {
|
|
250
252
|
values = (data === null || data === void 0 ? void 0 : data.map(item => item[field])) || [];
|
|
251
253
|
}
|
|
252
|
-
if (
|
|
253
|
-
cfg.domain = scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.domain;
|
|
254
|
-
} else if (type === ScaleTypes.CAT || type === ScaleTypes.IDENTITY) {
|
|
254
|
+
if (type === ScaleTypes.CAT || type === ScaleTypes.IDENTITY) {
|
|
255
255
|
cfg.domain = uniq(values);
|
|
256
256
|
} else if (type === ScaleTypes.QUANTILE) {
|
|
257
257
|
cfg.domain = values;
|
|
@@ -263,7 +263,7 @@ export default class FeatureScalePlugin {
|
|
|
263
263
|
// linear/Power/log
|
|
264
264
|
cfg.domain = extent(values);
|
|
265
265
|
}
|
|
266
|
-
return
|
|
266
|
+
return cfg;
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
// 创建Scale 实例
|
|
@@ -243,9 +243,11 @@ class FeatureScalePlugin {
|
|
|
243
243
|
}
|
|
244
244
|
// 生成Scale 默认配置
|
|
245
245
|
createScaleConfig(type, field, scaleOption, data) {
|
|
246
|
-
const cfg = {
|
|
246
|
+
const cfg = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, scaleOption), {}, {
|
|
247
247
|
type
|
|
248
|
-
};
|
|
248
|
+
});
|
|
249
|
+
if (cfg !== null && cfg !== void 0 && cfg.domain) return cfg;
|
|
250
|
+
|
|
249
251
|
// quantile domain 需要根据ID 进行去重
|
|
250
252
|
let values = [];
|
|
251
253
|
if (type === _l7Core.ScaleTypes.QUANTILE) {
|
|
@@ -258,9 +260,7 @@ class FeatureScalePlugin {
|
|
|
258
260
|
} else {
|
|
259
261
|
values = (data === null || data === void 0 ? void 0 : data.map(item => item[field])) || [];
|
|
260
262
|
}
|
|
261
|
-
if (
|
|
262
|
-
cfg.domain = scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.domain;
|
|
263
|
-
} else if (type === _l7Core.ScaleTypes.CAT || type === _l7Core.ScaleTypes.IDENTITY) {
|
|
263
|
+
if (type === _l7Core.ScaleTypes.CAT || type === _l7Core.ScaleTypes.IDENTITY) {
|
|
264
264
|
cfg.domain = uniq(values);
|
|
265
265
|
} else if (type === _l7Core.ScaleTypes.QUANTILE) {
|
|
266
266
|
cfg.domain = values;
|
|
@@ -272,7 +272,7 @@ class FeatureScalePlugin {
|
|
|
272
272
|
// linear/Power/log
|
|
273
273
|
cfg.domain = (0, _d3Array.extent)(values);
|
|
274
274
|
}
|
|
275
|
-
return
|
|
275
|
+
return cfg;
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
// 创建Scale 实例
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.22.
|
|
3
|
+
"version": "2.22.3",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "https://github.com/orgs/antvis/people",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"gl-matrix": "^3.1.0",
|
|
34
34
|
"gl-vec2": "^1.3.0",
|
|
35
35
|
"polyline-miter-util": "^1.0.1",
|
|
36
|
-
"@antv/l7-core": "2.22.
|
|
37
|
-
"@antv/l7-
|
|
38
|
-
"@antv/l7-
|
|
39
|
-
"@antv/l7-utils": "2.22.
|
|
36
|
+
"@antv/l7-core": "2.22.3",
|
|
37
|
+
"@antv/l7-source": "2.22.3",
|
|
38
|
+
"@antv/l7-maps": "2.22.3",
|
|
39
|
+
"@antv/l7-utils": "2.22.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/d3-array": "^2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/d3-scale": "^2.1.1",
|
|
46
46
|
"@types/earcut": "^2.1.0",
|
|
47
47
|
"@types/gl-matrix": "^2.4.5",
|
|
48
|
-
"@antv/l7-test-utils": "^2.22.
|
|
48
|
+
"@antv/l7-test-utils": "^2.22.3"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public",
|