@@ -212,32 +212,32 @@ function restart () {
212
212
. style ( "stroke" , function ( d ) { return d3 . rgb ( colors ( d . id ) ) . darker ( ) . toString ( ) ; } )
213
213
. on ( "mouseover" , function ( d ) {
214
214
if ( ! mousedown_node || d === mousedown_node ) return ;
215
-
215
+
216
216
// Enlarge target node.
217
217
d3 . select ( this ) . attr ( "transform" , "scale(1.1)" ) ;
218
218
} )
219
219
. on ( "mouseout" , function ( d ) {
220
220
if ( ! mousedown_node || d === mousedown_node ) return ;
221
-
221
+
222
222
// Unenlarge target node.
223
223
d3 . select ( this ) . attr ( "transform" , "" ) ;
224
224
} )
225
225
. on ( "mousedown" , function ( d ) {
226
226
mousedown_node = d ;
227
227
selected_link = null ;
228
-
228
+
229
229
// Toggle selection of this node.
230
230
if ( mousedown_node === selected_node ) {
231
231
selected_node = null ;
232
232
} else {
233
233
selected_node = mousedown_node ;
234
234
}
235
-
235
+
236
236
// Reposition drag line.
237
237
drag_line
238
238
. classed ( "hidden" , false )
239
239
. attr ( "d" , "M" + mousedown_node . x + "," + mousedown_node . y + "L" + mousedown_node . x + "," + mousedown_node . y ) ;
240
-
240
+
241
241
restart ( ) ;
242
242
} )
243
243
. on ( "mouseup" , function ( d ) {
@@ -249,7 +249,7 @@ function restart () {
249
249
resetMouseVars ( ) ;
250
250
return ;
251
251
}
252
-
252
+
253
253
// Unenlarge target node.
254
254
d3 . select ( this ) . attr ( "transform" , "" ) ;
255
255
@@ -263,7 +263,7 @@ function restart () {
263
263
source = mouseup_node ;
264
264
target = mousedown_node ;
265
265
}
266
-
266
+
267
267
var link ;
268
268
link = links . filter ( function ( l ) {
269
269
return ( l . source === source && l . target === target ) ;
@@ -277,7 +277,7 @@ function restart () {
277
277
links . push ( link ) ;
278
278
}
279
279
}
280
-
280
+
281
281
// Select new link.
282
282
selected_link = link ;
283
283
selected_node = null ;
@@ -317,7 +317,7 @@ function restart () {
317
317
318
318
function mousemove ( ) {
319
319
if ( ! mousedown_node ) return ;
320
-
320
+
321
321
// Update drag line.
322
322
drag_line . attr ( "d" , "M" + mousedown_node . x + "," + mousedown_node . y + "L" + d3 . mouse ( this ) [ 0 ] + "," + d3 . mouse ( this ) [ 1 ] ) ;
323
323
restart ( ) ;
0 commit comments