edwardchalstrey1 / seshat

This is the beginning of the Seshat Project code.
0 stars 2 forks source link

Visualise variables: Language #109

Closed edwardchalstrey1 closed 2 months ago

edwardchalstrey1 commented 2 months ago
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 - [x] ~~Assign the language colour to the shape table~~ - [x] 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 - [x] 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 - [x] Make a shape's fill stripey with 2 colours if there are 2 - [x] 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" - [x] 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 - [x] 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 - [x] 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 - [x] Enable adding of languages to the legend via a dropdown? - [x] 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

edwardchalstrey1 commented 2 months ago

Example screenshot from Idea 1

Screenshot 2024-04-10 at 14 30 08