@visactor/vchart 2.1.0-alpha.6 → 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/es5/index.js +1 -1
- package/build/index.es.js +51 -19
- package/build/index.js +51 -19
- package/build/index.min.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base/base-chart.d.ts +1 -0
- package/cjs/chart/base/base-chart.js +17 -13
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/component/index.js +2 -1
- package/cjs/component/marker/base-marker.js +16 -6
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/mark-point/base-mark-point.js +19 -6
- package/cjs/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/cjs/constant/attribute.js +1 -2
- package/cjs/constant/scatter.js +2 -1
- package/cjs/constant/waterfall.js +1 -2
- package/cjs/core/expression-function.js +1 -1
- package/cjs/core/factory.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/data/data-view-utils.js +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -1
- package/esm/chart/base/base-chart.d.ts +1 -0
- package/esm/chart/base/base-chart.js +16 -13
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/component/index.js +2 -1
- package/esm/component/marker/base-marker.js +16 -6
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/mark-point/base-mark-point.js +19 -6
- package/esm/component/marker/mark-point/base-mark-point.js.map +1 -1
- package/esm/constant/attribute.js +1 -2
- package/esm/constant/scatter.js +2 -1
- package/esm/constant/waterfall.js +1 -2
- package/esm/core/expression-function.js +1 -1
- package/esm/core/factory.js +1 -1
- package/esm/core/index.js +1 -1
- package/esm/data/data-view-utils.js +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -1
- package/package.json +5 -5
|
@@ -130,6 +130,7 @@ export declare class BaseChart<T extends IChartSpec> extends CompilableBase impl
|
|
|
130
130
|
private _canChangeMarkerComponentsWithoutRemake;
|
|
131
131
|
private _canAddMarkerComponentsWithoutRemake;
|
|
132
132
|
private _isMarkerAdditionSpecSafeWithoutRemake;
|
|
133
|
+
private _isAutoRangeMarkerSpec;
|
|
133
134
|
private _canRemoveMarkerComponentsWithoutRemake;
|
|
134
135
|
private _isOnlyMarkerComponentsRemoved;
|
|
135
136
|
private _isComponentSpecKey;
|
|
@@ -19,17 +19,10 @@ const data_1 = require("../chart-meta/data"), global_scale_1 = require("../../sc
|
|
|
19
19
|
[interface_1.ComponentTypeEnum.markLine]: !0,
|
|
20
20
|
[interface_1.ComponentTypeEnum.markArea]: !0
|
|
21
21
|
}, MARKER_ADDITION_REMAKE_SPEC_KEYS = {
|
|
22
|
-
autoRange: !0,
|
|
23
22
|
regionId: !0,
|
|
24
23
|
regionIndex: !0,
|
|
25
24
|
seriesId: !0,
|
|
26
25
|
seriesIndex: !0,
|
|
27
|
-
relativeSeriesId: !0,
|
|
28
|
-
relativeSeriesIndex: !0,
|
|
29
|
-
startRelativeSeriesId: !0,
|
|
30
|
-
startRelativeSeriesIndex: !0,
|
|
31
|
-
endRelativeSeriesId: !0,
|
|
32
|
-
endRelativeSeriesIndex: !0,
|
|
33
26
|
specifiedDataSeriesId: !0,
|
|
34
27
|
specifiedDataSeriesIndex: !0
|
|
35
28
|
};
|
|
@@ -121,8 +114,12 @@ class BaseChart extends compilable_base_1.CompilableBase {
|
|
|
121
114
|
const component = this._components.find((s => s.userId === userId));
|
|
122
115
|
if (component) return component;
|
|
123
116
|
}, this.getComponentsByType = type => this._components.filter((c => c.type === type)),
|
|
124
|
-
this._isMarkerAdditionSpecSafeWithoutRemake = spec =>
|
|
125
|
-
|
|
117
|
+
this._isMarkerAdditionSpecSafeWithoutRemake = spec => {
|
|
118
|
+
if (!spec || "object" != typeof spec) return !1;
|
|
119
|
+
const markerSpec = spec;
|
|
120
|
+
return !1 !== markerSpec.visible && !Object.keys(MARKER_ADDITION_REMAKE_SPEC_KEYS).some((key => !(0,
|
|
121
|
+
vutils_1.isNil)(markerSpec[key])));
|
|
122
|
+
}, this._paddingSpec = (0, util_1.normalizeLayoutPaddingSpec)(null !== (_a = spec.padding) && void 0 !== _a ? _a : option.getTheme("padding")),
|
|
126
123
|
this._event = new event_1.Event(option.eventDispatcher, option.mode), this._dataSet = option.dataSet,
|
|
127
124
|
this._chartData = new data_1.ChartData(this._dataSet), this._modelOption = Object.assign(Object.assign({}, option), {
|
|
128
125
|
mode: this._option.mode,
|
|
@@ -554,6 +551,9 @@ class BaseChart extends compilable_base_1.CompilableBase {
|
|
|
554
551
|
return !!(MARKER_COMPONENT_SPEC_KEYS[key] && (0, util_1.isArray)(currentSpec) && (0,
|
|
555
552
|
util_1.isArray)(nextSpec)) && (!(nextSpec.length <= currentSpec.length) && nextSpec.slice(currentSpec.length).every(this._isMarkerAdditionSpecSafeWithoutRemake));
|
|
556
553
|
}
|
|
554
|
+
_isAutoRangeMarkerSpec(spec) {
|
|
555
|
+
return !!spec && "object" == typeof spec && !0 === spec.autoRange;
|
|
556
|
+
}
|
|
557
557
|
_canRemoveMarkerComponentsWithoutRemake(key, currentSpec, nextSpec) {
|
|
558
558
|
return MARKER_COMPONENT_SPEC_KEYS[key] && (0, util_1.isArray)(currentSpec) && currentSpec.length > 0 && (0,
|
|
559
559
|
util_1.isArray)(nextSpec) && 0 === nextSpec.length;
|
|
@@ -619,14 +619,18 @@ class BaseChart extends compilable_base_1.CompilableBase {
|
|
|
619
619
|
}
|
|
620
620
|
_createMissingMarkerComponentsForSpecs(result, componentCache) {
|
|
621
621
|
var _a;
|
|
622
|
-
let createdCount = 0;
|
|
622
|
+
let createdCount = 0, hasAutoRangeMarker = !1;
|
|
623
623
|
null === (_a = this._specTransformer) || void 0 === _a || _a.forEachComponentInSpec(this._spec, ((constructor, specInfo) => {
|
|
624
624
|
if (result.reMake) return;
|
|
625
625
|
const compSpecKey = constructor.specKey || constructor.type;
|
|
626
626
|
MARKER_COMPONENT_SPEC_KEYS[compSpecKey] && !this._hasComponentForSpecInfo(compSpecKey, specInfo) && (this._isMarkerAdditionSpecSafeWithoutRemake(specInfo.spec) ? (this._createComponent(constructor, specInfo),
|
|
627
|
-
componentCache[compSpecKey] && componentCache[compSpecKey].componentCount++, createdCount
|
|
628
|
-
|
|
629
|
-
|
|
627
|
+
componentCache[compSpecKey] && componentCache[compSpecKey].componentCount++, createdCount++,
|
|
628
|
+
hasAutoRangeMarker = hasAutoRangeMarker || this._isAutoRangeMarkerSpec(specInfo.spec)) : result.reMake = !0);
|
|
629
|
+
}), this._option.getSpecInfo()), createdCount && (result.change = !0, result.effects = Object.assign(Object.assign(Object.assign(Object.assign({}, result.effects), {
|
|
630
|
+
component: !0
|
|
631
|
+
}), hasAutoRangeMarker ? {
|
|
632
|
+
scaleDomain: !0
|
|
633
|
+
} : null), {
|
|
630
634
|
layout: !0,
|
|
631
635
|
render: !0
|
|
632
636
|
}));
|