File tree Expand file tree Collapse file tree 1 file changed +28
-22
lines changed
Expand file tree Collapse file tree 1 file changed +28
-22
lines changed Original file line number Diff line number Diff line change 11window . dashCytoscapeFunctions = { } ;
22
3- window . dashCytoscapeFunctions . add_2_nodes = function ( event ) {
4- var pos = event . position || event . cyPosition ;
5- cy . add ( {
6- data : {
7- group : 'nodes' ,
8- id : Date . now ( ) ,
3+ window . dashCytoscapeFunctions = Object . assign (
4+ { } ,
5+ window . dashCytoscapeFunctions ,
6+ {
7+ add_2_nodes : function ( event ) {
8+ var pos = event . position || event . cyPosition ;
9+ cy . add ( {
10+ data : {
11+ group : 'nodes' ,
12+ id : Date . now ( ) ,
13+ } ,
14+ position : {
15+ x : pos . x ,
16+ y : pos . y ,
17+ } ,
18+ } ) ;
19+ cy . add ( {
20+ data : {
21+ group : 'nodes' ,
22+ id : `${ Date . now ( ) } _2` ,
23+ } ,
24+ position : {
25+ x : pos . x + 50 ,
26+ y : pos . y + 50 ,
27+ } ,
28+ } ) ;
929 } ,
10- position : {
11- x : pos . x ,
12- y : pos . y ,
13- } ,
14- } ) ;
15- cy . add ( {
16- data : {
17- group : 'nodes' ,
18- id : `${ Date . now ( ) } _2` ,
19- } ,
20- position : {
21- x : pos . x + 50 ,
22- y : pos . y + 50 ,
23- } ,
24- } ) ;
25- } ;
30+ }
31+ ) ;
You can’t perform that action at this time.
0 commit comments