Altair Charts: sorting on the axis

Hello -

First, I continue to love streamlit for my data app; and I especially appreciate the .tabs functionality–which was a big reason for me to upgrade from version 1.4.

However, upgrading to version 1.12 stopped the functionality of axis-sorting for my Altair charts. After some debugging, I found that my sorting of “layered charts” no longer worked starting with version 1.10 (i.e. it worked in Streamlit version 1.9). To be clear, sorting still works for Altair non-layered charts.

I have not looked at the streamlit repo codebase changes between v1.9 and v1.10, but this documentation (st,altair_chart documentation) suggests Streamlit is using the “vegalite v2” version of Altair and this issue on Altair github repo (Issue 643) suggests vegalite v2 does not support layered chart axis-sorting.

So I’m wondering if Streamlit downgraded to vegalite v2 from vegalite v3 starting at Streamlit v1.10? If so, can this be altered? If not, is there something else at issue?

I’d really appreciate the sorting functionality back and I’ve isolated the issue to a change with Streamlit v1.10.

Thanks, Ryan

Upon more research, I was able to use the advice in this Altair discussion (Issue 1963) to modify my code as necessary. So this concern is no longer urgent for me, however I would like to understand the change that occurred in Streamlit v1.10 to affect this alteration.

1 Like