Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for XML coloring in the renderer #171

Merged
merged 5 commits into from
Nov 9, 2020
Merged

Conversation

jan-ladleif
Copy link
Member

@jan-ladleif jan-ladleif commented Oct 29, 2020

Fixes #152, fixes #169

Basically the renderer now natively supports colors as defined in the diagram exchange information in the XML.
Since the standard is relatiely vague on how coloring should work, I made several decisions:

  • Since messages do not have their own display information in the XML, they are rendered according to the participant band they are attached to.
  • If a choreography activity has a custrom stroke color, all participant band dividers and markers are colored in that color as well.
  • If a participant band has no specific color, it somewhat blends in with the choreography activity it is attached to.
  • If multiple participant bands on sub-choreographies have different stroke colors, those might overlap.
  • Call activities have some not-so-nice artifacts if a participant band has a stroke.
  • ... probably a bit more, can be discussed!

Example diagram: example.txt (rename to .bpmn)
From top to bottom:

  1. Colored participant bands
  2. Colored activities
  3. Colored participant bands and activities
    image

@jan-ladleif jan-ladleif self-assigned this Oct 29, 2020
@jan-ladleif
Copy link
Member Author

@jan-ladleif
Copy link
Member Author

The color change command

modeling.setColor(event.element, {
  stroke: 'green',
  fill: 'yellow'
});

should now also work.
Again, there needs to be special code for participant bands and messages since they do not have a regular di reference.

@jan-ladleif jan-ladleif merged commit 67ce7cf into master Nov 9, 2020
@jan-ladleif jan-ladleif deleted the feat/color-api branch November 9, 2020 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color API not working Honor colors defined in DI
1 participant