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

added attributes to grammar

Open winfinit opened this issue 11 years ago • 10 comments

This feature will permit one to use attributes that raphael.js provides, which will allow us to modify how text looks and behaves.

extended syntax can look like this:

    Title: Sample Diagram[fontcolor="white", fillcolor="blue", color="red"]
    Participant Alice as A [color="red"]
    Participant Bob [fillcolor="blue", fontcolor="white"]
    A->Bob: Message [color="gray"]
    Note left of A: Hello color\nNotes [URL="http://example.com", fillcolor="orange"]
    Note right of Bob: Click Me\nI will take you\nto example.com [URL="http://example.com"]
    Note over A, Bob: Gradient colors [fillcolor="90-#f00:5-#00f:95"]

Sample generated UML diagram

winfinit avatar Aug 12 '14 17:08 winfinit

looking at this further, maybe it makes sense to sync attribute names more to graphviz attribute names instead of raphael.js, that way we can address issue #31 also (i.e. connector color, actor color, etc ...)?

graphviz aattributes (http://www.graphviz.org/doc/info/attrs.html)

winfinit avatar Aug 19 '14 22:08 winfinit

i've committed new changes that will permit one to control colors of actors, actor strokes, signal colors, note, and font color via attribute names from graphviz

winfinit avatar Aug 26 '14 22:08 winfinit

:+1:

ComFreek avatar Aug 27 '14 14:08 ComFreek

This looks fantastic! Any chance for a merge?

riaan53 avatar Jun 12 '15 13:06 riaan53

@bramp are you going to merge this neat PR? @winfinit thanks for that.

Restuta avatar Aug 05 '15 18:08 Restuta

This is cool, but I avoided merging as it introduces a new syntax that I'm unsure about supporting in the future. For example, we currently use Raphael that generates VML in IE, and SVG elsewhere. I'd rather change to something like svg.io dropping old IE support. Then we can use the styling native to SVG.

bramp avatar Aug 05 '15 19:08 bramp

I'm very interested in this sort of functionality.

Might I observe that MS have dropped support for IE7, IE8 and IE10 (On all platforms) and IE9 (on anything other than Vista or Server 2008) as of today. Perhaps this helps pave the way for "Dropping old IE support"

RoryBecker avatar Jan 12 '16 16:01 RoryBecker

Hi there,

I would love to see this coming up in a future release. If you plan on dropping vml support, you could start by preventing your lib to work if launched in IE lte 9. It would allow this feature to be integrated while you get to replace the rendering engine.

Thanks in advance !

CaptainQuirk avatar Dec 23 '16 00:12 CaptainQuirk

If no merge possible to see this coming up in a future release, I assume the only solution is through css attribut like onclick event..

Chetabahana avatar May 06 '18 11:05 Chetabahana

hi, I did the same thing as you did, but the effect didn't appear. Sequence_diagrams didn't support it.Can you list the complete code? my code:

zou79189747 avatar Jun 11 '18 08:06 zou79189747