def graph_to_d3_json(graph, attrs=True, node_attrs_to_attach=None,
    edge_attrs_to_attach=None, nodes=None):
    """Create a JSON representation of a graph."""
    j_data = graph.to_d3_json()
    return j_data
