You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/05/26 14:53:16 UTC
[incubator-echarts] 01/01: Merge branch 'next' into
label-enhancement
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch label-enhancement
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit 72c10a2d326e10dc17634bb97d05203e011f50b1
Merge: ea1978b 4d8fbea
Author: pissang <bm...@gmail.com>
AuthorDate: Tue May 26 22:52:02 2020 +0800
Merge branch 'next' into label-enhancement
build/dev-fast.js | 52 +++++++++
package-lock.json | 113 ++++++++++++++++++
package.json | 3 +
src/chart/bar/BarView.ts | 5 +-
src/component/axis/AngleAxisView.ts | 7 +-
src/coord/CoordinateSystem.ts | 3 -
src/data/List.ts | 43 ++++---
src/data/helper/dataProvider.ts | 6 +-
src/echarts.ts | 81 ++++++-------
src/model/Component.ts | 14 ++-
src/model/Global.ts | 17 ++-
src/model/Model.ts | 14 ++-
src/model/Series.ts | 14 ++-
src/util/graphic.ts | 24 +++-
src/util/types.ts | 1 +
src/view/Chart.ts | 14 ++-
src/view/Component.ts | 14 ++-
test/-cases.js | 2 +
test/axis-splitArea.html | 170 +++++++++++++++++++++++++++
test/bar-stream-large.html | 15 ++-
test/hoverStyle.html | 26 ++++-
test/lib/reset.css | 14 +++
test/lib/testHelper.js | 224 +++++++++++++++++++++++++++++-------
test/stream-basic.css | 39 +++++++
test/stream-basic.js | 99 ++++++++++++++++
test/stream-basic1.html | 106 +++++++++++++++++
test/stream-basic2.html | 114 ++++++++++++++++++
27 files changed, 1074 insertions(+), 160 deletions(-)
diff --cc src/echarts.ts
index 7420e3a,5be348b..6723c9d
--- a/src/echarts.ts
+++ b/src/echarts.ts
@@@ -175,6 -174,48 +175,44 @@@ messageCenterProto.on = createRegisterE
messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');
// messageCenterProto.one = createRegisterEventWithLowercaseMessageCenter('one');
+ // ---------------------------------------
+ // Internal method names for class ECharts
+ // ---------------------------------------
+ let prepare: (ecIns: ECharts) => void;
+ let prepareView: (ecIns: ECharts, isComponent: boolean) => void;
+ let updateDirectly: (
+ ecIns: ECharts, method: string, payload: Payload, mainType: ComponentMainType, subType?: ComponentSubType
+ ) => void;
+ type UpdateMethod = (this: ECharts, payload?: Payload) => void;
+ let updateMethods: {
+ prepareAndUpdate: UpdateMethod,
+ update: UpdateMethod,
+ updateTransform: UpdateMethod,
+ updateView: UpdateMethod,
+ updateVisual: UpdateMethod,
+ updateLayout: UpdateMethod
+ };
+ let doConvertPixel: (ecIns: ECharts, methodName: string, finder: ModelFinder, value: any) => any;
+ let updateStreamModes: (ecIns: ECharts, ecModel: GlobalModel) => void;
+ let doDispatchAction: (this: ECharts, payload: Payload, silent: boolean) => void;
+ let flushPendingActions: (this: ECharts, silent: boolean) => void;
+ let triggerUpdatedEvent: (this: ECharts, silent: boolean) => void;
+ let bindRenderedEvent: (zr: zrender.ZRenderType, ecIns: ECharts) => void;
+ let clearColorPalette: (ecModel: GlobalModel) => void;
+ let render: (ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) => void;
+ let renderComponents: (
+ ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload, dirtyList?: ComponentView[]
+ ) => void;
+ let renderSeries: (
+ ecIns: ECharts,
+ ecModel: GlobalModel,
+ api: ExtensionAPI,
+ payload: Payload | 'remain',
+ dirtyMap?: {[uid: string]: any}
+ ) => void;
+ let performPostUpdateFuncs: (ecModel: GlobalModel, api: ExtensionAPI) => void;
-let updateHoverLayerStatus: (ecIns: ECharts, ecModel: GlobalModel) => void;
-let updateBlend: (seriesModel: SeriesModel, chartView: ChartView) => void;
-let updateZ: (model: ComponentModel, view: ComponentView | ChartView) => void;
-let updateHoverEmphasisHandler: (view: ComponentView | ChartView) => void;
+ let createExtensionAPI: (ecIns: ECharts) => ExtensionAPI;
+ let enableConnect: (chart: ECharts) => void;
class ECharts extends Eventful {
@@@ -1666,11 -1692,13 +1704,14 @@@
if (dirtyMap && dirtyMap.get(seriesModel.uid)) {
renderTask.dirty();
}
-
- unfinished |= +renderTask.perform(scheduler.getPerformArgs(renderTask));
+ if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {
+ unfinished = true;
+ }
chartView.group.silent = !!seriesModel.get('silent');
+ // Should not call markRedraw on group, because it will disable zrender
+ // increamental render (alway render from the __startIndex each frame)
+ // chartView.group.markRedraw();
updateZ(seriesModel, chartView);
@@@ -1923,46 -1874,7 +1964,6 @@@
}
- // ---------------------------------------
- // Internal method names for class ECharts
- // ---------------------------------------
- let prepare: (ecIns: ECharts) => void;
- let prepareView: (ecIns: ECharts, isComponent: boolean) => void;
- let updateDirectly: (
- ecIns: ECharts, method: string, payload: Payload, mainType: ComponentMainType, subType?: ComponentSubType
- ) => void;
- type UpdateMethod = (this: ECharts, payload?: Payload) => void;
- let updateMethods: {
- prepareAndUpdate: UpdateMethod,
- update: UpdateMethod,
- updateTransform: UpdateMethod,
- updateView: UpdateMethod,
- updateVisual: UpdateMethod,
- updateLayout: UpdateMethod
- };
- let doConvertPixel: (ecIns: ECharts, methodName: string, finder: ModelFinder, value: any) => any;
- let updateStreamModes: (ecIns: ECharts, ecModel: GlobalModel) => void;
- let doDispatchAction: (this: ECharts, payload: Payload, silent: boolean) => void;
- let flushPendingActions: (this: ECharts, silent: boolean) => void;
- let triggerUpdatedEvent: (this: ECharts, silent: boolean) => void;
- let bindRenderedEvent: (zr: zrender.ZRenderType, ecIns: ECharts) => void;
- let clearColorPalette: (ecModel: GlobalModel) => void;
- let render: (ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload) => void;
- let renderComponents: (
- ecIns: ECharts, ecModel: GlobalModel, api: ExtensionAPI, payload: Payload, dirtyList?: ComponentView[]
- ) => void;
- let renderSeries: (
- ecIns: ECharts,
- ecModel: GlobalModel,
- api: ExtensionAPI,
- payload: Payload | 'remain',
- dirtyMap?: {[uid: string]: any}
- ) => void;
- let performPostUpdateFuncs: (ecModel: GlobalModel, api: ExtensionAPI) => void;
- let createExtensionAPI: (ecIns: ECharts) => ExtensionAPI;
- let enableConnect: (chart: ECharts) => void;
-
--
const echartsProto = ECharts.prototype;
echartsProto.on = createRegisterEventWithLowercaseECharts('on');
echartsProto.off = createRegisterEventWithLowercaseECharts('off');
diff --cc src/model/Model.ts
index a2f588f,e743be4..e9cf064
--- a/src/model/Model.ts
+++ b/src/model/Model.ts
@@@ -44,17 -46,30 +44,21 @@@ type Value<Opt, R> = Opt extends Dictio
class Model<Opt extends ModelOption = ModelOption> { // TODO: TYPE use unkown insteadof any?
- // [Caution]: for compat the previous "class extend"
- // publich and protected fields must be initialized on
- // prototype rather than in constructor. Otherwise the
- // subclass overrided filed will be overwritten by this
- // class. That is, they should not be initialized here.
+ // [Caution]: Becuase this class or desecendants can be used as `XXX.extend(subProto)`,
+ // the class members must not be initialized in constructor or declaration place.
+ // Otherwise there is bad case:
+ // class A {xxx = 1;}
+ // enableClassExtend(A);
+ // class B extends A {}
+ // var C = B.extend({xxx: 5});
+ // var c = new C();
+ // console.log(c.xxx); // expect 5 but always 1.
- /**
- * @readOnly
- */
parentModel: Model;
- /**
- * @readOnly
- */
- ecModel: GlobalModel;;
+ ecModel: GlobalModel;
- /**
- * @readOnly
- */
- option: Opt;
+ option: Opt; // TODO Opt should only be object.
constructor(option?: Opt, parentModel?: Model, ecModel?: GlobalModel) {
this.parentModel = parentModel;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org