import plotly.graph_objects as go


def load_data():
    return [(year, 100 * 1.12 ** (year - 2010)) for year in range(2010, 2020)]


def value_table(data):
    return {"columns": ["Year", "Illustrative index"], "rows": [list(row) for row in data]}


def make_before(data) -> go.Figure:
    years, values = zip(*data, strict=True)
    fig = go.Figure(go.Scatter(x=years, y=values, mode="lines+markers"))
    fig.update_layout(
        template="simple_white", width=1100, height=200, yaxis_range=[0, 1000], yaxis_title="Index"
    )
    return fig


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