@visactor/vchart 2.1.5-alpha.0 → 2.1.5-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/build/es5/index.js +1 -1
- package/build/index.es.js +65 -8
- package/build/index.js +73538 -70200
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.js +1 -1
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/component/legend/discrete/interface.d.ts +9 -1
- package/cjs/component/legend/discrete/interface.js.map +1 -1
- package/cjs/component/legend/discrete/util.js +12 -2
- package/cjs/component/legend/discrete/util.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +1 -1
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.d.ts +5 -0
- package/cjs/component/marker/mark-point/base-mark-point.js +30 -2
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/core/expression-function.js +1 -1
- package/cjs/core/factory-registry.js +1 -1
- package/cjs/core/factory-registry.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.js +1 -6
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/data-view-utils.js +1 -1
- package/esm/chart/base/base-chart.js +1 -1
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/component/legend/discrete/interface.d.ts +9 -1
- package/esm/component/legend/discrete/interface.js.map +1 -1
- package/esm/component/legend/discrete/util.js +11 -2
- package/esm/component/legend/discrete/util.js.map +1 -1
- package/esm/component/marker/interface.d.ts +1 -1
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.d.ts +5 -0
- package/esm/component/marker/mark-point/base-mark-point.js +34 -2
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/core/expression-function.js +1 -1
- package/esm/core/factory-registry.js +1 -1
- package/esm/core/factory-registry.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.js +1 -6
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/data-view-utils.js +1 -1
- package/package.json +8 -8
package/build/index.es.js
CHANGED
|
@@ -19529,7 +19529,7 @@ class VChart {
|
|
|
19529
19529
|
this._compiler.updateLayoutTag();
|
|
19530
19530
|
this._setFontFamilyTheme(this.getTheme('fontFamily'));
|
|
19531
19531
|
this._initDataSet(this._option.dataSet);
|
|
19532
|
-
this._autoSize = isTrueBrowseEnv ? (
|
|
19532
|
+
this._autoSize = isTrueBrowseEnv ? (_g = (_f = spec.autoFit) !== null && _f !== void 0 ? _f : this._option.autoFit) !== null && _g !== void 0 ? _g : true : false;
|
|
19533
19533
|
this._bindResizeEvent();
|
|
19534
19534
|
this._bindViewEvent();
|
|
19535
19535
|
this._initChartPlugin();
|
|
@@ -19700,7 +19700,6 @@ class VChart {
|
|
|
19700
19700
|
}
|
|
19701
19701
|
_reCompile(updateResult, morphConfig) {
|
|
19702
19702
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
19703
|
-
const shouldRestoreUserEvents = updateResult.reMake && !!this._chart;
|
|
19704
19703
|
if (updateResult.reMake) {
|
|
19705
19704
|
this._releaseData();
|
|
19706
19705
|
this._initDataSet();
|
|
@@ -19720,9 +19719,6 @@ class VChart {
|
|
|
19720
19719
|
if (updateResult.reMake) {
|
|
19721
19720
|
const cacheGrammarForMorph = this.isAnimationEnable() && (morphConfig === null || morphConfig === void 0 ? void 0 : morphConfig.morph) !== false;
|
|
19722
19721
|
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.releaseGrammar(!cacheGrammarForMorph);
|
|
19723
|
-
if (shouldRestoreUserEvents) {
|
|
19724
|
-
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
19725
|
-
}
|
|
19726
19722
|
}
|
|
19727
19723
|
else if (updateResult.reCompile) {
|
|
19728
19724
|
(_d = this._compiler) === null || _d === void 0 ? void 0 : _d.clear({ chart: this._chart, vChart: this });
|
|
@@ -20216,7 +20212,7 @@ class VChart {
|
|
|
20216
20212
|
resize = true;
|
|
20217
20213
|
}
|
|
20218
20214
|
const lasAutoSize = this._autoSize;
|
|
20219
|
-
this._autoSize = isTrueBrowser(this._option.mode) ? (
|
|
20215
|
+
this._autoSize = isTrueBrowser(this._option.mode) ? (_b = (_a = this._spec.autoFit) !== null && _a !== void 0 ? _a : this._option.autoFit) !== null && _b !== void 0 ? _b : true : false;
|
|
20220
20216
|
if (this._autoSize !== lasAutoSize) {
|
|
20221
20217
|
resize = true;
|
|
20222
20218
|
}
|
|
@@ -20812,7 +20808,7 @@ const lookup = (data, opt) => {
|
|
|
20812
20808
|
});
|
|
20813
20809
|
};
|
|
20814
20810
|
|
|
20815
|
-
const version = "2.1.
|
|
20811
|
+
const version = "2.1.5";
|
|
20816
20812
|
|
|
20817
20813
|
const addVChartProperty = (data, op) => {
|
|
20818
20814
|
const context = op.beforeCall();
|
|
@@ -30044,6 +30040,7 @@ class BaseChart extends CompilableBase {
|
|
|
30044
30040
|
m.beforeRelease();
|
|
30045
30041
|
});
|
|
30046
30042
|
}
|
|
30043
|
+
this._event.release();
|
|
30047
30044
|
super.release();
|
|
30048
30045
|
this.clear();
|
|
30049
30046
|
[...this._components, ...this._regions, ...this._series].forEach(m => {
|
|
@@ -55077,7 +55074,9 @@ function getLegendAttributes(spec, rect, layoutOrient) {
|
|
|
55077
55074
|
pager = cloneDeep(pager);
|
|
55078
55075
|
background = cloneDeep(background);
|
|
55079
55076
|
const attrs = restSpec;
|
|
55080
|
-
|
|
55077
|
+
const pagerLayout = pager.layout;
|
|
55078
|
+
const pagerPosition = pager.position;
|
|
55079
|
+
if (isFunction$1(attrs.maxRow) || isFunction$1(attrs.maxCol) || isFunction$1(pagerLayout) || isFunction$1(pagerPosition)) {
|
|
55081
55080
|
const resolvedOrient = isValidOrient(layoutOrient) ? layoutOrient : isValidOrient(orient) ? orient : 'left';
|
|
55082
55081
|
if (isFunction$1(attrs.maxRow)) {
|
|
55083
55082
|
attrs.maxRow = attrs.maxRow({ rect, orient: resolvedOrient, id });
|
|
@@ -55085,6 +55084,20 @@ function getLegendAttributes(spec, rect, layoutOrient) {
|
|
|
55085
55084
|
if (isFunction$1(attrs.maxCol)) {
|
|
55086
55085
|
attrs.maxCol = attrs.maxCol({ rect, orient: resolvedOrient, id });
|
|
55087
55086
|
}
|
|
55087
|
+
const isArrowPager = pager.type !== 'scrollbar';
|
|
55088
|
+
const pagerContext = {
|
|
55089
|
+
rect,
|
|
55090
|
+
orient: resolvedOrient,
|
|
55091
|
+
id,
|
|
55092
|
+
maxRow: attrs.maxRow,
|
|
55093
|
+
maxCol: attrs.maxCol
|
|
55094
|
+
};
|
|
55095
|
+
if (isArrowPager && isFunction$1(pagerLayout)) {
|
|
55096
|
+
pager.layout = pagerLayout(pagerContext);
|
|
55097
|
+
}
|
|
55098
|
+
if (isArrowPager && isFunction$1(pagerPosition)) {
|
|
55099
|
+
pager.position = pagerPosition(pagerContext);
|
|
55100
|
+
}
|
|
55088
55101
|
}
|
|
55089
55102
|
if (title.visible) {
|
|
55090
55103
|
attrs.title = transformLegendTitleAttributes(title);
|
|
@@ -63771,6 +63784,50 @@ class BaseMarkPoint extends BaseMarker {
|
|
|
63771
63784
|
super(...arguments);
|
|
63772
63785
|
this.specKey = 'markPoint';
|
|
63773
63786
|
this.layoutZIndex = LayoutZIndex.MarkPoint;
|
|
63787
|
+
this._handleDimensionHover = (params) => {
|
|
63788
|
+
var _a, _b;
|
|
63789
|
+
const targetSymbol = this._getTargetSymbolGraphic();
|
|
63790
|
+
if (!targetSymbol) {
|
|
63791
|
+
return;
|
|
63792
|
+
}
|
|
63793
|
+
switch (params.action) {
|
|
63794
|
+
case 'enter': {
|
|
63795
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER);
|
|
63796
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE);
|
|
63797
|
+
if (this._isDimensionHoverTarget(params)) {
|
|
63798
|
+
targetSymbol.addState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER, true);
|
|
63799
|
+
}
|
|
63800
|
+
else if ((_b = (_a = this._spec.targetSymbol) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.dimension_hover_reverse) {
|
|
63801
|
+
targetSymbol.addState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE, true);
|
|
63802
|
+
}
|
|
63803
|
+
break;
|
|
63804
|
+
}
|
|
63805
|
+
case 'leave':
|
|
63806
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER);
|
|
63807
|
+
targetSymbol.removeState(STATE_VALUE_ENUM.STATE_DIMENSION_HOVER_REVERSE);
|
|
63808
|
+
break;
|
|
63809
|
+
}
|
|
63810
|
+
};
|
|
63811
|
+
}
|
|
63812
|
+
initEvent() {
|
|
63813
|
+
var _a;
|
|
63814
|
+
super.initEvent();
|
|
63815
|
+
const targetSymbolState = (_a = this._spec.targetSymbol) === null || _a === void 0 ? void 0 : _a.state;
|
|
63816
|
+
if (this.coordinateType === 'cartesian' &&
|
|
63817
|
+
((targetSymbolState === null || targetSymbolState === void 0 ? void 0 : targetSymbolState.dimension_hover) || (targetSymbolState === null || targetSymbolState === void 0 ? void 0 : targetSymbolState.dimension_hover_reverse))) {
|
|
63818
|
+
this.event.on(DimensionEventEnum.dimensionHover, this._handleDimensionHover);
|
|
63819
|
+
}
|
|
63820
|
+
}
|
|
63821
|
+
_getTargetSymbolGraphic() {
|
|
63822
|
+
var _a;
|
|
63823
|
+
return (_a = this._markerComponent) === null || _a === void 0 ? void 0 : _a.find(node => node.name === 'mark-point-targetItem', true);
|
|
63824
|
+
}
|
|
63825
|
+
_isDimensionHoverTarget(params) {
|
|
63826
|
+
var _a, _b, _c, _d;
|
|
63827
|
+
const latestData = (_a = this._markerData) === null || _a === void 0 ? void 0 : _a.latestData;
|
|
63828
|
+
const markerData = (_c = (_b = latestData === null || latestData === void 0 ? void 0 : latestData[0]) === null || _b === void 0 ? void 0 : _b.latestData) !== null && _c !== void 0 ? _c : latestData;
|
|
63829
|
+
const markerXValues = array((_d = markerData === null || markerData === void 0 ? void 0 : markerData[0]) === null || _d === void 0 ? void 0 : _d.x).filter(isValid$1);
|
|
63830
|
+
return markerXValues.some(value => params.dimensionInfo.some(dimension => dimension.value === value));
|
|
63774
63831
|
}
|
|
63775
63832
|
static _getMarkerCoordinateType(markerSpec) {
|
|
63776
63833
|
const { doPolarProcess, doGeoProcess } = getMarkPointProcessInfo(markerSpec);
|