@@ -276,8 +276,10 @@ function nodeModel(d, n, i) {
276
276
var tc = tinycolor ( n . color ) ;
277
277
var zoneThicknessPad = c . nodePadAcross ;
278
278
var zoneLengthPad = d . nodePad / 2 ;
279
- var visibleThickness = n . x1 - n . x0 ;
280
- var visibleLength = Math . max ( 0.5 , ( n . y1 - n . y0 ) ) ;
279
+ n . dx = n . x1 - n . x0 ;
280
+ n . dy = n . y1 - n . y0 ;
281
+ var visibleThickness = n . dx ;
282
+ var visibleLength = Math . max ( 0.5 , n . dy ) ;
281
283
282
284
var basicKey = n . label ;
283
285
var key = basicKey + '__' + i ;
@@ -286,10 +288,6 @@ function nodeModel(d, n, i) {
286
288
n . trace = d . trace ;
287
289
n . curveNumber = d . trace . index ;
288
290
289
- // additionnal coordinates
290
- n . dx = n . x1 - n . x0 ;
291
- n . dy = n . y1 - n . y0 ;
292
-
293
291
return {
294
292
index : n . pointNumber ,
295
293
key : key ,
@@ -370,7 +368,7 @@ function textFlip(d) {return d.horizontal ? 'scale(1 1)' : 'scale(-1 1)';}
370
368
function nodeTextColor ( d ) { return d . darkBackground && ! d . horizontal ? 'rgb(255,255,255)' : 'rgb(0,0,0)' ; }
371
369
function nodeTextOffset ( d ) { return d . horizontal && d . left ? '100%' : '0%' ; }
372
370
373
- // // event handling
371
+ // event handling
374
372
375
373
function attachPointerEvents ( selection , sankey , eventSet ) {
376
374
selection
@@ -447,9 +445,7 @@ function attachDragHandler(sankeyNode, sankeyLink, callbacks) {
447
445
if ( d . arrangement === 'freeform' ) {
448
446
d . node . x0 = x - d . visibleWidth / 2 ;
449
447
d . node . x1 = x + d . visibleWidth / 2 ;
450
- // d.x0 = x;
451
448
}
452
- // d.node.y = Math.max(d.node.dy / 2, Math.min(d.size - d.node.dy / 2, y));
453
449
d . node . y0 = Math . max ( 0 , Math . min ( d . size - d . visibleHeight , y ) ) ;
454
450
d . node . y1 = d . node . y0 + d . visibleHeight ;
455
451
}
0 commit comments