Skip to content

886563: UG Documentation for Enable connector split support #4360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
ae05127
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran May 20, 2024
d463974
Merge branch 'development' into ES-886563-ConnectorSplit
BalaVigneshRaviChandran May 21, 2024
54f09e8
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran May 21, 2024
2f51f67
Merge branch 'ES-886563-ConnectorSplit' of https://github.com/syncfus…
BalaVigneshRaviChandran May 21, 2024
71e8785
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran May 29, 2024
aa7b723
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran May 30, 2024
e0c30b5
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran May 30, 2024
d3ca402
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran Jun 11, 2024
e03668d
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran Jun 11, 2024
9ea5fd6
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran Jun 11, 2024
11b0648
Update interaction.md
sarathkumarvenkatesan Jun 11, 2024
e61274f
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran Jun 11, 2024
128fc69
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran Jun 11, 2024
b9179b4
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran Jun 11, 2024
fe64a02
886563: UG Documentation for Enable connector split support
BalaVigneshRaviChandran Jun 11, 2024
bfe1403
Merge branch 'development' into ES-886563-ConnectorSplit
BalaVigneshRaviChandran Jun 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions blazor/diagram/connectors/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,96 @@ The following code example illustrates how to set the connection padding value f
}
```
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/Blazor-Diagram-Examples/tree/master/UG-Samples/Connectors/Customization/ConnectionPadding)

### How to enable Connector Split

Connectors are used to create links between two points, ports, or nodes to represent the relationships between them. By enabling the [EnableConnectorSplitting](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_EnableConnectorSplitting) property, you can split a connector between two nodes when a new node is dropped onto the existing connector. This action creates a connection between the new node and the existing nodes. By default, [EnableConnectorSplitting](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.SfDiagramComponent.html#Syncfusion_Blazor_Diagram_SfDiagramComponent_EnableConnectorSplitting) is set to false.

The following code illustrates how to enable connector splitting and create connections with a new node.
```cshtml
@using Syncfusion.Blazor.Diagram
<SfDiagramComponent @ref="Diagram" Width="1000px" Height="500px" Nodes="@nodes" Connectors="@connectors" EnableConnectorSplitting="true">

</SfDiagramComponent>
@code {
//Reference the diagram
SfDiagramComponent Diagram;
// Initialize diagram's connector collection
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
// Initialize diagram's node collection
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
nodes = new DiagramObjectCollection<Node>() {
new Node() { OffsetX = 100,
OffsetY = 100,
Height = 50,
Width = 100,
ID = "node1",
Style = new ShapeStyle(){ Fill = "#6495ED",
StrokeColor = "#6495ED",},
Shape = new BasicShape() { Type = NodeShapes.Basic, Shape = NodeBasicShapes.Rectangle }
},
new Node() { OffsetX = 300,
OffsetY = 300,
Height = 50,
Width = 100,
ID = "node2",
Style = new ShapeStyle(){ Fill = "#6495ED",
StrokeColor = "#6495ED",},
Shape = new BasicShape() { Type = NodeShapes.Basic, Shape = NodeBasicShapes.Rectangle }
},
new Node() { OffsetX = 300,
OffsetY = 100,
Height = 50,
Width = 100,
ID = "node3",
Style = new ShapeStyle(){ Fill = "#6495ED",
StrokeColor = "#6495ED",},
Shape = new BasicShape() { Type = NodeShapes.Basic, Shape = NodeBasicShapes.Rectangle }
}
};
Connector Connector = new Connector()
{
ID = "connector1",
//Source node id of the connector.
SourceID = "node1",
TargetDecorator = new DecoratorSettings()
{
Style = new ShapeStyle()
{
Fill = "#6495ED",
StrokeColor = "#6495ED",
}
},
//Target node id of the connector.
TargetID = "node2",
Style = new ShapeStyle()
{
Fill = "#6495ED",
StrokeColor = "#6495ED",
},
// Type of the connector
Type = ConnectorSegmentType.Straight,
Constraints = ConnectorConstraints.Default | ConnectorConstraints.AllowDrop,
};
connectors.Add(Connector);
}
}
```
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/Blazor-Diagram-Examples/tree/master/UG-Samples/Interaction)

>**Note:** The [AllowDrop](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.ConnectorConstraints.html#Syncfusion_Blazor_Diagram_ConnectorConstraints_AllowDrop) constraints must be enabled for the connector to allow dropping a node.

### Create connection using Connector splitting

When a node is dropped on a point-to-point connection, it connects as the source for the target connector.
Dropping another node on the target connector with only a source connection will connect the dropped node as its target, creating a complete connection.

If a node is dropped on an existing node-to-node connection, the connector between the two nodes splits, creating a connection between the new node and the existing nodes.

![ConnectorSplitting](../images/ConnectorSplitDemo.gif)

## See also

* [How to interact with the connector](./interactions)
Expand Down
Binary file added blazor/diagram/images/ConnectorSplitDemo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion blazor/diagram/interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,4 +732,4 @@ The following table illustrates those commands with the associated key values.

## See Also

* [How to control the diagram history](./undo-redo)
* [How to control the diagram history](./undo-redo)