File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -76,9 +76,9 @@ export default Ember.Component.extend({
76
76
return a . parent == b . parent ? 4 : 8 ;
77
77
} )
78
78
. nodeSize ( [ 6 , 180 ] ) ;
79
- graph ( root ) ;
80
79
81
80
function update ( source ) {
81
+ graph ( root ) ;
82
82
let nodes = root . descendants ( ) ;
83
83
let links = root . links ( ) ;
84
84
let node = g
@@ -144,6 +144,12 @@ export default Ember.Component.extend({
144
144
return `self: ${ ( d . data . stats . time . self / 1000000 ) . toFixed ( 2 ) } ` ;
145
145
} ) ;
146
146
147
+ // update exiting node locations
148
+ node
149
+ . transition ( )
150
+ . duration ( DURATION )
151
+ . attr ( 'transform' , d => `translate(${ d . y } ,${ d . x } )` ) ;
152
+
147
153
// Transition exiting nodes to the parent's new position.
148
154
node
149
155
. exit ( )
@@ -169,6 +175,17 @@ export default Ember.Component.extend({
169
175
+ " " + d . source . y + "," + d . source . x ;
170
176
} ) ;
171
177
178
+ link
179
+ . transition ( )
180
+ . duration ( DURATION )
181
+ . attr ( "d" , function ( d ) {
182
+ return "M" + d . target . y + "," + d . target . x
183
+ + "C" + ( d . source . y + 50 ) + "," + d . target . x
184
+ + " " + ( d . source . y + 50 ) + "," + d . source . x
185
+ + " " + d . source . y + "," + d . source . x ;
186
+ } ) ;
187
+
188
+ // update exiting link locations
172
189
link
173
190
. exit ( )
174
191
. transition ( )
You can’t perform that action at this time.
0 commit comments