def get_element_coordinates(feeder_mapping, element_type, name):
    """Return the coordinates of the bus to which the element is attached.

    Parameters
    ----------
    feeder_mapping : dict
        dictionary created by this module at a feeder level
    element_type : str
        capacitors, lines, loads, etc.
    name : str
        Element name

    Returns
    -------
    dict | None
        None is returned if no coordinates are stored.

        Example output::

        {'x': '34374.509', 'y': '206624.15'}

        If element_type == 'lines'
        {'from': None, 'to': {'x': '34802.251', 'y': '206769.654'}}

    """
    bus = feeder_mapping[element_type][name]
    if element_type == "lines":
        from_coords = feeder_mapping["bus_coords"].get(bus["from"])
        to_coords = feeder_mapping["bus_coords"].get(bus["to"])
        return {"from": from_coords, "to": to_coords}
    if element_type == "transformers":
        bus = bus["primary"]

    return feeder_mapping["bus_coords"].get(bus)