Skip to content

Commit

Permalink
Merge pull request #215 from Seshat-Global-History-Databank/consisten…
Browse files Browse the repository at this point in the history
…t-variable-colors

Consistent variable colors
  • Loading branch information
edwardchalstrey1 authored Jan 7, 2025
2 parents 369b549 + da9b425 commit 957e0cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
7 changes: 0 additions & 7 deletions seshat/apps/core/static/core/js/map_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ function updateLegend() {
colorBox.style.marginRight = '10px';
legendItem.appendChild(colorBox);

if (key === 'Unknown') {
colorBox.style.border = '1px solid black';
}
if (key === 'Unknown') {
legendItem.appendChild(document.createTextNode('Coded unknown'));
} else {
Expand Down Expand Up @@ -461,10 +458,6 @@ function updateLegend() {
colorBox.style.marginRight = '10px';
legendItem.appendChild(colorBox);

if (key === 'unknown') {
colorBox.style.border = '1px solid black';
}

legendItem.appendChild(document.createTextNode(longAbsentPresentVarName(key)));

legendDiv.appendChild(legendItem);
Expand Down
24 changes: 12 additions & 12 deletions seshat/apps/core/templates/core/world_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -796,22 +796,22 @@ <h2>How to use the Seshat World Map</h2>
// Note: uncoded and no seshat page are both now set to the same colour
// Note: if you modify this, you should check that updateLegend() is consistent (found in map_functions.js)
let variableColourMapping = {
'present': 'green',
'absent': 'red',
'present': '#82c1c1',
'absent': '#ff9c9c',
'P~A': 'orange',
'A~P': 'blue',
'unknown': 'yellow',
'uncoded': 'grey',
'no seshat page': 'grey'
'A~P': '#ffc68c',
'unknown': 'slategray',
'uncoded': 'silver',
'no seshat page': 'silver'
};

let oneLanguageColourMapping = {
'Present exclusively': 'green',
'Present': '#13d446',
'Absent': 'red',
'Unknown': 'yellow',
'Uncoded': 'grey',
'No Seshat page': 'grey'
'Present exclusively': 'blue',
'Present': '#82c1c1',
'Absent': '#ff9c9c',
'Unknown': 'slategray',
'Uncoded': 'silver',
'No Seshat page': 'silver'
};

function switchBaseMapWorldMap() {
Expand Down

0 comments on commit 957e0cd

Please sign in to comment.