-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (36 loc) · 857 Bytes
/
index.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
const G = require('@antv/g');
const Animate = require('./src/animate/animate');
const Chart = require('./src/chart/chart');
const Global = require('./src/global');
const Scale = require('./src/scale/index');
const Shape = require('./src/geom/shape/');
const Util = require('./src/util');
const G2 = {
// version
version: Global.version,
// visual encoding
Animate,
Chart,
Global,
Scale,
Shape,
Util,
// render engine
G,
DomUtil: G.DomUtil,
MatrixUtil: G.MatrixUtil,
PathUtil: G.PathUtil
};
G2.track = function(enable) {
Global.trackable = enable;
};
require('./src/track');
// 保证两个版本共存
if (typeof window !== 'undefined') {
if (window.G2) {
console.warn(`There are multiple versions of G2. Version ${G2.version}'s reference is 'window.G2_3'`);
} else {
window.G2 = G2;
}
}
module.exports = G2;