from typing import OrderedDict


def make_per_dataset_plot(delta_cchalf_i):
    """Make a line plot of delta cc half per group."""

    d = OrderedDict()
    d.update(
        {
            "per_dataset_plot": {
                "data": [
                    {
                        "y": [i * 100 for i in list(delta_cchalf_i.values())],
                        "x": list(delta_cchalf_i.keys()),
                        "type": "scatter",
                        "mode": "lines",
                    }
                ],
                "layout": {
                    "title": "Delta CC-Half vs group",
                    "xaxis": {"title": "Group number"},
                    "yaxis": {"title": "Delta CC-Half"},
                },
            }
        }
    )

    return d