def add_line(x1, y1, x2=None, y2=None, color='white', width=2, dash='solid', t='line', xref='paper',
             yref='paper'):
    """
    Add a line shape. Please check `plotly.graph_objects.Layout.add_shape` documentation for more details on the inputs.
    :param x1: starting `x` coordinate
    :param y1: starting `y` coordinate
    :param x2: last `x` coordinate
    :param y2:  last `y` coordinate
    :param color: the color of the line
    :param width: the width of the line
    :param dash: whether the line is 'solid', 'dashed' etc.
    :param t: the type of the shape, if you change it from line it can become another shaper.
    :param xref:  reference to 'paper'/canvas or 'plot'/axis coordinates, more details in `plotly` documentation
    :param yref: reference to 'paper'/canvas or 'plot'/axis coordinates, more details in `plotly` documentation
    :return:
    """
    res = {
        'type': t,
        'y0': y1,
        'x0': x1,
        'y1': y2 or y1,
        'x1': x2 or x1,
        'line': {
            'color': color,
            'width': width,
            'dash': dash,
        },
        'xref': xref,
        'yref': yref
    }
    return res