@visactor/vrender-components 0.20.6-alpha.0 → 0.20.6-alpha.2
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/cjs/axis/grid/base.d.ts +1 -0
- package/cjs/axis/grid/base.js +9 -3
- package/cjs/axis/grid/base.js.map +1 -1
- package/cjs/axis/grid/circle.d.ts +1 -0
- package/cjs/axis/grid/circle.js +4 -0
- package/cjs/axis/grid/circle.js.map +1 -1
- package/cjs/axis/grid/line.d.ts +2 -0
- package/cjs/axis/grid/line.js +9 -5
- package/cjs/axis/grid/line.js.map +1 -1
- package/cjs/axis/line.js +3 -2
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/overlap/auto-hide.d.ts +2 -1
- package/cjs/axis/overlap/auto-hide.js +29 -33
- package/cjs/axis/overlap/auto-hide.js.map +1 -1
- package/cjs/axis/overlap/util.js +11 -10
- package/cjs/axis/overlap/util.js.map +1 -1
- package/cjs/axis/tick-data/continuous.js +29 -5
- package/cjs/axis/tick-data/continuous.js.map +1 -1
- package/cjs/axis/tick-data/util.d.ts +1 -4
- package/cjs/axis/tick-data/util.js +2 -13
- package/cjs/axis/tick-data/util.js.map +1 -1
- package/cjs/axis/type.d.ts +3 -1
- package/cjs/axis/type.js.map +1 -1
- package/cjs/axis/util.d.ts +3 -1
- package/cjs/axis/util.js +16 -2
- package/cjs/axis/util.js.map +1 -1
- package/cjs/brush/type.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.js +1 -1
- package/cjs/label/arc.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +5 -9
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/legend/discrete/type.d.ts +0 -1
- package/cjs/legend/discrete/type.js.map +1 -1
- package/cjs/scrollbar/scrollbar.d.ts +1 -10
- package/cjs/scrollbar/scrollbar.js +6 -6
- package/cjs/scrollbar/scrollbar.js.map +1 -1
- package/dist/index.es.js +251 -137
- package/es/axis/grid/base.d.ts +1 -0
- package/es/axis/grid/base.js +8 -4
- package/es/axis/grid/base.js.map +1 -1
- package/es/axis/grid/circle.d.ts +1 -0
- package/es/axis/grid/circle.js +4 -0
- package/es/axis/grid/circle.js.map +1 -1
- package/es/axis/grid/line.d.ts +2 -0
- package/es/axis/grid/line.js +9 -5
- package/es/axis/grid/line.js.map +1 -1
- package/es/axis/line.js +3 -2
- package/es/axis/line.js.map +1 -1
- package/es/axis/overlap/auto-hide.d.ts +2 -1
- package/es/axis/overlap/auto-hide.js +25 -28
- package/es/axis/overlap/auto-hide.js.map +1 -1
- package/es/axis/overlap/util.js +10 -10
- package/es/axis/overlap/util.js.map +1 -1
- package/es/axis/tick-data/continuous.js +28 -5
- package/es/axis/tick-data/continuous.js.map +1 -1
- package/es/axis/tick-data/util.d.ts +1 -4
- package/es/axis/tick-data/util.js +0 -10
- package/es/axis/tick-data/util.js.map +1 -1
- package/es/axis/type.d.ts +3 -1
- package/es/axis/type.js.map +1 -1
- package/es/axis/util.d.ts +3 -1
- package/es/axis/util.js +14 -1
- package/es/axis/util.js.map +1 -1
- package/es/brush/type.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/arc.js +1 -1
- package/es/label/arc.js.map +1 -1
- package/es/legend/discrete/discrete.js +5 -9
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/legend/discrete/type.d.ts +0 -1
- package/es/legend/discrete/type.js.map +1 -1
- package/es/scrollbar/scrollbar.d.ts +1 -10
- package/es/scrollbar/scrollbar.js +6 -6
- package/es/scrollbar/scrollbar.js.map +1 -1
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, Point, PointService, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, cos, sin, pi, isArray, pointAt, isNumber, getDecimalPlaces, isNil, Color, has, normalTransform, isValidUrl, isBase64, acos, sqrt, transformBoundsWithMatrix, arrayEqual, getContextFont, clampAngleByRadian, asin, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, crossProduct, isValid, isEmpty, rectInsideAnotherRect, radianToDegree, getAngleByPoint, polarToCartesian, array, isValidNumber, calculateAnchorOfBounds, computeQuadrant, isGreater, isLess, isNumberClose, normalizeAngle, flattenArray, cloneDeep, get,
|
|
1
|
+
import { tau, halfPi as halfPi$1, AABBBounds, degreeToRadian, Point, PointService, abs, max, min, atan2, epsilon, Matrix, pi2, Logger, TextMeasure, EventEmitter, isBoolean, isObject, isFunction, isString, cos, sin, pi, isArray, pointAt, isNumber, getDecimalPlaces, isNil, Color, OBBBounds, has, normalTransform, isValidUrl, isBase64, acos, sqrt, transformBoundsWithMatrix, arrayEqual, getContextFont, rotatePoint, clampAngleByRadian, asin, Bounds, getRectIntersect, isRectIntersect, isPlainObject, merge, clamp, clampRange, normalizePadding, debounce, throttle, hexToRgb, crossProduct, isValid, isEmpty, rectInsideAnotherRect, radianToDegree, getAngleByPoint, polarToCartesian, array, isValidNumber, calculateAnchorOfBounds, computeQuadrant, isGreater, isLess, isNumberClose, normalizeAngle, flattenArray, cloneDeep, get, last, isRotateAABBIntersect, mixin, isEqual, interpolateString, minInArray, maxInArray, binaryFuzzySearchInNumberRange, polygonContainPoint } from '@visactor/vutils';
|
|
2
2
|
import { isContinuous, isDiscrete, LinearScale } from '@visactor/vscale';
|
|
3
3
|
|
|
4
4
|
class Generator {
|
|
@@ -4466,6 +4466,9 @@ class Graphic extends Node {
|
|
|
4466
4466
|
get AABBBounds() {
|
|
4467
4467
|
return this.tryUpdateAABBBounds("imprecise" === this.attribute.boundsMode);
|
|
4468
4468
|
}
|
|
4469
|
+
get OBBBounds() {
|
|
4470
|
+
return this.tryUpdateOBBBounds();
|
|
4471
|
+
}
|
|
4469
4472
|
get globalAABBBounds() {
|
|
4470
4473
|
return this.tryUpdateGlobalAABBBounds();
|
|
4471
4474
|
}
|
|
@@ -4478,7 +4481,7 @@ class Graphic extends Node {
|
|
|
4478
4481
|
constructor() {
|
|
4479
4482
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4480
4483
|
var _a;
|
|
4481
|
-
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
4484
|
+
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background ? this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
4482
4485
|
}
|
|
4483
4486
|
setMode(mode) {
|
|
4484
4487
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -4512,13 +4515,22 @@ class Graphic extends Node {
|
|
|
4512
4515
|
const bounds = this.doUpdateAABBBounds(full);
|
|
4513
4516
|
return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), bounds;
|
|
4514
4517
|
}
|
|
4518
|
+
tryUpdateOBBBounds() {
|
|
4519
|
+
if (this._OBBBounds || (this._OBBBounds = new OBBBounds()), this.tryUpdateAABBBounds(), this.updateOBBBoundsStamp === this.updateAABBBoundsStamp) return this._OBBBounds;
|
|
4520
|
+
if (this.updateOBBBoundsStamp = this.updateAABBBoundsStamp, !this.valid) return this._OBBBounds.clear(), this._OBBBounds;
|
|
4521
|
+
return this.doUpdateOBBBounds();
|
|
4522
|
+
}
|
|
4515
4523
|
combindShadowAABBBounds(bounds) {
|
|
4516
4524
|
if (this.shadowRoot) {
|
|
4517
4525
|
const b = this.shadowRoot.AABBBounds.clone();
|
|
4518
4526
|
bounds.union(b);
|
|
4519
4527
|
}
|
|
4520
4528
|
}
|
|
4529
|
+
doUpdateOBBBounds() {
|
|
4530
|
+
return this._OBBBounds;
|
|
4531
|
+
}
|
|
4521
4532
|
doUpdateAABBBounds(full) {
|
|
4533
|
+
this.updateAABBBoundsStamp++;
|
|
4522
4534
|
const graphicTheme = this.getGraphicTheme();
|
|
4523
4535
|
this._AABBBounds.clear();
|
|
4524
4536
|
const attribute = this.attribute,
|
|
@@ -5476,6 +5488,7 @@ class Group extends Graphic {
|
|
|
5476
5488
|
}), application.graphicService.updateTempAABBBounds(aabbBounds), application.graphicService.transformAABBBounds(attribute, aabbBounds, groupTheme, !1, this), originalAABBBounds.copy(aabbBounds), originalAABBBounds;
|
|
5477
5489
|
}
|
|
5478
5490
|
doUpdateAABBBounds() {
|
|
5491
|
+
this.updateAABBBoundsStamp++;
|
|
5479
5492
|
const bounds = super.doUpdateAABBBounds();
|
|
5480
5493
|
return this.parent && this.parent.addChildUpdateBoundTag(), this._emitCustomEvent("AAABBBoundsChange"), bounds;
|
|
5481
5494
|
}
|
|
@@ -5811,7 +5824,7 @@ function drawPathProxy(graphic, context, x, y, drawContext, params, fillCb, stro
|
|
|
5811
5824
|
const path = "function" == typeof graphic.pathProxy ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;
|
|
5812
5825
|
return renderCommandList(path.commandList, context, x, y), context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes), doStroke && (strokeCb ? strokeCb(context, graphic.attribute, themeAttributes) : sVisible && (context.setStrokeStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.stroke())), doFill && (fillCb ? fillCb(context, graphic.attribute, themeAttributes) : fVisible && (context.setCommonStyle(graphic, graphic.attribute, x - originX, y - originY, themeAttributes), context.fill())), !0;
|
|
5813
5826
|
}
|
|
5814
|
-
function intersect
|
|
5827
|
+
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
5815
5828
|
const x10 = x1 - x0,
|
|
5816
5829
|
y10 = y1 - y0,
|
|
5817
5830
|
x32 = x3 - x2,
|
|
@@ -5880,7 +5893,7 @@ function calculateArcCornerRadius(arc, startAngle, endAngle, innerRadius, outerR
|
|
|
5880
5893
|
yire = innerRadius * sin(innerEndAngle);
|
|
5881
5894
|
let xore, yore, xirs, yirs;
|
|
5882
5895
|
if ((maxInnerCornerRadius > epsilon || maxOuterCornerRadius > epsilon) && (xore = outerRadius * cos(outerEndAngle), yore = outerRadius * sin(outerEndAngle), xirs = innerRadius * cos(innerStartAngle), yirs = innerRadius * sin(innerStartAngle), deltaAngle < pi)) {
|
|
5883
|
-
const oc = intersect
|
|
5896
|
+
const oc = intersect(xors, yors, xirs, yirs, xore, yore, xire, yire);
|
|
5884
5897
|
if (oc) {
|
|
5885
5898
|
const ax = xors - oc[0],
|
|
5886
5899
|
ay = yors - oc[1],
|
|
@@ -9152,7 +9165,10 @@ class InteractiveDrawItemInterceptorContribution {
|
|
|
9152
9165
|
}
|
|
9153
9166
|
beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) {
|
|
9154
9167
|
const baseGraphic = graphic.baseGraphic;
|
|
9155
|
-
|
|
9168
|
+
let intree = !!baseGraphic.stage,
|
|
9169
|
+
_g = baseGraphic.parent;
|
|
9170
|
+
for (; intree && _g && _g.stage !== _g;) intree = !!_g.stage, _g = _g.parent;
|
|
9171
|
+
if (!intree) {
|
|
9156
9172
|
const interactiveLayer = drawContext.stage.getLayer("_builtin_interactive");
|
|
9157
9173
|
if (interactiveLayer) {
|
|
9158
9174
|
this.getShadowRoot(interactiveLayer).removeChild(graphic);
|
|
@@ -9501,6 +9517,35 @@ class Text extends Graphic {
|
|
|
9501
9517
|
getGraphicTheme() {
|
|
9502
9518
|
return getTheme(this).text;
|
|
9503
9519
|
}
|
|
9520
|
+
doUpdateOBBBounds() {
|
|
9521
|
+
const graphicTheme = this.getGraphicTheme();
|
|
9522
|
+
this._OBBBounds.clear();
|
|
9523
|
+
const attribute = this.attribute,
|
|
9524
|
+
{
|
|
9525
|
+
angle = graphicTheme.angle
|
|
9526
|
+
} = attribute;
|
|
9527
|
+
if (!angle) {
|
|
9528
|
+
const b = this.AABBBounds;
|
|
9529
|
+
return this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2), this._OBBBounds;
|
|
9530
|
+
}
|
|
9531
|
+
this.obbText || (this.obbText = new Text({})), this.obbText.setAttributes(Object.assign(Object.assign({}, attribute), {
|
|
9532
|
+
angle: 0
|
|
9533
|
+
}));
|
|
9534
|
+
const bounds1 = this.obbText.AABBBounds,
|
|
9535
|
+
{
|
|
9536
|
+
x: x,
|
|
9537
|
+
y: y
|
|
9538
|
+
} = attribute,
|
|
9539
|
+
boundsCenter = {
|
|
9540
|
+
x: (bounds1.x1 + bounds1.x2) / 2,
|
|
9541
|
+
y: (bounds1.y1 + bounds1.y2) / 2
|
|
9542
|
+
},
|
|
9543
|
+
center = rotatePoint(boundsCenter, angle, {
|
|
9544
|
+
x: x,
|
|
9545
|
+
y: y
|
|
9546
|
+
});
|
|
9547
|
+
return this._OBBBounds.copy(bounds1), this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y), this._OBBBounds.angle = angle, this._OBBBounds;
|
|
9548
|
+
}
|
|
9504
9549
|
updateAABBBounds(attribute, textTheme, aabbBounds) {
|
|
9505
9550
|
const {
|
|
9506
9551
|
text = textTheme.text
|
|
@@ -11933,13 +11978,14 @@ class Arc extends Graphic {
|
|
|
11933
11978
|
return super.needUpdateTag(key, ARC_UPDATE_TAG_KEY);
|
|
11934
11979
|
}
|
|
11935
11980
|
toCustomPath() {
|
|
11981
|
+
var _a, _b, _c, _d;
|
|
11936
11982
|
const attribute = this.attribute,
|
|
11937
11983
|
{
|
|
11938
11984
|
startAngle: startAngle,
|
|
11939
11985
|
endAngle: endAngle
|
|
11940
11986
|
} = this.getParsedAngle();
|
|
11941
|
-
let innerRadius = attribute.innerRadius - (attribute.innerPadding
|
|
11942
|
-
outerRadius = attribute.outerRadius - (attribute.outerPadding
|
|
11987
|
+
let innerRadius = (null !== (_a = attribute.innerRadius) && void 0 !== _a ? _a : 0) - (null !== (_b = attribute.innerPadding) && void 0 !== _b ? _b : 0),
|
|
11988
|
+
outerRadius = (null !== (_c = attribute.outerRadius) && void 0 !== _c ? _c : 0) - (null !== (_d = attribute.outerPadding) && void 0 !== _d ? _d : 0);
|
|
11943
11989
|
const deltaAngle = abs(endAngle - startAngle),
|
|
11944
11990
|
clockwise = endAngle > startAngle;
|
|
11945
11991
|
if (outerRadius < innerRadius) {
|
|
@@ -14139,7 +14185,7 @@ class ScrollBar extends AbstractComponent {
|
|
|
14139
14185
|
let currentScrollValue;
|
|
14140
14186
|
let currentPos;
|
|
14141
14187
|
let delta = 0;
|
|
14142
|
-
const { width, height } = this.
|
|
14188
|
+
const { width, height } = this._getSliderRenderBounds();
|
|
14143
14189
|
if (direction === 'vertical') {
|
|
14144
14190
|
currentPos = y;
|
|
14145
14191
|
delta = currentPos - this._prePos;
|
|
@@ -14241,7 +14287,7 @@ class ScrollBar extends AbstractComponent {
|
|
|
14241
14287
|
const rail = group.createOrUpdateChild('scrollbar-rail', Object.assign({ x: 0, y: 0, width,
|
|
14242
14288
|
height }, railStyle), 'rect');
|
|
14243
14289
|
this._rail = rail;
|
|
14244
|
-
const sliderRenderBounds = this.
|
|
14290
|
+
const sliderRenderBounds = this._getSliderRenderBounds();
|
|
14245
14291
|
const sliderPos = this._getSliderPos(clampRange(range, limitRange[0], limitRange[1]));
|
|
14246
14292
|
const sliderSize = sliderPos[1] - sliderPos[0];
|
|
14247
14293
|
this._sliderSize = sliderSize;
|
|
@@ -14271,7 +14317,7 @@ class ScrollBar extends AbstractComponent {
|
|
|
14271
14317
|
y: containerAABBBounds.y1
|
|
14272
14318
|
};
|
|
14273
14319
|
}
|
|
14274
|
-
|
|
14320
|
+
_getSliderRenderBounds() {
|
|
14275
14321
|
if (this._sliderRenderBounds) {
|
|
14276
14322
|
return this._sliderRenderBounds;
|
|
14277
14323
|
}
|
|
@@ -14291,14 +14337,14 @@ class ScrollBar extends AbstractComponent {
|
|
|
14291
14337
|
_getDefaultSliderCornerRadius() {
|
|
14292
14338
|
const { direction, round } = this.attribute;
|
|
14293
14339
|
if (round) {
|
|
14294
|
-
const { width, height } = this.
|
|
14340
|
+
const { width, height } = this._getSliderRenderBounds();
|
|
14295
14341
|
return direction === 'horizontal' ? height : width;
|
|
14296
14342
|
}
|
|
14297
14343
|
return 0;
|
|
14298
14344
|
}
|
|
14299
14345
|
_getSliderPos(range) {
|
|
14300
14346
|
const { direction } = this.attribute;
|
|
14301
|
-
const { width, height, x1, y1 } = this.
|
|
14347
|
+
const { width, height, x1, y1 } = this._getSliderRenderBounds();
|
|
14302
14348
|
if (direction === 'horizontal') {
|
|
14303
14349
|
return [width * range[0] + x1, width * range[1] + x1];
|
|
14304
14350
|
}
|
|
@@ -14310,7 +14356,7 @@ class ScrollBar extends AbstractComponent {
|
|
|
14310
14356
|
}
|
|
14311
14357
|
const { limitRange = [0, 1], direction } = this.attribute;
|
|
14312
14358
|
const [min, max] = clampRange(limitRange, 0, 1);
|
|
14313
|
-
const { width, height, x1, y1 } = this.
|
|
14359
|
+
const { width, height, x1, y1 } = this._getSliderRenderBounds();
|
|
14314
14360
|
const sliderSize = this._sliderSize;
|
|
14315
14361
|
return direction === 'horizontal'
|
|
14316
14362
|
? clampRange([x1 + min * width, x1 + max * width], x1, width - sliderSize)
|
|
@@ -17315,7 +17361,9 @@ class ArcLabel extends LabelBase {
|
|
|
17315
17361
|
const radius = this.computeRadius(radiusRatio, attribute.width, attribute.height);
|
|
17316
17362
|
const flag = isQuadrantLeft(quadrant) ? -1 : 1;
|
|
17317
17363
|
let cx = 0;
|
|
17318
|
-
let limit = (flag > 0 ? plotLayout.x2 - pointB.x : pointB.x - plotLayout.x1
|
|
17364
|
+
let limit = (flag > 0 ? plotLayout.x2 - pointB.x + this._alignOffset : pointB.x - plotLayout.x1 - this._alignOffset) -
|
|
17365
|
+
this._line2MinLength -
|
|
17366
|
+
spaceWidth;
|
|
17319
17367
|
if (labelLayoutAlign === 'labelLine') {
|
|
17320
17368
|
cx = (radius + line1MinLength + this._line2MinLength) * flag + center.x;
|
|
17321
17369
|
limit = (flag > 0 ? plotLayout.x2 - cx : cx - plotLayout.x1) - spaceWidth;
|
|
@@ -18351,6 +18399,25 @@ function getPolygonPath(points, closed) {
|
|
|
18351
18399
|
}
|
|
18352
18400
|
return path;
|
|
18353
18401
|
}
|
|
18402
|
+
function textIntersect(textA, textB, sep) {
|
|
18403
|
+
let a = textA.OBBBounds;
|
|
18404
|
+
let b = textB.OBBBounds;
|
|
18405
|
+
if (a && b && !a.empty() && !b.empty()) {
|
|
18406
|
+
return a.intersects(b);
|
|
18407
|
+
}
|
|
18408
|
+
a = textA.AABBBounds;
|
|
18409
|
+
b = textB.AABBBounds;
|
|
18410
|
+
return sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
|
|
18411
|
+
}
|
|
18412
|
+
function hasOverlap(items, pad) {
|
|
18413
|
+
for (let i = 1, n = items.length, a = items[0], b; i < n; a = b, ++i) {
|
|
18414
|
+
b = items[i];
|
|
18415
|
+
if (textIntersect(a, b, pad)) {
|
|
18416
|
+
return true;
|
|
18417
|
+
}
|
|
18418
|
+
}
|
|
18419
|
+
return false;
|
|
18420
|
+
}
|
|
18354
18421
|
|
|
18355
18422
|
const dispatchHoverState = (e, container, lastHover) => {
|
|
18356
18423
|
const target = e.target;
|
|
@@ -18772,12 +18839,86 @@ class AxisBase extends AbstractComponent {
|
|
|
18772
18839
|
}
|
|
18773
18840
|
}
|
|
18774
18841
|
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18778
|
-
|
|
18779
|
-
|
|
18842
|
+
const methods$1 = {
|
|
18843
|
+
parity: function (items) {
|
|
18844
|
+
return items.filter((item, i) => (i % 2 ? item.setAttribute('opacity', 0) : 1));
|
|
18845
|
+
},
|
|
18846
|
+
greedy: function (items, sep) {
|
|
18847
|
+
let a;
|
|
18848
|
+
return items.filter((b, i) => {
|
|
18849
|
+
if (!i || !textIntersect(a, b, sep)) {
|
|
18850
|
+
a = b;
|
|
18851
|
+
return 1;
|
|
18852
|
+
}
|
|
18853
|
+
return b.setAttribute('opacity', 0);
|
|
18854
|
+
});
|
|
18855
|
+
}
|
|
18856
|
+
};
|
|
18857
|
+
function hasBounds(item) {
|
|
18858
|
+
let bounds;
|
|
18859
|
+
if (!item.OBBBounds.empty()) {
|
|
18860
|
+
bounds = item.OBBBounds;
|
|
18861
|
+
}
|
|
18862
|
+
else {
|
|
18863
|
+
bounds = item.AABBBounds;
|
|
18864
|
+
}
|
|
18865
|
+
return bounds.width() > 1 && bounds.height() > 1;
|
|
18866
|
+
}
|
|
18867
|
+
function reset(items) {
|
|
18868
|
+
items.forEach(item => item.setAttribute('opacity', 1));
|
|
18869
|
+
return items;
|
|
18870
|
+
}
|
|
18871
|
+
function forceItemVisible$1(sourceItem, items, check, comparator, inverse = false) {
|
|
18872
|
+
if (check && !sourceItem.attribute.opacity) {
|
|
18873
|
+
const remainLength = items.length;
|
|
18874
|
+
if (remainLength > 1) {
|
|
18875
|
+
sourceItem.setAttribute('opacity', 1);
|
|
18876
|
+
for (let i = 0; i < remainLength; i++) {
|
|
18877
|
+
const item = inverse ? items[remainLength - 1 - i] : items[i];
|
|
18878
|
+
if (comparator(item)) {
|
|
18879
|
+
item.setAttribute('opacity', 0);
|
|
18880
|
+
}
|
|
18881
|
+
else {
|
|
18882
|
+
break;
|
|
18883
|
+
}
|
|
18884
|
+
}
|
|
18885
|
+
}
|
|
18886
|
+
}
|
|
18887
|
+
}
|
|
18888
|
+
function autoHide(labels, config) {
|
|
18889
|
+
if (isEmpty(labels)) {
|
|
18890
|
+
return;
|
|
18891
|
+
}
|
|
18892
|
+
const source = labels.filter(hasBounds);
|
|
18893
|
+
if (isEmpty(source)) {
|
|
18894
|
+
return;
|
|
18895
|
+
}
|
|
18896
|
+
let items;
|
|
18897
|
+
items = reset(source);
|
|
18898
|
+
const { method = 'parity', separation: sep = 0 } = config;
|
|
18899
|
+
const reduce = isFunction(method) ? method : methods$1[method] || methods$1.parity;
|
|
18900
|
+
if (items.length >= 3 && hasOverlap(items, sep)) {
|
|
18901
|
+
do {
|
|
18902
|
+
items = reduce(items, sep);
|
|
18903
|
+
} while (items.length >= 3 && hasOverlap(items, sep));
|
|
18904
|
+
const shouldCheck = (length, visibility) => length < 3 || visibility;
|
|
18905
|
+
const checkFirst = shouldCheck(items.length, config.firstVisible);
|
|
18906
|
+
let checkLast = shouldCheck(items.length, config.lastVisible);
|
|
18907
|
+
const firstSourceItem = source[0];
|
|
18908
|
+
const lastSourceItem = last(source);
|
|
18909
|
+
if (textIntersect(firstSourceItem, lastSourceItem, sep)) {
|
|
18910
|
+
lastSourceItem.setAttribute('opacity', 0);
|
|
18911
|
+
checkLast = false;
|
|
18912
|
+
}
|
|
18913
|
+
forceItemVisible$1(firstSourceItem, items, checkFirst, (item) => textIntersect(item, firstSourceItem, sep));
|
|
18914
|
+
forceItemVisible$1(lastSourceItem, items, checkLast, (item) => textIntersect(item, lastSourceItem, sep) ||
|
|
18915
|
+
(checkFirst && item !== firstSourceItem ? textIntersect(item, firstSourceItem, sep) : false), true);
|
|
18916
|
+
}
|
|
18917
|
+
source.forEach(item => {
|
|
18918
|
+
item.setAttribute('visible', !!item.attribute.opacity);
|
|
18919
|
+
});
|
|
18780
18920
|
}
|
|
18921
|
+
|
|
18781
18922
|
function genNormalBounds(item) {
|
|
18782
18923
|
const bounds = item.AABBBounds;
|
|
18783
18924
|
return {
|
|
@@ -18796,7 +18937,10 @@ function genRotateBounds(items) {
|
|
|
18796
18937
|
return;
|
|
18797
18938
|
}
|
|
18798
18939
|
const bounds = genNormalBounds(item);
|
|
18799
|
-
const rotatedCenter =
|
|
18940
|
+
const rotatedCenter = rotatePoint({ x: item.attribute.x, y: item.attribute.y }, bounds.angle, {
|
|
18941
|
+
x: bounds.centerX,
|
|
18942
|
+
y: bounds.centerY
|
|
18943
|
+
});
|
|
18800
18944
|
const deltaX = rotatedCenter.x - bounds.centerX;
|
|
18801
18945
|
const deltaY = rotatedCenter.y - bounds.centerY;
|
|
18802
18946
|
bounds.x1 += deltaX;
|
|
@@ -18809,6 +18953,10 @@ function genRotateBounds(items) {
|
|
|
18809
18953
|
});
|
|
18810
18954
|
}
|
|
18811
18955
|
function itemIntersect(item1, item2) {
|
|
18956
|
+
var _a, _b;
|
|
18957
|
+
if (!((_a = item1.OBBBounds) === null || _a === void 0 ? void 0 : _a.empty()) && !((_b = item2.OBBBounds) === null || _b === void 0 ? void 0 : _b.empty())) {
|
|
18958
|
+
return item1.OBBBounds.intersects(item2.OBBBounds);
|
|
18959
|
+
}
|
|
18812
18960
|
return (isRectIntersect(item1.AABBBounds, item2.AABBBounds, false) &&
|
|
18813
18961
|
(item1.rotatedBounds && item2.rotatedBounds
|
|
18814
18962
|
? isRotateAABBIntersect(item1.rotatedBounds, item2.rotatedBounds, true)
|
|
@@ -18826,86 +18974,6 @@ function isAngleHorizontal(angle) {
|
|
|
18826
18974
|
return !hasAngle || Math.abs(sin) <= DELTA_ANGLE;
|
|
18827
18975
|
}
|
|
18828
18976
|
|
|
18829
|
-
const methods$1 = {
|
|
18830
|
-
parity: function (items) {
|
|
18831
|
-
return items.filter((item, i) => (i % 2 ? item.setAttribute('opacity', 0) : 1));
|
|
18832
|
-
},
|
|
18833
|
-
greedy: function (items, sep) {
|
|
18834
|
-
let a;
|
|
18835
|
-
return items.filter((b, i) => {
|
|
18836
|
-
if (!i || !intersect$1(a, b, sep)) {
|
|
18837
|
-
a = b;
|
|
18838
|
-
return 1;
|
|
18839
|
-
}
|
|
18840
|
-
return b.setAttribute('opacity', 0);
|
|
18841
|
-
});
|
|
18842
|
-
}
|
|
18843
|
-
};
|
|
18844
|
-
function intersect$1(textA, textB, sep) {
|
|
18845
|
-
const a = textA.AABBBounds;
|
|
18846
|
-
const b = textB.AABBBounds;
|
|
18847
|
-
return (sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2) &&
|
|
18848
|
-
(textA.rotatedBounds && textB.rotatedBounds
|
|
18849
|
-
? sep >
|
|
18850
|
-
Math.max(textB.rotatedBounds.x1 - textA.rotatedBounds.x2, textA.rotatedBounds.x1 - textB.rotatedBounds.x2, textB.rotatedBounds.y1 - textA.rotatedBounds.y2, textA.rotatedBounds.y1 - textB.rotatedBounds.y2)
|
|
18851
|
-
: true));
|
|
18852
|
-
}
|
|
18853
|
-
function hasOverlap$1(items, pad) {
|
|
18854
|
-
for (let i = 1, n = items.length, a = items[0], b; i < n; a = b, ++i) {
|
|
18855
|
-
if (intersect$1(a, (b = items[i]), pad)) {
|
|
18856
|
-
return true;
|
|
18857
|
-
}
|
|
18858
|
-
}
|
|
18859
|
-
}
|
|
18860
|
-
function hasBounds(item) {
|
|
18861
|
-
const b = item.AABBBounds;
|
|
18862
|
-
return b.width() > 1 && b.height() > 1;
|
|
18863
|
-
}
|
|
18864
|
-
function reset(items) {
|
|
18865
|
-
items.forEach(item => item.setAttribute('opacity', 1));
|
|
18866
|
-
return items;
|
|
18867
|
-
}
|
|
18868
|
-
function autoHide(labels, config) {
|
|
18869
|
-
if (isEmpty(labels)) {
|
|
18870
|
-
return;
|
|
18871
|
-
}
|
|
18872
|
-
const source = labels.filter(hasBounds);
|
|
18873
|
-
if (isEmpty(source)) {
|
|
18874
|
-
return;
|
|
18875
|
-
}
|
|
18876
|
-
let items;
|
|
18877
|
-
items = reset(source);
|
|
18878
|
-
genRotateBounds(items);
|
|
18879
|
-
const { method = 'parity', separation: sep = 0 } = config;
|
|
18880
|
-
const reduce = isFunction(method) ? method : methods$1[method] || methods$1.parity;
|
|
18881
|
-
if (items.length >= 3 && hasOverlap$1(items, sep)) {
|
|
18882
|
-
do {
|
|
18883
|
-
items = reduce(items, sep);
|
|
18884
|
-
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
18885
|
-
const checkLast = items.length < 3 || config.lastVisible;
|
|
18886
|
-
if (checkLast) {
|
|
18887
|
-
const lastSourceItem = last(source);
|
|
18888
|
-
if (!lastSourceItem.attribute.opacity) {
|
|
18889
|
-
const remainLength = items.length;
|
|
18890
|
-
if (remainLength > 1) {
|
|
18891
|
-
lastSourceItem.setAttribute('opacity', 1);
|
|
18892
|
-
for (let i = remainLength - 1; i >= 0; i--) {
|
|
18893
|
-
if (intersect$1(items[i], lastSourceItem, sep)) {
|
|
18894
|
-
items[i].setAttribute('opacity', 0);
|
|
18895
|
-
}
|
|
18896
|
-
else {
|
|
18897
|
-
break;
|
|
18898
|
-
}
|
|
18899
|
-
}
|
|
18900
|
-
}
|
|
18901
|
-
}
|
|
18902
|
-
}
|
|
18903
|
-
}
|
|
18904
|
-
source.forEach(item => {
|
|
18905
|
-
item.setAttribute('visible', !!item.attribute.opacity);
|
|
18906
|
-
});
|
|
18907
|
-
}
|
|
18908
|
-
|
|
18909
18977
|
function autoRotate(items, rotateConfig) {
|
|
18910
18978
|
if (isEmpty(items)) {
|
|
18911
18979
|
return;
|
|
@@ -19640,7 +19708,7 @@ class LineAxis extends AxisBase {
|
|
|
19640
19708
|
}
|
|
19641
19709
|
const { verticalLimitSize, label, orient } = this.attribute;
|
|
19642
19710
|
const limitLength = this._getAxisLabelLimitLength(verticalLimitSize, layerCount);
|
|
19643
|
-
const { layoutFunc, autoRotate: autoRotate$1, autoRotateAngle, autoLimit: autoLimit$1, limitEllipsis, autoHide: autoHide$1, autoHideMethod, autoHideSeparation, lastVisible, autoWrap: autoWrap$1, overflowLimitLength } = label;
|
|
19711
|
+
const { layoutFunc, autoRotate: autoRotate$1, autoRotateAngle, autoLimit: autoLimit$1, limitEllipsis, autoHide: autoHide$1, autoHideMethod, autoHideSeparation, lastVisible, firstVisible, autoWrap: autoWrap$1, overflowLimitLength } = label;
|
|
19644
19712
|
if (isFunction(layoutFunc)) {
|
|
19645
19713
|
layoutFunc(labelShapes, labelData, layer, this);
|
|
19646
19714
|
}
|
|
@@ -19682,7 +19750,8 @@ class LineAxis extends AxisBase {
|
|
|
19682
19750
|
orient,
|
|
19683
19751
|
method: autoHideMethod,
|
|
19684
19752
|
separation: autoHideSeparation,
|
|
19685
|
-
lastVisible
|
|
19753
|
+
lastVisible,
|
|
19754
|
+
firstVisible
|
|
19686
19755
|
});
|
|
19687
19756
|
}
|
|
19688
19757
|
}
|
|
@@ -20160,18 +20229,6 @@ const labelOverlap = (prevLabel, nextLabel, gap = 0) => {
|
|
|
20160
20229
|
const nextBounds = new AABBBounds(nextLabel).expand(gap / 2);
|
|
20161
20230
|
return prevBounds.intersects(nextBounds);
|
|
20162
20231
|
};
|
|
20163
|
-
function intersect(a, b, sep) {
|
|
20164
|
-
return sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
|
|
20165
|
-
}
|
|
20166
|
-
function hasOverlap(items, pad) {
|
|
20167
|
-
for (let i = 1, n = items.length, a = items[0], b; i < n; a = b, ++i) {
|
|
20168
|
-
b = items[i];
|
|
20169
|
-
if (intersect(a.AABBBounds, b.AABBBounds, pad)) {
|
|
20170
|
-
return true;
|
|
20171
|
-
}
|
|
20172
|
-
}
|
|
20173
|
-
return false;
|
|
20174
|
-
}
|
|
20175
20232
|
const MIN_TICK_GAP = 12;
|
|
20176
20233
|
const calculateFlushPos = (basePosition, size, rangePosition, otherEnd) => {
|
|
20177
20234
|
return rangePosition < basePosition
|
|
@@ -20282,6 +20339,30 @@ function getScaleTicks(op, scale, count, getTicks) {
|
|
|
20282
20339
|
}
|
|
20283
20340
|
return scaleTicks;
|
|
20284
20341
|
}
|
|
20342
|
+
function forceItemVisible(sourceItem, items, check, comparator, inverse = false) {
|
|
20343
|
+
if (check && !items.includes(sourceItem)) {
|
|
20344
|
+
let remainLength = items.length;
|
|
20345
|
+
if (remainLength > 1) {
|
|
20346
|
+
if (inverse) {
|
|
20347
|
+
items.push(sourceItem);
|
|
20348
|
+
}
|
|
20349
|
+
else {
|
|
20350
|
+
items.unshift(sourceItem);
|
|
20351
|
+
}
|
|
20352
|
+
for (let i = 0; i < remainLength; i++) {
|
|
20353
|
+
const index = inverse ? remainLength - 1 - i : i;
|
|
20354
|
+
if (comparator(items[index])) {
|
|
20355
|
+
items.splice(index, 1);
|
|
20356
|
+
i--;
|
|
20357
|
+
remainLength--;
|
|
20358
|
+
}
|
|
20359
|
+
else {
|
|
20360
|
+
break;
|
|
20361
|
+
}
|
|
20362
|
+
}
|
|
20363
|
+
}
|
|
20364
|
+
}
|
|
20365
|
+
}
|
|
20285
20366
|
const DEFAULT_CONTINUOUS_TICK_COUNT = 5;
|
|
20286
20367
|
const continuousTicks = (scale, op) => {
|
|
20287
20368
|
var _a, _b;
|
|
@@ -20325,6 +20406,13 @@ const continuousTicks = (scale, op) => {
|
|
|
20325
20406
|
return scale.ticks(count, { noDecimals, customTicks });
|
|
20326
20407
|
});
|
|
20327
20408
|
}
|
|
20409
|
+
const domain = scale.domain();
|
|
20410
|
+
if (op.labelFirstVisible && domain[0] !== scaleTicks[0]) {
|
|
20411
|
+
scaleTicks.unshift(domain[0]);
|
|
20412
|
+
}
|
|
20413
|
+
if (op.labelLastVisible && domain[domain.length - 1] !== scaleTicks[scaleTicks.length - 1]) {
|
|
20414
|
+
scaleTicks.push(domain[domain.length - 1]);
|
|
20415
|
+
}
|
|
20328
20416
|
if (op.sampling) {
|
|
20329
20417
|
if (op.coordinateType === 'cartesian' || (op.coordinateType === 'polar' && op.axisOrientType === 'radius')) {
|
|
20330
20418
|
const { labelGap = 4, labelFlush } = op;
|
|
@@ -20332,10 +20420,23 @@ const continuousTicks = (scale, op) => {
|
|
|
20332
20420
|
AABBBounds: bounds,
|
|
20333
20421
|
value: scaleTicks[i]
|
|
20334
20422
|
}));
|
|
20423
|
+
const source = [...items];
|
|
20424
|
+
const firstSourceItem = source[0];
|
|
20425
|
+
const lastSourceItem = last(source);
|
|
20335
20426
|
const samplingMethod = breakData && breakData() ? methods.greedy : methods.parity;
|
|
20336
20427
|
while (items.length >= 3 && hasOverlap(items, labelGap)) {
|
|
20337
20428
|
items = samplingMethod(items, labelGap);
|
|
20338
20429
|
}
|
|
20430
|
+
const shouldCheck = (length, visibility) => length < 3 || visibility;
|
|
20431
|
+
const checkFirst = shouldCheck(items.length, op.labelFirstVisible);
|
|
20432
|
+
let checkLast = shouldCheck(items.length, op.labelLastVisible);
|
|
20433
|
+
if (textIntersect(firstSourceItem, lastSourceItem, labelGap)) {
|
|
20434
|
+
items.push(firstSourceItem);
|
|
20435
|
+
checkLast = false;
|
|
20436
|
+
}
|
|
20437
|
+
forceItemVisible(firstSourceItem, items, checkFirst, (item) => textIntersect(item, firstSourceItem, labelGap));
|
|
20438
|
+
forceItemVisible(lastSourceItem, items, checkLast, (item) => textIntersect(item, lastSourceItem, labelGap) ||
|
|
20439
|
+
(checkFirst && item !== firstSourceItem ? textIntersect(item, firstSourceItem, labelGap) : false), true);
|
|
20339
20440
|
const ticks = items.map(item => item.value);
|
|
20340
20441
|
if (ticks.length < 3 && labelFlush) {
|
|
20341
20442
|
if (ticks.length > 1) {
|
|
@@ -20357,7 +20458,7 @@ const methods = {
|
|
|
20357
20458
|
greedy: function (items, sep) {
|
|
20358
20459
|
let a;
|
|
20359
20460
|
return items.filter((b, i) => {
|
|
20360
|
-
if (!i || !
|
|
20461
|
+
if (!i || !textIntersect(a, b, sep)) {
|
|
20361
20462
|
a = b;
|
|
20362
20463
|
return true;
|
|
20363
20464
|
}
|
|
@@ -20854,8 +20955,25 @@ class BaseGrid extends AbstractComponent {
|
|
|
20854
20955
|
? alternateColor
|
|
20855
20956
|
: [alternateColor, 'transparent'];
|
|
20856
20957
|
const getColor = (index) => colors[index % colors.length];
|
|
20857
|
-
|
|
20858
|
-
|
|
20958
|
+
const originalItems = this.attribute.items;
|
|
20959
|
+
const firstItem = originalItems[0];
|
|
20960
|
+
const lastItem = originalItems[originalItems.length - 1];
|
|
20961
|
+
const noZero = !isNumberClose(firstItem.value, 0) && !isNumberClose(lastItem.value, 0);
|
|
20962
|
+
const noOne = !isNumberClose(firstItem.value, 1) && !isNumberClose(lastItem.value, 1);
|
|
20963
|
+
const allPoints = [];
|
|
20964
|
+
const isDesc = firstItem.value > lastItem.value;
|
|
20965
|
+
if ((isDesc && noOne) || (!isDesc && noZero)) {
|
|
20966
|
+
allPoints.push(this.getGridPointsByValue(isDesc ? 1 : 0));
|
|
20967
|
+
}
|
|
20968
|
+
items.forEach((item) => {
|
|
20969
|
+
allPoints.push(item.points);
|
|
20970
|
+
});
|
|
20971
|
+
if ((isDesc && noZero) || (!isDesc && noOne)) {
|
|
20972
|
+
allPoints.push(this.getGridPointsByValue(isDesc ? 0 : 1));
|
|
20973
|
+
}
|
|
20974
|
+
for (let index = 0; index < allPoints.length - 1; index++) {
|
|
20975
|
+
const prev = allPoints[index];
|
|
20976
|
+
const curr = allPoints[index + 1];
|
|
20859
20977
|
const path = getRegionPath(prev, curr, gridAttrs);
|
|
20860
20978
|
const shape = graphicCreator.path({
|
|
20861
20979
|
path,
|
|
@@ -20941,6 +21059,10 @@ class LineAxisGrid extends BaseGrid {
|
|
|
20941
21059
|
}
|
|
20942
21060
|
return gridPoints;
|
|
20943
21061
|
}
|
|
21062
|
+
getGridPointsByValue(value) {
|
|
21063
|
+
const basePoint = this.getTickCoord(value);
|
|
21064
|
+
return this._getGridPoint(this.attribute.type, basePoint);
|
|
21065
|
+
}
|
|
20944
21066
|
getGridAttribute(isSubGrid) {
|
|
20945
21067
|
const { type: gridType, alignWithLabel = true } = this.attribute;
|
|
20946
21068
|
const tickSegment = this._parseTickSegment();
|
|
@@ -20969,7 +21091,7 @@ class LineAxisGrid extends BaseGrid {
|
|
|
20969
21091
|
else {
|
|
20970
21092
|
gridAttribute = merge({}, this.attribute, this.attribute.subGrid);
|
|
20971
21093
|
const subGridItems = [];
|
|
20972
|
-
const { count: subCount = 4 } =
|
|
21094
|
+
const { count: subCount = 4 } = gridAttribute;
|
|
20973
21095
|
const tickLineCount = this.data.length;
|
|
20974
21096
|
if (tickLineCount >= 2) {
|
|
20975
21097
|
const points = this._getPointsOfSubGrid(tickSegment, alignWithLabel);
|
|
@@ -20978,23 +21100,22 @@ class LineAxisGrid extends BaseGrid {
|
|
|
20978
21100
|
const next = points[i + 1];
|
|
20979
21101
|
subGridItems.push({
|
|
20980
21102
|
id: `sub-${i}-0`,
|
|
20981
|
-
points: this.
|
|
21103
|
+
points: this.getGridPointsByValue(pre.value),
|
|
20982
21104
|
datum: {}
|
|
20983
21105
|
});
|
|
20984
21106
|
for (let j = 0; j < subCount; j++) {
|
|
20985
21107
|
const percent = (j + 1) / (subCount + 1);
|
|
20986
21108
|
const value = (1 - percent) * pre.value + percent * next.value;
|
|
20987
|
-
const point = this.getTickCoord(value);
|
|
20988
21109
|
subGridItems.push({
|
|
20989
21110
|
id: `sub-${i}-${j + 1}`,
|
|
20990
|
-
points: this.
|
|
21111
|
+
points: this.getGridPointsByValue(value),
|
|
20991
21112
|
datum: {}
|
|
20992
21113
|
});
|
|
20993
21114
|
}
|
|
20994
21115
|
if (i === points.length - 2) {
|
|
20995
21116
|
subGridItems.push({
|
|
20996
21117
|
id: `sub-${i}-${subCount + 1}`,
|
|
20997
|
-
points: this.
|
|
21118
|
+
points: this.getGridPointsByValue(next.value),
|
|
20998
21119
|
datum: {}
|
|
20999
21120
|
});
|
|
21000
21121
|
}
|
|
@@ -21012,6 +21133,11 @@ class CircleAxisGrid extends BaseGrid {
|
|
|
21012
21133
|
constructor(attributes, options) {
|
|
21013
21134
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, BaseGrid.defaultAttributes, attributes), options);
|
|
21014
21135
|
}
|
|
21136
|
+
getGridPointsByValue(value) {
|
|
21137
|
+
const basePoint = this.getTickCoord(value);
|
|
21138
|
+
const { radius, innerRadius = 0 } = this.attribute;
|
|
21139
|
+
return [basePoint, this.getVerticalCoord(basePoint, radius - innerRadius, true)];
|
|
21140
|
+
}
|
|
21015
21141
|
getGridAttribute(isSubGrid) {
|
|
21016
21142
|
let gridAttribute;
|
|
21017
21143
|
let items = [];
|
|
@@ -24517,7 +24643,7 @@ class DiscreteLegend extends LegendBase {
|
|
|
24517
24643
|
let focusSpace = 0;
|
|
24518
24644
|
if (focus) {
|
|
24519
24645
|
const focusSize = get(focusIconStyle, 'size', DEFAULT_SHAPE_SIZE);
|
|
24520
|
-
focusShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: -focusSize / 2 - 1, strokeBoundsBuffer: 0 }, focusIconStyle), { visible: true, pickMode: 'imprecise'
|
|
24646
|
+
focusShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: -focusSize / 2 - 1, strokeBoundsBuffer: 0, boundsPadding: parsedPadding }, focusIconStyle), { visible: true, pickMode: 'imprecise' }));
|
|
24521
24647
|
this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup);
|
|
24522
24648
|
focusSpace = focusSize;
|
|
24523
24649
|
}
|
|
@@ -24700,15 +24826,6 @@ class DiscreteLegend extends LegendBase {
|
|
|
24700
24826
|
: (e) => {
|
|
24701
24827
|
return e.detail.current;
|
|
24702
24828
|
};
|
|
24703
|
-
const onScroll = (e) => {
|
|
24704
|
-
e.preventDefault();
|
|
24705
|
-
const scrollComponent = this._pagerComponent;
|
|
24706
|
-
const preScrollRange = scrollComponent.getScrollRange();
|
|
24707
|
-
const { direction } = scrollComponent.attribute;
|
|
24708
|
-
const { width, height } = scrollComponent.getSliderRenderBounds();
|
|
24709
|
-
const currentScrollValue = direction === 'vertical' ? e.deltaY / height : e.deltaX / width;
|
|
24710
|
-
scrollComponent.setScrollRange([preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue], true);
|
|
24711
|
-
};
|
|
24712
24829
|
const onPaging = (e) => {
|
|
24713
24830
|
const newPage = pageParser(e);
|
|
24714
24831
|
if (newPage === this._itemContext.currentPage) {
|
|
@@ -24733,9 +24850,6 @@ class DiscreteLegend extends LegendBase {
|
|
|
24733
24850
|
if (this._itemContext.isScrollbar) {
|
|
24734
24851
|
this._pagerComponent.addEventListener('scrollDrag', onPaging);
|
|
24735
24852
|
this._pagerComponent.addEventListener('scrollUp', onPaging);
|
|
24736
|
-
if (this.attribute.pager.roamScroll) {
|
|
24737
|
-
this.addEventListener('wheel', onScroll);
|
|
24738
|
-
}
|
|
24739
24853
|
}
|
|
24740
24854
|
else {
|
|
24741
24855
|
this._pagerComponent.addEventListener('toPrev', onPaging);
|
|
@@ -29014,6 +29128,6 @@ EmptyTip.defaultAttributes = {
|
|
|
29014
29128
|
}
|
|
29015
29129
|
};
|
|
29016
29130
|
|
|
29017
|
-
const version = "0.20.6-alpha.
|
|
29131
|
+
const version = "0.20.6-alpha.2";
|
|
29018
29132
|
|
|
29019
|
-
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|
|
29133
|
+
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|