Author Topic: Legend Elements and Layout diagram button  (Read 5037 times)

BobM

  • EA User
  • **
  • Posts: 143
  • Karma: +9/-0
    • View Profile
Legend Elements and Layout diagram button
« on: February 15, 2023, 07:58:04 pm »
Hi,

I'm going to feature request to always place elements of the Legend type in a corner outside other elements.
The reason being it is obnoxious how poor it behaves with a lot of diagram types if not all.

My question: Is there any reason why a diagram should have multiple legends?

In the above case I will have to be more precise with my wording when submitting the feature request. (probably going to be the current most sizable legend element going into the corner and the smaller one either left or right from it depending on which corner the legend was placed) -> reasoning being that a legend could potentially expand.

ea0522

  • EA User
  • **
  • Posts: 134
  • Karma: +5/-0
    • View Profile
Re: Legend Elements and Layout diagram button
« Reply #1 on: February 15, 2023, 08:41:19 pm »
As only one legend could be active at any time, you could probably hide the legends not in use at that moment?
It should only provide a mechanism to be able to select a non-active (hidden) legend.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13240
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Legend Elements and Layout diagram button
« Reply #2 on: February 15, 2023, 08:44:42 pm »
Yes, you can actually have multiple legends active at the same time.

I have a client that uses up to three legends:

- One that sets the fill color
- One that sets the line color
- One that sets the line thickness

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1077
  • Karma: +28/-8
    • View Profile
Re: Legend Elements and Layout diagram button
« Reply #3 on: February 15, 2023, 08:56:55 pm »
You can have diagrams with multiple legends but there are limitations if you try to apply multiple legends to elements or connectors. If you try to apply 2 different legends to elements/connectors (base elements/connectors): you are constrained to Geert example. In other words, I can use a legend to change the fill colour of classes and another.

What I would like to have is the option to use a legend for classes, another for components, another for ports, and so on. Sparx does not handle this very gracefully, last time we tried we had to be very careful with collisions.

BobM

  • EA User
  • **
  • Posts: 143
  • Karma: +9/-0
    • View Profile
Re: Legend Elements and Layout diagram button
« Reply #4 on: February 15, 2023, 09:22:58 pm »
Thank you for the feedback,

I will ponder upon it for another 24 hours before suggesting anything but it looks like Sparx needs to revisit the whole legend feature.

Basically it comes down with one legend is sufficient but a legend should be created out of building blocks:

In Geert his example:

Diagram type legend:
all element - fill color
+all connectors - line color
+all connectors - line thickness

In Modesto his example:
- specific element - border color
+ specific element - border color
+ specific element - border color

Currently it only separates the Element and Connector tab, so I think this could be resolved with not a lot of Legacy issues, it would require a selection to display which type of element it refers to

IF they fix that the placement when hitting the layout diagram button should be easier to resolve as well.

I hope above statement makes sense that this would simplify the usage of legends (only maintaining one for each diagram type)?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13240
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Legend Elements and Layout diagram button
« Reply #5 on: February 15, 2023, 09:51:26 pm »
Not exactly. My example was in fact all for elements.

- element - fillcolor
- element - border color
- element - border width

Relations don't have fillcolor, but only border(line) color and width

Geert

BobM

  • EA User
  • **
  • Posts: 143
  • Karma: +9/-0
    • View Profile
Re: Legend Elements and Layout diagram button
« Reply #6 on: February 15, 2023, 10:10:53 pm »
Sorry for misinterpreting, but the proposed solution should cover it

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1077
  • Karma: +28/-8
    • View Profile
Re: Legend Elements and Layout diagram button
« Reply #7 on: February 15, 2023, 11:16:54 pm »
My specific example is
- Element - applies to all, set fill colour based on Element.Phase
- Element - applies to all, set line thickness colour based on Element.Alias (we use this for ports)
- Connector - applies to all, set line colour

As long as you use different filters applied to different element types, IIRC you can use multiple legends for different elements.

However, Sparx does not handle very gracefully examples like:
- Element - applies to Class, set fill colour based on Element.Phase (or a tag value)
- Element - applies to Component, set a different fill colour based on Element.Phase (or a tag value)

In this example, one fill colour will collide and override the other.


In my opinion, this limitation is unfortunate.