Visualise variables: Language
Closed this issue · 1 comments
edwardchalstrey1 commented
Idea 1) One colours per language
See the language
branch where I have implemented both the "one language" view and also the "all languages" view, which has a colour per language. The problem with this is that to do the same thing for language genus and language family, and also for other categorical variables, we'd need to assign a set of colours for each of these, which is way too slow to do on the fly, but the adding the colours to the database approach, whilst it works, would be annoying to have to do for every single categorical variable. Choosing a colour pattern for 3+ colours isn't intuitive, see the workaround below where one colour is striped with grey
-
Assign the language colour to the shape table - Refactor so that the language table has an added colour field instead of the shape table and that this gets updated by the
populate_videodata
command - Refactor
assign_categorical_variables_to_shapes
to add in the languages and language colours as lists to shapes - Implement a way to visualise shapes that have multiple languages
- Make a shape's fill stripey with 2 colours if there are 2
- For shapes with 3+ languages, make fill stripey with one of the languages, ideally the one already selecyed, and black - on the legend, black says "3+ languages"
- Adding a language to the legend should add all polities that have that language, including stripey/mixed
- It should not add other languages from mixed polities to the legend, because that quickly gets out of hand
- Clicking a polity with one language should add that to the legend
- Clicking a polity with 2 languages should not add both colours, but add both to the legend, so the two boxes are the two striped colours
- Clicking a polity with 3+ should do the same ^ but with grey as the second colour, and list all the languages
- Uncoded should be black and yellow
- Make it like polities where you have to click to populate the legend, but highlighting does it for all polities of that language
- Add a count of polities next to the language on the legend
- Enable adding of languages to the legend via a dropdown?
- Make selected languages remain on legend until removed
- Suppress the choose language dropdown for the multi-language view
Idea 2) Use roughly the same present/absent legend scheme and a dropdown to select language
- Create alternative view where you just select a language with the dropdown and get the same colours as present/absent:
- Green "Present exclusively" for polities that include that language exlusively
- Light Green "Present non-exclusively" for polities that have the language and others
- Purple "Other languages" for polities that lack that language, but have others
- Black/Yellow "Uncoded"
- Grey "Unknown"
- Make sure calling the languageview dropdown changes stuff
- Add language_genus and linguistic family to the dropdown and they should work in the same way as language
- Add all of language language genus and linguistic family to tooltip, regardless of which 3 selected
Can we use other means, e.g. searching some db or language model to get languages for missing polities
avoid lag, however if it slows the page loading it probably isn't worth itWould it look good to stripe the polity colour and language present/absent colour (I guess for other vars too)- Make sure clicking doesn't change weight on other variables
- Change 'Other languages' to 'Absent'
- Make a new branch that removes Idea 1, so we don't generate language colours anymore
- Remove all use of patterns on new branch
- Too slow, makes playing the animation crash everything
- Generating the patterns once when the page is loaded would help, rather than every time
plotPolities
is called, but I think this creates more problems that it solves
- Make the thickness for shapes on language 2 since we aren't using patterns anymore
- Set Uncoded to be yellow with black borders (or just black as previously), for other vars too
- Add white for basemap to legend
edwardchalstrey1 commented