Changeset - 5edc670d4252
[Not reviewed]
default
0 1 0
Branko Majic (branko) - 12 years ago 2013-11-09 13:49:13
branko@majic.rs
CONNT-17: Order the entities of a project by primary key in order to have consistent assignment of node colours as in case of tabular listing.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
conntrackt/utils.py
Show inline comments
 
@@ -155,8 +155,8 @@ def generate_project_diagram(project):
 
    # Get distinct colours, one for each node/entity.
 
    colors = get_distinct_colors(entities.count())
 

	
 
    # Created nodes based on entities, and put them into correct cluster.
 
    for entity in entities:
 
    # Create nodes based on entities, and put them into correct cluster.
 
    for entity in entities.order_by("pk"):
 

	
 
        # Try to get the existing cluster based on location name.
 
        location = entity.location
 
@@ -169,7 +169,7 @@ def generate_project_diagram(project):
 
            clusters[cluster_name] = cluster
 

	
 
        # Fetch a colour that will be associated with the node/entity.
 
        node_color = colors.pop()
 
        node_color = colors.pop(0)
 
        node_colors[entity.id] = node_color.hex
 

	
 
        # Determine whether the node label should be black or white based on brightness of node colour.
0 comments (0 inline, 0 general)