Book a Demo

Author Topic: Auto Colouring Based on a Set Membership  (Read 7403 times)

Peter Kelley

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Auto Colouring Based on a Set Membership
« on: November 28, 2018, 04:57:25 pm »
I want to automatically colour elements on a diagram based on whether the element is a member of a set or an intersection of sets. For example all the elements that belong to business units A and B should be green whilst all elements that only belong to B should be yellow.

I'm trying to find a way to do this using tagged values and legends.

The CheckList tagged value type will store the data I want however I am at a loss as to how to reference this in a Legend object.

Multiple boolean tagged values, one for each category, will also encode the data (badly) however I am not sure how to represent each category combination in the legend.

Is there such a thing as a computed tagged value?

In any case can anyone see a solution to this issue?
Peter Kelley

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Auto Colouring Based on a Set Membership
« Reply #1 on: November 29, 2018, 08:49:14 am »
Is there such a thing as a computed tagged value?

If you write a script to compute it
The Sparx Team
[email protected]

Peter Kelley

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: Auto Colouring Based on a Set Membership
« Reply #2 on: November 29, 2018, 09:35:39 am »
Is there such a thing as a computed tagged value?

If you write a script to compute it

I'm pretty new to scripting. Is there a way to trigger a script on element save to compute the value?
Peter Kelley

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Auto Colouring Based on a Set Membership
« Reply #3 on: November 29, 2018, 09:42:33 am »
Yes. You need to hook to EA_OnContextItemChanged.

q.

steen.jensen

  • EA User
  • **
  • Posts: 181
  • Karma: +8/-1
    • View Profile
Re: Auto Colouring Based on a Set Membership
« Reply #4 on: November 29, 2018, 09:54:36 am »
You can use several diagram-filters there each filter rule is color the element with right Tagged value.

You can use OR & AND to filter groups to combine different filter sets

I use one set of filter for different element color based on a specific tv and another set of filter for coloring the elements border with a different tv.
That way I can use several filter sets for multi coloring that is based on my own tagged values

Peter Kelley

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: Auto Colouring Based on a Set Membership
« Reply #5 on: November 29, 2018, 03:20:27 pm »
Yes. You need to hook to EA_OnContextItemChanged.

q.

So an add in rather than a script?
Peter Kelley

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Auto Colouring Based on a Set Membership
« Reply #6 on: November 29, 2018, 03:26:55 pm »
Yes. You need to hook to EA_OnContextItemChanged.

q.

So an add in rather than a script?
Yes, unless you use the EA-Matic add-in, which will forward the event to your script.

Geert

Peter Kelley

  • EA User
  • **
  • Posts: 23
  • Karma: +0/-0
    • View Profile
Re: Auto Colouring Based on a Set Membership
« Reply #7 on: November 29, 2018, 03:59:09 pm »
You can use several diagram-filters there each filter rule is color the element with right Tagged value.

You can use OR & AND to filter groups to combine different filter sets

I use one set of filter for different element color based on a specific tv and another set of filter for coloring the elements border with a different tv.
That way I can use several filter sets for multi coloring that is based on my own tagged values

Looking at the diagram filters I only see options to fade, hide or greyscale elements that do not match the filter or to select those that do. I don't see options to color elements that match the filter. Are you able to explain a little more?
Peter Kelley

steen.jensen

  • EA User
  • **
  • Posts: 181
  • Karma: +8/-1
    • View Profile
Re: Auto Colouring Based on a Set Membership
« Reply #8 on: December 25, 2018, 10:55:36 am »
Using "Legend" you can color selected element or connectors just as diagram filter