提交 c5a49ea4 编写于 作者: L lang

Inside message center

上级 b374c6ba
......@@ -28,6 +28,13 @@ define(function (require) {
// TODO Transform first or filter first
var PROCESSOR_STAGES = ['transform', 'filter', 'statistic'];
/**
* @module echarts~MessageCenter
*/
function MessageCenter() {
Eventful.call(this);
}
zrUtil.mixin(MessageCenter, Eventful);
/**
* @module echarts~ECharts
*/
......@@ -105,6 +112,12 @@ define(function (require) {
Eventful.call(this);
/**
* @type {module:echarts~MessageCenter}
* @private
*/
this._messageCenter = new MessageCenter();
// Init mouse events
this._initEvents();
......@@ -346,7 +359,7 @@ define(function (require) {
// Convert type to eventType
var eventObj = zrUtil.extend({}, payload);
eventObj.type = actionInfo.event || eventObj.type;
this.trigger(eventObj.type, eventObj);
this._messageCenter.trigger(eventObj.type, eventObj);
}
}
};
......@@ -553,6 +566,12 @@ define(function (require) {
}
}, this);
}, this);
zrUtil.each(eventActionMap, function (actionType, eventType) {
this._messageCenter.on(eventType, function (event) {
this.trigger(eventType, event);
}, this);
}, this);
};
/**
......@@ -674,7 +693,8 @@ define(function (require) {
// Connecting
zrUtil.each(eventActionMap, function (actionType, eventType) {
chart.on(eventType, function (event) {
// FIXME
chart._messageCenter.on(eventType, function (event) {
if (connectedGroups[chart.group]) {
chart.__connectedActionDispatching = true;
for (var id in instances) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册