import plotly.graph_objects as go


def load_data():
    return [("A", 53), ("B", 46), ("C", 57), ("D", 49)]


def value_table(data):
    return {"columns": ["Group", "Share (%)"], "rows": [list(row) for row in data]}


def make_before(data) -> go.Figure:
    fig = go.Figure(
        go.Table(
            header={"values": ["Group", "Share (%)"]},
            cells={"values": list(zip(*data, strict=True))},
        )
    )
    fig.update_layout(template="simple_white", height=290)
    return fig


if __name__ == "__main__":
    print(make_before(load_data()).to_json())
