Grid3DModel.js
3.6 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import * as echarts from 'echarts/lib/echarts';
import componentViewControlMixin from '../common/componentViewControlMixin';
import componentPostEffectMixin from '../common/componentPostEffectMixin';
import componentLightMixin from '../common/componentLightMixin';
var Grid3DModel = echarts.ComponentModel.extend({
type: 'grid3D',
dependencies: ['xAxis3D', 'yAxis3D', 'zAxis3D'],
defaultOption: {
show: true,
zlevel: -10,
// Layout used for viewport
left: 0,
top: 0,
width: '100%',
height: '100%',
environment: 'auto',
// Dimension of grid3D
boxWidth: 100,
boxHeight: 100,
boxDepth: 100,
// Common axis options.
axisPointer: {
show: true,
lineStyle: {
color: 'rgba(0, 0, 0, 0.8)',
width: 1
},
label: {
show: true,
// (dimValue: number, value: Array) => string
formatter: null,
// TODO, Consider boxWidth
margin: 8,
// backgroundColor: '#ffbd67',
// borderColor: '#000',
// borderWidth: 0,
textStyle: {
fontSize: 14,
color: '#fff',
backgroundColor: 'rgba(0,0,0,0.5)',
padding: 3,
borderRadius: 3
}
}
},
axisLine: {
show: true,
lineStyle: {
color: '#333',
width: 2,
type: 'solid'
}
},
axisTick: {
show: true,
inside: false,
length: 3,
lineStyle: {
width: 1
}
},
axisLabel: {
show: true,
inside: false,
rotate: 0,
margin: 8,
textStyle: {
fontSize: 12
}
},
splitLine: {
show: true,
lineStyle: {
color: ['#ccc'],
width: 1,
type: 'solid'
}
},
splitArea: {
show: false,
areaStyle: {
color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)']
}
},
// Light options
light: {
main: {
// Alpha angle for top-down rotation
// Positive to rotate to top.
alpha: 30,
// beta angle for left-right rotation
// Positive to rotate to right.
beta: 40
},
ambient: {
intensity: 0.4
}
},
viewControl: {
// Small damping for precise control.
// damping: 0.1,
// Alpha angle for top-down rotation
// Positive to rotate to top.
alpha: 20,
// beta angle for left-right rotation
// Positive to rotate to right.
beta: 40,
autoRotate: false,
// Distance to the surface of grid3D.
distance: 200,
// Min distance to the surface of grid3D
minDistance: 40,
// Max distance to the surface of grid3D
maxDistance: 400
}
}
});
echarts.util.merge(Grid3DModel.prototype, componentViewControlMixin);
echarts.util.merge(Grid3DModel.prototype, componentPostEffectMixin);
echarts.util.merge(Grid3DModel.prototype, componentLightMixin);
export default Grid3DModel;