import plotly.express as px


import plotly.graph_objects as go


def load_data():
    iris = px.data.iris()
    return list(zip(iris["petal_length"], iris["petal_width"], strict=True))


def value_table(data):
    return {
        "columns": ["Petal length (cm)", "Petal width (cm)"],
        "rows": [list(row) for row in data],
    }


def make_after(data) -> go.Figure:
    lengths, widths = zip(*data, strict=True)
    fig = px.scatter(
        x=lengths,
        y=widths,
        marginal_x="rug",
        marginal_y="rug",
        template="simple_white",
        labels={"x": "Petal length (cm)", "y": "Petal width (cm)"},
    )
    fig.update_layout(
        font={"family": "Inter, system-ui, -apple-system, sans-serif", "color": "#1f2937"},
        colorway=["#3b82c4", "#d97706", "#14967f", "#8b5cf6", "#dc4c3e", "#78716c"],
    )
    return fig


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