private static void ClearGraph(EasyGraphView easyGraphView) { var nodes = ExtractNodes(easyGraphView); foreach (var node in nodes) { var edges = ExtractEdges(easyGraphView); edges.Where(x => x.input.node == node || x.output.node == node).ToList() .ForEach(edge => easyGraphView.RemoveElement(edge)); easyGraphView.RemoveElement(node); } }