gridemissions
gridemissions copied to clipboard
Refactor `viz.d3map.create_graph`
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 {}