@@ -13,21 +13,6 @@ export class Complex extends Interactor {
1313 this . upperGroup = document . createElementNS ( svgns , "g" ) ;
1414 this . initLabel ( ) ;
1515 this . padding = 28 ;
16-
17- // const self = this;
18- // // its bad if you end up with these getting called
19- // Object.defineProperty(this, "width", {
20- // get: function height() {
21- // return self.naryLink.path.getBBox().width;
22- // //return 160;
23- // }
24- // });
25- // Object.defineProperty(this, "height", {
26- // get: function height() {
27- // return self.naryLink.path.getBBox().height;
28- // //return 160;
29- // }
30- // });
3116 }
3217
3318 initLink ( naryLink ) {
@@ -36,15 +21,14 @@ export class Complex extends Interactor {
3621 }
3722
3823 setLinked ( ) {
39-
4024 this . naryLink . path2 . classList . add ( "linked-complex" ) ;
4125 }
4226
4327 getPosition ( originPoint ) {
44- let mapped = this . naryLink . mapped ; //getMappedCoordinates();
28+ let mapped = this . naryLink . mapped ;
4529 if ( ! mapped ) {
4630 this . naryLink . setLinkCoordinates ( ) ;
47- mapped = this . naryLink . mapped ; //this.naryLink.orbitNodeCount(this.naryLink.getMappedCoordinates());
31+ mapped = this . naryLink . mapped ;
4832 }
4933 const mc = mapped . length ;
5034 let xSum = 0 ,
@@ -55,8 +39,6 @@ export class Complex extends Interactor {
5539 }
5640 let center = [ xSum / mc , ySum / mc ] ;
5741 if ( originPoint ) {
58- // if (participant.type === "complex"){
59- // startPoint = participant.getPosition();
6042 let naryPath = this . naryLink . hull ;
6143 let iPath = [ ] ;
6244 for ( let p of naryPath ) {
@@ -100,15 +82,15 @@ export class Complex extends Interactor {
10082 const args = cmd . slice ( 1 ) . trim ( ) . split ( / [ \s , ] + / ) . map ( Number ) ;
10183
10284 switch ( type ) {
103- case 'M' :
104- case 'L' :
85+ case "M" :
86+ case "L" :
10587 for ( let i = 0 ; i < args . length ; i += 2 ) {
10688 const [ x , y ] = [ args [ i ] , args [ i + 1 ] ] ;
10789 updateHighest ( x , y ) ;
10890 currentPoint = [ x , y ] ;
10991 }
11092 break ;
111- case 'C' :
93+ case "C" :
11294 for ( let i = 0 ; i < args . length ; i += 6 ) {
11395 const [ x1 , y1 , x2 , y2 , x , y ] = args . slice ( i , i + 6 ) ;
11496 updateHighest ( x1 , y1 ) ;
@@ -117,21 +99,21 @@ export class Complex extends Interactor {
11799 currentPoint = [ x , y ] ;
118100 }
119101 break ;
120- case 'Q' :
102+ case "Q" :
121103 for ( let i = 0 ; i < args . length ; i += 4 ) {
122104 const [ x1 , y1 , x , y ] = args . slice ( i , i + 4 ) ;
123105 updateHighest ( x1 , y1 ) ;
124106 updateHighest ( x , y ) ;
125107 currentPoint = [ x , y ] ;
126108 }
127109 break ;
128- case 'H' :
110+ case "H" :
129111 for ( const x of args ) {
130112 updateHighest ( x , currentPoint [ 1 ] ) ;
131113 currentPoint [ 0 ] = x ;
132114 }
133115 break ;
134- case 'V' :
116+ case "V" :
135117 for ( const y of args ) {
136118 updateHighest ( currentPoint [ 0 ] , y ) ;
137119 currentPoint [ 1 ] = y ;
@@ -154,4 +136,9 @@ export class Complex extends Interactor {
154136 getResidueCoordinates ( ) {
155137 return this . getPosition ( ) ;
156138 }
139+
140+ setAllLinkCoordinates ( ) {
141+ this . setLabelPosition ( ) ;
142+ super . setAllLinkCoordinates ( ) ;
143+ }
157144}
0 commit comments