@visactor/vchart 1.13.23 → 1.13.24
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/build/es5/index.js +1 -1
- package/build/index.es.js +29 -0
- package/build/index.js +29 -0
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/compile/compiler.d.ts +2 -0
- package/cjs/compile/compiler.js +15 -3
- package/cjs/compile/compiler.js.map +1 -1
- package/esm/compile/compiler.d.ts +2 -0
- package/esm/compile/compiler.js +16 -4
- package/esm/compile/compiler.js.map +1 -1
- package/package.json +5 -5
package/build/index.es.js
CHANGED
|
@@ -58354,6 +58354,33 @@ class Compiler {
|
|
|
58354
58354
|
});
|
|
58355
58355
|
}
|
|
58356
58356
|
}
|
|
58357
|
+
_isGeoRegionRoamDragEnabled() {
|
|
58358
|
+
var _a, _b;
|
|
58359
|
+
const chartSpec = (_b = (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.getSpec) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
58360
|
+
const regions = chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.region;
|
|
58361
|
+
if (!isArray$1(regions)) {
|
|
58362
|
+
return false;
|
|
58363
|
+
}
|
|
58364
|
+
return regions.some((region) => {
|
|
58365
|
+
var _a;
|
|
58366
|
+
if ((region === null || region === void 0 ? void 0 : region.coordinate) !== 'geo' || !region.roam) {
|
|
58367
|
+
return false;
|
|
58368
|
+
}
|
|
58369
|
+
if (region.roam === true) {
|
|
58370
|
+
return true;
|
|
58371
|
+
}
|
|
58372
|
+
return (_a = region.roam.drag) !== null && _a !== void 0 ? _a : true;
|
|
58373
|
+
});
|
|
58374
|
+
}
|
|
58375
|
+
_shouldDisableCanvasTouchAction() {
|
|
58376
|
+
if (!isTrueBrowser(this._option.mode)) {
|
|
58377
|
+
return false;
|
|
58378
|
+
}
|
|
58379
|
+
const supportsTouchEvents = isValid$1(this._option.supportsTouchEvents)
|
|
58380
|
+
? this._option.supportsTouchEvents
|
|
58381
|
+
: vglobal.supportsTouchEvents;
|
|
58382
|
+
return supportsTouchEvents === false && this._isGeoRegionRoamDragEnabled();
|
|
58383
|
+
}
|
|
58357
58384
|
_setCanvasStyle() {
|
|
58358
58385
|
if (!this._view) {
|
|
58359
58386
|
return;
|
|
@@ -58364,6 +58391,7 @@ class Compiler {
|
|
|
58364
58391
|
const canvas = this.getCanvas();
|
|
58365
58392
|
if (canvas) {
|
|
58366
58393
|
canvas.style.display = 'block';
|
|
58394
|
+
canvas.style.touchAction = this._shouldDisableCanvasTouchAction() ? 'none' : '';
|
|
58367
58395
|
}
|
|
58368
58396
|
}
|
|
58369
58397
|
}
|
|
@@ -58410,6 +58438,7 @@ class Compiler {
|
|
|
58410
58438
|
return;
|
|
58411
58439
|
}
|
|
58412
58440
|
chart.compile();
|
|
58441
|
+
this._setCanvasStyle();
|
|
58413
58442
|
chart.afterCompile();
|
|
58414
58443
|
this.updateDepend();
|
|
58415
58444
|
this.compileInteractions();
|
package/build/index.js
CHANGED
|
@@ -58360,6 +58360,33 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58360
58360
|
});
|
|
58361
58361
|
}
|
|
58362
58362
|
}
|
|
58363
|
+
_isGeoRegionRoamDragEnabled() {
|
|
58364
|
+
var _a, _b;
|
|
58365
|
+
const chartSpec = (_b = (_a = this._compileChart) === null || _a === void 0 ? void 0 : _a.getSpec) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
58366
|
+
const regions = chartSpec === null || chartSpec === void 0 ? void 0 : chartSpec.region;
|
|
58367
|
+
if (!isArray$1(regions)) {
|
|
58368
|
+
return false;
|
|
58369
|
+
}
|
|
58370
|
+
return regions.some((region) => {
|
|
58371
|
+
var _a;
|
|
58372
|
+
if ((region === null || region === void 0 ? void 0 : region.coordinate) !== 'geo' || !region.roam) {
|
|
58373
|
+
return false;
|
|
58374
|
+
}
|
|
58375
|
+
if (region.roam === true) {
|
|
58376
|
+
return true;
|
|
58377
|
+
}
|
|
58378
|
+
return (_a = region.roam.drag) !== null && _a !== void 0 ? _a : true;
|
|
58379
|
+
});
|
|
58380
|
+
}
|
|
58381
|
+
_shouldDisableCanvasTouchAction() {
|
|
58382
|
+
if (!isTrueBrowser(this._option.mode)) {
|
|
58383
|
+
return false;
|
|
58384
|
+
}
|
|
58385
|
+
const supportsTouchEvents = isValid$1(this._option.supportsTouchEvents)
|
|
58386
|
+
? this._option.supportsTouchEvents
|
|
58387
|
+
: vglobal.supportsTouchEvents;
|
|
58388
|
+
return supportsTouchEvents === false && this._isGeoRegionRoamDragEnabled();
|
|
58389
|
+
}
|
|
58363
58390
|
_setCanvasStyle() {
|
|
58364
58391
|
if (!this._view) {
|
|
58365
58392
|
return;
|
|
@@ -58370,6 +58397,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58370
58397
|
const canvas = this.getCanvas();
|
|
58371
58398
|
if (canvas) {
|
|
58372
58399
|
canvas.style.display = 'block';
|
|
58400
|
+
canvas.style.touchAction = this._shouldDisableCanvasTouchAction() ? 'none' : '';
|
|
58373
58401
|
}
|
|
58374
58402
|
}
|
|
58375
58403
|
}
|
|
@@ -58416,6 +58444,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58416
58444
|
return;
|
|
58417
58445
|
}
|
|
58418
58446
|
chart.compile();
|
|
58447
|
+
this._setCanvasStyle();
|
|
58419
58448
|
chart.afterCompile();
|
|
58420
58449
|
this.updateDepend();
|
|
58421
58450
|
this.compileInteractions();
|