Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

Automatically associate edge color and value

0 votes
Suppose I have an external file with some data about a graph whose edges values are members of a small family (e.g. all edges values are either 0.25, 0.5, 0.75 or 1).

Is it possible to automatically color the edges of the imported graph according to the edges' values? Following the last example, I'd want all edges of value 1 in black, of value 0.75 in dark blue, of 0.5 in blue and 0.25 in light blue.

Is it possible to do the same but for a range of values (e.g. all edges of values between 0.75 and 1 in black)? Perhaps change the color gradually from black for edge value 1 to light blue for edge value 0.25?

 

Thanks.
in Help by
retagged by

1 Answer

0 votes
 
Best answer

Yes, that's possible with the "Properties Mapper" (in menu Edit).

In more detail, you need to add a new configuration for edges and add to it a mapping from your data to the Line Color. With the conversion type, you can specify whether the mapping should be from each single value to a single color (Distinct Values) or from value ranges (Ranges of Values). It is also possible to use one color gradient for all values in a definable range.

Since calculating a range of values is only possible for numerical values, it is important that your data is defined accordingly. You can check this with the command "Manage Custom Properties" in menu Edit. In the Edge Properties table, the Type of the data should be either Decimal or Integer. If the Type is currently Text but the values are actually numbers it is save to simply select the matching type.

The related manual page and this forum contain more information on the properties mapper and its use cases. Please let me know if you need more information.

by [yWorks] (26.8k points)
selected by
That works perfectly. Thank you!
Legal Disclosure | Privacy Policy
...