@visactor/react-vchart 2.1.0-alpha.3 → 2.1.0-alpha.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 +67 -16
- package/build/index.min.js +3 -3
- package/cjs/charts/AreaChart.js +1 -1
- package/cjs/charts/Bar3dChart.js +1 -1
- package/cjs/charts/BarChart.js +1 -1
- package/cjs/charts/BaseChart.js +1 -1
- package/cjs/charts/BoxPlotChart.js +1 -1
- package/cjs/charts/CirclePackingChart.js +1 -1
- package/cjs/charts/CircularProgressChart.js +1 -1
- package/cjs/charts/CommonChart.js +1 -1
- package/cjs/charts/CorrelationChart.js +1 -1
- package/cjs/charts/Funnel3dChart.js +1 -1
- package/cjs/charts/FunnelChart.js +1 -1
- package/cjs/charts/GaugeChart.js +1 -1
- package/cjs/charts/HeatmapChart.js +1 -1
- package/cjs/charts/Histogram3dChart.js +1 -1
- package/cjs/charts/HistogramChart.js +2 -1
- package/cjs/charts/LineChart.js +1 -1
- package/cjs/charts/LinearProgressChart.js +1 -1
- package/cjs/charts/LiquidChart.js +1 -1
- package/cjs/charts/MapChart.js +1 -1
- package/cjs/charts/MosaicChart.js +1 -1
- package/cjs/charts/PictogramChart.js +1 -1
- package/cjs/charts/Pie3dChart.js +1 -1
- package/cjs/charts/PieChart.js +1 -1
- package/cjs/charts/RadarChart.js +1 -1
- package/cjs/charts/RangeAreaChart.js +1 -1
- package/cjs/charts/RangeColumn3dChart.js +1 -1
- package/cjs/charts/RangeColumnChart.js +1 -1
- package/cjs/charts/RoseChart.js +1 -1
- package/cjs/charts/SankeyChart.js +1 -1
- package/cjs/charts/ScatterChart.js +1 -1
- package/cjs/charts/SequenceChart.js +2 -1
- package/cjs/charts/SunburstChart.js +1 -1
- package/cjs/charts/TreemapChart.js +1 -1
- package/cjs/charts/VennChart.js +1 -1
- package/cjs/charts/WaterfallChart.js +1 -1
- package/cjs/charts/WordCloud3dChart.js +1 -1
- package/cjs/charts/WordCloudChart.js +1 -1
- package/cjs/components/MarkArea.js +2 -1
- package/cjs/components/MarkPoint.js +1 -2
- package/cjs/context/chart.js +1 -1
- package/cjs/context/stage.js +1 -1
- package/cjs/series/Area.js +1 -1
- package/cjs/series/Bar.js +1 -1
- package/cjs/series/Bar3d.js +1 -1
- package/cjs/series/BaseSeries.js +1 -1
- package/cjs/series/BoxPlot.js +1 -1
- package/cjs/series/CirclePacking.js +1 -1
- package/cjs/series/CircularProgress.js +1 -1
- package/cjs/series/Correlation.js +1 -1
- package/cjs/series/Dot.js +1 -1
- package/cjs/series/Funnel.js +1 -1
- package/cjs/series/Funnel3d.js +1 -1
- package/cjs/series/Gauge.js +1 -2
- package/cjs/series/GaugePointer.js +1 -1
- package/cjs/series/Heatmap.js +1 -1
- package/cjs/series/Line.js +1 -1
- package/cjs/series/LinearProgress.js +1 -1
- package/cjs/series/Link.js +1 -1
- package/cjs/series/Liquid.js +1 -1
- package/cjs/series/Map.js +1 -1
- package/cjs/series/Mosaic.js +1 -1
- package/cjs/series/Pictogram.js +1 -1
- package/cjs/series/Pie.js +1 -1
- package/cjs/series/Pie3d.js +1 -1
- package/cjs/series/Radar.js +1 -1
- package/cjs/series/RangeArea.js +1 -1
- package/cjs/series/RangeColumn.js +1 -1
- package/cjs/series/RangeColumn3d.js +1 -1
- package/cjs/series/Rose.js +1 -2
- package/cjs/series/Sankey.js +1 -1
- package/cjs/series/Scatter.js +1 -1
- package/cjs/series/Series.js +1 -1
- package/cjs/series/Sunburst.js +1 -1
- package/cjs/series/Treemap.js +1 -1
- package/cjs/series/Venn.js +1 -1
- package/cjs/series/Waterfall.js +1 -1
- package/esm/charts/AreaChart.js +1 -1
- package/esm/charts/Bar3dChart.js +1 -1
- package/esm/charts/BarChart.js +1 -1
- package/esm/charts/BaseChart.js +1 -1
- package/esm/charts/BoxPlotChart.js +1 -1
- package/esm/charts/CirclePackingChart.js +1 -1
- package/esm/charts/CircularProgressChart.js +1 -1
- package/esm/charts/CommonChart.js +1 -1
- package/esm/charts/CorrelationChart.js +1 -1
- package/esm/charts/Funnel3dChart.js +1 -1
- package/esm/charts/FunnelChart.js +1 -1
- package/esm/charts/GaugeChart.js +1 -1
- package/esm/charts/HeatmapChart.js +1 -1
- package/esm/charts/Histogram3dChart.js +1 -1
- package/esm/charts/HistogramChart.js +2 -1
- package/esm/charts/LineChart.js +1 -1
- package/esm/charts/LinearProgressChart.js +1 -1
- package/esm/charts/LiquidChart.js +1 -1
- package/esm/charts/MapChart.js +1 -1
- package/esm/charts/MosaicChart.js +1 -1
- package/esm/charts/PictogramChart.js +1 -1
- package/esm/charts/Pie3dChart.js +1 -1
- package/esm/charts/PieChart.js +1 -1
- package/esm/charts/RadarChart.js +1 -1
- package/esm/charts/RangeAreaChart.js +1 -1
- package/esm/charts/RangeColumn3dChart.js +1 -1
- package/esm/charts/RangeColumnChart.js +1 -1
- package/esm/charts/RoseChart.js +1 -1
- package/esm/charts/SankeyChart.js +1 -1
- package/esm/charts/ScatterChart.js +1 -1
- package/esm/charts/SequenceChart.js +2 -1
- package/esm/charts/SunburstChart.js +1 -1
- package/esm/charts/TreemapChart.js +1 -1
- package/esm/charts/VennChart.js +1 -1
- package/esm/charts/WaterfallChart.js +1 -1
- package/esm/charts/WordCloud3dChart.js +1 -1
- package/esm/charts/WordCloudChart.js +1 -1
- package/esm/components/MarkArea.js +2 -1
- package/esm/components/MarkPoint.js +1 -2
- package/esm/context/chart.js +1 -1
- package/esm/context/stage.js +1 -1
- package/esm/series/Area.js +1 -1
- package/esm/series/Bar.js +1 -1
- package/esm/series/Bar3d.js +1 -1
- package/esm/series/BaseSeries.js +1 -1
- package/esm/series/BoxPlot.js +1 -1
- package/esm/series/CirclePacking.js +1 -1
- package/esm/series/CircularProgress.js +1 -1
- package/esm/series/Correlation.js +1 -1
- package/esm/series/Dot.js +1 -1
- package/esm/series/Funnel.js +1 -1
- package/esm/series/Funnel3d.js +1 -1
- package/esm/series/Gauge.js +1 -2
- package/esm/series/GaugePointer.js +1 -1
- package/esm/series/Heatmap.js +1 -1
- package/esm/series/Line.js +1 -1
- package/esm/series/LinearProgress.js +1 -1
- package/esm/series/Link.js +1 -1
- package/esm/series/Liquid.js +1 -1
- package/esm/series/Map.js +1 -1
- package/esm/series/Mosaic.js +1 -1
- package/esm/series/Pictogram.js +1 -1
- package/esm/series/Pie.js +1 -1
- package/esm/series/Pie3d.js +1 -1
- package/esm/series/Radar.js +1 -1
- package/esm/series/RangeArea.js +1 -1
- package/esm/series/RangeColumn.js +1 -1
- package/esm/series/RangeColumn3d.js +1 -1
- package/esm/series/Rose.js +1 -2
- package/esm/series/Sankey.js +1 -1
- package/esm/series/Scatter.js +1 -1
- package/esm/series/Series.js +1 -1
- package/esm/series/Sunburst.js +1 -1
- package/esm/series/Treemap.js +1 -1
- package/esm/series/Venn.js +1 -1
- package/esm/series/Waterfall.js +1 -1
- package/package.json +5 -5
package/build/index.js
CHANGED
|
@@ -64017,17 +64017,15 @@
|
|
|
64017
64017
|
}
|
|
64018
64018
|
}
|
|
64019
64019
|
_compareSpec(spec, prevSpec) {
|
|
64020
|
+
var _a, _b;
|
|
64020
64021
|
const result = super._compareSpec(spec, prevSpec);
|
|
64021
64022
|
if (result.reMake) return result;
|
|
64022
64023
|
const specChanged = !isEqual(prevSpec, spec);
|
|
64023
|
-
return result.reRender = !0, (null == prevSpec ? void 0 : prevSpec.type) !== (null == spec ? void 0 : spec.type) || (null == prevSpec ? void 0 : prevSpec.visible) !== (null == spec ? void 0 : spec.visible) ? (result.reMake = !0, result) : (
|
|
64024
|
-
var _a, _b;
|
|
64025
|
-
return (null === (_a = null == prevSpec ? void 0 : prevSpec[k]) || void 0 === _a ? void 0 : _a.visible) !== (null === (_b = null == spec ? void 0 : spec[k]) || void 0 === _b ? void 0 : _b.visible);
|
|
64026
|
-
}), specChanged && !result.reMake && this._isComponentOnlySpecChange(spec, prevSpec) && (result.effects = Object.assign(Object.assign({}, result.effects), {
|
|
64024
|
+
return result.reRender = !0, (null == prevSpec ? void 0 : prevSpec.type) !== (null == spec ? void 0 : spec.type) || (null == prevSpec ? void 0 : prevSpec.visible) !== (null == spec ? void 0 : spec.visible) ? (result.reMake = !0, result) : !0 !== (null === (_a = null == spec ? void 0 : spec.grid) || void 0 === _a ? void 0 : _a.visible) || !0 === (null === (_b = null == prevSpec ? void 0 : prevSpec.grid) || void 0 === _b ? void 0 : _b.visible) || this._gridMark ? (specChanged && !result.reMake && this._isComponentOnlySpecChange(spec, prevSpec) && (result.effects = Object.assign(Object.assign({}, result.effects), {
|
|
64027
64025
|
component: !0,
|
|
64028
64026
|
layout: !0,
|
|
64029
64027
|
render: !0
|
|
64030
|
-
})), result);
|
|
64028
|
+
})), result) : (result.reMake = !0, result);
|
|
64031
64029
|
}
|
|
64032
64030
|
_isComponentOnlySpecChange(spec, prevSpec) {
|
|
64033
64031
|
return Object.keys(Object.assign(Object.assign({}, prevSpec), spec)).every(key => isEqual(null == prevSpec ? void 0 : prevSpec[key], null == spec ? void 0 : spec[key]) || AXIS_COMPONENT_ONLY_CHANGE_KEYS[key]);
|
|
@@ -66320,10 +66318,25 @@
|
|
|
66320
66318
|
return t;
|
|
66321
66319
|
};
|
|
66322
66320
|
const MARKER_COMPONENT_SPEC_KEYS = {
|
|
66323
|
-
|
|
66324
|
-
|
|
66325
|
-
|
|
66326
|
-
|
|
66321
|
+
[ComponentTypeEnum.markPoint]: !0,
|
|
66322
|
+
[ComponentTypeEnum.markLine]: !0,
|
|
66323
|
+
[ComponentTypeEnum.markArea]: !0
|
|
66324
|
+
},
|
|
66325
|
+
MARKER_ADDITION_REMAKE_SPEC_KEYS = {
|
|
66326
|
+
autoRange: !0,
|
|
66327
|
+
regionId: !0,
|
|
66328
|
+
regionIndex: !0,
|
|
66329
|
+
seriesId: !0,
|
|
66330
|
+
seriesIndex: !0,
|
|
66331
|
+
relativeSeriesId: !0,
|
|
66332
|
+
relativeSeriesIndex: !0,
|
|
66333
|
+
startRelativeSeriesId: !0,
|
|
66334
|
+
startRelativeSeriesIndex: !0,
|
|
66335
|
+
endRelativeSeriesId: !0,
|
|
66336
|
+
endRelativeSeriesIndex: !0,
|
|
66337
|
+
specifiedDataSeriesId: !0,
|
|
66338
|
+
specifiedDataSeriesIndex: !0
|
|
66339
|
+
};
|
|
66327
66340
|
let BaseChart$1 = class BaseChart extends CompilableBase {
|
|
66328
66341
|
getSpec() {
|
|
66329
66342
|
return this._spec;
|
|
@@ -66399,7 +66412,7 @@
|
|
|
66399
66412
|
}, this.getComponentsByKey = key => this._components.filter(c => (c.specKey || c.type) === key), this.getComponentByUserId = userId => {
|
|
66400
66413
|
const component = this._components.find(s => s.userId === userId);
|
|
66401
66414
|
if (component) return component;
|
|
66402
|
-
}, this.getComponentsByType = type => this._components.filter(c => c.type === type), this._paddingSpec = normalizeLayoutPaddingSpec(null !== (_a = spec.padding) && void 0 !== _a ? _a : option.getTheme("padding")), this._event = new Event$1(option.eventDispatcher, option.mode), this._dataSet = option.dataSet, this._chartData = new ChartData(this._dataSet), this._modelOption = Object.assign(Object.assign({}, option), {
|
|
66415
|
+
}, this.getComponentsByType = type => this._components.filter(c => c.type === type), this._isMarkerAdditionSpecSafeWithoutRemake = spec => !(!spec || "object" != typeof spec || !1 === spec.visible) && !Object.keys(MARKER_ADDITION_REMAKE_SPEC_KEYS).some(key => !isNil$1(spec[key])), this._paddingSpec = normalizeLayoutPaddingSpec(null !== (_a = spec.padding) && void 0 !== _a ? _a : option.getTheme("padding")), this._event = new Event$1(option.eventDispatcher, option.mode), this._dataSet = option.dataSet, this._chartData = new ChartData(this._dataSet), this._modelOption = Object.assign(Object.assign({}, option), {
|
|
66403
66416
|
mode: this._option.mode,
|
|
66404
66417
|
map: this._idMap,
|
|
66405
66418
|
getChartLayoutRect: () => this._layoutRect,
|
|
@@ -66713,7 +66726,7 @@
|
|
|
66713
66726
|
return Object.keys(spec).filter(key => !ignoreKeys[key]).sort();
|
|
66714
66727
|
}
|
|
66715
66728
|
updateSpec(spec) {
|
|
66716
|
-
var _a;
|
|
66729
|
+
var _a, _b;
|
|
66717
66730
|
const result = {
|
|
66718
66731
|
change: !1,
|
|
66719
66732
|
reMake: !1,
|
|
@@ -66729,7 +66742,7 @@
|
|
|
66729
66742
|
const key = currentKeys[i],
|
|
66730
66743
|
currentSpec = this._spec[key],
|
|
66731
66744
|
nextSpec = spec[key];
|
|
66732
|
-
if (isArray$1(currentSpec) && currentSpec.length !== array(nextSpec).length && !this.
|
|
66745
|
+
if (isArray$1(currentSpec) && currentSpec.length !== array(nextSpec).length && !this._canChangeMarkerComponentsWithoutRemake(key, currentSpec, nextSpec)) return result.reMake = !0, this.setLayoutTag(!0, null, !1), result;
|
|
66733
66746
|
}
|
|
66734
66747
|
const oldSpec = this._spec,
|
|
66735
66748
|
onlyMarkerComponentsRemoved = this._isOnlyMarkerComponentsRemoved(this._spec, spec, currentKeys),
|
|
@@ -66740,9 +66753,9 @@
|
|
|
66740
66753
|
if (this.updateGlobalScale(result), result.reMake) return this.setLayoutTag(!0, null, !1), result;
|
|
66741
66754
|
if (this.updateRegionSpec(result), result.reMake) return this.setLayoutTag(!0, null, !1), result;
|
|
66742
66755
|
const componentUpdateResult = this.updateComponentSpec(result);
|
|
66743
|
-
return result.reMake ? (this.setLayoutTag(!0, null, !1), result) : isUpdateSpecResultLocalOnly(result) ? result : onlyComponentSpecsChanged && !componentUpdateResult.hasNonComponentOnlyUpdate && (isUpdateSpecResultComponentOnly(result) || this._isComponentScaleDomainOnlyUpdate(result)) ? (componentUpdateResult.componentOnlyUpdatedComponents.forEach(component => {
|
|
66756
|
+
return result.reMake ? (this.setLayoutTag(!0, null, !1), result) : (!onlyComponentSpecsChanged && (null === (_a = result.effects) || void 0 === _a ? void 0 : _a.localOnly) && delete result.effects.localOnly, isUpdateSpecResultLocalOnly(result) ? result : onlyComponentSpecsChanged && !componentUpdateResult.hasNonComponentOnlyUpdate && (isUpdateSpecResultComponentOnly(result) || this._isComponentScaleDomainOnlyUpdate(result)) ? (componentUpdateResult.componentOnlyUpdatedComponents.forEach(component => {
|
|
66744
66757
|
component.reInit(component.getSpec());
|
|
66745
|
-
}), (null === (
|
|
66758
|
+
}), (null === (_b = result.effects) || void 0 === _b ? void 0 : _b.layout) && this.setLayoutTag(!0, null, !1), result) : (this.setLayoutTag(!0, null, !1), this.updateSeriesSpec(result), result.reMake || (this.reInit(), onlySeriesSpecsChanged && this._canSkipChartDataStages(result) || (this.updateDataSpec(), this.reDataFlow(), this._reRunStackDataFlow(), this.getAllModels().forEach(model => model.onDataUpdate()))), result));
|
|
66746
66759
|
}
|
|
66747
66760
|
updateChartConfig(result, oldSpec) {
|
|
66748
66761
|
var _a, _b;
|
|
@@ -66788,7 +66801,7 @@
|
|
|
66788
66801
|
componentResult = c.updateSpec(cmpSpec);
|
|
66789
66802
|
isUpdateSpecResultComponentOnly(componentResult) || this._isComponentScaleDomainOnlyUpdate(componentResult) ? componentOnlyUpdatedComponents.push(c) : isEqual(previousComponentSpec, cmpSpec) || (hasNonComponentOnlyUpdate = !0), mergeUpdateResult(result, componentResult);
|
|
66790
66803
|
}
|
|
66791
|
-
});
|
|
66804
|
+
}), result.reMake || this._createMissingMarkerComponentsForSpecs(result, componentCache);
|
|
66792
66805
|
for (const key in componentCache) if (Object.prototype.hasOwnProperty.call(componentCache, key)) {
|
|
66793
66806
|
const element = componentCache[key];
|
|
66794
66807
|
element.componentCount !== element.specCount && (result.reMake = !0);
|
|
@@ -66810,6 +66823,12 @@
|
|
|
66810
66823
|
hasNonComponentOnlyUpdate: hasNonComponentOnlyUpdate
|
|
66811
66824
|
};
|
|
66812
66825
|
}
|
|
66826
|
+
_canChangeMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
66827
|
+
return this._canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) || this._canAddMarkerComponentsWithoutRemake(key, currentSpec, nextSpec);
|
|
66828
|
+
}
|
|
66829
|
+
_canAddMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
66830
|
+
return !!(MARKER_COMPONENT_SPEC_KEYS[key] && isArray$1(currentSpec) && isArray$1(nextSpec)) && !(nextSpec.length <= currentSpec.length) && nextSpec.slice(currentSpec.length).every(this._isMarkerAdditionSpecSafeWithoutRemake);
|
|
66831
|
+
}
|
|
66813
66832
|
_canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
66814
66833
|
return MARKER_COMPONENT_SPEC_KEYS[key] && isArray$1(currentSpec) && currentSpec.length > 0 && isArray$1(nextSpec) && 0 === nextSpec.length;
|
|
66815
66834
|
}
|
|
@@ -66819,7 +66838,7 @@
|
|
|
66819
66838
|
return hasMarkerRemoval && onlyMarkerRemoval;
|
|
66820
66839
|
}
|
|
66821
66840
|
_isComponentSpecKey(key) {
|
|
66822
|
-
return this._components.some(component => (component.specKey || component.type) === key);
|
|
66841
|
+
return !!MARKER_COMPONENT_SPEC_KEYS[key] || this._components.some(component => (component.specKey || component.type) === key);
|
|
66823
66842
|
}
|
|
66824
66843
|
_isOnlyComponentSpecsChanged(currentSpec, nextSpec, specKeys) {
|
|
66825
66844
|
let hasComponentSpecChange = !1;
|
|
@@ -66845,6 +66864,38 @@
|
|
|
66845
66864
|
const effects = result.effects;
|
|
66846
66865
|
return !(!(null == effects ? void 0 : effects.component) || !effects.scaleDomain || result.reMake || result.reCompile || result.reSize || effects.remake || effects.compile || effects.data || effects.series || effects.animation || result.reTransformSpec || result.reAnimate || result.changeTheme || result.changeBackground);
|
|
66847
66866
|
}
|
|
66867
|
+
_reRunStackDataFlow() {
|
|
66868
|
+
var _a, _b;
|
|
66869
|
+
this._series.some(series => {
|
|
66870
|
+
var _a;
|
|
66871
|
+
return null === (_a = series.getStack) || void 0 === _a ? void 0 : _a.call(series);
|
|
66872
|
+
}) && (null === (_b = null === (_a = this._stack) || void 0 === _a ? void 0 : _a.stackAll) || void 0 === _b || _b.call(_a), this._series.forEach(series => {
|
|
66873
|
+
series.getViewDataFilter() && series.reTransformViewData();
|
|
66874
|
+
}));
|
|
66875
|
+
}
|
|
66876
|
+
_getModelSpecIndex(specInfo) {
|
|
66877
|
+
var _a;
|
|
66878
|
+
const specPath = null !== (_a = specInfo.specPath) && void 0 !== _a ? _a : [],
|
|
66879
|
+
specIndex = specPath[specPath.length - 1];
|
|
66880
|
+
return "number" == typeof specIndex ? specIndex : 0;
|
|
66881
|
+
}
|
|
66882
|
+
_hasComponentForSpecInfo(key, specInfo) {
|
|
66883
|
+
const specIndex = this._getModelSpecIndex(specInfo);
|
|
66884
|
+
return this._components.some(component => (component.specKey || component.type) === key && component.getSpecIndex() === specIndex);
|
|
66885
|
+
}
|
|
66886
|
+
_createMissingMarkerComponentsForSpecs(result, componentCache) {
|
|
66887
|
+
var _a;
|
|
66888
|
+
let createdCount = 0;
|
|
66889
|
+
null === (_a = this._specTransformer) || void 0 === _a || _a.forEachComponentInSpec(this._spec, (constructor, specInfo) => {
|
|
66890
|
+
if (result.reMake) return;
|
|
66891
|
+
const compSpecKey = constructor.specKey || constructor.type;
|
|
66892
|
+
MARKER_COMPONENT_SPEC_KEYS[compSpecKey] && !this._hasComponentForSpecInfo(compSpecKey, specInfo) && (this._isMarkerAdditionSpecSafeWithoutRemake(specInfo.spec) ? (this._createComponent(constructor, specInfo), componentCache[compSpecKey] && componentCache[compSpecKey].componentCount++, createdCount++) : result.reMake = !0);
|
|
66893
|
+
}, this._option.getSpecInfo()), createdCount && (result.change = !0, result.effects = Object.assign(Object.assign({}, result.effects), {
|
|
66894
|
+
component: !0,
|
|
66895
|
+
layout: !0,
|
|
66896
|
+
render: !0
|
|
66897
|
+
}));
|
|
66898
|
+
}
|
|
66848
66899
|
_removeMarkerComponentsForEmptySpecs(result) {
|
|
66849
66900
|
const removedComponents = this._components.filter(component => {
|
|
66850
66901
|
var _a;
|