Skip to content

Commit e888265

Browse files
committed
fix source.x -> source.vx.
1 parent 0812ab2 commit e888265

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/js/graph.js

+16-14
Original file line numberDiff line numberDiff line change
@@ -587,31 +587,33 @@ window.Widgets.Graph = {};
587587
// );
588588

589589
options.promotable_sim.on('tick', function() {
590+
// console.log(['promotable_sim ticked',this, options.promo_svg
591+
// .selectAll('.plinks')]);
590592
options.promo_svg
591593
.selectAll('.plinks')
592-
.attr('x1', (d) => d.source.x)
593-
.attr('y1', (d) => d.source.y)
594-
.attr('x2', (d) => d.target.x)
595-
.attr('y2', (d) => d.target.y);
594+
.attr('x1', (d) => d.source.vx)
595+
.attr('y1', (d) => d.source.vy)
596+
.attr('x2', (d) => d.target.vx)
597+
.attr('y2', (d) => d.target.vy);
596598

597599
options.promo_svg
598600
.selectAll('.pnodes')
599-
.attr('x', (d) => d.x - options.radius / 2)
600-
.attr('y', (d) => d.y - options.radius / 2);
601+
.attr('x', (d) => d.vx - options.radius / 2)
602+
.attr('y', (d) => d.vy - options.radius / 2);
601603

602604
options.promo_svg.selectAll('.pedgepath').attr(
603605
'd',
604606
function(d) {
605607
//console.log('pedgepath->', d);
606608
return (
607609
'M ' +
608-
d.source.x +
610+
d.source.vx +
609611
' ' +
610-
d.source.y +
612+
d.source.vy +
611613
' L ' +
612-
d.target.x +
614+
d.target.vx +
613615
' ' +
614-
d.target.y
616+
d.target.vy
615617
);
616618
},
617619
// (d) =>
@@ -648,13 +650,13 @@ window.Widgets.Graph = {};
648650
console.log('sedgepath->', d);
649651
return (
650652
'M ' +
651-
d.source.x +
653+
d.source.vx +
652654
' ' +
653-
d.source.y +
655+
d.source.vy +
654656
' L ' +
655-
d.target.x +
657+
d.target.vx +
656658
' ' +
657-
d.target.y
659+
d.target.vy
658660
);
659661
},
660662
// (d) =>

0 commit comments

Comments
 (0)