forked from apache/echarts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoordinateSystem.js
45 lines (32 loc) · 1.13 KB
/
CoordinateSystem.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
define(function(require) {
'use strict';
// var zrUtil = require('zrender/core/util');
var coordinateSystemCreators = {};
function CoordinateSystemManager() {
this._coordinateSystems = {};
this._coordinateSystemsList = [];
}
CoordinateSystemManager.prototype = {
constructor: CoordinateSystemManager,
update: function (ecModel, api) {
var coordinateSystems = {};
for (var type in coordinateSystemCreators) {
coordinateSystems[type] = coordinateSystemCreators[type].create(ecModel, api);
}
this._coordinateSystems = coordinateSystems;
},
get: function (type, idx) {
var list = this._coordinateSystems[type];
if (list) {
return list[idx || 0];
}
}
};
CoordinateSystemManager.register = function (type, coordinateSystemCreator) {
coordinateSystemCreators[type] = coordinateSystemCreator;
};
CoordinateSystemManager.get = function (type) {
return coordinateSystemCreators[type];
}
return CoordinateSystemManager;
});