mgansler / mscgen

Automatically exported from code.google.com/p/mscgen
GNU General Public License v2.0
1 stars 0 forks source link

Enhancement: annotations #24

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice if there was an ability to make a left and/or right 
aligned column to include some annotations that don't fit nicely onto the 
diagram.

For example, say I have access to timestamp information for each action, I 
might like to be able to see the timestamp of each action in a column off 
to the left of the main diagram without it cluttering up the diagram 
itself.

example syntax:

A->B [ label="hello", leftannotate="Timestamp: 10:00:01" ]

A->B [ label="hello", leftannotate="Sent: 10:00:01", 
rightannotate="Arrived: 10:01:05" ]

Original issue reported on code.google.com by dunbar....@gmail.com on 7 Aug 2009 at 11:35

GoogleCodeExporter commented 8 years ago
To date I've being using ID and IDURL to cross reference from MSCs to numbered 
lists
of annotations - more like footnotes I guess.

I see that having annotations at the sides would be nice though, especially for
timescales and the like.  I'll think about how to add this, probably after the 
0.17
release.

Original comment by Michael....@gmail.com on 9 Aug 2009 at 2:22

GoogleCodeExporter commented 8 years ago
Instead of an attribute, annotations could be an arc itself, so that attributes 
can be specified for them as in the below example syntax.

msc {

(LEFT NOTE)  [label="Sent: 10:00:01"],
(RIGHT NOTE) [label="Arrived: 10:01:05"]

}

The brackets are just for the parser to take it as command instead of entity 
name. It could be anything else.

Original comment by arunmozh...@gmail.com on 27 Sep 2010 at 9:10

GoogleCodeExporter commented 8 years ago
That's quite a nice idea.  Use of the comma an keep it on the same line as 
other arcs and such reuses existing syntax neatly.

Thanks for the suggestion.  Once some other formatting bugs are fixed, I'll 
take a look at adding this.

Original comment by Michael....@gmail.com on 2 Oct 2010 at 8:26

GoogleCodeExporter commented 8 years ago
I wasn't aware of the comma syntax actually, and now the linecolor is also 
fixed, the syntax basically already meets my needs, if a little verbosely e.g.:

msc {
"TIME @ A",A,B,"TIME @ B";
"TIME @ A" box "TIME @ A" [ label = "10:00:01" , linecolor="white" ],
A=>B [ label = "message" ],
"TIME @ B" box "TIME @ B" [ label = "10:00:04" , linecolor="white" ];
"TIME @ A" box "TIME @ A" [ label = "10:00:05" , linecolor="white" ],
A<=B [ label = "response" ],
"TIME @ B" box "TIME @ B" [ label = "10:00:07" , linecolor="white" ];
}

Original comment by dunbar....@gmail.com on 5 Oct 2010 at 2:05

GoogleCodeExporter commented 8 years ago
I've been thinking about this some more.  Your workaround with the white lines 
can be made a bit less verbose using "arclinecolour" on the entity:

msc {
arcgradient = 8;
"TIME @ A" [arclinecolour="white",linecolour="white"],A,B,"TIME @ B" 
[arclinecolour="white",linecolour="white"];
"TIME @ A" box "TIME @ A" [ label = "10:00:01" ],
A=>B [ label = "message" ],
"TIME @ B" box "TIME @ B" [ label = "10:00:04" ];
"TIME @ A" box "TIME @ A" [ label = "10:00:05" ],
A<=B [ label = "response" ],
"TIME @ B" box "TIME @ B" [ label = "10:00:07" ];
}

One problem with using boxes is that they can now wrap long lines.  The hscale 
or width attributes can be used to give more space, but I plan on adding 
specific syntax for annotations to sort this out.

Original comment by Michael....@gmail.com on 5 Mar 2011 at 3:57