jdechalendar / gridemissions

Tools for power sector emissions tracking
MIT License
35 stars 6 forks source link

Refactor `viz.d3map.create_graph` #17

Open jdechalendar opened 7 months ago

jdechalendar commented 7 months ago

Refactor viz.d3map.create_graph to the following signature. This would make it easier to re-use this function for more general purposes.

def create_graph2(
    size: ge.GraphData, color: ge.GraphData, field_size: str, field_color: str
) -> dict:
    """
    Parameters
    ----------
    size: ge.GraphData
    color: ge.GraphData
    field_size: str
    field_color: str
    Notes
    -----
    For links: we only consider the oriented connection with a positive flow and use
    the color of the source node for the link
    Dev
    ---
    create_graph2(co2, co2i, "D", "D") should produce the same result as what we had with create_graph
    """
    return {}