Fix: allow string keys in size legend

`__main__` test in components/legend.py doesn't crash anymore