File size: 923 Bytes
fd4a87f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import streamlit as st

def render(tab, sim_bill_counts, sim_state_counts, model_bills, sec_counts):
    countbar_col1, countbar_col2 = tab.columns([1, 2])
    countbar_col1.subheader('Number of bills similar to each model')
    countbar_col1.bar_chart(
        data=sim_bill_counts,
        horizontal=True,
        x='model',
        y='count'
    )
    
    countbar_col2.subheader('Number of states these bills come from')
    countbar_col2.bar_chart(
        data=sim_state_counts,
        x='state',
        y='count',
        color='model',
        stack=False
    )
    
    for model, col_modsec in zip(
        model_bills, tab.columns([1] * len(model_bills))
    ):
        col_modsec.subheader(f'Sections of {model}')
        col_modsec.bar_chart(
            data=sec_counts.query('model == @model').reset_index(drop=True),
            horizontal=True,
            x='section',
            y='count'
        )