@visactor/react-vchart 2.1.0-alpha.5 → 2.1.0-alpha.7
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 +381 -229
- package/build/index.min.js +3 -3
- package/package.json +6 -6
package/build/index.js
CHANGED
|
@@ -14275,13 +14275,11 @@
|
|
|
14275
14275
|
};
|
|
14276
14276
|
}
|
|
14277
14277
|
recomputeCurrentStatePatch() {
|
|
14278
|
-
var _a, _b
|
|
14278
|
+
var _a, _b;
|
|
14279
14279
|
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [], this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
|
|
14280
|
-
const stateResolveBaseAttrs =
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
const transition = stateModel.useStates(this.currentStates),
|
|
14284
|
-
effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states,
|
|
14280
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
|
|
14281
|
+
transition = this.createStateModel(stateResolveBaseAttrs).useStates(this.currentStates),
|
|
14282
|
+
effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
|
|
14285
14283
|
resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
14286
14284
|
this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
|
|
14287
14285
|
}
|
|
@@ -14874,7 +14872,15 @@
|
|
|
14874
14872
|
var _a;
|
|
14875
14873
|
return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
|
|
14876
14874
|
}
|
|
14877
|
-
|
|
14875
|
+
getStateResolveBaseAttrs() {
|
|
14876
|
+
var _a;
|
|
14877
|
+
return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
14878
|
+
}
|
|
14879
|
+
syncStateResolveContext(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
14880
|
+
var _a;
|
|
14881
|
+
return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs), stateResolveBaseAttrs;
|
|
14882
|
+
}
|
|
14883
|
+
createStateModel(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
|
|
14878
14884
|
const {
|
|
14879
14885
|
compiledDefinitions: compiledDefinitions,
|
|
14880
14886
|
stateProxyEligibility: stateProxyEligibility,
|
|
@@ -14887,7 +14893,7 @@
|
|
|
14887
14893
|
stateProxyEligibility: stateProxyEligibility,
|
|
14888
14894
|
states: this.states,
|
|
14889
14895
|
mergeMode: this.stateMergeMode
|
|
14890
|
-
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode, this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0), new StateModel({
|
|
14896
|
+
}), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode, this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0), this.syncStateResolveContext(stateResolveBaseAttrs), new StateModel({
|
|
14891
14897
|
states: this.states,
|
|
14892
14898
|
currentStates: this.currentStates,
|
|
14893
14899
|
stateSort: this.stateSort,
|
|
@@ -14957,18 +14963,18 @@
|
|
|
14957
14963
|
};
|
|
14958
14964
|
}
|
|
14959
14965
|
resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
|
|
14960
|
-
var _a, _b
|
|
14966
|
+
var _a, _b;
|
|
14961
14967
|
let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
|
|
14962
14968
|
const isSimpleLocalTransition = !!transition;
|
|
14963
14969
|
let resolvedStateAttrs;
|
|
14964
14970
|
if (transition) resolvedStateAttrs = transition.resolvedStateAttrs;else {
|
|
14965
|
-
const stateResolveBaseAttrs =
|
|
14966
|
-
stateModel = this.createStateModel();
|
|
14967
|
-
|
|
14971
|
+
const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
|
|
14972
|
+
stateModel = this.createStateModel(stateResolveBaseAttrs);
|
|
14973
|
+
forceResolverRefresh && (null === (_a = this.stateEngine) || void 0 === _a || _a.invalidateResolverCache()), transition = stateModel.useStates(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
14968
14974
|
}
|
|
14969
14975
|
return {
|
|
14970
14976
|
transition: transition,
|
|
14971
|
-
effectiveStates: null !== (
|
|
14977
|
+
effectiveStates: null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
|
|
14972
14978
|
resolvedStateAttrs: resolvedStateAttrs,
|
|
14973
14979
|
isSimpleLocalTransition: isSimpleLocalTransition
|
|
14974
14980
|
};
|
|
@@ -15139,10 +15145,10 @@
|
|
|
15139
15145
|
}
|
|
15140
15146
|
}
|
|
15141
15147
|
invalidateResolver() {
|
|
15142
|
-
var _a, _b
|
|
15148
|
+
var _a, _b;
|
|
15143
15149
|
if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
|
|
15144
|
-
|
|
15145
|
-
this.
|
|
15150
|
+
this.syncStateResolveContext();
|
|
15151
|
+
this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1, this.stateEngine.invalidateResolverCache();
|
|
15146
15152
|
const transition = this.stateEngine.applyStates(this.currentStates),
|
|
15147
15153
|
resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
15148
15154
|
this.effectiveStates = [...transition.effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
@@ -60614,27 +60620,30 @@
|
|
|
60614
60620
|
};
|
|
60615
60621
|
|
|
60616
60622
|
const lookup = (data, opt) => {
|
|
60617
|
-
|
|
60618
|
-
const
|
|
60619
|
-
|
|
60623
|
+
var _a;
|
|
60624
|
+
const fromData = null === (_a = opt.from) || void 0 === _a ? void 0 : _a.call(opt);
|
|
60625
|
+
if (!fromData) return data;
|
|
60626
|
+
const fields = (option = opt.fields, isFunction$1(option) ? option() : option);
|
|
60627
|
+
var option;
|
|
60628
|
+
const key = opt.key,
|
|
60620
60629
|
values = opt.values,
|
|
60621
60630
|
defaultValue = opt.default,
|
|
60622
60631
|
as = opt.as || [fields],
|
|
60623
|
-
index =
|
|
60624
|
-
return obj[fields] && map.set(obj[fields]
|
|
60632
|
+
index = fromData.reduce(function (map, obj) {
|
|
60633
|
+
return obj[fields] && map.set(`${obj[fields]}`, obj), map;
|
|
60625
60634
|
}, new Map());
|
|
60626
60635
|
let set;
|
|
60627
60636
|
if (isFunction$1(opt.set)) set = function (d) {
|
|
60628
|
-
const v = index.get(d[key]);
|
|
60637
|
+
const v = index.get(`${d[key]}`);
|
|
60629
60638
|
opt.set(d, v);
|
|
60630
60639
|
};else if (values) {
|
|
60631
60640
|
const m = values.length;
|
|
60632
60641
|
set = function (d) {
|
|
60633
|
-
const v = index.get(d[key]);
|
|
60642
|
+
const v = index.get(`${d[key]}`);
|
|
60634
60643
|
if (isNil$1(v)) for (let i = 0; i < m; ++i) d[as[i]] = defaultValue;else for (let i = 0; i < m; ++i) d[as[i]] = v[values[i]];
|
|
60635
60644
|
};
|
|
60636
60645
|
} else set = function (d) {
|
|
60637
|
-
const v = index.get(d[key]);
|
|
60646
|
+
const v = index.get(`${d[key]}`);
|
|
60638
60647
|
d[as[0]] = isValid$1(v) ? v : defaultValue;
|
|
60639
60648
|
};
|
|
60640
60649
|
return 0 === data.length ? [] : data.map(d => (set(d), d));
|
|
@@ -61512,9 +61521,9 @@
|
|
|
61512
61521
|
type: "dataview"
|
|
61513
61522
|
}), this._viewStackData.transform({
|
|
61514
61523
|
type: "stackSplit",
|
|
61515
|
-
options: {
|
|
61524
|
+
options: () => ({
|
|
61516
61525
|
fields: this.getStackGroupFields()
|
|
61517
|
-
}
|
|
61526
|
+
})
|
|
61518
61527
|
}, !1);
|
|
61519
61528
|
}
|
|
61520
61529
|
_noAnimationDataKey(datum, index) {
|
|
@@ -66325,17 +66334,10 @@
|
|
|
66325
66334
|
[ComponentTypeEnum.markArea]: !0
|
|
66326
66335
|
},
|
|
66327
66336
|
MARKER_ADDITION_REMAKE_SPEC_KEYS = {
|
|
66328
|
-
autoRange: !0,
|
|
66329
66337
|
regionId: !0,
|
|
66330
66338
|
regionIndex: !0,
|
|
66331
66339
|
seriesId: !0,
|
|
66332
66340
|
seriesIndex: !0,
|
|
66333
|
-
relativeSeriesId: !0,
|
|
66334
|
-
relativeSeriesIndex: !0,
|
|
66335
|
-
startRelativeSeriesId: !0,
|
|
66336
|
-
startRelativeSeriesIndex: !0,
|
|
66337
|
-
endRelativeSeriesId: !0,
|
|
66338
|
-
endRelativeSeriesIndex: !0,
|
|
66339
66341
|
specifiedDataSeriesId: !0,
|
|
66340
66342
|
specifiedDataSeriesIndex: !0
|
|
66341
66343
|
};
|
|
@@ -66414,7 +66416,11 @@
|
|
|
66414
66416
|
}, this.getComponentsByKey = key => this._components.filter(c => (c.specKey || c.type) === key), this.getComponentByUserId = userId => {
|
|
66415
66417
|
const component = this._components.find(s => s.userId === userId);
|
|
66416
66418
|
if (component) return component;
|
|
66417
|
-
}, this.getComponentsByType = type => this._components.filter(c => c.type === type), this._isMarkerAdditionSpecSafeWithoutRemake = spec =>
|
|
66419
|
+
}, this.getComponentsByType = type => this._components.filter(c => c.type === type), this._isMarkerAdditionSpecSafeWithoutRemake = spec => {
|
|
66420
|
+
if (!spec || "object" != typeof spec) return !1;
|
|
66421
|
+
const markerSpec = spec;
|
|
66422
|
+
return !1 !== markerSpec.visible && !Object.keys(MARKER_ADDITION_REMAKE_SPEC_KEYS).some(key => !isNil$1(markerSpec[key]));
|
|
66423
|
+
}, 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), {
|
|
66418
66424
|
mode: this._option.mode,
|
|
66419
66425
|
map: this._idMap,
|
|
66420
66426
|
getChartLayoutRect: () => this._layoutRect,
|
|
@@ -66749,7 +66755,8 @@
|
|
|
66749
66755
|
const oldSpec = this._spec,
|
|
66750
66756
|
onlyMarkerComponentsRemoved = this._isOnlyMarkerComponentsRemoved(this._spec, spec, currentKeys),
|
|
66751
66757
|
onlyComponentSpecsChanged = this._isOnlyComponentSpecsChanged(this._spec, spec, currentKeys),
|
|
66752
|
-
onlySeriesSpecsChanged = this._isOnlySeriesSpecsChanged(this._spec, spec, currentKeys)
|
|
66758
|
+
onlySeriesSpecsChanged = this._isOnlySeriesSpecsChanged(this._spec, spec, currentKeys),
|
|
66759
|
+
onlyComponentOrSeriesSpecsChanged = !(!onlyComponentSpecsChanged && !onlySeriesSpecsChanged) || this._isOnlyComponentOrSeriesSpecsChanged(this._spec, spec, currentKeys);
|
|
66753
66760
|
if (this._spec = spec, onlyMarkerComponentsRemoved) return this._removeMarkerComponentsForEmptySpecs(result), result;
|
|
66754
66761
|
if (this.updateChartConfig(result, oldSpec), result.reMake) return this.setLayoutTag(!0, null, !1), result;
|
|
66755
66762
|
if (this.updateGlobalScale(result), result.reMake) return this.setLayoutTag(!0, null, !1), result;
|
|
@@ -66757,7 +66764,7 @@
|
|
|
66757
66764
|
const componentUpdateResult = this.updateComponentSpec(result);
|
|
66758
66765
|
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 => {
|
|
66759
66766
|
component.reInit(component.getSpec());
|
|
66760
|
-
}), (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(),
|
|
66767
|
+
}), (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(), onlyComponentOrSeriesSpecsChanged && this._canSkipChartDataStages(result) || (this.updateDataSpec(), this.reDataFlow(), this._reRunStackDataFlow(), this.getAllModels().forEach(model => model.onDataUpdate()))), result));
|
|
66761
66768
|
}
|
|
66762
66769
|
updateChartConfig(result, oldSpec) {
|
|
66763
66770
|
var _a, _b;
|
|
@@ -66831,6 +66838,9 @@
|
|
|
66831
66838
|
_canAddMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
66832
66839
|
return !!(MARKER_COMPONENT_SPEC_KEYS[key] && isArray$1(currentSpec) && isArray$1(nextSpec)) && !(nextSpec.length <= currentSpec.length) && nextSpec.slice(currentSpec.length).every(this._isMarkerAdditionSpecSafeWithoutRemake);
|
|
66833
66840
|
}
|
|
66841
|
+
_isAutoRangeMarkerSpec(spec) {
|
|
66842
|
+
return !!spec && "object" == typeof spec && !0 === spec.autoRange;
|
|
66843
|
+
}
|
|
66834
66844
|
_canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
66835
66845
|
return MARKER_COMPONENT_SPEC_KEYS[key] && isArray$1(currentSpec) && currentSpec.length > 0 && isArray$1(nextSpec) && 0 === nextSpec.length;
|
|
66836
66846
|
}
|
|
@@ -66858,6 +66868,15 @@
|
|
|
66858
66868
|
onlySeriesSpecChange = specKeys.every(key => !!isEqual(currentSpecRecord[key], nextSpecRecord[key]) || !!seriesRelatedSpecKeys[key] && (hasSeriesSpecChange = !0, !0));
|
|
66859
66869
|
return hasSeriesSpecChange && onlySeriesSpecChange;
|
|
66860
66870
|
}
|
|
66871
|
+
_isOnlyComponentOrSeriesSpecsChanged(currentSpec, nextSpec, specKeys) {
|
|
66872
|
+
var _a, _b;
|
|
66873
|
+
let hasComponentOrSeriesSpecChange = !1;
|
|
66874
|
+
const currentSpecRecord = currentSpec,
|
|
66875
|
+
nextSpecRecord = nextSpec,
|
|
66876
|
+
seriesRelatedSpecKeys = null !== (_b = null === (_a = this._specTransformer) || void 0 === _a ? void 0 : _a.getSeriesRelatedSpecKeys()) && void 0 !== _b ? _b : {},
|
|
66877
|
+
onlyComponentOrSeriesSpecChange = specKeys.every(key => !!isEqual(currentSpecRecord[key], nextSpecRecord[key]) || !(!this._isComponentSpecKey(key) && !seriesRelatedSpecKeys[key]) && (hasComponentOrSeriesSpecChange = !0, !0));
|
|
66878
|
+
return hasComponentOrSeriesSpecChange && onlyComponentOrSeriesSpecChange;
|
|
66879
|
+
}
|
|
66861
66880
|
_canSkipChartDataStages(result) {
|
|
66862
66881
|
const effects = result.effects;
|
|
66863
66882
|
return !(!(null == effects ? void 0 : effects.series) || effects.remake || effects.data || effects.scaleDomain || result.reMake);
|
|
@@ -66887,13 +66906,17 @@
|
|
|
66887
66906
|
}
|
|
66888
66907
|
_createMissingMarkerComponentsForSpecs(result, componentCache) {
|
|
66889
66908
|
var _a;
|
|
66890
|
-
let createdCount = 0
|
|
66909
|
+
let createdCount = 0,
|
|
66910
|
+
hasAutoRangeMarker = !1;
|
|
66891
66911
|
null === (_a = this._specTransformer) || void 0 === _a || _a.forEachComponentInSpec(this._spec, (constructor, specInfo) => {
|
|
66892
66912
|
if (result.reMake) return;
|
|
66893
66913
|
const compSpecKey = constructor.specKey || constructor.type;
|
|
66894
|
-
MARKER_COMPONENT_SPEC_KEYS[compSpecKey] && !this._hasComponentForSpecInfo(compSpecKey, specInfo) && (this._isMarkerAdditionSpecSafeWithoutRemake(specInfo.spec) ? (this._createComponent(constructor, specInfo), componentCache[compSpecKey] && componentCache[compSpecKey].componentCount++, createdCount
|
|
66895
|
-
}, this._option.getSpecInfo()), createdCount && (result.change = !0, result.effects = Object.assign(Object.assign({}, result.effects), {
|
|
66896
|
-
component: !0
|
|
66914
|
+
MARKER_COMPONENT_SPEC_KEYS[compSpecKey] && !this._hasComponentForSpecInfo(compSpecKey, specInfo) && (this._isMarkerAdditionSpecSafeWithoutRemake(specInfo.spec) ? (this._createComponent(constructor, specInfo), componentCache[compSpecKey] && componentCache[compSpecKey].componentCount++, createdCount++, hasAutoRangeMarker = hasAutoRangeMarker || this._isAutoRangeMarkerSpec(specInfo.spec)) : result.reMake = !0);
|
|
66915
|
+
}, this._option.getSpecInfo()), createdCount && (result.change = !0, result.effects = Object.assign(Object.assign(Object.assign(Object.assign({}, result.effects), {
|
|
66916
|
+
component: !0
|
|
66917
|
+
}), hasAutoRangeMarker ? {
|
|
66918
|
+
scaleDomain: !0
|
|
66919
|
+
} : null), {
|
|
66897
66920
|
layout: !0,
|
|
66898
66921
|
render: !0
|
|
66899
66922
|
}));
|
|
@@ -67493,7 +67516,7 @@
|
|
|
67493
67516
|
},
|
|
67494
67517
|
{
|
|
67495
67518
|
fields: fields
|
|
67496
|
-
} = op;
|
|
67519
|
+
} = isFunction$1(op) ? op() : op;
|
|
67497
67520
|
if (!(null == fields ? void 0 : fields.length)) return result;
|
|
67498
67521
|
const lastFieldIndex = fields.length - 1;
|
|
67499
67522
|
let nextNode,
|
|
@@ -69601,12 +69624,17 @@
|
|
|
69601
69624
|
}
|
|
69602
69625
|
}
|
|
69603
69626
|
|
|
69604
|
-
const map$1 = (data, opt) =>
|
|
69605
|
-
|
|
69606
|
-
|
|
69607
|
-
|
|
69608
|
-
|
|
69609
|
-
|
|
69627
|
+
const map$1 = (data, opt) => {
|
|
69628
|
+
const options = isFunction$1(opt) ? opt() : opt,
|
|
69629
|
+
features = data.features;
|
|
69630
|
+
return features && features.forEach((f, index) => {
|
|
69631
|
+
var _a, _b;
|
|
69632
|
+
f[DEFAULT_DATA_INDEX] = index;
|
|
69633
|
+
const name = null === (_a = f.properties) || void 0 === _a ? void 0 : _a[options.nameProperty],
|
|
69634
|
+
mappedName = null === (_b = options.nameMap) || void 0 === _b ? void 0 : _b[`${name}`];
|
|
69635
|
+
f[DEFAULT_MAP_LOOK_UP_KEY] = mappedName || name;
|
|
69636
|
+
}), features;
|
|
69637
|
+
};
|
|
69610
69638
|
|
|
69611
69639
|
class MapSeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
69612
69640
|
constructor() {
|
|
@@ -70358,10 +70386,10 @@
|
|
|
70358
70386
|
level: TransformLevel.copyDataView
|
|
70359
70387
|
}).transform({
|
|
70360
70388
|
type: "map",
|
|
70361
|
-
options: {
|
|
70389
|
+
options: () => ({
|
|
70362
70390
|
nameMap: this._nameMap,
|
|
70363
70391
|
nameProperty: this._nameProperty
|
|
70364
|
-
}
|
|
70392
|
+
})
|
|
70365
70393
|
}).transform({
|
|
70366
70394
|
type: "lookup",
|
|
70367
70395
|
options: {
|
|
@@ -70370,7 +70398,7 @@
|
|
|
70370
70398
|
return null === (_a = this._data) || void 0 === _a ? void 0 : _a.getLatestData();
|
|
70371
70399
|
},
|
|
70372
70400
|
key: DEFAULT_MAP_LOOK_UP_KEY,
|
|
70373
|
-
fields: this._nameField,
|
|
70401
|
+
fields: () => this._nameField,
|
|
70374
70402
|
set: (feature, datum) => {
|
|
70375
70403
|
datum && Object.keys(datum).forEach(key => {
|
|
70376
70404
|
key in feature || (feature[key] = datum[key]);
|
|
@@ -70516,12 +70544,13 @@
|
|
|
70516
70544
|
|
|
70517
70545
|
const waterfall$1 = (lastData, op) => {
|
|
70518
70546
|
if (!lastData || 0 === lastData.length) return lastData;
|
|
70519
|
-
const
|
|
70547
|
+
const options = isFunction$1(op) ? op() : op,
|
|
70548
|
+
{
|
|
70520
70549
|
indexField: indexField,
|
|
70521
70550
|
total: totalSpec,
|
|
70522
70551
|
groupData: groupData,
|
|
70523
70552
|
calculationMode: calculationMode
|
|
70524
|
-
} =
|
|
70553
|
+
} = options,
|
|
70525
70554
|
totalData = [],
|
|
70526
70555
|
{
|
|
70527
70556
|
dimensionValues: dimensionValues,
|
|
@@ -70547,7 +70576,7 @@
|
|
|
70547
70576
|
positive: temp.end,
|
|
70548
70577
|
negative: temp.end
|
|
70549
70578
|
},
|
|
70550
|
-
indexData = !0 ===
|
|
70579
|
+
indexData = !0 === options.stackInverse ? dimensionData[key].reverse() : dimensionData[key];
|
|
70551
70580
|
if (null == indexData || indexData.forEach((d, i) => {
|
|
70552
70581
|
i === indexData.length - 1 ? d[STACK_FIELD_TOTAL_TOP] = !0 : delete d[STACK_FIELD_TOTAL_TOP];
|
|
70553
70582
|
}), indexData.length > 1) {
|
|
@@ -70559,9 +70588,9 @@
|
|
|
70559
70588
|
} else if (index === indexValues.length - 1) return !0;
|
|
70560
70589
|
return !1;
|
|
70561
70590
|
};
|
|
70562
|
-
if (indexData.some(d => isTotalCheck(d))) return temp = computeTotalWithMultipleData(indexData, key, total, totalData, temp, indexValues, index,
|
|
70591
|
+
if (indexData.some(d => isTotalCheck(d))) return temp = computeTotalWithMultipleData(indexData, key, total, totalData, temp, indexValues, index, options, isTotalCheck), void totalData.push(total);
|
|
70563
70592
|
}
|
|
70564
|
-
temp = computeNormalData(indexData, key, total, totalData, temp, indexValues, index,
|
|
70593
|
+
temp = computeNormalData(indexData, key, total, totalData, temp, indexValues, index, options), totalData.push(total);
|
|
70565
70594
|
}), totalData;
|
|
70566
70595
|
};
|
|
70567
70596
|
function computeTotalWithMultipleData(indexData, key, total, totalData, temp, indexValues, index, op, isTotalCheck) {
|
|
@@ -70686,12 +70715,12 @@
|
|
|
70686
70715
|
total: total,
|
|
70687
70716
|
seriesField: seriesField,
|
|
70688
70717
|
calculationMode: calculationMode
|
|
70689
|
-
} = op,
|
|
70718
|
+
} = isFunction$1(op) ? op() : op,
|
|
70690
70719
|
totalData = {
|
|
70691
70720
|
[indexField]: (null == total ? void 0 : total.text) || "total",
|
|
70692
70721
|
[valueField]: data.reduce((pre, cur) => precisionAdd(pre, +cur[valueField]), 0)
|
|
70693
70722
|
};
|
|
70694
|
-
return seriesField && (totalData[seriesField] = "total"), "decrease" === calculationMode ?
|
|
70723
|
+
return seriesField && (totalData[seriesField] = "total"), "decrease" === calculationMode ? [totalData, ...data] : [...data, totalData];
|
|
70695
70724
|
};
|
|
70696
70725
|
|
|
70697
70726
|
const Appear_FadeIn$6 = {
|
|
@@ -71188,17 +71217,20 @@
|
|
|
71188
71217
|
return this._seriesField === WaterfallDefaultSeriesField ? [this._theme.seriesFieldName.increase, this._theme.seriesFieldName.decrease, this._theme.seriesFieldName.total] : super.getSeriesKeys();
|
|
71189
71218
|
}
|
|
71190
71219
|
initData() {
|
|
71191
|
-
var _a
|
|
71220
|
+
var _a;
|
|
71192
71221
|
super.initData(), registerDataSetInstanceTransform(this._dataSet, "waterfallFillTotal", waterfallFillTotal), registerDataSetInstanceTransform(this._dataSet, "waterfall", waterfall$1), (isNil$1(this._spec.total) || "end" === this._spec.total.type) && (null === (_a = this._rawData) || void 0 === _a || _a.transform({
|
|
71193
71222
|
type: "waterfallFillTotal",
|
|
71194
|
-
options: {
|
|
71195
|
-
|
|
71196
|
-
|
|
71197
|
-
|
|
71198
|
-
|
|
71199
|
-
|
|
71200
|
-
|
|
71201
|
-
|
|
71223
|
+
options: () => {
|
|
71224
|
+
var _a;
|
|
71225
|
+
return {
|
|
71226
|
+
indexField: this.getGroupFields()[0],
|
|
71227
|
+
valueField: this.getStackValueField(),
|
|
71228
|
+
seriesField: this.getSeriesField(),
|
|
71229
|
+
seriesFieldName: this._theme.seriesFieldName,
|
|
71230
|
+
total: this._spec.total,
|
|
71231
|
+
calculationMode: null !== (_a = this._spec.calculationMode) && void 0 !== _a ? _a : "increase",
|
|
71232
|
+
stackInverse: this.getRegion().getStackInverse()
|
|
71233
|
+
};
|
|
71202
71234
|
}
|
|
71203
71235
|
}, !1));
|
|
71204
71236
|
const totalData = dataViewFromDataView(this.getViewData(), this._dataSet, {
|
|
@@ -71206,17 +71238,20 @@
|
|
|
71206
71238
|
});
|
|
71207
71239
|
this.getViewData().target.removeListener("change", totalData.reRunAllTransform), this._totalData = new CompilableData(this._option, totalData), totalData.transform({
|
|
71208
71240
|
type: "waterfall",
|
|
71209
|
-
options: {
|
|
71210
|
-
|
|
71211
|
-
|
|
71212
|
-
|
|
71213
|
-
|
|
71214
|
-
|
|
71215
|
-
|
|
71216
|
-
|
|
71217
|
-
|
|
71218
|
-
|
|
71219
|
-
|
|
71241
|
+
options: () => {
|
|
71242
|
+
var _a;
|
|
71243
|
+
return {
|
|
71244
|
+
indexField: this.getGroupFields()[0],
|
|
71245
|
+
valueField: this.getStackValueField(),
|
|
71246
|
+
seriesField: this.getSeriesField(),
|
|
71247
|
+
seriesFieldName: this._theme.seriesFieldName,
|
|
71248
|
+
startAs: STACK_FIELD_START,
|
|
71249
|
+
endAs: STACK_FIELD_END,
|
|
71250
|
+
total: this._spec.total,
|
|
71251
|
+
calculationMode: null !== (_a = this._spec.calculationMode) && void 0 !== _a ? _a : "increase",
|
|
71252
|
+
groupData: () => this.getGroups().groupData,
|
|
71253
|
+
stackInverse: this.getRegion().getStackInverse()
|
|
71254
|
+
};
|
|
71220
71255
|
}
|
|
71221
71256
|
}, !1), totalData.target.addListener("change", this._reStackTotal);
|
|
71222
71257
|
}
|
|
@@ -71341,14 +71376,16 @@
|
|
|
71341
71376
|
|
|
71342
71377
|
const foldOutlierData = (data, op) => {
|
|
71343
71378
|
const result = [],
|
|
71379
|
+
options = isFunction$1(op) ? op() : op,
|
|
71344
71380
|
{
|
|
71345
71381
|
outliersField: outliersField,
|
|
71346
71382
|
dimensionField: dimensionField,
|
|
71347
71383
|
seriesField: seriesField
|
|
71348
|
-
} =
|
|
71384
|
+
} = options;
|
|
71349
71385
|
return (data[0].latestData || []).forEach(d => {
|
|
71350
|
-
|
|
71351
|
-
|
|
71386
|
+
const rawOutlierValues = d[outliersField],
|
|
71387
|
+
outlierValues = isArray$1(rawOutlierValues) ? rawOutlierValues : [rawOutlierValues];
|
|
71388
|
+
result.push(...outlierValues.map(v => {
|
|
71352
71389
|
const resData = {
|
|
71353
71390
|
[BOX_PLOT_OUTLIER_VALUE_FIELD]: v
|
|
71354
71391
|
};
|
|
@@ -72154,11 +72191,11 @@
|
|
|
72154
72191
|
type: "dataview"
|
|
72155
72192
|
}), outlierDataView.name = `${PREFIX}_series_${this.id}_outlierData`, outlierDataView.transform({
|
|
72156
72193
|
type: "foldOutlierData",
|
|
72157
|
-
options: {
|
|
72194
|
+
options: () => ({
|
|
72158
72195
|
dimensionField: "horizontal" === this._direction ? this._fieldY : this._fieldX,
|
|
72159
72196
|
outliersField: this._outliersField,
|
|
72160
72197
|
seriesField: this._seriesField
|
|
72161
|
-
}
|
|
72198
|
+
})
|
|
72162
72199
|
}), outlierDataView.transform({
|
|
72163
72200
|
type: "addVChartProperty",
|
|
72164
72201
|
options: {
|
|
@@ -73394,7 +73431,22 @@
|
|
|
73394
73431
|
}));
|
|
73395
73432
|
};
|
|
73396
73433
|
|
|
73434
|
+
const ROSE_LIKE_SERIES_COMPILE_ONLY_KEYS = {
|
|
73435
|
+
radius: !0,
|
|
73436
|
+
outerRadius: !0,
|
|
73437
|
+
innerRadius: !0,
|
|
73438
|
+
startAngle: !0,
|
|
73439
|
+
endAngle: !0,
|
|
73440
|
+
centerX: !0,
|
|
73441
|
+
centerY: !0
|
|
73442
|
+
};
|
|
73397
73443
|
class RoseLikeSeries extends PolarSeries {
|
|
73444
|
+
_getSpecUpdatePolicy() {
|
|
73445
|
+
const policy = super._getSpecUpdatePolicy();
|
|
73446
|
+
return Object.assign(Object.assign({}, policy), {
|
|
73447
|
+
compileOnlyKeys: Object.assign(Object.assign({}, policy.compileOnlyKeys), ROSE_LIKE_SERIES_COMPILE_ONLY_KEYS)
|
|
73448
|
+
});
|
|
73449
|
+
}
|
|
73398
73450
|
getStackGroupFields() {
|
|
73399
73451
|
return this._angleField;
|
|
73400
73452
|
}
|
|
@@ -73784,7 +73836,10 @@
|
|
|
73784
73836
|
super(...arguments), this.type = ComponentTypeEnum.polarLinearAxis, this._zero = !0, this._nice = !0, this._extend = {}, this._scale = new LinearScale();
|
|
73785
73837
|
}
|
|
73786
73838
|
setAttrFromSpec() {
|
|
73839
|
+
var _a, _b;
|
|
73787
73840
|
super.setAttrFromSpec(), this.setExtraAttrFromSpec();
|
|
73841
|
+
const tickTransform = null === (_b = null === (_a = this._tickData) || void 0 === _a ? void 0 : _a[0]) || void 0 === _b ? void 0 : _b.getDataView().transformsArr.find(t => t.type === this.registerTicksTransform());
|
|
73842
|
+
tickTransform && (tickTransform.options = this._tickTransformOption());
|
|
73788
73843
|
}
|
|
73789
73844
|
initScales() {
|
|
73790
73845
|
super.initScales(), this.setScaleNice();
|
|
@@ -73831,6 +73886,9 @@
|
|
|
73831
73886
|
initScales() {
|
|
73832
73887
|
super.initScales(), this.calcScales(this._defaultBandInnerPadding, this._defaultBandOuterPadding);
|
|
73833
73888
|
}
|
|
73889
|
+
reInit(spec) {
|
|
73890
|
+
super.reInit(spec), this._updateData();
|
|
73891
|
+
}
|
|
73834
73892
|
registerTicksTransform() {
|
|
73835
73893
|
const name = `${this.type}-ticks`;
|
|
73836
73894
|
return registerDataSetInstanceTransform(this._option.dataSet, name, polarAngleAxisDiscreteTicks), name;
|
|
@@ -74428,6 +74486,16 @@
|
|
|
74428
74486
|
}
|
|
74429
74487
|
};
|
|
74430
74488
|
|
|
74489
|
+
const DOT_SERIES_COMPILE_ONLY_KEYS = {
|
|
74490
|
+
highLightSeriesGroup: !0,
|
|
74491
|
+
titleField: !0,
|
|
74492
|
+
subTitleField: !0
|
|
74493
|
+
},
|
|
74494
|
+
DOT_SERIES_COMPILE_ONLY_SUB_KEYS = {
|
|
74495
|
+
grid: {
|
|
74496
|
+
background: !0
|
|
74497
|
+
}
|
|
74498
|
+
};
|
|
74431
74499
|
class DotSeries extends CartesianSeries {
|
|
74432
74500
|
constructor() {
|
|
74433
74501
|
super(...arguments), this.type = SeriesTypeEnum.dot;
|
|
@@ -74465,6 +74533,13 @@
|
|
|
74465
74533
|
setGridBackground(gridBackground) {
|
|
74466
74534
|
isValid$1(gridBackground) && (this._gridBackground = gridBackground);
|
|
74467
74535
|
}
|
|
74536
|
+
_getSpecUpdatePolicy() {
|
|
74537
|
+
const policy = super._getSpecUpdatePolicy();
|
|
74538
|
+
return Object.assign(Object.assign({}, policy), {
|
|
74539
|
+
compileOnlyKeys: Object.assign(Object.assign({}, policy.compileOnlyKeys), DOT_SERIES_COMPILE_ONLY_KEYS),
|
|
74540
|
+
compileOnlySubKeys: Object.assign(Object.assign({}, policy.compileOnlySubKeys), DOT_SERIES_COMPILE_ONLY_SUB_KEYS)
|
|
74541
|
+
});
|
|
74542
|
+
}
|
|
74468
74543
|
initData() {
|
|
74469
74544
|
var _a;
|
|
74470
74545
|
super.initData(), this._xDimensionStatisticsDomain = this.getRawData().latestData.map(d => d[this._fieldY[0]]), registerDataSetInstanceTransform(this._option.dataSet, "objFlat", objFlat), registerDataSetInstanceTransform(this._option.dataSet, "copyDataView", copyDataView), registerDataSetInstanceParser(this._option.dataSet, "dataview", dataViewParser), null === (_a = this.getViewData()) || void 0 === _a || _a.transform({
|
|
@@ -74972,6 +75047,16 @@
|
|
|
74972
75047
|
}
|
|
74973
75048
|
});
|
|
74974
75049
|
|
|
75050
|
+
const PROGRESS_LIKE_SERIES_COMPILE_ONLY_KEYS = {
|
|
75051
|
+
radius: !0,
|
|
75052
|
+
outerRadius: !0,
|
|
75053
|
+
innerRadius: !0,
|
|
75054
|
+
startAngle: !0,
|
|
75055
|
+
endAngle: !0,
|
|
75056
|
+
centerX: !0,
|
|
75057
|
+
centerY: !0,
|
|
75058
|
+
clamp: !0
|
|
75059
|
+
};
|
|
74975
75060
|
class ProgressLikeSeries extends PolarSeries {
|
|
74976
75061
|
constructor() {
|
|
74977
75062
|
super(...arguments), this._arcGroupMark = null, this._getAngleValueStart = datum => {
|
|
@@ -75011,6 +75096,12 @@
|
|
|
75011
75096
|
return this._getAngleValueEndWithoutMask(datum);
|
|
75012
75097
|
};
|
|
75013
75098
|
}
|
|
75099
|
+
_getSpecUpdatePolicy() {
|
|
75100
|
+
const policy = super._getSpecUpdatePolicy();
|
|
75101
|
+
return Object.assign(Object.assign({}, policy), {
|
|
75102
|
+
compileOnlyKeys: Object.assign(Object.assign({}, policy.compileOnlyKeys), PROGRESS_LIKE_SERIES_COMPILE_ONLY_KEYS)
|
|
75103
|
+
});
|
|
75104
|
+
}
|
|
75014
75105
|
setAttrFromSpec() {
|
|
75015
75106
|
var _a, _b, _c;
|
|
75016
75107
|
super.setAttrFromSpec();
|
|
@@ -75242,7 +75333,8 @@
|
|
|
75242
75333
|
};
|
|
75243
75334
|
|
|
75244
75335
|
const CIRCULAR_PROGRESS_SERIES_COMPILE_ONLY_KEYS = {
|
|
75245
|
-
cornerRadius: !0
|
|
75336
|
+
cornerRadius: !0,
|
|
75337
|
+
roundCap: !0
|
|
75246
75338
|
};
|
|
75247
75339
|
class CircularProgressSeries extends ProgressLikeSeries {
|
|
75248
75340
|
constructor() {
|
|
@@ -75438,7 +75530,9 @@
|
|
|
75438
75530
|
};
|
|
75439
75531
|
|
|
75440
75532
|
const LINEAR_PROGRESS_SERIES_COMPILE_ONLY_KEYS = {
|
|
75441
|
-
bandWidth: !0
|
|
75533
|
+
bandWidth: !0,
|
|
75534
|
+
cornerRadius: !0,
|
|
75535
|
+
clamp: !0
|
|
75442
75536
|
},
|
|
75443
75537
|
LINEAR_PROGRESS_SERIES_COMPILE_ONLY_SUB_KEYS = {
|
|
75444
75538
|
progress: {
|
|
@@ -80168,12 +80262,12 @@
|
|
|
80168
80262
|
}), registerTextMark(), registerWordCloudAnimation(), Factory.registerSeries(WordCloudSeries.type, WordCloudSeries);
|
|
80169
80263
|
};
|
|
80170
80264
|
|
|
80265
|
+
const resolveOptionValue$2 = option => isFunction$1(option) ? option() : option;
|
|
80171
80266
|
const funnel = (originData, op) => {
|
|
80172
|
-
var _a, _b;
|
|
80267
|
+
var _a, _b, _c, _d;
|
|
80173
80268
|
const data = originData.map(datum => Object.assign({}, datum));
|
|
80174
80269
|
if (!data || 0 === data.length) return data;
|
|
80175
80270
|
const {
|
|
80176
|
-
valueField: valueField,
|
|
80177
80271
|
asTransformRatio: asTransformRatio,
|
|
80178
80272
|
asReachRatio: asReachRatio,
|
|
80179
80273
|
asHeightRatio: asHeightRatio,
|
|
@@ -80182,14 +80276,15 @@
|
|
|
80182
80276
|
asLastValueRatio: asLastValueRatio,
|
|
80183
80277
|
asLastValue: asLastValue,
|
|
80184
80278
|
asCurrentValue: asCurrentValue,
|
|
80185
|
-
asNextValue: asNextValue
|
|
80186
|
-
heightVisual = !1,
|
|
80187
|
-
isCone = !0,
|
|
80188
|
-
range: range
|
|
80279
|
+
asNextValue: asNextValue
|
|
80189
80280
|
} = op,
|
|
80281
|
+
valueField = resolveOptionValue$2(op.valueField),
|
|
80282
|
+
heightVisual = null !== (_a = resolveOptionValue$2(op.heightVisual)) && void 0 !== _a && _a,
|
|
80283
|
+
isCone = null === (_b = resolveOptionValue$2(op.isCone)) || void 0 === _b || _b,
|
|
80284
|
+
range = resolveOptionValue$2(op.range),
|
|
80190
80285
|
max = data.reduce((m, d) => Math.max(m, Number.parseFloat(d[valueField]) || -1 / 0), -1 / 0),
|
|
80191
80286
|
min = data.reduce((m, d) => Math.min(m, Number.parseFloat(d[valueField]) || 1 / 0), 1 / 0),
|
|
80192
|
-
rangeArr = [null !== (
|
|
80287
|
+
rangeArr = [null !== (_c = null == range ? void 0 : range.min) && void 0 !== _c ? _c : min, null !== (_d = null == range ? void 0 : range.max) && void 0 !== _d ? _d : max];
|
|
80193
80288
|
return data.forEach((d, i) => {
|
|
80194
80289
|
var _a, _b;
|
|
80195
80290
|
const currentValue = Number.parseFloat(d[valueField]),
|
|
@@ -80354,12 +80449,12 @@
|
|
|
80354
80449
|
}), fields;
|
|
80355
80450
|
}
|
|
80356
80451
|
_statisticViewData() {
|
|
80357
|
-
var _a
|
|
80452
|
+
var _a;
|
|
80358
80453
|
super._statisticViewData(), this._data.getDataView().transform({
|
|
80359
80454
|
type: "funnel",
|
|
80360
80455
|
options: {
|
|
80361
|
-
valueField: this.getValueField(),
|
|
80362
|
-
isCone: this._spec.isCone,
|
|
80456
|
+
valueField: () => this.getValueField(),
|
|
80457
|
+
isCone: () => this._spec.isCone,
|
|
80363
80458
|
asCurrentValue: FUNNEL_CURRENT_VALUE,
|
|
80364
80459
|
asTransformRatio: FUNNEL_TRANSFORM_RATIO,
|
|
80365
80460
|
asReachRatio: FUNNEL_REACH_RATIO,
|
|
@@ -80369,12 +80464,9 @@
|
|
|
80369
80464
|
asLastValueRatio: FUNNEL_LAST_VALUE_RATIO,
|
|
80370
80465
|
asLastValue: FUNNEL_LAST_VALUE,
|
|
80371
80466
|
asNextValue: FUNNEL_NEXT_VALUE,
|
|
80372
|
-
range:
|
|
80373
|
-
min: null !== (_b = null === (_a = this._spec.range) || void 0 === _a ? void 0 : _a.min) && void 0 !== _b ? _b : null === (_d = null === (_c = this.getViewDataStatistics().latestData) || void 0 === _c ? void 0 : _c[this.getValueField()]) || void 0 === _d ? void 0 : _d.min,
|
|
80374
|
-
max: null !== (_f = null === (_e = this._spec.range) || void 0 === _e ? void 0 : _e.max) && void 0 !== _f ? _f : null === (_h = null === (_g = this.getViewDataStatistics().latestData) || void 0 === _g ? void 0 : _g[this.getValueField()]) || void 0 === _h ? void 0 : _h.max
|
|
80375
|
-
}
|
|
80467
|
+
range: () => this._spec.range
|
|
80376
80468
|
}
|
|
80377
|
-
}), null === (
|
|
80469
|
+
}), null === (_a = this._viewDataTransform.getDataView()) || void 0 === _a || _a.transform({
|
|
80378
80470
|
type: "funnelTransform",
|
|
80379
80471
|
options: {
|
|
80380
80472
|
asIsTransformLevel: FUNNEL_TRANSFORM_LEVEL
|
|
@@ -81602,21 +81694,27 @@
|
|
|
81602
81694
|
return (null === (_a = data[0]) || void 0 === _a ? void 0 : _a.latestData) ? data[0].latestData : data;
|
|
81603
81695
|
};
|
|
81604
81696
|
const sankeyLayout = (data, op) => {
|
|
81605
|
-
|
|
81606
|
-
|
|
81697
|
+
const options = isFunction$1(op) ? op() : op;
|
|
81698
|
+
if (!data || !(null == options ? void 0 : options.view) || !data.length) return [];
|
|
81699
|
+
const view = options.view();
|
|
81607
81700
|
if (view.x1 - view.x0 == 0 || view.y1 - view.y0 == 0 || view.x1 - view.x0 == -1 / 0 || view.x1 - view.x0 == 1 / 0 || view.y1 - view.y0 == -1 / 0 || view.y1 - view.y0 == 1 / 0) return [];
|
|
81608
|
-
const originalData = data[0]
|
|
81609
|
-
|
|
81610
|
-
|
|
81611
|
-
originalData.links.forEach(datum => {
|
|
81612
|
-
const updatedDatum = {};
|
|
81613
|
-
for (const key in datum) key === op.sourceField ? updatedDatum.source = datum[op.sourceField] : key === op.targetField ? updatedDatum.target = datum[op.targetField] : key === op.valueField ? updatedDatum.value = datum[op.valueField] : updatedDatum[key] = datum[key];
|
|
81614
|
-
updatedData.push(updatedDatum);
|
|
81615
|
-
}), originalData.links = updatedData;
|
|
81616
|
-
}
|
|
81617
|
-
const layout = new SankeyLayout(op),
|
|
81701
|
+
const originalData = data[0],
|
|
81702
|
+
layoutData = normalizeSankeyData(originalData, options),
|
|
81703
|
+
layout = new SankeyLayout(options),
|
|
81618
81704
|
result = [];
|
|
81619
|
-
return result.push(layout.layout(
|
|
81705
|
+
return result.push(layout.layout(layoutData, view)), result;
|
|
81706
|
+
};
|
|
81707
|
+
const normalizeSankeyData = (data, options) => {
|
|
81708
|
+
if ("source" === options.sourceField && "target" === options.targetField && "value" === options.valueField) return data;
|
|
81709
|
+
const links = data.links;
|
|
81710
|
+
return links ? Object.assign(Object.assign({}, data), {
|
|
81711
|
+
links: links.map(link => {
|
|
81712
|
+
const updatedLink = {};
|
|
81713
|
+
return Object.keys(link).forEach(key => {
|
|
81714
|
+
key === options.sourceField ? updatedLink.source = link[options.sourceField] : key === options.targetField ? updatedLink.target = link[options.targetField] : key === options.valueField ? updatedLink.value = link[options.valueField] : updatedLink[key] = link[key];
|
|
81715
|
+
}), updatedLink;
|
|
81716
|
+
})
|
|
81717
|
+
}) : data;
|
|
81620
81718
|
};
|
|
81621
81719
|
|
|
81622
81720
|
const sankeyNodes = data => {
|
|
@@ -82110,7 +82208,6 @@
|
|
|
82110
82208
|
super.setAttrFromSpec(), this.setCategoryField(this._spec.categoryField), this.setValueField(this._spec.valueField), this.setSeriesField(null !== (_a = this._spec.seriesField) && void 0 !== _a ? _a : this._spec.categoryField);
|
|
82111
82209
|
}
|
|
82112
82210
|
initData() {
|
|
82113
|
-
var _a, _b, _c, _d;
|
|
82114
82211
|
super.initData();
|
|
82115
82212
|
const viewData = this.getViewData(),
|
|
82116
82213
|
rawData = this.getRawData();
|
|
@@ -82119,38 +82216,41 @@
|
|
|
82119
82216
|
type: "sankeyFormat"
|
|
82120
82217
|
}, !1), viewData.transform({
|
|
82121
82218
|
type: "sankeyLayout",
|
|
82122
|
-
options: {
|
|
82123
|
-
|
|
82124
|
-
|
|
82125
|
-
|
|
82126
|
-
|
|
82127
|
-
|
|
82128
|
-
|
|
82129
|
-
|
|
82130
|
-
|
|
82131
|
-
|
|
82132
|
-
|
|
82133
|
-
|
|
82134
|
-
|
|
82135
|
-
|
|
82136
|
-
|
|
82137
|
-
|
|
82138
|
-
|
|
82139
|
-
|
|
82140
|
-
|
|
82141
|
-
|
|
82142
|
-
|
|
82143
|
-
|
|
82144
|
-
|
|
82145
|
-
|
|
82146
|
-
|
|
82147
|
-
|
|
82148
|
-
|
|
82149
|
-
|
|
82150
|
-
|
|
82151
|
-
|
|
82152
|
-
|
|
82153
|
-
|
|
82219
|
+
options: () => {
|
|
82220
|
+
var _a, _b, _c, _d;
|
|
82221
|
+
return {
|
|
82222
|
+
view: () => ({
|
|
82223
|
+
x0: this._viewBox.x1,
|
|
82224
|
+
x1: this._viewBox.x2,
|
|
82225
|
+
y0: this._viewBox.y1,
|
|
82226
|
+
y1: this._viewBox.y2
|
|
82227
|
+
}),
|
|
82228
|
+
sourceField: this._spec.sourceField,
|
|
82229
|
+
targetField: this._spec.targetField,
|
|
82230
|
+
valueField: this._spec.valueField,
|
|
82231
|
+
direction: this.direction,
|
|
82232
|
+
crossNodeAlign: this._spec.crossNodeAlign,
|
|
82233
|
+
nodeAlign: null !== (_a = this._spec.nodeAlign) && void 0 !== _a ? _a : "justify",
|
|
82234
|
+
nodeGap: null !== (_b = this._spec.nodeGap) && void 0 !== _b ? _b : 8,
|
|
82235
|
+
nodeWidth: null !== (_c = this._spec.nodeWidth) && void 0 !== _c ? _c : 10,
|
|
82236
|
+
linkWidth: this._spec.linkWidth,
|
|
82237
|
+
minStepWidth: this._spec.minStepWidth,
|
|
82238
|
+
minNodeHeight: null !== (_d = this._spec.minNodeHeight) && void 0 !== _d ? _d : 4,
|
|
82239
|
+
maxNodeHeight: this._spec.maxNodeHeight,
|
|
82240
|
+
minLinkHeight: this._spec.minLinkHeight,
|
|
82241
|
+
maxLinkHeight: this._spec.maxLinkHeight,
|
|
82242
|
+
iterations: this._spec.iterations,
|
|
82243
|
+
nodeKey: this._spec.nodeKey,
|
|
82244
|
+
linkSortBy: this._spec.linkSortBy,
|
|
82245
|
+
nodeSortBy: this._spec.nodeSortBy,
|
|
82246
|
+
setNodeLayer: this._spec.setNodeLayer,
|
|
82247
|
+
dropIsolatedNode: this._spec.dropIsolatedNode,
|
|
82248
|
+
nodeHeight: this._spec.nodeHeight,
|
|
82249
|
+
linkHeight: this._spec.linkHeight,
|
|
82250
|
+
equalNodeHeight: this._spec.equalNodeHeight,
|
|
82251
|
+
linkOverlap: this._spec.linkOverlap,
|
|
82252
|
+
inverse: this._spec.inverse
|
|
82253
|
+
};
|
|
82154
82254
|
},
|
|
82155
82255
|
level: TransformLevel.sankeyLayout
|
|
82156
82256
|
});
|
|
@@ -82522,14 +82622,16 @@
|
|
|
82522
82622
|
};
|
|
82523
82623
|
|
|
82524
82624
|
const treemapLayout = (data, op) => {
|
|
82525
|
-
|
|
82526
|
-
|
|
82625
|
+
const options = isFunction$1(op) ? op() : op,
|
|
82626
|
+
viewBox = options.getViewBox();
|
|
82627
|
+
if (viewBox) {
|
|
82628
|
+
const res = new TreemapLayout(options).layout(data, viewBox),
|
|
82527
82629
|
nodes = [];
|
|
82528
82630
|
return flattenNodes(res, nodes, {
|
|
82529
|
-
maxDepth: null ==
|
|
82530
|
-
}), nodes.forEach(
|
|
82631
|
+
maxDepth: null == options ? void 0 : options.maxDepth
|
|
82632
|
+
}), nodes.forEach(datum => {
|
|
82531
82633
|
datum && [DEFAULT_HIERARCHY_ROOT, "name"].forEach(key => {
|
|
82532
|
-
datum[key] = datum.datum[datum.depth][
|
|
82634
|
+
datum[key] = datum.datum[datum.depth][options.nameField];
|
|
82533
82635
|
});
|
|
82534
82636
|
}), nodes;
|
|
82535
82637
|
}
|
|
@@ -82612,28 +82714,31 @@
|
|
|
82612
82714
|
}), isValidNumber$1(this._spec.maxDepth) && (this._maxDepth = this._spec.maxDepth - 1);
|
|
82613
82715
|
}
|
|
82614
82716
|
initData() {
|
|
82615
|
-
var _a
|
|
82717
|
+
var _a;
|
|
82616
82718
|
super.initData(), registerDataSetInstanceTransform(this._dataSet, "treemap", treemapLayout), null === (_a = this._data.getDataView()) || void 0 === _a || _a.transform({
|
|
82617
82719
|
type: "treemap",
|
|
82618
|
-
options: {
|
|
82619
|
-
|
|
82620
|
-
|
|
82621
|
-
|
|
82622
|
-
|
|
82623
|
-
|
|
82624
|
-
|
|
82625
|
-
|
|
82626
|
-
|
|
82627
|
-
|
|
82628
|
-
|
|
82629
|
-
|
|
82630
|
-
|
|
82631
|
-
|
|
82632
|
-
|
|
82633
|
-
|
|
82634
|
-
|
|
82635
|
-
|
|
82636
|
-
|
|
82720
|
+
options: () => {
|
|
82721
|
+
var _a, _b, _c, _d;
|
|
82722
|
+
return {
|
|
82723
|
+
nameField: this._categoryField,
|
|
82724
|
+
valueField: this._valueField,
|
|
82725
|
+
getViewBox: () => this._viewBox.empty() ? null : {
|
|
82726
|
+
x0: this._viewBox.x1,
|
|
82727
|
+
x1: this._viewBox.x2,
|
|
82728
|
+
y0: this._viewBox.y1,
|
|
82729
|
+
y1: this._viewBox.y2
|
|
82730
|
+
},
|
|
82731
|
+
maxDepth: this._maxDepth,
|
|
82732
|
+
gapWidth: this._spec.gapWidth,
|
|
82733
|
+
padding: this._spec.nodePadding,
|
|
82734
|
+
splitType: this._spec.splitType,
|
|
82735
|
+
aspectRatio: this._spec.aspectRatio,
|
|
82736
|
+
labelPadding: (null === (_a = this._spec.nonLeafLabel) || void 0 === _a ? void 0 : _a.visible) ? null === (_b = this._spec.nonLeafLabel) || void 0 === _b ? void 0 : _b.padding : 0,
|
|
82737
|
+
labelPosition: null === (_c = this._spec.nonLeafLabel) || void 0 === _c ? void 0 : _c.position,
|
|
82738
|
+
minVisibleArea: null !== (_d = this._spec.minVisibleArea) && void 0 !== _d ? _d : 10,
|
|
82739
|
+
minChildrenVisibleArea: this._spec.minChildrenVisibleArea,
|
|
82740
|
+
minChildrenVisibleSize: this._spec.minChildrenVisibleSize
|
|
82741
|
+
};
|
|
82637
82742
|
}
|
|
82638
82743
|
}), this.getViewData() && this._spec.drill && this.initDrillableData(this._dataSet);
|
|
82639
82744
|
}
|
|
@@ -83448,36 +83553,41 @@
|
|
|
83448
83553
|
const CORRELATION_Y = `${PREFIX}_CORRELATION_Y`;
|
|
83449
83554
|
const CORRELATION_SIZE = `${PREFIX}_CORRELATION_SIZE`;
|
|
83450
83555
|
|
|
83556
|
+
const resolveOptionValue$1 = option => isFunction$1(option) ? option() : option;
|
|
83451
83557
|
const correlation$1 = (data, options) => {
|
|
83452
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
83558
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
83453
83559
|
if (!data || !(null == options ? void 0 : options.view) || !isArray$1(data)) return data;
|
|
83454
|
-
const
|
|
83560
|
+
const dataList = data,
|
|
83561
|
+
viewBox = options.view();
|
|
83455
83562
|
if (viewBox.x1 - viewBox.x0 == 0 || viewBox.y1 - viewBox.y0 == 0 || viewBox.x1 - viewBox.x0 == -1 / 0 || viewBox.x1 - viewBox.x0 == 1 / 0 || viewBox.y1 - viewBox.y0 == -1 / 0 || viewBox.y1 - viewBox.y0 == 1 / 0) return data;
|
|
83456
|
-
const startAngle = degreeToRadian(null !== (_a = options.startAngle) && void 0 !== _a ? _a : -90),
|
|
83457
|
-
endAngle = degreeToRadian(null !== (_b = options.endAngle) && void 0 !== _b ? _b : 270),
|
|
83563
|
+
const startAngle = degreeToRadian(null !== (_a = resolveOptionValue$1(options.startAngle)) && void 0 !== _a ? _a : -90),
|
|
83564
|
+
endAngle = degreeToRadian(null !== (_b = resolveOptionValue$1(options.endAngle)) && void 0 !== _b ? _b : 270),
|
|
83458
83565
|
maxRadius = Math.max((viewBox.x1 - viewBox.x0) / 2, (viewBox.y1 - viewBox.y0) / 2),
|
|
83459
|
-
innerRadius = toPercent(null !== (_c = options.innerRadius) && void 0 !== _c ? _c : 0, maxRadius),
|
|
83460
|
-
outerRadius = toPercent(options.outerRadius, maxRadius),
|
|
83461
|
-
|
|
83462
|
-
|
|
83463
|
-
|
|
83566
|
+
innerRadius = toPercent(null !== (_c = resolveOptionValue$1(options.innerRadius)) && void 0 !== _c ? _c : 0, maxRadius),
|
|
83567
|
+
outerRadius = toPercent(resolveOptionValue$1(options.outerRadius), maxRadius),
|
|
83568
|
+
centerOption = resolveOptionValue$1(options.center),
|
|
83569
|
+
center = [isNumber$2(null == centerOption ? void 0 : centerOption[0]) ? centerOption[0] : viewBox.x0 + toPercent(null !== (_d = null == centerOption ? void 0 : centerOption[0]) && void 0 !== _d ? _d : "50%", viewBox.x1 - viewBox.x0), isNumber$2(null == centerOption ? void 0 : centerOption[1]) ? centerOption[1] : viewBox.y0 + toPercent(null !== (_e = null == centerOption ? void 0 : centerOption[1]) && void 0 !== _e ? _e : "50%", viewBox.y1 - viewBox.y0)],
|
|
83570
|
+
fieldAccessor = field$2(resolveOptionValue$1(options.field)),
|
|
83571
|
+
values = dataList.map(fieldAccessor),
|
|
83464
83572
|
[min, max] = extent$2(values),
|
|
83465
83573
|
radiusScale = min === max ? val => (innerRadius + outerRadius) / 2 : val => innerRadius + (outerRadius - innerRadius) * (val - min) / (max - min),
|
|
83466
|
-
|
|
83467
|
-
|
|
83574
|
+
radiusField = resolveOptionValue$1(options.radiusField),
|
|
83575
|
+
radiusRange = resolveOptionValue$1(options.radiusRange),
|
|
83576
|
+
sizeAccessor = isNil$1(radiusField) ? fieldAccessor : field$2(radiusField),
|
|
83577
|
+
defaultSize = null !== (_f = null == radiusRange ? void 0 : radiusRange[1]) && void 0 !== _f ? _f : 5;
|
|
83468
83578
|
let sizeScale = datum => defaultSize;
|
|
83469
83579
|
if (sizeAccessor) {
|
|
83470
|
-
const [minSize, maxSize] = sizeAccessor !== fieldAccessor ? extent$2(
|
|
83471
|
-
minR = null !== (
|
|
83472
|
-
maxR = null !== (
|
|
83580
|
+
const [minSize, maxSize] = sizeAccessor !== fieldAccessor ? extent$2(dataList.map(sizeAccessor)) : [min, max],
|
|
83581
|
+
minR = null !== (_g = null == radiusRange ? void 0 : radiusRange[0]) && void 0 !== _g ? _g : 5,
|
|
83582
|
+
maxR = null !== (_h = null == radiusRange ? void 0 : radiusRange[1]) && void 0 !== _h ? _h : 5;
|
|
83473
83583
|
minSize !== maxSize && (sizeScale = datum => minR + (maxR - minR) * (sizeAccessor(datum) - minSize) / (maxSize - minSize));
|
|
83474
83584
|
}
|
|
83475
83585
|
const minAngle = Math.min(startAngle, endAngle),
|
|
83476
83586
|
maxAngle = Math.max(startAngle, endAngle),
|
|
83477
|
-
angles = getPartialAngles(minAngle, maxAngle,
|
|
83587
|
+
angles = getPartialAngles(minAngle, maxAngle, dataList.length),
|
|
83478
83588
|
res = [],
|
|
83479
83589
|
searchAngle = (maxAngle - minAngle) / 60;
|
|
83480
|
-
return
|
|
83590
|
+
return dataList.forEach((datum, index) => {
|
|
83481
83591
|
const radius = radiusScale(values[index]),
|
|
83482
83592
|
size = sizeScale(datum);
|
|
83483
83593
|
let x,
|
|
@@ -83508,14 +83618,18 @@
|
|
|
83508
83618
|
for (; i < count;) j < stepCount && (res.push(startAngle + (j % 2 ? Math.floor(j / 2) + Math.floor(stepCount / 2) : j / 2) * stepAngle * stepSign), j++), i++, j === stepCount && (j = 0, stepIndex += 1, stepSign *= -1, 0 === offsetAngle ? offsetAngle = stepAngle / 2 : offsetAngle /= 2, startAngle = -1 === stepSign ? maxAngle - offsetAngle : minAngle + offsetAngle, stepIndex >= 2 && (stepAngle /= 2, stepCount *= 2));
|
|
83509
83619
|
return res;
|
|
83510
83620
|
},
|
|
83511
|
-
hasOverlap = (item, arr) => !(!arr || !arr.length) && arr.some(entry =>
|
|
83621
|
+
hasOverlap = (item, arr) => !(!arr || !arr.length) && arr.some(entry => {
|
|
83622
|
+
const x = entry.x,
|
|
83623
|
+
y = entry.y,
|
|
83624
|
+
size = entry.size;
|
|
83625
|
+
return Math.pow(item.x - x, 2) + Math.pow(item.y - y, 2) < Math.pow(item.size + size, 2);
|
|
83626
|
+
});
|
|
83512
83627
|
|
|
83628
|
+
const resolveOptionValue = option => isFunction$1(option) ? option() : option;
|
|
83513
83629
|
const correlationCenter = (data, options) => {
|
|
83514
83630
|
if (!data || !isArray$1(data)) return [];
|
|
83515
|
-
const
|
|
83516
|
-
|
|
83517
|
-
categoryField: categoryField
|
|
83518
|
-
} = options,
|
|
83631
|
+
const keyword = resolveOptionValue(options.keyword),
|
|
83632
|
+
categoryField = resolveOptionValue(options.categoryField),
|
|
83519
83633
|
nodeInfo = data[0].latestData[0];
|
|
83520
83634
|
return {
|
|
83521
83635
|
[categoryField]: keyword,
|
|
@@ -83654,7 +83768,6 @@
|
|
|
83654
83768
|
super.setAttrFromSpec(), this.setCategoryField(this._spec.categoryField), this.setValueField(this._spec.valueField), this.setSeriesField(this._spec.seriesField), this.setSizeField(this._spec.sizeField), this.setSizeRange(this._spec.sizeRange);
|
|
83655
83769
|
}
|
|
83656
83770
|
initData() {
|
|
83657
|
-
var _a, _b, _c;
|
|
83658
83771
|
if (super.initData(), !this._data) return;
|
|
83659
83772
|
registerDataSetInstanceTransform(this._dataSet, "correlation", correlation$1);
|
|
83660
83773
|
const centerDataSet = new DataSet();
|
|
@@ -83667,8 +83780,11 @@
|
|
|
83667
83780
|
}), centerDataView.transform({
|
|
83668
83781
|
type: "correlationCenter",
|
|
83669
83782
|
options: {
|
|
83670
|
-
keyword:
|
|
83671
|
-
|
|
83783
|
+
keyword: () => {
|
|
83784
|
+
var _a, _b, _c;
|
|
83785
|
+
return null !== (_c = null === (_b = null === (_a = this._spec.centerLabel) || void 0 === _a ? void 0 : _a.style) || void 0 === _b ? void 0 : _b.text) && void 0 !== _c ? _c : "";
|
|
83786
|
+
},
|
|
83787
|
+
categoryField: () => this._spec.categoryField
|
|
83672
83788
|
}
|
|
83673
83789
|
}), this._centerSeriesData = new CompilableData(this._option, centerDataView);
|
|
83674
83790
|
}
|
|
@@ -83686,14 +83802,14 @@
|
|
|
83686
83802
|
y0: this._viewBox.y1,
|
|
83687
83803
|
y1: this._viewBox.y2
|
|
83688
83804
|
}),
|
|
83689
|
-
field: this._spec.valueField,
|
|
83690
|
-
radiusRange: this._spec.sizeRange,
|
|
83691
|
-
radiusField: this._spec.sizeField,
|
|
83692
|
-
center: [this._spec.centerX, this._spec.centerY],
|
|
83693
|
-
innerRadius: this._spec.innerRadius,
|
|
83694
|
-
outerRadius: this._spec.outerRadius,
|
|
83695
|
-
startAngle: this._spec.startAngle,
|
|
83696
|
-
endAngle: this._spec.endAngle
|
|
83805
|
+
field: () => this._spec.valueField,
|
|
83806
|
+
radiusRange: () => this._spec.sizeRange,
|
|
83807
|
+
radiusField: () => this._spec.sizeField,
|
|
83808
|
+
center: () => [this._spec.centerX, this._spec.centerY],
|
|
83809
|
+
innerRadius: () => this._spec.innerRadius,
|
|
83810
|
+
outerRadius: () => this._spec.outerRadius,
|
|
83811
|
+
startAngle: () => this._spec.startAngle,
|
|
83812
|
+
endAngle: () => this._spec.endAngle
|
|
83697
83813
|
}
|
|
83698
83814
|
});
|
|
83699
83815
|
}
|
|
@@ -84399,10 +84515,11 @@
|
|
|
84399
84515
|
}
|
|
84400
84516
|
|
|
84401
84517
|
const vennLayout = (data, op) => {
|
|
84402
|
-
const
|
|
84518
|
+
const options = isFunction$1(op) ? op() : op,
|
|
84519
|
+
viewBox = options.getViewBox();
|
|
84403
84520
|
return viewBox && (null == data ? void 0 : data.length) ? vennTransform(Object.assign({
|
|
84404
|
-
setField:
|
|
84405
|
-
valueField:
|
|
84521
|
+
setField: options.setField,
|
|
84522
|
+
valueField: options.valueField
|
|
84406
84523
|
}, viewBox), data) : [];
|
|
84407
84524
|
};
|
|
84408
84525
|
|
|
@@ -84486,7 +84603,7 @@
|
|
|
84486
84603
|
var _a;
|
|
84487
84604
|
super.initData(), registerDataSetInstanceTransform(this._dataSet, "venn", vennLayout), null === (_a = this._data.getDataView()) || void 0 === _a || _a.transform({
|
|
84488
84605
|
type: "venn",
|
|
84489
|
-
options: {
|
|
84606
|
+
options: () => ({
|
|
84490
84607
|
getViewBox: () => this._viewBox.empty() ? null : {
|
|
84491
84608
|
x0: this._viewBox.x1,
|
|
84492
84609
|
x1: this._viewBox.x2,
|
|
@@ -84495,7 +84612,7 @@
|
|
|
84495
84612
|
},
|
|
84496
84613
|
setField: this._categoryField,
|
|
84497
84614
|
valueField: this._valueField
|
|
84498
|
-
}
|
|
84615
|
+
})
|
|
84499
84616
|
});
|
|
84500
84617
|
}
|
|
84501
84618
|
compile() {
|
|
@@ -84798,7 +84915,7 @@
|
|
|
84798
84915
|
}), indicatorSpec;
|
|
84799
84916
|
}
|
|
84800
84917
|
_getDefaultSeriesSpec(spec, pickKeys) {
|
|
84801
|
-
return super._getDefaultSeriesSpec(spec, ["radius", "outerRadius", "innerRadius", "startAngle", "endAngle", "sortDataByAxis"], pickKeys);
|
|
84918
|
+
return super._getDefaultSeriesSpec(spec, ["radius", "outerRadius", "innerRadius", "startAngle", "endAngle", "centerX", "centerY", "sortDataByAxis"], pickKeys);
|
|
84802
84919
|
}
|
|
84803
84920
|
transformSpec(spec) {
|
|
84804
84921
|
super.transformSpec(spec), isArray$1(spec.dataZoom) && spec.dataZoom.length > 0 && spec.dataZoom.forEach(zoom => {
|
|
@@ -84812,7 +84929,7 @@
|
|
|
84812
84929
|
return !1;
|
|
84813
84930
|
}
|
|
84814
84931
|
_getDefaultSeriesSpec(spec) {
|
|
84815
|
-
const series = super._getDefaultSeriesSpec(spec, ["startAngle", "endAngle", "centerX", "centerY"]);
|
|
84932
|
+
const series = super._getDefaultSeriesSpec(spec, ["startAngle", "endAngle", "centerX", "centerY", "clamp"]);
|
|
84816
84933
|
return series.categoryField = spec.categoryField || spec.radiusField, series.valueField = spec.valueField || spec.angleField, series;
|
|
84817
84934
|
}
|
|
84818
84935
|
_transformProgressAxisSpec(spec, angleAxisDefaultSpec, radiusAxisDefaultSpec, angleAxisAppendSpec, radiusAxisAppendSpec) {
|
|
@@ -84891,7 +85008,7 @@
|
|
|
84891
85008
|
_getDefaultSeriesSpec(spec) {
|
|
84892
85009
|
var _a, _b, _c;
|
|
84893
85010
|
const series = super._getDefaultSeriesSpec(spec);
|
|
84894
|
-
return series.radius = null !== (_a = spec.radius) && void 0 !== _a ? _a : POLAR_DEFAULT_RADIUS, series.outerRadius = null !== (_b = spec.outerRadius) && void 0 !== _b ? _b : POLAR_DEFAULT_RADIUS, series.innerRadius = null !== (_c = spec.innerRadius) && void 0 !== _c ? _c : 0, series.stack = spec.stack, series.percent = spec.percent, series;
|
|
85011
|
+
return this._addSeriesRelatedSpecKeys(["radius", "outerRadius", "innerRadius"]), series.radius = null !== (_a = spec.radius) && void 0 !== _a ? _a : POLAR_DEFAULT_RADIUS, series.outerRadius = null !== (_b = spec.outerRadius) && void 0 !== _b ? _b : POLAR_DEFAULT_RADIUS, series.innerRadius = null !== (_c = spec.innerRadius) && void 0 !== _c ? _c : 0, series.stack = spec.stack, series.percent = spec.percent, series;
|
|
84895
85012
|
}
|
|
84896
85013
|
transformSpec(spec) {
|
|
84897
85014
|
var _a;
|
|
@@ -85016,7 +85133,7 @@
|
|
|
85016
85133
|
var _a, _b, _c, _d;
|
|
85017
85134
|
const series = super._getDefaultSeriesSpec(spec),
|
|
85018
85135
|
areaTheme = null === (_b = (_a = this._option).getTheme) || void 0 === _b ? void 0 : _b.call(_a, "series", "radar", "area");
|
|
85019
|
-
return series.line = spec.line, series.point = spec.point, series.stack = spec.stack, series.percent = spec.percent, series.area = mergeSpec({
|
|
85136
|
+
return this._addSeriesRelatedSpecKeys(["line", "point", "area"]), series.line = spec.line, series.point = spec.point, series.stack = spec.stack, series.percent = spec.percent, series.area = mergeSpec({
|
|
85020
85137
|
visible: null !== (_c = null == areaTheme ? void 0 : areaTheme.visible) && void 0 !== _c && _c
|
|
85021
85138
|
}, spec.area), series.seriesMark = null !== (_d = spec.seriesMark) && void 0 !== _d ? _d : "area", series.activePoint = spec.activePoint, series.pointDis = spec.pointDis, series.pointDisMul = spec.pointDisMul, series.markOverlap = spec.markOverlap, series;
|
|
85022
85139
|
}
|
|
@@ -85365,7 +85482,7 @@
|
|
|
85365
85482
|
_getDefaultSeriesSpec(spec) {
|
|
85366
85483
|
var _a, _b;
|
|
85367
85484
|
const series = super._getDefaultSeriesSpec(spec);
|
|
85368
|
-
return this._addSeriesRelatedSpecKeys(["cornerRadius"]), series.progress = spec.progress, series.track = spec.track, series.tickMask = spec.tickMask, series.cornerRadius = null !== (_a = spec.cornerRadius) && void 0 !== _a ? _a : 0, series.roundCap = null !== (_b = spec.roundCap) && void 0 !== _b && _b, series;
|
|
85485
|
+
return this._addSeriesRelatedSpecKeys(["cornerRadius", "progress", "track", "roundCap"]), series.progress = spec.progress, series.track = spec.track, series.tickMask = spec.tickMask, series.cornerRadius = null !== (_a = spec.cornerRadius) && void 0 !== _a ? _a : 0, series.roundCap = null !== (_b = spec.roundCap) && void 0 !== _b && _b, series;
|
|
85369
85486
|
}
|
|
85370
85487
|
transformSpec(spec) {
|
|
85371
85488
|
super.transformSpec(spec), this._transformProgressAxisSpec(spec, {
|
|
@@ -85396,7 +85513,7 @@
|
|
|
85396
85513
|
class GaugeChartSpecTransformer extends ProgressLikeChartSpecTransformer {
|
|
85397
85514
|
_getDefaultSeriesSpec(spec) {
|
|
85398
85515
|
const series = super._getDefaultSeriesSpec(spec);
|
|
85399
|
-
return series.radiusField = spec.radiusField, series.pin = spec.pin, series.pinBackground = spec.pinBackground, series.pointer = spec.pointer, series;
|
|
85516
|
+
return this._addSeriesRelatedSpecKeys(["pin", "pinBackground", "pointer"]), series.radiusField = spec.radiusField, series.pin = spec.pin, series.pinBackground = spec.pinBackground, series.pointer = spec.pointer, series;
|
|
85400
85517
|
}
|
|
85401
85518
|
_getDefaultCircularProgressSeriesSpec(spec) {
|
|
85402
85519
|
const series = super._getDefaultSeriesSpec(spec);
|
|
@@ -85516,7 +85633,7 @@
|
|
|
85516
85633
|
_getDefaultSeriesSpec(spec) {
|
|
85517
85634
|
var _a, _b;
|
|
85518
85635
|
const series = super._getDefaultSeriesSpec(spec, ["bandWidth", "progress", "track", "clamp"]);
|
|
85519
|
-
return series.direction = null !== (_a = spec.direction) && void 0 !== _a ? _a : "horizontal", series.cornerRadius = null !== (_b = spec.cornerRadius) && void 0 !== _b ? _b : 0, series;
|
|
85636
|
+
return series.direction = null !== (_a = spec.direction) && void 0 !== _a ? _a : "horizontal", this._addSeriesRelatedSpecKeys(["cornerRadius"]), series.cornerRadius = null !== (_b = spec.cornerRadius) && void 0 !== _b ? _b : 0, series;
|
|
85520
85637
|
}
|
|
85521
85638
|
transformSpec(spec) {
|
|
85522
85639
|
var _a, _b;
|
|
@@ -85764,7 +85881,7 @@
|
|
|
85764
85881
|
_getDefaultSeriesSpec(spec) {
|
|
85765
85882
|
var _a, _b;
|
|
85766
85883
|
const series = super._getDefaultSeriesSpec(spec);
|
|
85767
|
-
return series.area = spec.area, series.point = spec.point, series.line = spec.line, "horizontal" === spec.direction ? series.xField = null !== (_a = spec.xField) && void 0 !== _a ? _a : [spec.minField, spec.maxField] : series.yField = null !== (_b = spec.yField) && void 0 !== _b ? _b : [spec.minField, spec.maxField], series.stack = !1, series;
|
|
85884
|
+
return this._addSeriesRelatedSpecKeys(["area", "point", "line"]), series.area = spec.area, series.point = spec.point, series.line = spec.line, "horizontal" === spec.direction ? series.xField = null !== (_a = spec.xField) && void 0 !== _a ? _a : [spec.minField, spec.maxField] : series.yField = null !== (_b = spec.yField) && void 0 !== _b ? _b : [spec.minField, spec.maxField], series.stack = !1, series;
|
|
85768
85885
|
}
|
|
85769
85886
|
transformSpec(spec) {
|
|
85770
85887
|
super.transformSpec(spec), setDefaultCrosshairForCartesianChart(spec);
|
|
@@ -89838,7 +89955,7 @@
|
|
|
89838
89955
|
datum: datum,
|
|
89839
89956
|
title: title,
|
|
89840
89957
|
content: content
|
|
89841
|
-
} = op,
|
|
89958
|
+
} = isFunction$1(op) ? op() : op,
|
|
89842
89959
|
mappedData = [],
|
|
89843
89960
|
datumResult = datum.call(null);
|
|
89844
89961
|
return title.visible && mappedData.push({
|
|
@@ -89939,11 +90056,11 @@
|
|
|
89939
90056
|
});
|
|
89940
90057
|
displayData.transform({
|
|
89941
90058
|
type: "indicatorFilter",
|
|
89942
|
-
options: {
|
|
90059
|
+
options: () => ({
|
|
89943
90060
|
title: this._title,
|
|
89944
90061
|
content: this._content,
|
|
89945
90062
|
datum: () => this._activeDatum
|
|
89946
|
-
}
|
|
90063
|
+
})
|
|
89947
90064
|
}), displayData.target.addListener("change", this.updateDatum.bind(this)), this._displayData = new CompilableData(this._option, displayData);
|
|
89948
90065
|
}
|
|
89949
90066
|
updateLayoutAttribute() {
|
|
@@ -90731,20 +90848,31 @@
|
|
|
90731
90848
|
MARKER_COORDINATE_PLACEHOLDER = "__vchart_marker_coordinate__",
|
|
90732
90849
|
MARKER_TEXT_PLACEHOLDER = "__vchart_marker_text__",
|
|
90733
90850
|
MARKER_AUTO_RANGE_PLACEHOLDER = "__vchart_marker_auto_range__",
|
|
90851
|
+
MARKER_STYLE_PLACEHOLDER = "__vchart_marker_style__",
|
|
90734
90852
|
MARKER_DOMAIN_POSITION_SPEC_KEYS = ["coordinate", "coordinates", "x", "y", "x1", "y1", "angle", "angle1", "radius", "radius1"],
|
|
90735
90853
|
MARKER_LAYOUT_POSITION_SPEC_KEYS = ["position", "positions", "coordinatesOffset", "regionRelative"],
|
|
90736
90854
|
normalizeMarkerLabelFormatMethod = label => Array.isArray(label) ? label.map(normalizeMarkerLabelFormatMethod) : label && "object" == typeof label ? "function" != typeof label.formatMethod ? label : Object.assign(Object.assign({}, label), {
|
|
90737
90855
|
formatMethod: MARKER_FORMAT_METHOD_PLACEHOLDER
|
|
90738
90856
|
}) : label,
|
|
90857
|
+
normalizeMarkerStyles = value => {
|
|
90858
|
+
if (Array.isArray(value)) return value.map(normalizeMarkerStyles);
|
|
90859
|
+
if (!value || "object" != typeof value) return value;
|
|
90860
|
+
const normalized = Object.assign({}, value);
|
|
90861
|
+
return Object.keys(normalized).forEach(key => {
|
|
90862
|
+
"style" === key || key.endsWith("Style") ? normalized[key] = MARKER_STYLE_PLACEHOLDER : normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
90863
|
+
}), normalized;
|
|
90864
|
+
},
|
|
90739
90865
|
normalizeMarkerSpecForComponentOnlyUpdate = (spec, options) => {
|
|
90740
90866
|
var _a;
|
|
90741
90867
|
if (!spec || "object" != typeof spec) return spec;
|
|
90742
90868
|
const normalized = Object.assign({}, spec);
|
|
90743
90869
|
options.normalizeDomainPosition && MARKER_DOMAIN_POSITION_SPEC_KEYS.forEach(key => {
|
|
90744
|
-
|
|
90870
|
+
normalized[key] = MARKER_COORDINATE_PLACEHOLDER;
|
|
90745
90871
|
}), options.normalizeAutoRange && "autoRange" in normalized && (normalized.autoRange = MARKER_AUTO_RANGE_PLACEHOLDER), MARKER_LAYOUT_POSITION_SPEC_KEYS.forEach(key => {
|
|
90746
90872
|
key in normalized && (normalized[key] = MARKER_COORDINATE_PLACEHOLDER);
|
|
90747
|
-
}), "label" in normalized && (normalized.label = normalizeMarkerLabelFormatMethod(normalized.label))
|
|
90873
|
+
}), "label" in normalized && (normalized.label = normalizeMarkerLabelFormatMethod(normalized.label)), Object.keys(normalized).forEach(key => {
|
|
90874
|
+
normalized[key] = normalizeMarkerStyles(normalized[key]);
|
|
90875
|
+
});
|
|
90748
90876
|
const text = null === (_a = normalized.itemContent) || void 0 === _a ? void 0 : _a.text;
|
|
90749
90877
|
return text && "object" == typeof text && (normalized.itemContent = Object.assign(Object.assign({}, normalized.itemContent), {
|
|
90750
90878
|
text: Object.assign(Object.assign({}, normalizeMarkerLabelFormatMethod(text)), {
|
|
@@ -90931,7 +91059,7 @@
|
|
|
90931
91059
|
}));
|
|
90932
91060
|
}
|
|
90933
91061
|
reInit(spec) {
|
|
90934
|
-
super.reInit(spec), this._bindSeries(), this._initDataView(), this._buildMarkerAttributeContext(), this._markerComponent && this._updateMarkerLayout();
|
|
91062
|
+
super.reInit(spec), this._releaseMarkerData(), this._bindSeries(), this._initDataView(), this._buildMarkerAttributeContext(), this._markerComponent && this._updateMarkerLayout();
|
|
90935
91063
|
}
|
|
90936
91064
|
_initCommonDataView() {
|
|
90937
91065
|
const {
|
|
@@ -92980,7 +93108,7 @@
|
|
|
92980
93108
|
return new MarkPoint$1(markPointAttrs);
|
|
92981
93109
|
}
|
|
92982
93110
|
_markerLayout() {
|
|
92983
|
-
var _a, _b, _c, _d, _e, _f;
|
|
93111
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
92984
93112
|
const spec = this._spec,
|
|
92985
93113
|
data = this._markerData,
|
|
92986
93114
|
relativeSeries = this._relativeSeries,
|
|
@@ -92988,9 +93116,30 @@
|
|
|
92988
93116
|
point: point
|
|
92989
93117
|
} = this._computePointsAttr(),
|
|
92990
93118
|
seriesData = this._getRelativeDataView().latestData,
|
|
92991
|
-
dataPoints = data ? data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData : seriesData
|
|
93119
|
+
dataPoints = data ? data.latestData[0] && data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData : seriesData,
|
|
93120
|
+
{
|
|
93121
|
+
itemLine = {},
|
|
93122
|
+
itemContent = {}
|
|
93123
|
+
} = this._spec,
|
|
93124
|
+
{
|
|
93125
|
+
visible: itemLineVisible,
|
|
93126
|
+
line = {}
|
|
93127
|
+
} = itemLine,
|
|
93128
|
+
restItemLine = __rest$1(itemLine, ["visible", "line"]),
|
|
93129
|
+
itemLineAttrs = !1 !== itemLineVisible ? Object.assign(Object.assign({}, restItemLine), {
|
|
93130
|
+
visible: !0,
|
|
93131
|
+
lineStyle: transformToGraphic(line.style)
|
|
93132
|
+
}) : {
|
|
93133
|
+
visible: !1
|
|
93134
|
+
},
|
|
93135
|
+
labelAttrs = transformLabelAttributes(Object.assign(Object.assign({}, itemContent.text), {
|
|
93136
|
+
style: merge$1({
|
|
93137
|
+
dx: 0,
|
|
93138
|
+
dy: 0
|
|
93139
|
+
}, null !== (_b = null === (_a = itemContent.text) || void 0 === _a ? void 0 : _a.style) && void 0 !== _b ? _b : itemContent.style)
|
|
93140
|
+
}), data, this._markAttributeContext);
|
|
92992
93141
|
let limitRect;
|
|
92993
|
-
if (spec.clip || (null === (
|
|
93142
|
+
if (spec.clip || (null === (_c = spec.itemContent) || void 0 === _c ? void 0 : _c.confine)) {
|
|
92994
93143
|
const {
|
|
92995
93144
|
minX: minX,
|
|
92996
93145
|
maxX: maxX,
|
|
@@ -93005,21 +93154,24 @@
|
|
|
93005
93154
|
};
|
|
93006
93155
|
}
|
|
93007
93156
|
if (this._markerComponent) {
|
|
93008
|
-
const attribute = null !== (
|
|
93009
|
-
textStyle = null !== (
|
|
93010
|
-
specText = null === (
|
|
93157
|
+
const attribute = null !== (_d = this._markerComponent.attribute) && void 0 !== _d ? _d : {},
|
|
93158
|
+
textStyle = null !== (_f = null === (_e = attribute.itemContent) || void 0 === _e ? void 0 : _e.textStyle) && void 0 !== _f ? _f : {},
|
|
93159
|
+
specText = null === (_g = this._spec.itemContent.text) || void 0 === _g ? void 0 : _g.text;
|
|
93011
93160
|
this._markerComponent.setAttributes({
|
|
93012
93161
|
position: void 0 === point ? {
|
|
93013
93162
|
x: null,
|
|
93014
93163
|
y: null
|
|
93015
93164
|
} : point,
|
|
93016
93165
|
itemContent: Object.assign(Object.assign({}, attribute.itemContent), {
|
|
93017
|
-
|
|
93018
|
-
|
|
93166
|
+
panel: null !== (_h = labelAttrs.panel) && void 0 !== _h ? _h : null === (_j = attribute.itemContent) || void 0 === _j ? void 0 : _j.panel,
|
|
93167
|
+
padding: null !== (_k = labelAttrs.padding) && void 0 !== _k ? _k : null === (_l = attribute.itemContent) || void 0 === _l ? void 0 : _l.padding,
|
|
93168
|
+
textStyle: Object.assign(Object.assign(Object.assign({}, textStyle), null !== (_m = labelAttrs.textStyle) && void 0 !== _m ? _m : {}), {
|
|
93169
|
+
text: (null === (_o = this._spec.itemContent.text) || void 0 === _o ? void 0 : _o.formatMethod) ? this._spec.itemContent.text.formatMethod(dataPoints, seriesData) : isValid$1(specText) ? specText : textStyle.text
|
|
93019
93170
|
}),
|
|
93020
93171
|
offsetX: computeOffsetFromRegion(point, attribute.itemContent.offsetX, this._relativeSeries.getRegion()),
|
|
93021
93172
|
offsetY: computeOffsetFromRegion(point, attribute.itemContent.offsetY, this._relativeSeries.getRegion())
|
|
93022
93173
|
}),
|
|
93174
|
+
itemLine: itemLineAttrs,
|
|
93023
93175
|
limitRect: limitRect,
|
|
93024
93176
|
dx: this._layoutOffsetX,
|
|
93025
93177
|
dy: this._layoutOffsetY
|