@@ -5,34 +5,6 @@ import * as d3 from 'd3';
5
5
var root = { } ;
6
6
let duration = 750 ;
7
7
8
- // var test={
9
- // name: 'root',
10
- // state: {
11
- // "kids": 0,
12
- // "kids1": 0,
13
- // "kids2": 0,
14
- // "kids3": 0,
15
- // "kids4": 0,
16
- // "kids5": {
17
- // subkid: 3,
18
- // subkid3: 5,
19
- // sukid5:{
20
- // kid:1,
21
- // kid:3
22
- // }
23
- // },
24
- // "kids6": 0,
25
- // "kids7": 0,
26
- // "kids8": 0,
27
- // "kids9": 0,
28
- // "kids10": 0,
29
- // "kids11": 0,
30
- // "kids12": 0,
31
- // "kids13": 0,
32
- // },
33
- // children: [{name: 'hello',state:{name: "codesmith"}},{name: 'bye'}]
34
- // }
35
-
36
8
class Chart extends Component {
37
9
constructor ( props ) {
38
10
super ( props ) ;
@@ -50,20 +22,17 @@ class Chart extends Component {
50
22
}
51
23
}
52
24
53
-
54
25
removed3Tree ( ) {
55
26
const { anchor } = this . refs ;
56
27
while ( anchor . hasChildNodes ( ) ) {
57
28
anchor . removeChild ( anchor . lastChild ) ;
58
29
}
59
30
}
60
31
61
-
62
32
maked3Tree ( ) {
63
33
this . removed3Tree ( ) ;
64
34
65
35
duration = 0 ;
66
- // root = test;
67
36
68
37
var margin = { top : 20 , right : 120 , bottom : 20 , left : 120 } ,
69
38
width = 960 - margin . right - margin . left ,
@@ -90,8 +59,6 @@ class Chart extends Component {
90
59
. on ( "mouseover" , tipMouseover )
91
60
. on ( "mouseout" , tipMouseout )
92
61
93
-
94
-
95
62
root . x0 = height / 2 ;
96
63
root . y0 = 0 ;
97
64
@@ -198,29 +165,28 @@ class Chart extends Component {
198
165
update ( d ) ;
199
166
}
200
167
201
-
202
168
// Show state on mouse over
203
- function mouseover ( d ) {
169
+ function mouseover ( ) {
204
170
div . transition ( )
205
171
. duration ( 300 )
206
172
. style ( "display" , "block" )
207
173
. style ( "opacity" , 1 )
208
174
}
209
175
210
- function mouseout ( d ) {
176
+ function mouseout ( ) {
211
177
div . transition ( )
212
178
. duration ( 3000 )
213
179
. style ( "opacity" , 1e-6 )
214
180
. style ( "display" , "none" ) ;
215
181
}
216
182
217
- function tipMouseover ( d ) {
183
+ function tipMouseover ( ) {
218
184
div . transition ( )
219
185
. duration ( 300 )
220
186
. style ( "opacity" , 1 ) ;
221
187
}
222
188
223
- function tipMouseout ( d ) {
189
+ function tipMouseout ( ) {
224
190
div . transition ( )
225
191
. duration ( 3000 )
226
192
. style ( "opacity" , 1e-6 )
0 commit comments