js-sequence-diagrams icon indicating copy to clipboard operation
js-sequence-diagrams copied to clipboard

Can I use duplicate note name?

Open suhyunjeon opened this issue 10 years ago • 6 comments

Can I use duplicate note name? I want to connect links each note like A->B, B->C, C<-B. They recognized that unique notes. 'C', 'C<', 'B', 'B<'. It is same. They changed note names.

Title: SBC Call Flow Diagram
A->B: INVITE SDP
B->C: INVITE SDP
C<-B: 180 Ringing
C->B: 180 Ringing
B-A: 180 Ringing
B<-C: 200 OK
B->C: 200 OK
B<-C: 200 OK

Image of Yaktocat

suhyunjeon avatar May 22 '15 01:05 suhyunjeon

If I understand you correctly, I think you just need to flip your arrows.

Instead of C<-B, write B->C.

bramp avatar May 22 '15 05:05 bramp

Hello @bramp. Thank you for your reply. It is same to result. I changed source code from sequence-diagram-min.js.

    Diagram.prototype.getActor = function(alias, name) {
        alias = alias.replace("<", "");
        alias = alias.trim();

It solved problem.

suhyunjeon avatar May 22 '15 06:05 suhyunjeon

Would you show me the resulting image with your change. I would like to understand what you were trying to achieve.

Thanks

bramp avatar May 22 '15 06:05 bramp

OK.

//////////////// Before //////////////// Image of Yaktocat

//////////////// After ////////////////

Image of Yaktocat

suhyunjeon avatar May 22 '15 06:05 suhyunjeon

Hey @suhyunjeon that 2nd diagram doesn't look quite right. The 180 Ringing arrow is going in the wrong direction, acording to your text.

Either way, I think you just need to rework your text to always have arrows pointing right. For example:

192.168.12.154->192.168.13.223: INVITE SDP
192.168.13.223->192.168.13.224: INVITE SDP
192.168.13.223->192.168.13.224: 180 Ringing
192.168.13.224->192.168.13.223: 180 Ringing
192.168.12.154->192.168.13.223: 180 Ringing
192.168.12.42->192.168.13.223: 200 OK
192.168.13.223->192.168.13.224: 200 OK
192.168.13.224->192.168.13.223: 200 OK

makes: screen shot 2015-05-24 at 1 03 22 pm

which has arrows going both left and right in the image.

bramp avatar May 24 '15 20:05 bramp

I was upload wrong result pic. It it right yours. Anyway it need to modify code( sequence-diagram-min.js) what I want to do.

suhyunjeon avatar May 26 '15 00:05 suhyunjeon