Skip to content

Commit

Permalink
Refactor shapeColour calculation to prioritize 'to' value over 'from'…
Browse files Browse the repository at this point in the history
… value for hierarchical complexity
  • Loading branch information
edwardchalstrey1 committed Jan 8, 2025
1 parent b53baab commit f3deccb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion seshat/apps/core/templates/core/world_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,12 @@ <h2>How to use the Seshat World Map</h2>
} else if (variable == 'administrative_level') {
hierarchicalVariableMaxValue = highestAdministrativeLevel;
}
shapeColour = hierarchicalComplexityColour(hierarchicalVariableMaxValue, shape[variable][0]); // TODO: Make this an average
// Calculate the colour based highest of the from and to values
if (shape[variable][1] != 'None' && shape[variable][1] != null) { // If the to value is not None, use it since it is the highest
shapeColour = hierarchicalComplexityColour(hierarchicalVariableMaxValue, shape[variable][1]);
} else { // If the to value is None, use the from value (even if it is None)
shapeColour = hierarchicalComplexityColour(hierarchicalVariableMaxValue, shape[variable][0]);
}

} else { // Absent-present variables
shapeWeight = polityBorderWeightSelected;
Expand Down

0 comments on commit f3deccb

Please sign in to comment.