CityofToronto / bdit_plotting_gallery

A gallery of static Python plots that the Big Data Innovation Team has produced
GNU General Public License v3.0
1 stars 0 forks source link

RICK line chart + colour improvements #28

Open scann0n opened 4 weeks ago

scann0n commented 4 weeks ago

@scann0n tried to make a multi line graph with 5 lines and it threw this error:

File /opt/jupyterhub/lib64/python3.9/site-packages/rick/rick.py:64, in colour.get_colour_from_index(self, index)
     63 def get_colour_from_index(self, index):
---> 64     return self.colours_map[index]

KeyError: 5

I think this is because the colours_map in line 57 of rick.py only has 4 colours listed, which are:

 colours_map = {
        1: purple_1,
        2: purple_2,
        3: purple_3,
        4: light_grey
    }
    def get_colour_from_index(self, index):
        return self.colours_map[index]

Separate but related issue - having the charts show up in various shades of purple makes them hard to read :meow_sad-rain:. It would be great if the colours_map was something like 1: purple_1, 2: light_grey, 3: orange, 4: blue, 5: purple_4, 6: green ... etc I mean why not list all of the eight colours so that we never get this error again?

chmnata commented 5 days ago

@leo-oxu Do you mind reordering the colours by swapping the order of orange and grey? We should do purple -> grey -> orange. Thanks!! Sorry for flip flopping on the orders