sverweij / mscgen_js

text => sequence charts
https://mscgen.js.org
GNU General Public License v3.0
206 stars 25 forks source link

Feature Request: additional attribute 'textsize' #254

Closed efgruber closed 5 years ago

efgruber commented 6 years ago

similar to 'textcolor' it would be perfect if I could control the size of a displayed text (e.g. note, label, ...) suggestion: attribute 'textsize' possible values: (one of) 'smaller', 'small', 'large', 'larger', 'normal'

possible alternative: like http://msc-generator.sourceforge.net/help/4.0/ch06s11.html

sverweij commented 6 years ago

Hi @efgruber, thanks for the suggestion. What's the motivation to have this in mscgenjs, i.e. what do you want to express with different sized text? (I'm asking to understand).

efgruber commented 6 years ago

Hi, first and foremost: awsome tool, great work!

I'm generating sequence charts from logfiles of a distributed software system. As these files are complex and difficult to read, I'm creating a chart to have an overview which component communicates (over different protocols) with other compoments. To keep the overview clearly arranged I reduced log-lines to source, destination and main main message type. Sometimes the chart would be more useful, if I could add some additional information (e.g. message attributes like SIP from, to) - I did this already, but the chart got blown up (in meaning of size) soon. So for full information I used backlinks (from signal to the corresponding line of the logfile web-representation) but enhancing labes with additional information in a smaller font would be perfect.

sverweij commented 6 years ago

Clear. I understand the use(fulness). In its current set up supporting more than one font size in the same chart is quite hard. I'm looking to improve that (and maybe support some simple markup as well) down the road, but it will not be done in the (usually) few days it takes to introduce a new feature :-/ (item on backlog)

Two other things:

  1. I also saw (in the chart you originally posted) you include timing information in notes - SDL MSC's have the time interval concept for that (vertical arrows with a . Your chart is not the first one either. Would _time interval_s be a useful addition to mscgenjs as well ?

  2. In the mean time: what I sometimes see done in log visualisations is that message information is hidden in a 'second layer' (which of course will only be useful if your trace output is used in an interactive mode).

    • With mscgenjs (in xù mode) it's possible to add a title attribute, whose information shows up on hover only. Additional benefit is that that information is aligned left & space respecting so message contents can retain their layout (see sample below).
    • Another alternative is to use anchor links in the url attribute here's jsfiddle demoing that(for one reason or other this works in all browsers except safari :-/)
    • For something that works in all browsers, with some minimal javascript you can attain something similar see e.g. this jsfiddle
xu {
  a, poetryserver;

  a => poetryserver [
    label="send me a sonnet()"
  ];
  poetryserver >> a [
  label="here's sonnet XIV", 
  title="Not from the stars do I my judgement pluck;
And yet methinks I have Astronomy,
But not to tell of good or evil luck,
Of plagues, of dearths, or seasons' quality;
Nor can I fortune to brief minutes tell,
Pointing to each his thunder, rain and wind,
Or say with princes if it shall go well
By oft predict that I in heaven find:
But from thine eyes my knowledge I derive,
And, constant stars, in them I read such art
As truth and beauty shall together thrive,
If from thyself, to store thou wouldst convert;

   Or else of thee this I prognosticate:
   Thy end is truth's and beauty's doom and date."
   ];
}
screen shot 2018-06-22 at 15 55 00
efgruber commented 6 years ago

Thank you for your detailed answer, you pointed out a very usefull feature I wasn't aware of:

title is a very smart solution for my needs, as the charts are embedded in a website already. Still, smaller fonts would be a nice feature - but hover text does it for me.

Concerning the time interval: especially thinking on 'handwritten' sequence charts that sounds like a very useful feature, as mine a generated I satisfied as is. What I wouldn't recommend: adjusting the vertical spacing based on the time value, in my particular case the chart would get unreadable, as I have timeouts from 20 milliseconds up to 8 seconds and more. You should also have in mind, if timegaps are computed between signals from/to/ one entity or between every signal in the chart, regardless of their source and destination.

Again - thank you for your help, you did a great job!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.