AlloyTools / org.alloytools.alloy

Alloy is a language for describing structures and a tool for exploring them. It has been used in a wide range of applications from finding holes in security mechanisms to designing telephone switching networks. This repository contains the code for the tool.
Other
694 stars 123 forks source link

Use a different color for every sig from scratch when opening Viz (a.k.a poor man's magic layout) #229

Closed grayswandyr closed 3 months ago

grayswandyr commented 5 months ago

When opening the Visualizer, every sig has the same shape and color by default. It would be more readable if every sig was assigned a distinct color from scratch. Doing this only would make diagrams much more readable while not changing their layout (contrary to changing shapes or even Magic Layout, which could remain up to the user). An option could exist to keep the old full-yellow behavior if people think it's necessary.

grayswandyr commented 5 months ago

Private communication: @dnjackson suggests to make this an option of Magic Layout. He fears cases where one would want to undo the theming, in which case it would be a real pain.

nmacedo commented 3 months ago

The way things work for edges is that there is a color named "magic" that assigns different colors to edges sequentially. I can also add that "magic" color to nodes. If you go to sig "univ" and set its color to "magic", all other sigs will have different colors (since they will inherit "magic" by default).

nmacedo commented 3 months ago

It would be something like this, if you select "magic" at the top:

Screenshot 2024-03-26 at 17 57 29

But then you can still customize individual sigs:

Screenshot 2024-03-26 at 17 59 28

And if you get tired of "magic", you can just change the default back to other color:

Screenshot 2024-03-26 at 18 00 13

This is exactly how edge color already works.

grayswandyr commented 3 months ago

That's great! Following up on @dnjackson's comment, please just ensure that the default color remains yellow. And as for relations, the color should remain the same from state to state.