Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
162 changes: 81 additions & 81 deletions blazor/diagram/annotations/appearance.md

Large diffs are not rendered by default.

49 changes: 24 additions & 25 deletions blazor/diagram/annotations/connector-annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The [Offset](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.Pat
@code
{
//Defines diagram's connector collection.
DiagramObjectCollection<Connector> connectors;
private DiagramObjectCollection<Connector> connectors;

protected override void OnInitialized()
{
Expand All @@ -44,23 +44,23 @@ The [Offset](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.Pat
Style = new TextStyle() { StrokeColor = "#6495ED" },
Annotations = new DiagramObjectCollection<PathAnnotation>()
{
new PathAnnotation
{
new PathAnnotation
{
Content = "Offset as 0",
// Sets the offset of the annotation as 0.
Offset = 0
Offset = 0
},
new PathAnnotation
{
new PathAnnotation
{
Content = "Offset as 0.5",
// Sets the offset of the annotation as 0.5.
Offset = 0.5
Offset = 0.5
},
new PathAnnotation
{
new PathAnnotation
{
Content = "Offset as 1",
// Sets the offset of the annotation as 1.
Offset = 1
Offset = 1
},
}
};
Expand Down Expand Up @@ -92,7 +92,7 @@ The [Alignment](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.
@code
{
//Defines diagram's connector collection.
DiagramObjectCollection<Connector> connectors;
private DiagramObjectCollection<Connector> connectors;

protected override void OnInitialized()
{
Expand All @@ -105,17 +105,17 @@ The [Alignment](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagram.
Style = new TextStyle() { StrokeColor = "#6495ED" },
Annotations = new DiagramObjectCollection<PathAnnotation>()
{
new PathAnnotation
{
new PathAnnotation
{
Content = "Before",
// Sets the alignment of the annotation as Before.
Alignment = AnnotationAlignment.Before
Alignment = AnnotationAlignment.Before
},
new PathAnnotation
{
new PathAnnotation
{
Content = "After",
// Sets the alignment of the annotation as After.
Alignment = AnnotationAlignment.After
Alignment = AnnotationAlignment.After
},
}
};
Expand All @@ -140,13 +140,12 @@ The [Displacement](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Diagr
```cshtml
@using Syncfusion.Blazor.Diagram

<SfDiagramComponent Height="600px" Connectors="@connectors">
</SfDiagramComponent>
<SfDiagramComponent Height="600px" Connectors="@connectors" />

@code
{
//Defines diagram's connector collection.
public DiagramObjectCollection<Connector> connectors { get; set; }
private DiagramObjectCollection<Connector> connectors { get; set; }

protected override void OnInitialized()
{
Expand Down Expand Up @@ -193,7 +192,7 @@ The following code example shows how the connector annotation rotated in its pat
@code
{
// Defines diagram's connector collection.
DiagramObjectCollection<Connector> connectors;
private DiagramObjectCollection<Connector> connectors;

protected override void OnInitialized()
{
Expand All @@ -206,12 +205,12 @@ The following code example shows how the connector annotation rotated in its pat
Style = new TextStyle() { StrokeColor = "#6495ED" },
Annotations = new DiagramObjectCollection<PathAnnotation>()
{
new PathAnnotation
{
Content = "Annotation",
new PathAnnotation
{
Content = "Annotation",
// Set the segment angle for the connector's annotation.
SegmentAngle = true,
Offset = 0.7
Offset = 0.7
},
}
};
Expand Down
12 changes: 7 additions & 5 deletions blazor/diagram/annotations/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ The following code example shows how to register and get notifications from the
@code
{
// Defines diagram's nodes collection.
DiagramObjectCollection<Node> nodes;
private DiagramObjectCollection<Node> nodes;

// Triggered when the node and connector's labels change in the diagram.
private void OnLabelTextChanging(TextChangeEventArgs args)
{
args.Cancel = true;
}
private void OnLabelTextChanging(TextChangeEventArgs args)
{
args.Cancel = true;
}

// Triggered this event when complete the editing for Annotation and update the old text and new text values.
private void OnTextChanged(TextChangeEventArgs args)
{
Expand Down
37 changes: 19 additions & 18 deletions blazor/diagram/annotations/interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The [RotationReference](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.
@code
{
// Defines diagram's node collection.
DiagramObjectCollection<Node> nodes;
private DiagramObjectCollection<Node> nodes;

protected override void OnInitialized()
{
Expand All @@ -37,15 +37,14 @@ The [RotationReference](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.
OffsetY = 100,
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
{
new ShapeAnnotation
{
new ShapeAnnotation
{
Content = "Node1",
RotationReference = AnnotationRotationReference.Parent,
}
},

};
Node node2 = new Node()
Node node2 = new Node()
{
ID = "node2",
Width = 100,
Expand All @@ -54,13 +53,12 @@ The [RotationReference](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.
OffsetY = 100,
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
{
new ShapeAnnotation
{
new ShapeAnnotation
{
Content = "Node2",
RotationReference = AnnotationRotationReference.Page,
}
},

};
nodes.Add(node1);
nodes.Add(node2);
Expand All @@ -85,10 +83,13 @@ The following code examples illustrate how to configure `RotationAngle` for an a

```cshtml
@using Syncfusion.Blazor.Diagram

<SfDiagramComponent Height="600px" Nodes="@nodes" />

@code
{
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
private DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();

protected override void OnInitialized()
{
Node node = new Node()
Expand All @@ -98,15 +99,15 @@ The following code examples illustrate how to configure `RotationAngle` for an a
Width = 100,
OffsetX = 100,
OffsetY = 100,
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
{
new ShapeAnnotation
{
Content = "Node",
ID = "Annotation",
RotationAngle = 30,
}
},
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
{
new ShapeAnnotation
{
Content = "Node",
ID = "Annotation",
RotationAngle = 30,
}
},
};
nodes.Add(node);
}
Expand Down
43 changes: 17 additions & 26 deletions blazor/diagram/annotations/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ The following code example demonstrates how to create an annotation for a node a
@code
{
// Defines diagram's connector collection.
DiagramObjectCollection<Connector> connectors;

private DiagramObjectCollection<Connector> connectors;
// Defines diagram's node collection.
DiagramObjectCollection<Node> nodes;
private DiagramObjectCollection<Node> nodes;

protected override void OnInitialized()
{
Expand Down Expand Up @@ -91,16 +90,14 @@ The following code explains how to add an annotation to a node at runtime by usi
@using Syncfusion.Blazor.Buttons

<SfButton Content="Addlabel" OnClick="@AddLabel" />
<SfDiagramComponent Height="600px" @ref="@diagram" Nodes="@nodes">
</SfDiagramComponent>
<SfDiagramComponent Height="600px" @ref="@diagram" Nodes="@nodes" />

@code
{
// Reference to diagram.
SfDiagramComponent diagram;

private SfDiagramComponent diagram;
// Defines diagram's node collection.
DiagramObjectCollection<Node> nodes;
private DiagramObjectCollection<Node> nodes;

protected override void OnInitialized()
{
Expand All @@ -117,7 +114,7 @@ The following code explains how to add an annotation to a node at runtime by usi
}

// Method to add annotation at runtime.
public void AddLabel()
private void AddLabel()
{
ShapeAnnotation annotation = new ShapeAnnotation { Content = "Annotation" };
(diagram.Nodes[0].Annotations as DiagramObjectCollection<ShapeAnnotation>).Add(annotation);
Expand All @@ -134,7 +131,7 @@ The following code explains how to add an annotation to a node at runtime by usi

```csharp
//Method to add annotation at runtime.
public async void AddLabel()
private async void AddLabel()
{
ShapeAnnotation annotation = new ShapeAnnotation { Content = "Annotation" };
await(diagram.Nodes[0].Annotations as DiagramObjectCollection<ShapeAnnotation>).AddAsync(annotation);
Expand All @@ -152,18 +149,15 @@ An annotation can be removed from a node or connector's `Annotations` collection
@using Syncfusion.Blazor.Diagram
@using Syncfusion.Blazor.Buttons


<SfButton Content="Removelabel" OnClick="@RemoveLabel" />

<SfDiagramComponent Height="600px" @ref="@diagram" Nodes="@nodes" />

@code
{
// Reference to diagram.
SfDiagramComponent diagram;

private SfDiagramComponent diagram;
// Defines diagram's node collection.
DiagramObjectCollection<Node> nodes;
private DiagramObjectCollection<Node> nodes;

protected override void OnInitialized()
{
Expand All @@ -184,7 +178,7 @@ An annotation can be removed from a node or connector's `Annotations` collection
}

// Method to remove annotation at runtime.
public void RemoveLabel()
private void RemoveLabel()
{
(diagram.Nodes[0].Annotations as DiagramObjectCollection<ShapeAnnotation>).RemoveAt(0);
}
Expand All @@ -198,7 +192,7 @@ Also, The `Remove` method can also be used to remove a specific annotation objec

```cshtml
// Method to remove annotation at runtime using Remove method.
public void RemoveLabel()
private void RemoveLabel()
{
ShapeAnnotation annotation = (diagram.Nodes[0].Annotations[0]) as ShapeAnnotation;
(diagram.Nodes[0].Annotations as DiagramObjectCollection<ShapeAnnotation>).Remove(annotation);
Expand All @@ -218,18 +212,15 @@ The following code sample shows how to change the content of a node's annotation
@using Syncfusion.Blazor.Diagram
@using Syncfusion.Blazor.Buttons


<SfButton Content="Updatelabel" OnClick="@UpdateLabel" />

<SfDiagramComponent Height="600px" @ref="@diagram" Nodes="@nodes" />

@code
{
// Reference to diagram.
SfDiagramComponent diagram;

private SfDiagramComponent diagram;
// Defines diagram's node collection.
DiagramObjectCollection<Node> nodes;
private DiagramObjectCollection<Node> nodes;

protected override void OnInitialized()
{
Expand All @@ -239,9 +230,9 @@ The following code sample shows how to change the content of a node's annotation
Width = 100,
Height = 100,
OffsetX = 100,
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
{
new ShapeAnnotation { Content = "Node" }
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
{
new ShapeAnnotation { Content = "Node" }
},
OffsetY = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Expand All @@ -250,7 +241,7 @@ The following code sample shows how to change the content of a node's annotation
}

// Method to update the annotation at runtime.
public void UpdateLabel()
private void UpdateLabel()
{
diagram.Nodes[0].Annotations[0].Content = "Updated Annotation";
}
Expand Down
Loading