import plotly.graph_objects as go


def load_data():
    return [(1978, 18), (1985, 27.5)]


def value_table(data):
    return {
        "columns": ["Deadline", "Standard (miles per gallon)"],
        "rows": [list(row) for row in data],
    }


def make_before(data) -> go.Figure:
    x, y = zip(*data, strict=True)
    fig = go.Figure(go.Bar(x=x, y=y))
    fig.update_layout(template="simple_white", yaxis_title="Miles per gallon")
    return fig


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