protected override LayoutData CreateConfiguredLayoutData(GraphControl graphControl, ILayoutAlgorithm layout) { var layoutData = new PartialLayoutData(); var selection = graphControl.Selection; layoutData.AffectedNodes.Source = selection.SelectedNodes; layoutData.AffectedEdges.Source = selection.SelectedEdges; return(layoutData); }
///<summary> /// Runs either the table or the three tiers layout depending on the selected scenario. ///</summary> private async Task RunLayout() { DisableButtons(); var layoutData = new PartialLayoutData { AffectedEdges = { Mapper = partialEdgesMapper }, AffectedNodes = { Mapper = partialNodesMapper } }; var executor = new LayoutExecutor( graphControl, CreateConfiguredPartialLayout()) { Duration = TimeSpan.FromMilliseconds(500), AnimateViewport = true, LayoutData = layoutData }; try { await executor.Start(); } catch (Exception e) { MessageBox.Show(this, "Layout did not complete successfully.\n" + e.Message); } EnableButtons(); }