for element in initial_elements:
element["data"].pop("associated_ids", None)
"""Sub dictionary for data within VizToComponentElementsValue"""
id: Required[str]
source: NotRequired[str]
target: NotRequired[str]
group: Required[str]
associated_ids: Required[dict[str, list[int]]] # e.g. {"sym_load": [1, 2], "sym_gen": [3]}
class VizToComponentElementsValue(TypedDict):
"""Element data for mapping visualization elements to component types and IDs
This is what is needed for cytoscape elements."""
data: _VizToComponentElementsValueData
classes: str
position: NotRequired[dict[Literal["x", "y"], float]]
selectable: NotRequired[bool]
VizToComponentElements = dict[str, VizToComponentElementsValue]