🇲🇾 pru-viz | An Election Dashboard! (ft. interactive map crossfiltering, pagination, multipage)

:malaysia: pru-viz | A Malaysian Election Dashboard

Open in Streamlit


Took some time out of my semester break to create this neat dashboard displaying the recently concluded 15th Malaysian General Election and census data. Nice clean .csv’s were released around the time and I thought that this would be a good opportunity to learn Streamlit through a project.

Election Data

I made an interactive map using streamlit-echarts which on a click event triggers all the other charts on the page to re-render according to the constituency clicked. Results are displayed with Bootstrap cards, while the age pyramid and pie were similarly made in ECharts.

The result cards are paginated with a page size of 4 to maintain a consistent UI.

The dropdown allows user to visualize metrics other than results such as spoilt votes, voter turnout, etc.

As an extra, I included a function to turn the result map into a continuous area cartogram, adjusting each constituency with respect to its population size.

Census Data

This section is inspired by KAWASANKU, an official dashboard by the Department of Statistics Malaysia. It utilizes pie charts from Plotly Express and bar charts from Altair. The metric cards are from streamlit-extras. Cross filtering is applied from the cascading select boxes to the metric cards & pie charts.

Thanks for reading! Any sources missed here are most likely mentioned on the site.