def cartesian(netx):
    """
    Converts node coordinates from a :py:class:`networkx.Graph` object
    to a list of dicts with following format:
    [{'node': <node id>,
      'x': <x position>,
      'y': <y position>}]
    :param G:
    :return: coordinates
    :rtype: list
    """
    return [{'node': n,
             'x': float(netx.pos[n][0]),
             'y': float(netx.pos[n][1])} for n in netx.pos]