@visactor/vchart 1.1.0-beta.3 → 1.1.0-beta.4
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/index.js +328 -306
- package/build/index.min.js +2 -2
- package/cjs/chart/base-chart.d.ts +3 -1
- package/cjs/chart/base-chart.js +34 -1
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +10 -1
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/component/axis/base-axis.js +1 -14
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/interface.d.ts +1 -0
- package/cjs/component/axis/interface.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.d.ts +16 -0
- package/cjs/component/axis/mixin/band-axis-mixin.js +15 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/crosshair/cartesian.d.ts +2 -0
- package/cjs/component/crosshair/cartesian.js +11 -2
- package/cjs/component/crosshair/cartesian.js.map +1 -1
- package/cjs/component/crosshair/interface/spec.d.ts +6 -1
- package/cjs/component/crosshair/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js +6 -7
- package/cjs/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.d.ts +0 -1
- package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.js +4 -2
- package/cjs/component/tooltip/handler/dom/model/base-tooltip-model.js.map +1 -1
- package/cjs/component/tooltip/interface/common.d.ts +6 -0
- package/cjs/component/tooltip/interface/common.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +3 -2
- package/cjs/component/tooltip/tooltip.js +4 -2
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.d.ts +2 -1
- package/cjs/core/vchart.js +4 -0
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/transforms/legend-data/discrete/discrete.js +3 -3
- package/cjs/data/transforms/legend-data/discrete/discrete.js.map +1 -1
- package/cjs/event/event.d.ts +5 -1
- package/cjs/event/event.js +3 -0
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/events/dimension/base.d.ts +4 -0
- package/cjs/event/events/dimension/base.js +16 -1
- package/cjs/event/events/dimension/base.js.map +1 -1
- package/cjs/event/events/dimension/util/cartesian.d.ts +4 -0
- package/cjs/event/events/dimension/util/cartesian.js +37 -46
- package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
- package/cjs/event/interface.d.ts +5 -0
- package/cjs/event/interface.js.map +1 -1
- package/cjs/interaction/dimension-trigger.js +3 -3
- package/cjs/interaction/dimension-trigger.js.map +1 -1
- package/cjs/util/env.d.ts +1 -0
- package/cjs/util/env.js +3 -2
- package/cjs/util/env.js.map +1 -1
- package/esm/chart/base-chart.d.ts +3 -1
- package/esm/chart/base-chart.js +35 -0
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +10 -1
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/component/axis/base-axis.js +1 -14
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/interface.d.ts +1 -0
- package/esm/component/axis/interface.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.d.ts +16 -0
- package/esm/component/axis/mixin/band-axis-mixin.js +16 -0
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/crosshair/cartesian.d.ts +2 -0
- package/esm/component/crosshair/cartesian.js +12 -1
- package/esm/component/crosshair/cartesian.js.map +1 -1
- package/esm/component/crosshair/interface/spec.d.ts +6 -1
- package/esm/component/crosshair/interface/spec.js.map +1 -1
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js +3 -4
- package/esm/component/tooltip/handler/dom/dom-tooltip-handler.js.map +1 -1
- package/esm/component/tooltip/handler/dom/model/base-tooltip-model.d.ts +0 -1
- package/esm/component/tooltip/handler/dom/model/base-tooltip-model.js +1 -1
- package/esm/component/tooltip/handler/dom/model/base-tooltip-model.js.map +1 -1
- package/esm/component/tooltip/interface/common.d.ts +6 -0
- package/esm/component/tooltip/interface/common.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +3 -2
- package/esm/component/tooltip/tooltip.js +5 -3
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.d.ts +2 -1
- package/esm/core/vchart.js +4 -0
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/transforms/legend-data/discrete/discrete.js +3 -3
- package/esm/data/transforms/legend-data/discrete/discrete.js.map +1 -1
- package/esm/event/event.d.ts +5 -1
- package/esm/event/event.js +3 -0
- package/esm/event/event.js.map +1 -1
- package/esm/event/events/dimension/base.d.ts +4 -0
- package/esm/event/events/dimension/base.js +18 -1
- package/esm/event/events/dimension/base.js.map +1 -1
- package/esm/event/events/dimension/util/cartesian.d.ts +4 -0
- package/esm/event/events/dimension/util/cartesian.js +32 -44
- package/esm/event/events/dimension/util/cartesian.js.map +1 -1
- package/esm/event/interface.d.ts +5 -0
- package/esm/event/interface.js.map +1 -1
- package/esm/interaction/dimension-trigger.js +2 -4
- package/esm/interaction/dimension-trigger.js.map +1 -1
- package/esm/util/env.d.ts +1 -0
- package/esm/util/env.js +2 -0
- package/esm/util/env.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -7392,6 +7392,7 @@
|
|
|
7392
7392
|
};
|
|
7393
7393
|
|
|
7394
7394
|
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
|
7395
|
+
const domDocument = isBrowser && globalThis.document;
|
|
7395
7396
|
function isTrueBrowser(mode) {
|
|
7396
7397
|
return (mode === 'desktop-browser' || mode === 'mobile-browser') && isBrowser;
|
|
7397
7398
|
}
|
|
@@ -15570,7 +15571,7 @@
|
|
|
15570
15571
|
return referenceNode.parent !== this ? null : (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, referenceNode._next ? (referenceNode._next._prev = newNode, newNode._next = referenceNode._next) : this._lastChild = newNode, referenceNode._next = newNode, newNode._prev = referenceNode, this._idMap || (this._idMap = new Map()), this._idMap.set(newNode._uid, newNode), this._structEdit = !0, this.setCount(newNode.count), newNode);
|
|
15571
15572
|
}
|
|
15572
15573
|
insertInto(newNode, idx) {
|
|
15573
|
-
if (this._nodeList && console.warn("insertIntoKeepIdx和insertInto混用可能会存在错误"), idx >= this.childrenCount) return this.appendChild(newNode);
|
|
15574
|
+
if (!this._ignoreWarn && this._nodeList && console.warn("insertIntoKeepIdx和insertInto混用可能会存在错误"), idx >= this.childrenCount) return this.appendChild(newNode);
|
|
15574
15575
|
if (this._uid === newNode._uid) return null;
|
|
15575
15576
|
if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");
|
|
15576
15577
|
if (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, 0 === idx) newNode._next = this._firstChild, this._firstChild && (this._firstChild._prev = newNode), newNode._prev = null, this._firstChild = newNode;else {
|
|
@@ -15592,7 +15593,10 @@
|
|
|
15592
15593
|
let node;
|
|
15593
15594
|
this._nodeList[idx] = newNode;
|
|
15594
15595
|
for (let i = idx - 1; i >= 0 && (node = this._nodeList[i], !node); i--);
|
|
15595
|
-
|
|
15596
|
+
if (node) return node._next ? this.insertBefore(newNode, node._next) : this.appendChild(newNode);
|
|
15597
|
+
this._ignoreWarn = !0;
|
|
15598
|
+
const data = this.insertInto(newNode, 0);
|
|
15599
|
+
return this._ignoreWarn = !1, data;
|
|
15596
15600
|
}
|
|
15597
15601
|
removeChild(child) {
|
|
15598
15602
|
if (!this._idMap) return null;
|
|
@@ -23609,6 +23613,7 @@
|
|
|
23609
23613
|
function getTextBounds(params) {
|
|
23610
23614
|
return text.setAttributes(params), text.AABBBounds;
|
|
23611
23615
|
}
|
|
23616
|
+
createRichText({});
|
|
23612
23617
|
|
|
23613
23618
|
class DefaultCanvasAllocate {
|
|
23614
23619
|
constructor() {
|
|
@@ -23995,7 +24000,7 @@
|
|
|
23995
24000
|
isFullStroke: isFullStroke,
|
|
23996
24001
|
stroke: arrayStroke
|
|
23997
24002
|
} = parseStroke(stroke);
|
|
23998
|
-
if ((doFill || isFullStroke) && (context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), this._arcRenderContribitions || (this._arcRenderContribitions = this.arcRenderContribitions.getContributions() || [], this._arcRenderContribitions.sort((a, b) => b.order - a.order)), this._arcRenderContribitions.forEach(c => {
|
|
24003
|
+
if ((doFill || isFullStroke || background) && (context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), this._arcRenderContribitions || (this._arcRenderContribitions = this.arcRenderContribitions.getContributions() || [], this._arcRenderContribitions.sort((a, b) => b.order - a.order)), this._arcRenderContribitions.forEach(c => {
|
|
23999
24004
|
c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, fillCb, strokeCb);
|
|
24000
24005
|
}), context.setShadowStyle && context.setShadowStyle(arc, arc.attribute, arcAttribute), doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill())), doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()))), !isFullStroke && doStroke) {
|
|
24001
24006
|
context.beginPath();
|
|
@@ -28590,6 +28595,25 @@
|
|
|
28590
28595
|
_context.setLineDash(lineDash);
|
|
28591
28596
|
}
|
|
28592
28597
|
}
|
|
28598
|
+
_setStrokeStyle(params, attribute, offsetX, offsetY, defaultParams) {
|
|
28599
|
+
const _context = this.nativeContext;
|
|
28600
|
+
defaultParams || (defaultParams = this.strokeAttributes);
|
|
28601
|
+
const {
|
|
28602
|
+
strokeOpacity = defaultParams.strokeOpacity,
|
|
28603
|
+
opacity = defaultParams.opacity
|
|
28604
|
+
} = attribute;
|
|
28605
|
+
if (strokeOpacity > 1e-12 && opacity > 1e-12) {
|
|
28606
|
+
const {
|
|
28607
|
+
lineWidth = defaultParams.lineWidth,
|
|
28608
|
+
stroke = defaultParams.stroke,
|
|
28609
|
+
lineJoin = defaultParams.lineJoin,
|
|
28610
|
+
lineDash = defaultParams.lineDash,
|
|
28611
|
+
lineCap = defaultParams.lineCap,
|
|
28612
|
+
miterLimit = defaultParams.miterLimit
|
|
28613
|
+
} = attribute;
|
|
28614
|
+
_context.globalAlpha = strokeOpacity * opacity, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
28615
|
+
}
|
|
28616
|
+
}
|
|
28593
28617
|
draw() {
|
|
28594
28618
|
const _context = this.nativeContext;
|
|
28595
28619
|
this.drawPromise = new Promise(resolve => {
|
|
@@ -33752,7 +33776,7 @@
|
|
|
33752
33776
|
encodeGraphic() {
|
|
33753
33777
|
this.coordinateTransformEncode(this.items);
|
|
33754
33778
|
const graphicAttributes = this.transformElementItems(this.items, this.mark.markType);
|
|
33755
|
-
this.graphicItem ? this.applyGraphicAttributes(graphicAttributes) : this.initGraphicItem(graphicAttributes), this.diffState !== DiffState.enter && this.diffState !== DiffState.update || !this.states.length ||
|
|
33779
|
+
this.graphicItem ? (this.graphicItem.clearStates(), this.graphicItem.states = {}, this.graphicItem.stateProxy = null, this.applyGraphicAttributes(graphicAttributes)) : this.initGraphicItem(graphicAttributes), this.diffState !== DiffState.enter && this.diffState !== DiffState.update || !this.states.length || this.useStates(this.states), this.mark.markType === GrammarMarkType.shape && (this.graphicItem.datum = this.items[0].datum), this.items.forEach(item => {
|
|
33756
33780
|
item.nextAttrs = {};
|
|
33757
33781
|
}), this._setCutomizedShape();
|
|
33758
33782
|
}
|
|
@@ -33823,7 +33847,7 @@
|
|
|
33823
33847
|
const item = items[0];
|
|
33824
33848
|
if (!item.nextAttrs || 0 === Object.keys(item.nextAttrs).length) return {};
|
|
33825
33849
|
let nextAttrs = null == item ? void 0 : item.nextAttrs;
|
|
33826
|
-
if (items && items.length && isNil(null === (_a = item.nextAttrs) || void 0 === _a ? void 0 : _a.points) && !
|
|
33850
|
+
if (items && items.length && isNil(null === (_a = item.nextAttrs) || void 0 === _a ? void 0 : _a.points) && (!0 === computePoints || isValidPointsChannel(Object.keys(item.nextAttrs), this.mark.markType)) && isPointsMarkType(markType)) {
|
|
33827
33851
|
const lastPoints = this.getGraphicAttribute("points", !1),
|
|
33828
33852
|
lastSegments = this.getGraphicAttribute("segments", !1),
|
|
33829
33853
|
enableSegments = null !== (_b = item.nextAttrs.enableSegments) && void 0 !== _b ? _b : this.getGraphicAttribute("enableSegments", !1),
|
|
@@ -36730,7 +36754,7 @@
|
|
|
36730
36754
|
constructor(view, markType, group) {
|
|
36731
36755
|
super(view), this.grammarType = "mark", this.elements = [], this.elementMap = new Map(), this.isUpdated = !0, this.animate = new Animate(this, {}), this.differ = new Differ([]), this.evaluateSync = (data, parameters) => {
|
|
36732
36756
|
var _a;
|
|
36733
|
-
return this.evaluateMainTasks(data, parameters), (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) || this.evaluateTransformSync(this.
|
|
36757
|
+
return this.evaluateMainTasks(data, parameters), (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) || this.evaluateTransformSync(this._getTransformsAfterEncode(), this.elements, parameters), this;
|
|
36734
36758
|
}, this.markType = markType, this.spec.type = markType, this.spec.encode = {
|
|
36735
36759
|
update: {}
|
|
36736
36760
|
}, this.spec.group = group, group && (this.group = group, this.attach(group), group.appendChild(this));
|
|
@@ -36791,7 +36815,7 @@
|
|
|
36791
36815
|
evaluate(data, parameters) {
|
|
36792
36816
|
var _a;
|
|
36793
36817
|
return __awaiter$7(this, void 0, void 0, function* () {
|
|
36794
|
-
return this.evaluateMainTasks(data, parameters), (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) || (yield this.evaluateTransform(this.
|
|
36818
|
+
return this.evaluateMainTasks(data, parameters), (null === (_a = this.renderContext) || void 0 === _a ? void 0 : _a.progressive) || (yield this.evaluateTransform(this._getTransformsAfterEncode(), this.elements, parameters)), this;
|
|
36795
36819
|
});
|
|
36796
36820
|
}
|
|
36797
36821
|
output() {
|
|
@@ -37509,143 +37533,25 @@
|
|
|
37509
37533
|
return "#" + rgbToHex(r, g, b);
|
|
37510
37534
|
}
|
|
37511
37535
|
|
|
37512
|
-
|
|
37513
|
-
|
|
37514
|
-
* @module glMatrix
|
|
37515
|
-
*/
|
|
37516
|
-
var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;
|
|
37517
|
-
if (!Math.hypot) Math.hypot = function () {
|
|
37518
|
-
var y = 0,
|
|
37519
|
-
i = arguments.length;
|
|
37520
|
-
while (i--) {
|
|
37521
|
-
y += arguments[i] * arguments[i];
|
|
37522
|
-
}
|
|
37523
|
-
return Math.sqrt(y);
|
|
37524
|
-
};
|
|
37525
|
-
|
|
37526
|
-
/**
|
|
37527
|
-
* 2 Dimensional Vector
|
|
37528
|
-
* @module vec2
|
|
37529
|
-
*/
|
|
37530
|
-
|
|
37531
|
-
/**
|
|
37532
|
-
* Creates a new, empty vec2
|
|
37533
|
-
*
|
|
37534
|
-
* @returns {vec2} a new 2D vector
|
|
37535
|
-
*/
|
|
37536
|
-
|
|
37537
|
-
function create$2() {
|
|
37538
|
-
var out = new ARRAY_TYPE(2);
|
|
37539
|
-
if (ARRAY_TYPE != Float32Array) {
|
|
37540
|
-
out[0] = 0;
|
|
37541
|
-
out[1] = 0;
|
|
37542
|
-
}
|
|
37543
|
-
return out;
|
|
37536
|
+
function scale(vector, scale) {
|
|
37537
|
+
return [vector[0] * scale, vector[1] * scale];
|
|
37544
37538
|
}
|
|
37545
|
-
|
|
37546
|
-
|
|
37547
|
-
|
|
37548
|
-
* @param {vec2} out the receiving vector
|
|
37549
|
-
* @param {ReadonlyVec2} a the vector to scale
|
|
37550
|
-
* @param {Number} b amount to scale the vector by
|
|
37551
|
-
* @returns {vec2} out
|
|
37552
|
-
*/
|
|
37553
|
-
|
|
37554
|
-
function scale(out, a, b) {
|
|
37555
|
-
out[0] = a[0] * b;
|
|
37556
|
-
out[1] = a[1] * b;
|
|
37557
|
-
return out;
|
|
37558
|
-
}
|
|
37559
|
-
/**
|
|
37560
|
-
* Calculates the length of a vec2
|
|
37561
|
-
*
|
|
37562
|
-
* @param {ReadonlyVec2} a vector to calculate length of
|
|
37563
|
-
* @returns {Number} length of a
|
|
37564
|
-
*/
|
|
37565
|
-
|
|
37566
|
-
function length(a) {
|
|
37567
|
-
var x = a[0],
|
|
37568
|
-
y = a[1];
|
|
37569
|
-
return Math.hypot(x, y);
|
|
37539
|
+
function length(vector) {
|
|
37540
|
+
const [x, y] = vector;
|
|
37541
|
+
return Math.sqrt(x * x + y * y);
|
|
37570
37542
|
}
|
|
37571
|
-
|
|
37572
|
-
|
|
37573
|
-
|
|
37574
|
-
|
|
37575
|
-
* @param {ReadonlyVec2} a vector to normalize
|
|
37576
|
-
* @returns {vec2} out
|
|
37577
|
-
*/
|
|
37578
|
-
|
|
37579
|
-
function normalize(out, a) {
|
|
37580
|
-
var x = a[0],
|
|
37581
|
-
y = a[1];
|
|
37582
|
-
var len = x * x + y * y;
|
|
37583
|
-
if (len > 0) {
|
|
37584
|
-
//TODO: evaluate use of glm_invsqrt here?
|
|
37585
|
-
len = 1 / Math.sqrt(len);
|
|
37586
|
-
}
|
|
37587
|
-
out[0] = a[0] * len;
|
|
37588
|
-
out[1] = a[1] * len;
|
|
37589
|
-
return out;
|
|
37543
|
+
function normalize(vector) {
|
|
37544
|
+
const [x, y] = vector;
|
|
37545
|
+
let len = x * x + y * y;
|
|
37546
|
+
return len > 0 && (len = 1 / Math.sqrt(len)), [vector[0] * len, vector[1] * len];
|
|
37590
37547
|
}
|
|
37591
|
-
|
|
37592
|
-
|
|
37593
|
-
|
|
37594
|
-
|
|
37595
|
-
|
|
37596
|
-
*/
|
|
37597
|
-
|
|
37598
|
-
function angle(a, b) {
|
|
37599
|
-
var x1 = a[0],
|
|
37600
|
-
y1 = a[1],
|
|
37601
|
-
x2 = b[0],
|
|
37602
|
-
y2 = b[1],
|
|
37603
|
-
// mag is the product of the magnitudes of a and b
|
|
37604
|
-
mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),
|
|
37605
|
-
// mag &&.. short circuits if mag == 0
|
|
37606
|
-
cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1
|
|
37607
|
-
|
|
37548
|
+
function angle(vector1, vector2) {
|
|
37549
|
+
const [x1, y1] = vector1,
|
|
37550
|
+
[x2, y2] = vector2,
|
|
37551
|
+
mag = Math.sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)),
|
|
37552
|
+
cosine = mag && (x1 * x2 + y1 * y2) / mag;
|
|
37608
37553
|
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
37609
37554
|
}
|
|
37610
|
-
/**
|
|
37611
|
-
* Perform some operation over an array of vec2s.
|
|
37612
|
-
*
|
|
37613
|
-
* @param {Array} a the array of vectors to iterate over
|
|
37614
|
-
* @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed
|
|
37615
|
-
* @param {Number} offset Number of elements to skip at the beginning of the array
|
|
37616
|
-
* @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array
|
|
37617
|
-
* @param {Function} fn Function to call for each vector in the array
|
|
37618
|
-
* @param {Object} [arg] additional argument to pass to fn
|
|
37619
|
-
* @returns {Array} a
|
|
37620
|
-
* @function
|
|
37621
|
-
*/
|
|
37622
|
-
|
|
37623
|
-
(function () {
|
|
37624
|
-
var vec = create$2();
|
|
37625
|
-
return function (a, stride, offset, count, fn, arg) {
|
|
37626
|
-
var i, l;
|
|
37627
|
-
if (!stride) {
|
|
37628
|
-
stride = 2;
|
|
37629
|
-
}
|
|
37630
|
-
if (!offset) {
|
|
37631
|
-
offset = 0;
|
|
37632
|
-
}
|
|
37633
|
-
if (count) {
|
|
37634
|
-
l = Math.min(count * stride + offset, a.length);
|
|
37635
|
-
} else {
|
|
37636
|
-
l = a.length;
|
|
37637
|
-
}
|
|
37638
|
-
for (i = offset; i < l; i += stride) {
|
|
37639
|
-
vec[0] = a[i];
|
|
37640
|
-
vec[1] = a[i + 1];
|
|
37641
|
-
fn(vec, vec, arg);
|
|
37642
|
-
a[i] = vec[0];
|
|
37643
|
-
a[i + 1] = vec[1];
|
|
37644
|
-
}
|
|
37645
|
-
return a;
|
|
37646
|
-
};
|
|
37647
|
-
})();
|
|
37648
|
-
|
|
37649
37555
|
function direction(v1, v2) {
|
|
37650
37556
|
return v1[0] * v2[1] - v2[0] * v1[1];
|
|
37651
37557
|
}
|
|
@@ -39190,11 +39096,10 @@
|
|
|
39190
39096
|
axisTitle.name = AXIS_ELEMENT_NAME.title, axisTitle.id = this._getNodeId("title"), container.add(axisTitle);
|
|
39191
39097
|
}
|
|
39192
39098
|
renderGrid(container) {
|
|
39193
|
-
this._renderGridByType("grid", container);
|
|
39194
39099
|
const {
|
|
39195
39100
|
visible: visible
|
|
39196
39101
|
} = this.attribute.subGrid || {};
|
|
39197
|
-
visible && this._renderGridByType("subGrid", container);
|
|
39102
|
+
visible && this._renderGridByType("subGrid", container), this._renderGridByType("grid", container);
|
|
39198
39103
|
}
|
|
39199
39104
|
getVerticalCoord(point, offset, inside) {
|
|
39200
39105
|
const vector = this.getVerticalVector(offset, inside, point);
|
|
@@ -39429,9 +39334,9 @@
|
|
|
39429
39334
|
verticalFactor = 1
|
|
39430
39335
|
} = this.attribute,
|
|
39431
39336
|
axisVector = this.getRelativeVector(),
|
|
39432
|
-
|
|
39433
|
-
verticalVector = [
|
|
39434
|
-
return scale(
|
|
39337
|
+
normalizedAxisVector = normalize(axisVector),
|
|
39338
|
+
verticalVector = [normalizedAxisVector[1], -1 * normalizedAxisVector[0]];
|
|
39339
|
+
return scale(verticalVector, offset * (inside ? 1 : -1) * verticalFactor);
|
|
39435
39340
|
}
|
|
39436
39341
|
getTitleAttribute() {
|
|
39437
39342
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -39673,7 +39578,7 @@
|
|
|
39673
39578
|
center: center
|
|
39674
39579
|
} = this.attribute,
|
|
39675
39580
|
vector = [point.x - center.x, point.y - center.y];
|
|
39676
|
-
return scale(vector,
|
|
39581
|
+
return scale(vector, (inside ? -1 : 1) * (axisInside ? -1 : 1) * offset / length(vector));
|
|
39677
39582
|
}
|
|
39678
39583
|
getRelativeVector(point) {
|
|
39679
39584
|
const {
|
|
@@ -41143,7 +41048,8 @@
|
|
|
41143
41048
|
} = handler;
|
|
41144
41049
|
preShape || (preShape = isHorizontal ? "triangleLeft" : "triangleUp"), nextShape || (nextShape = isHorizontal ? "triangleRight" : "triangleDown");
|
|
41145
41050
|
const preHandler = createSymbol(Object.assign(Object.assign({
|
|
41146
|
-
strokeBoundsBuffer: 0
|
|
41051
|
+
strokeBoundsBuffer: 0,
|
|
41052
|
+
pickMode: "imprecise"
|
|
41147
41053
|
}, handlerStyle), {
|
|
41148
41054
|
x: 0,
|
|
41149
41055
|
y: 0,
|
|
@@ -41170,7 +41076,8 @@
|
|
|
41170
41076
|
}, textStyle));
|
|
41171
41077
|
this.text = text, container.add(text);
|
|
41172
41078
|
const nextHandler = createSymbol(Object.assign(Object.assign({
|
|
41173
|
-
strokeBoundsBuffer: 0
|
|
41079
|
+
strokeBoundsBuffer: 0,
|
|
41080
|
+
pickMode: "imprecise"
|
|
41174
41081
|
}, handlerStyle), {
|
|
41175
41082
|
x: isHorizontal ? handlerSizeX + 2 * handlerSpace + maxTextWidth : 0,
|
|
41176
41083
|
y: isHorizontal ? 0 : handlerSizeY + 2 * handlerSpace + maxTextHeight,
|
|
@@ -41400,14 +41307,16 @@
|
|
|
41400
41307
|
const itemGroup = this._renderEachItem(item, !!isEmpty(defaultSelected) || (null == defaultSelected ? void 0 : defaultSelected.includes(item.label)), index),
|
|
41401
41308
|
itemWidth = itemGroup.attribute.width,
|
|
41402
41309
|
itemHeight = itemGroup.attribute.height;
|
|
41403
|
-
this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (maxPages = maxRow, isValid(maxWidth) && maxWidth < startX + itemWidth && (doWrap = !0, startX = 0, startY += itemHeight + spaceRow, pages += 1), index > 0 && itemGroup.setAttributes({
|
|
41310
|
+
this._itemHeight = Math.max(this._itemHeight, itemHeight), maxWidthInCol = Math.max(itemWidth, maxWidthInCol), this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth), isHorizontal ? (maxPages = maxRow, isValid(maxWidth) && (itemWidth >= maxWidth ? (doWrap = !0, index > 0 && (startX = 0, startY += itemHeight + spaceRow, pages += 1)) : maxWidth < startX + itemWidth && (doWrap = !0, startX = 0, startY += itemHeight + spaceRow, pages += 1)), index > 0 && itemGroup.setAttributes({
|
|
41404
41311
|
x: startX,
|
|
41405
41312
|
y: startY
|
|
41406
41313
|
}), startX += spaceCol + itemWidth) : (maxPages = maxCol, isValid(maxHeight) && maxHeight < startY + itemHeight && (doWrap = !0, startY = 0, startX += maxWidthInCol + spaceCol, maxWidthInCol = 0, pages += 1), index > 0 && itemGroup.setAttributes({
|
|
41407
41314
|
x: startX,
|
|
41408
41315
|
y: startY
|
|
41409
41316
|
}), startY += spaceRow + itemHeight), itemsContainer.add(itemGroup);
|
|
41410
|
-
})
|
|
41317
|
+
});
|
|
41318
|
+
let pagerRendered = !1;
|
|
41319
|
+
doWrap && autoPage && pages > maxPages && (pagerRendered = this._renderPager(isHorizontal)), pagerRendered || (itemsContainer.setAttribute("y", this._title ? this._title.AABBBounds.height() + get(this.attribute, "title.space", 8) : 0), this._innerView.add(itemsContainer));
|
|
41411
41320
|
}
|
|
41412
41321
|
_bindEvents() {
|
|
41413
41322
|
if (!this._itemsContainer) return;
|
|
@@ -41539,43 +41448,50 @@
|
|
|
41539
41448
|
startX = 0,
|
|
41540
41449
|
startY = 0,
|
|
41541
41450
|
pages = 1;
|
|
41542
|
-
|
|
41543
|
-
|
|
41544
|
-
|
|
41545
|
-
|
|
41546
|
-
|
|
41547
|
-
|
|
41548
|
-
|
|
41549
|
-
|
|
41550
|
-
|
|
41551
|
-
|
|
41552
|
-
|
|
41553
|
-
|
|
41554
|
-
|
|
41555
|
-
|
|
41556
|
-
|
|
41557
|
-
|
|
41558
|
-
|
|
41559
|
-
|
|
41560
|
-
|
|
41561
|
-
|
|
41562
|
-
|
|
41563
|
-
|
|
41564
|
-
|
|
41565
|
-
|
|
41566
|
-
}
|
|
41567
|
-
|
|
41568
|
-
|
|
41569
|
-
|
|
41570
|
-
|
|
41571
|
-
|
|
41572
|
-
|
|
41573
|
-
|
|
41574
|
-
|
|
41575
|
-
|
|
41576
|
-
|
|
41577
|
-
|
|
41578
|
-
|
|
41451
|
+
if (isHorizontal) {
|
|
41452
|
+
if (pagerComp = new Pager(Object.assign({
|
|
41453
|
+
layout: 1 === maxRow ? "horizontal" : "vertical",
|
|
41454
|
+
total: 99
|
|
41455
|
+
}, merge$1({
|
|
41456
|
+
handler: {
|
|
41457
|
+
preShape: "triangleUp",
|
|
41458
|
+
nextShape: "triangleDown"
|
|
41459
|
+
}
|
|
41460
|
+
}, pageStyle))), this._pager = pagerComp, this._innerView.add(pagerComp), pageHeight = (maxRow - 1) * spaceRow + this._itemHeight * maxRow, pageWidth = maxWidth - pagerComp.AABBBounds.width() - pagerSpace, pageWidth <= 0) return this._innerView.removeChild(pagerComp), !1;
|
|
41461
|
+
itemsContainer.getChildren().forEach((item, index) => {
|
|
41462
|
+
const {
|
|
41463
|
+
width: width,
|
|
41464
|
+
height: height
|
|
41465
|
+
} = item.attribute;
|
|
41466
|
+
pageWidth < startX + width && (startX = 0, startY += height + spaceRow, pages += 1), index > 0 && item.setAttributes({
|
|
41467
|
+
x: startX,
|
|
41468
|
+
y: startY
|
|
41469
|
+
}), startX += spaceCol + width;
|
|
41470
|
+
}), pagerComp.setAttributes({
|
|
41471
|
+
total: Math.ceil(pages / maxRow),
|
|
41472
|
+
x: pageWidth,
|
|
41473
|
+
y: renderStartY + pageHeight / 2 - pagerComp.AABBBounds.height() / 2
|
|
41474
|
+
});
|
|
41475
|
+
} else {
|
|
41476
|
+
if (pagerComp = new Pager(Object.assign({
|
|
41477
|
+
layout: "horizontal",
|
|
41478
|
+
total: 99
|
|
41479
|
+
}, pageStyle)), this._pager = pagerComp, this._innerView.add(pagerComp), pageWidth = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol, pageHeight = maxHeight - pagerComp.AABBBounds.height() - pagerSpace - renderStartY, pageHeight <= 0) return this._innerView.removeChild(pagerComp), !1;
|
|
41480
|
+
itemsContainer.getChildren().forEach((item, index) => {
|
|
41481
|
+
const {
|
|
41482
|
+
height: height
|
|
41483
|
+
} = item.attribute;
|
|
41484
|
+
pageHeight < startY + height && (startY = 0, startX += this._itemMaxWidth + spaceCol, pages += 1), index > 0 && item.setAttributes({
|
|
41485
|
+
x: startX,
|
|
41486
|
+
y: startY
|
|
41487
|
+
}), startY += spaceRow + height;
|
|
41488
|
+
}), pagerComp.setAttributes({
|
|
41489
|
+
total: Math.ceil(pages / maxCol),
|
|
41490
|
+
x: (pageWidth - pagerComp.AABBBounds.width()) / 2,
|
|
41491
|
+
y: maxHeight - pagerComp.AABBBounds.height()
|
|
41492
|
+
});
|
|
41493
|
+
}
|
|
41494
|
+
pager.defaultCurrent > 1 && (isHorizontal ? itemsContainer.setAttribute("y", -(pager.defaultCurrent - 1) * (pageHeight + spaceRow)) : itemsContainer.setAttribute("x", -(pager.defaultCurrent - 1) * (pageWidth + spaceCol)));
|
|
41579
41495
|
const clipGroup = createGroup({
|
|
41580
41496
|
x: 0,
|
|
41581
41497
|
y: renderStartY,
|
|
@@ -41595,7 +41511,7 @@
|
|
|
41595
41511
|
x: -(current - 1) * (pageWidth + spaceCol)
|
|
41596
41512
|
}, animationDuration, animationEasing) : isHorizontal ? itemsContainer.setAttribute("y", -(current - 1) * (pageHeight + spaceRow)) : itemsContainer.setAttribute("x", -(current - 1) * (pageWidth + spaceCol));
|
|
41597
41513
|
};
|
|
41598
|
-
this._pager.addEventListener("toPrev", onPaging), this._pager.addEventListener("toNext", onPaging);
|
|
41514
|
+
return this._pager.addEventListener("toPrev", onPaging), this._pager.addEventListener("toNext", onPaging), !0;
|
|
41599
41515
|
}
|
|
41600
41516
|
_setLegendItemState(legendItem, stateName) {
|
|
41601
41517
|
let keepCurrentStates = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
@@ -49565,6 +49481,64 @@
|
|
|
49565
49481
|
return data;
|
|
49566
49482
|
};
|
|
49567
49483
|
|
|
49484
|
+
const DEFAULT_SMOOTH_INTERPOLATE = 'monotone';
|
|
49485
|
+
const DEFAULT_LINEAR_CLOSED_INTERPOLATE = 'linearClosed';
|
|
49486
|
+
|
|
49487
|
+
var ShapeTypeEnum;
|
|
49488
|
+
(function (ShapeTypeEnum) {
|
|
49489
|
+
ShapeTypeEnum["circle"] = "circle";
|
|
49490
|
+
ShapeTypeEnum["triangle"] = "triangle";
|
|
49491
|
+
ShapeTypeEnum["triangleUp"] = "triangleUp";
|
|
49492
|
+
ShapeTypeEnum["triangleLeft"] = "triangleLeft";
|
|
49493
|
+
ShapeTypeEnum["triangleRight"] = "triangleRight";
|
|
49494
|
+
ShapeTypeEnum["triangleDown"] = "triangleDown";
|
|
49495
|
+
ShapeTypeEnum["thinTriangle"] = "thinTriangle";
|
|
49496
|
+
ShapeTypeEnum["rect"] = "rect";
|
|
49497
|
+
ShapeTypeEnum["diamond"] = "diamond";
|
|
49498
|
+
ShapeTypeEnum["square"] = "square";
|
|
49499
|
+
ShapeTypeEnum["arrowLeft"] = "arrowLeft";
|
|
49500
|
+
ShapeTypeEnum["arrow2Left"] = "arrow2Left";
|
|
49501
|
+
ShapeTypeEnum["arrowRight"] = "arrowRight";
|
|
49502
|
+
ShapeTypeEnum["arrow2Right"] = "arrow2Right";
|
|
49503
|
+
ShapeTypeEnum["cross"] = "cross";
|
|
49504
|
+
ShapeTypeEnum["wedge"] = "wedge";
|
|
49505
|
+
ShapeTypeEnum["star"] = "star";
|
|
49506
|
+
ShapeTypeEnum["wye"] = "wye";
|
|
49507
|
+
})(ShapeTypeEnum || (ShapeTypeEnum = {}));
|
|
49508
|
+
|
|
49509
|
+
const DEFAULT_CLOSE_STROKE_JOIN = 'bevel';
|
|
49510
|
+
|
|
49511
|
+
var TooltipFixedPosition;
|
|
49512
|
+
(function (TooltipFixedPosition) {
|
|
49513
|
+
TooltipFixedPosition["top"] = "top";
|
|
49514
|
+
TooltipFixedPosition["left"] = "left";
|
|
49515
|
+
TooltipFixedPosition["right"] = "right";
|
|
49516
|
+
TooltipFixedPosition["bottom"] = "bottom";
|
|
49517
|
+
TooltipFixedPosition["inside"] = "inside";
|
|
49518
|
+
})(TooltipFixedPosition || (TooltipFixedPosition = {}));
|
|
49519
|
+
|
|
49520
|
+
function isXAxis(orient) {
|
|
49521
|
+
return orient === 'bottom' || orient === 'top';
|
|
49522
|
+
}
|
|
49523
|
+
function isYAxis(orient) {
|
|
49524
|
+
return orient === 'left' || orient === 'right';
|
|
49525
|
+
}
|
|
49526
|
+
function isZAxis(orient) {
|
|
49527
|
+
return orient === 'z';
|
|
49528
|
+
}
|
|
49529
|
+
function autoAxisType(orient, isHorizontal) {
|
|
49530
|
+
if (isHorizontal) {
|
|
49531
|
+
return isXAxis(orient) ? 'linear' : 'band';
|
|
49532
|
+
}
|
|
49533
|
+
return isXAxis(orient) ? 'band' : 'linear';
|
|
49534
|
+
}
|
|
49535
|
+
function getOrient(spec, whiteList) {
|
|
49536
|
+
return isValidOrient(spec.orient) || (whiteList && whiteList.includes(spec.orient)) ? spec.orient : 'left';
|
|
49537
|
+
}
|
|
49538
|
+
function getDirectionByOrient(orient) {
|
|
49539
|
+
return orient === 'top' || orient === 'bottom' ? Direction$2.horizontal : Direction$2.vertical;
|
|
49540
|
+
}
|
|
49541
|
+
|
|
49568
49542
|
const getAxis$1 = (chart, type, pos) => {
|
|
49569
49543
|
const axesComponents = chart
|
|
49570
49544
|
.getAllComponents()
|
|
@@ -49592,6 +49566,8 @@
|
|
|
49592
49566
|
}
|
|
49593
49567
|
return null;
|
|
49594
49568
|
};
|
|
49569
|
+
const XAxisGetDimensionField = (series) => series.fieldX[0];
|
|
49570
|
+
const YAxisGetDimensionField = (series) => series.fieldY[0];
|
|
49595
49571
|
const getCartesianDimensionInfo = (chart, pos) => {
|
|
49596
49572
|
if (!chart) {
|
|
49597
49573
|
return null;
|
|
@@ -49605,49 +49581,15 @@
|
|
|
49605
49581
|
const yAxisList = getAxis$1(chart, 'y', pos);
|
|
49606
49582
|
const targetAxisInfo = [];
|
|
49607
49583
|
if (xAxisList) {
|
|
49608
|
-
const getDimensionField = (series) => series.fieldX[0];
|
|
49609
49584
|
xAxisList.forEach(axis => {
|
|
49610
|
-
const
|
|
49611
|
-
|
|
49612
|
-
const xValue = x - axis.getLayoutStartPoint().x;
|
|
49613
|
-
if ((xValue - xScale.range()[0]) * (xValue - xScale.range()[1]) > 0) {
|
|
49614
|
-
return;
|
|
49615
|
-
}
|
|
49616
|
-
const value = xScale.invert(xValue);
|
|
49617
|
-
if (isNil(value)) {
|
|
49618
|
-
return;
|
|
49619
|
-
}
|
|
49620
|
-
const domain = xScale.domain();
|
|
49621
|
-
let index = domain.findIndex((v) => v?.toString() === value.toString());
|
|
49622
|
-
if (index < 0) {
|
|
49623
|
-
index = undefined;
|
|
49624
|
-
}
|
|
49625
|
-
const data = getDimensionData(value, axis, 'cartesian', getDimensionField);
|
|
49626
|
-
targetAxisInfo.push({ index, value, axis, data });
|
|
49627
|
-
}
|
|
49585
|
+
const info = getDiscreteAxisDimensionInfo(axis, x, 'x', XAxisGetDimensionField);
|
|
49586
|
+
info && targetAxisInfo.push(info);
|
|
49628
49587
|
});
|
|
49629
49588
|
}
|
|
49630
49589
|
if (yAxisList) {
|
|
49631
|
-
const getDimensionField = (series) => series.fieldY[0];
|
|
49632
49590
|
yAxisList.forEach(axis => {
|
|
49633
|
-
const
|
|
49634
|
-
|
|
49635
|
-
const yValue = y - axis.getLayoutStartPoint().y;
|
|
49636
|
-
if ((yValue - yScale.range()[0]) * (yValue - yScale.range()[1]) > 0) {
|
|
49637
|
-
return;
|
|
49638
|
-
}
|
|
49639
|
-
const value = yScale.invert(yValue);
|
|
49640
|
-
if (isNil(value)) {
|
|
49641
|
-
return;
|
|
49642
|
-
}
|
|
49643
|
-
const domain = yScale.domain();
|
|
49644
|
-
let index = domain.findIndex((v) => v?.toString() === value.toString());
|
|
49645
|
-
if (index < 0) {
|
|
49646
|
-
index = undefined;
|
|
49647
|
-
}
|
|
49648
|
-
const data = getDimensionData(value, axis, 'cartesian', getDimensionField);
|
|
49649
|
-
targetAxisInfo.push({ index, value, axis, data });
|
|
49650
|
-
}
|
|
49591
|
+
const info = getDiscreteAxisDimensionInfo(axis, y, 'y', YAxisGetDimensionField);
|
|
49592
|
+
info && targetAxisInfo.push(info);
|
|
49651
49593
|
});
|
|
49652
49594
|
}
|
|
49653
49595
|
if (!targetAxisInfo.length) {
|
|
@@ -49655,6 +49597,31 @@
|
|
|
49655
49597
|
}
|
|
49656
49598
|
return targetAxisInfo;
|
|
49657
49599
|
};
|
|
49600
|
+
const getDiscreteAxisDimensionInfo = (axis, posValue, posKey, getDimensionField) => {
|
|
49601
|
+
const scale = axis.getScale();
|
|
49602
|
+
const scalePos = posValue - axis.getLayoutStartPoint()[posKey];
|
|
49603
|
+
if ((scalePos - scale.range()[0]) * (scalePos - scale.range()[1]) > 0) {
|
|
49604
|
+
return null;
|
|
49605
|
+
}
|
|
49606
|
+
const value = scale.invert(scalePos);
|
|
49607
|
+
return getDimensionInfoInAxis(axis, value, getDimensionField);
|
|
49608
|
+
};
|
|
49609
|
+
const getDimensionInfoInAxis = (axis, value, getDimensionField) => {
|
|
49610
|
+
const scale = axis.getScale();
|
|
49611
|
+
if (!scale || !isDiscrete(scale.type)) {
|
|
49612
|
+
return null;
|
|
49613
|
+
}
|
|
49614
|
+
if (isNil(value)) {
|
|
49615
|
+
return null;
|
|
49616
|
+
}
|
|
49617
|
+
const domain = scale.domain();
|
|
49618
|
+
let index = domain.findIndex((v) => v?.toString() === value.toString());
|
|
49619
|
+
if (index < 0) {
|
|
49620
|
+
index = undefined;
|
|
49621
|
+
}
|
|
49622
|
+
const data = getDimensionData(value, axis, 'cartesian', getDimensionField ?? (isXAxis(axis.orient) ? XAxisGetDimensionField : YAxisGetDimensionField));
|
|
49623
|
+
return { index, value, axis, data };
|
|
49624
|
+
};
|
|
49658
49625
|
|
|
49659
49626
|
const getAxis = (chart, type, pos) => {
|
|
49660
49627
|
const axesComponents = chart
|
|
@@ -49805,6 +49772,33 @@
|
|
|
49805
49772
|
}
|
|
49806
49773
|
return result;
|
|
49807
49774
|
}
|
|
49775
|
+
dispatch(v, opt) {
|
|
49776
|
+
const axis = this._chart?.getAllComponents().filter(c => {
|
|
49777
|
+
if (c.specKey !== 'axes') {
|
|
49778
|
+
return false;
|
|
49779
|
+
}
|
|
49780
|
+
const scale = c.getScale();
|
|
49781
|
+
if (!isDiscrete(scale.type)) {
|
|
49782
|
+
return false;
|
|
49783
|
+
}
|
|
49784
|
+
if (opt?.filter) {
|
|
49785
|
+
return opt.filter(c);
|
|
49786
|
+
}
|
|
49787
|
+
return true;
|
|
49788
|
+
});
|
|
49789
|
+
const dimensionInfo = [];
|
|
49790
|
+
axis.forEach(a => {
|
|
49791
|
+
const info = getDimensionInfoInAxis(a, v);
|
|
49792
|
+
if (info) {
|
|
49793
|
+
dimensionInfo.push(info);
|
|
49794
|
+
}
|
|
49795
|
+
});
|
|
49796
|
+
this._callback.call(null, {
|
|
49797
|
+
action: 'enter',
|
|
49798
|
+
dimensionInfo
|
|
49799
|
+
});
|
|
49800
|
+
return dimensionInfo;
|
|
49801
|
+
}
|
|
49808
49802
|
}
|
|
49809
49803
|
|
|
49810
49804
|
class DimensionClickEvent extends DimensionEvent {
|
|
@@ -49925,6 +49919,9 @@
|
|
|
49925
49919
|
_eventDispatcher;
|
|
49926
49920
|
_mode;
|
|
49927
49921
|
_composedEventMap = new Map();
|
|
49922
|
+
getComposedEventMap() {
|
|
49923
|
+
return this._composedEventMap;
|
|
49924
|
+
}
|
|
49928
49925
|
constructor(eventDispatcher, mode) {
|
|
49929
49926
|
this._eventDispatcher = eventDispatcher;
|
|
49930
49927
|
this._mode = mode;
|
|
@@ -51483,6 +51480,9 @@
|
|
|
51483
51480
|
getComponents() {
|
|
51484
51481
|
return this._chart.getAllComponents();
|
|
51485
51482
|
}
|
|
51483
|
+
setDimensionIndex(value, opt = {}) {
|
|
51484
|
+
return this._chart?.setDimensionIndex(value, opt);
|
|
51485
|
+
}
|
|
51486
51486
|
}
|
|
51487
51487
|
|
|
51488
51488
|
var STATE_VALUE_ENUM;
|
|
@@ -51587,7 +51587,7 @@
|
|
|
51587
51587
|
}
|
|
51588
51588
|
constructor(option) {
|
|
51589
51589
|
this._option = option;
|
|
51590
|
-
this.event =
|
|
51590
|
+
this.event = this._option.model.getOption().getChart().getEvent();
|
|
51591
51591
|
this.interaction = option.interaction;
|
|
51592
51592
|
this.initConfig(option.mode);
|
|
51593
51593
|
}
|
|
@@ -51620,7 +51620,9 @@
|
|
|
51620
51620
|
const items = [];
|
|
51621
51621
|
params.dimensionInfo.forEach(df => {
|
|
51622
51622
|
df.data.forEach(dd => {
|
|
51623
|
-
const seriesMark = (reverse ? this._markReverse : this._marks)
|
|
51623
|
+
const seriesMark = (reverse ? this._markReverse : this._marks)
|
|
51624
|
+
.getMarks()
|
|
51625
|
+
.filter(m => m.model === dd.series && m.getVisible());
|
|
51624
51626
|
seriesMark.forEach(m => {
|
|
51625
51627
|
const elements = m
|
|
51626
51628
|
.getProduct()
|
|
@@ -54110,7 +54112,7 @@
|
|
|
54110
54112
|
VChart.useMark([ComponentMark, GroupMark]);
|
|
54111
54113
|
Factory.registerRegion('region', Region);
|
|
54112
54114
|
Factory.registerLayout('base', Layout);
|
|
54113
|
-
const version = "1.1.0-beta.
|
|
54115
|
+
const version = "1.1.0-beta.4";
|
|
54114
54116
|
|
|
54115
54117
|
var SeriesMarkNameEnum;
|
|
54116
54118
|
(function (SeriesMarkNameEnum) {
|
|
@@ -54598,6 +54600,9 @@
|
|
|
54598
54600
|
_globalScale;
|
|
54599
54601
|
_idMap = new Map();
|
|
54600
54602
|
_event;
|
|
54603
|
+
getEvent() {
|
|
54604
|
+
return this._event;
|
|
54605
|
+
}
|
|
54601
54606
|
_dataSet;
|
|
54602
54607
|
_layoutTag = true;
|
|
54603
54608
|
getLayoutTag() {
|
|
@@ -55479,6 +55484,51 @@
|
|
|
55479
55484
|
}
|
|
55480
55485
|
});
|
|
55481
55486
|
}
|
|
55487
|
+
setDimensionIndex(value, opt) {
|
|
55488
|
+
let dimensionInfo = null;
|
|
55489
|
+
Array.from(this._event.getComposedEventMap().values()).forEach(e => {
|
|
55490
|
+
const { eventType, event } = e;
|
|
55491
|
+
if (eventType === DimensionEventEnum.dimensionHover || eventType === DimensionEventEnum.dimensionClick) {
|
|
55492
|
+
const info = event.dispatch(value, opt);
|
|
55493
|
+
if (info?.length) {
|
|
55494
|
+
dimensionInfo = info;
|
|
55495
|
+
}
|
|
55496
|
+
}
|
|
55497
|
+
});
|
|
55498
|
+
if (!dimensionInfo) {
|
|
55499
|
+
return;
|
|
55500
|
+
}
|
|
55501
|
+
if (opt.tooltip) {
|
|
55502
|
+
const tooltip = this._components.find(c => c.type === ComponentTypeEnum.tooltip);
|
|
55503
|
+
if (tooltip.getVisible()) {
|
|
55504
|
+
const dataFilter = {};
|
|
55505
|
+
dimensionInfo.forEach((d) => {
|
|
55506
|
+
const { axis, value, data } = d;
|
|
55507
|
+
const isY = axis.orient === 'left' || axis.orient === 'right';
|
|
55508
|
+
data.forEach(d => {
|
|
55509
|
+
if (isY) {
|
|
55510
|
+
dataFilter[d.series.fieldY[0]] = value;
|
|
55511
|
+
}
|
|
55512
|
+
else {
|
|
55513
|
+
dataFilter[d.series.fieldX[0]] = value;
|
|
55514
|
+
}
|
|
55515
|
+
});
|
|
55516
|
+
});
|
|
55517
|
+
tooltip.showTooltip(dataFilter, opt.showTooltipOption);
|
|
55518
|
+
}
|
|
55519
|
+
}
|
|
55520
|
+
if (opt.crosshair) {
|
|
55521
|
+
const crosshair = this._components.find(c => c.type === ComponentTypeEnum.cartesianCrosshair);
|
|
55522
|
+
if (crosshair && crosshair.clearAxisValue && crosshair.setAxisValue) {
|
|
55523
|
+
dimensionInfo.forEach((d) => {
|
|
55524
|
+
const { axis, value } = d;
|
|
55525
|
+
crosshair.clearAxisValue();
|
|
55526
|
+
crosshair.setAxisValue(value, axis);
|
|
55527
|
+
crosshair.layoutByValue();
|
|
55528
|
+
});
|
|
55529
|
+
}
|
|
55530
|
+
}
|
|
55531
|
+
}
|
|
55482
55532
|
}
|
|
55483
55533
|
|
|
55484
55534
|
class CartesianChart extends BaseChart {
|
|
@@ -55600,42 +55650,6 @@
|
|
|
55600
55650
|
ChartTypeEnum["heatmap"] = "heatmap";
|
|
55601
55651
|
})(ChartTypeEnum || (ChartTypeEnum = {}));
|
|
55602
55652
|
|
|
55603
|
-
const DEFAULT_SMOOTH_INTERPOLATE = 'monotone';
|
|
55604
|
-
const DEFAULT_LINEAR_CLOSED_INTERPOLATE = 'linearClosed';
|
|
55605
|
-
|
|
55606
|
-
var ShapeTypeEnum;
|
|
55607
|
-
(function (ShapeTypeEnum) {
|
|
55608
|
-
ShapeTypeEnum["circle"] = "circle";
|
|
55609
|
-
ShapeTypeEnum["triangle"] = "triangle";
|
|
55610
|
-
ShapeTypeEnum["triangleUp"] = "triangleUp";
|
|
55611
|
-
ShapeTypeEnum["triangleLeft"] = "triangleLeft";
|
|
55612
|
-
ShapeTypeEnum["triangleRight"] = "triangleRight";
|
|
55613
|
-
ShapeTypeEnum["triangleDown"] = "triangleDown";
|
|
55614
|
-
ShapeTypeEnum["thinTriangle"] = "thinTriangle";
|
|
55615
|
-
ShapeTypeEnum["rect"] = "rect";
|
|
55616
|
-
ShapeTypeEnum["diamond"] = "diamond";
|
|
55617
|
-
ShapeTypeEnum["square"] = "square";
|
|
55618
|
-
ShapeTypeEnum["arrowLeft"] = "arrowLeft";
|
|
55619
|
-
ShapeTypeEnum["arrow2Left"] = "arrow2Left";
|
|
55620
|
-
ShapeTypeEnum["arrowRight"] = "arrowRight";
|
|
55621
|
-
ShapeTypeEnum["arrow2Right"] = "arrow2Right";
|
|
55622
|
-
ShapeTypeEnum["cross"] = "cross";
|
|
55623
|
-
ShapeTypeEnum["wedge"] = "wedge";
|
|
55624
|
-
ShapeTypeEnum["star"] = "star";
|
|
55625
|
-
ShapeTypeEnum["wye"] = "wye";
|
|
55626
|
-
})(ShapeTypeEnum || (ShapeTypeEnum = {}));
|
|
55627
|
-
|
|
55628
|
-
const DEFAULT_CLOSE_STROKE_JOIN = 'bevel';
|
|
55629
|
-
|
|
55630
|
-
var TooltipFixedPosition;
|
|
55631
|
-
(function (TooltipFixedPosition) {
|
|
55632
|
-
TooltipFixedPosition["top"] = "top";
|
|
55633
|
-
TooltipFixedPosition["left"] = "left";
|
|
55634
|
-
TooltipFixedPosition["right"] = "right";
|
|
55635
|
-
TooltipFixedPosition["bottom"] = "bottom";
|
|
55636
|
-
TooltipFixedPosition["inside"] = "inside";
|
|
55637
|
-
})(TooltipFixedPosition || (TooltipFixedPosition = {}));
|
|
55638
|
-
|
|
55639
55653
|
function setDefaultCrosshairForCartesianChart(spec) {
|
|
55640
55654
|
spec.crosshair = array(spec.crosshair || {}).map(crosshairCfg => {
|
|
55641
55655
|
return merge$1({
|
|
@@ -65533,28 +65547,6 @@
|
|
|
65533
65547
|
}
|
|
65534
65548
|
mixin(RadarSeries, LineLikeSeriesMixin);
|
|
65535
65549
|
|
|
65536
|
-
function isXAxis(orient) {
|
|
65537
|
-
return orient === 'bottom' || orient === 'top';
|
|
65538
|
-
}
|
|
65539
|
-
function isYAxis(orient) {
|
|
65540
|
-
return orient === 'left' || orient === 'right';
|
|
65541
|
-
}
|
|
65542
|
-
function isZAxis(orient) {
|
|
65543
|
-
return orient === 'z';
|
|
65544
|
-
}
|
|
65545
|
-
function autoAxisType(orient, isHorizontal) {
|
|
65546
|
-
if (isHorizontal) {
|
|
65547
|
-
return isXAxis(orient) ? 'linear' : 'band';
|
|
65548
|
-
}
|
|
65549
|
-
return isXAxis(orient) ? 'band' : 'linear';
|
|
65550
|
-
}
|
|
65551
|
-
function getOrient(spec, whiteList) {
|
|
65552
|
-
return isValidOrient(spec.orient) || (whiteList && whiteList.includes(spec.orient)) ? spec.orient : 'left';
|
|
65553
|
-
}
|
|
65554
|
-
function getDirectionByOrient(orient) {
|
|
65555
|
-
return orient === 'top' || orient === 'bottom' ? Direction$2.horizontal : Direction$2.vertical;
|
|
65556
|
-
}
|
|
65557
|
-
|
|
65558
65550
|
class DotSeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
65559
65551
|
updateTooltipSpec() {
|
|
65560
65552
|
super.updateTooltipSpec();
|
|
@@ -78376,18 +78368,6 @@
|
|
|
78376
78368
|
});
|
|
78377
78369
|
}
|
|
78378
78370
|
updateScaleDomain() {
|
|
78379
|
-
if (!this.isSeriesDataEnable()) {
|
|
78380
|
-
return;
|
|
78381
|
-
}
|
|
78382
|
-
this.computeStatisticsDomain();
|
|
78383
|
-
for (let i = 0; i < this._scales.length; i++) {
|
|
78384
|
-
const data = this.collectData(i);
|
|
78385
|
-
const domain = this.computeDomain(data);
|
|
78386
|
-
this._scales[i].domain(domain);
|
|
78387
|
-
}
|
|
78388
|
-
this.transformScaleDomain();
|
|
78389
|
-
this.event.emit(ChartEvent.scaleDomainUpdate, { model: this });
|
|
78390
|
-
this.event.emit(ChartEvent.scaleUpdate, { model: this });
|
|
78391
78371
|
}
|
|
78392
78372
|
computeData() {
|
|
78393
78373
|
this._tickData.getDataView().reRunAllTransform();
|
|
@@ -79397,6 +79377,26 @@
|
|
|
79397
79377
|
}
|
|
79398
79378
|
return Array.from(tempSet);
|
|
79399
79379
|
}
|
|
79380
|
+
updateScaleDomain() {
|
|
79381
|
+
if (!this.isSeriesDataEnable()) {
|
|
79382
|
+
return;
|
|
79383
|
+
}
|
|
79384
|
+
this.computeStatisticsDomain();
|
|
79385
|
+
const userDomain = this._spec.domain;
|
|
79386
|
+
for (let i = 0; i < this._scales.length; i++) {
|
|
79387
|
+
if (userDomain && userDomain.length && i === 0) {
|
|
79388
|
+
this._scales[i].domain(userDomain);
|
|
79389
|
+
}
|
|
79390
|
+
else {
|
|
79391
|
+
const data = this.collectData(i);
|
|
79392
|
+
const domain = this.computeDomain(data);
|
|
79393
|
+
this._scales[i].domain(domain);
|
|
79394
|
+
}
|
|
79395
|
+
}
|
|
79396
|
+
this.transformScaleDomain();
|
|
79397
|
+
this.event.emit(ChartEvent.scaleDomainUpdate, { model: this });
|
|
79398
|
+
this.event.emit(ChartEvent.scaleUpdate, { model: this });
|
|
79399
|
+
}
|
|
79400
79400
|
}
|
|
79401
79401
|
|
|
79402
79402
|
class CartesianBandAxis extends CartesianAxis {
|
|
@@ -80080,7 +80080,8 @@
|
|
|
80080
80080
|
}
|
|
80081
80081
|
|
|
80082
80082
|
const discreteLegendDataMake = (data, op) => {
|
|
80083
|
-
const result =
|
|
80083
|
+
const result = [];
|
|
80084
|
+
const tempKey = {};
|
|
80084
80085
|
const { series, seriesField } = op;
|
|
80085
80086
|
series().forEach(s => {
|
|
80086
80087
|
const field = seriesField(s);
|
|
@@ -80092,13 +80093,14 @@
|
|
|
80092
80093
|
infoList = s.getSeriesInfoInField(field);
|
|
80093
80094
|
}
|
|
80094
80095
|
infoList.forEach(info => {
|
|
80095
|
-
if (
|
|
80096
|
+
if (tempKey[info.key]) {
|
|
80096
80097
|
return;
|
|
80097
80098
|
}
|
|
80098
|
-
|
|
80099
|
+
tempKey[info.key] = true;
|
|
80100
|
+
result.push(info);
|
|
80099
80101
|
});
|
|
80100
80102
|
});
|
|
80101
|
-
return
|
|
80103
|
+
return result;
|
|
80102
80104
|
};
|
|
80103
80105
|
const discreteLegendFilter = (data, op) => {
|
|
80104
80106
|
const { selected, field, data: legendData } = op;
|
|
@@ -81839,6 +81841,24 @@
|
|
|
81839
81841
|
}
|
|
81840
81842
|
return value;
|
|
81841
81843
|
}
|
|
81844
|
+
clearAxisValue() {
|
|
81845
|
+
this.currValueX.clear();
|
|
81846
|
+
this.currValueY.clear();
|
|
81847
|
+
}
|
|
81848
|
+
setAxisValue(v, axis) {
|
|
81849
|
+
if (isXAxis(axis.orient)) {
|
|
81850
|
+
this.currValueX.set(axis.getSpecIndex(), {
|
|
81851
|
+
v,
|
|
81852
|
+
axis
|
|
81853
|
+
});
|
|
81854
|
+
}
|
|
81855
|
+
else {
|
|
81856
|
+
this.currValueX.set(axis.getSpecIndex(), {
|
|
81857
|
+
v,
|
|
81858
|
+
axis
|
|
81859
|
+
});
|
|
81860
|
+
}
|
|
81861
|
+
}
|
|
81842
81862
|
getAllAxisValues(axisMap, p, currValue, vertical) {
|
|
81843
81863
|
let discrete = false;
|
|
81844
81864
|
axisMap.forEach(item => {
|
|
@@ -81889,7 +81909,7 @@
|
|
|
81889
81909
|
this._yLeftLabel && this._yLeftLabel.hideAll();
|
|
81890
81910
|
this._yRightLabel && this._yRightLabel.hideAll();
|
|
81891
81911
|
}
|
|
81892
|
-
layoutByValue(tag) {
|
|
81912
|
+
layoutByValue(tag = LayoutType$1.ALL) {
|
|
81893
81913
|
if (!this.enable) {
|
|
81894
81914
|
return;
|
|
81895
81915
|
}
|
|
@@ -84689,7 +84709,6 @@
|
|
|
84689
84709
|
return styleObj;
|
|
84690
84710
|
}
|
|
84691
84711
|
|
|
84692
|
-
const domDocument = globalThis.document;
|
|
84693
84712
|
class BaseTooltipModel {
|
|
84694
84713
|
static type = 'tooltipModel';
|
|
84695
84714
|
static isInstance(obj) {
|
|
@@ -85323,7 +85342,7 @@
|
|
|
85323
85342
|
|
|
85324
85343
|
class DomTooltipHandler extends BaseTooltipHandler {
|
|
85325
85344
|
type = TooltipHandlerType.dom;
|
|
85326
|
-
_tooltipContainer =
|
|
85345
|
+
_tooltipContainer = domDocument?.body;
|
|
85327
85346
|
_domStyle;
|
|
85328
85347
|
_tooltipActual;
|
|
85329
85348
|
model;
|
|
@@ -85859,7 +85878,7 @@
|
|
|
85859
85878
|
this._spec.parentElement = userSpec.parentElement;
|
|
85860
85879
|
}
|
|
85861
85880
|
else if (isTrueBrowser(this._option.mode)) {
|
|
85862
|
-
this._spec.parentElement =
|
|
85881
|
+
this._spec.parentElement = domDocument?.body;
|
|
85863
85882
|
}
|
|
85864
85883
|
if (isValid(userSpec.confine)) {
|
|
85865
85884
|
this._spec.confine = userSpec.confine;
|
|
@@ -85953,6 +85972,9 @@
|
|
|
85953
85972
|
}
|
|
85954
85973
|
return false;
|
|
85955
85974
|
}
|
|
85975
|
+
getVisible() {
|
|
85976
|
+
return this._spec.visible === true;
|
|
85977
|
+
}
|
|
85956
85978
|
}
|
|
85957
85979
|
|
|
85958
85980
|
function barLabel(labelInfo) {
|