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
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Commands/AlignLeft.razor
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
//Method to align selected objects at left of the selection boundary.
private void OnAlignLeft()
{
diagram.SetAlign(AlignmentOptions.Left);
_diagram.SetAlign(AlignmentOptions.Left);
}
}
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Commands/BringForward.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//Reference the diagram
private SfDiagramComponent _diagram;
//Initialize the diagram's nodes collection
private DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
private DiagramObjectCollection<Node> _nodes = new DiagramObjectCollection<Node>();

protected override void OnInitialized()
{
Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Commands/BringIntoCenter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
private void BringIntoCenter1()
{
DiagramRect bound = new DiagramRect(950, 650, 500, 500);
diagram.BringIntoCenter(bound);
_diagram.BringIntoCenter(bound);
}
}
6 changes: 3 additions & 3 deletions Diagram/Server/Pages/Commands/CustomCommands.razor
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@
if (args.Gesture.Modifiers == ModifierKeys.Control && args.Gesture.Key == DiagramKeys.G)
{
//Custom command to group the selected nodes
diagram.Group();
_diagram.Group();
}
if (args.Gesture.Modifiers == ModifierKeys.Control && args.Gesture.Key == DiagramKeys.U)
{
DiagramSelectionSettings selector = diagram.SelectionSettings;
DiagramSelectionSettings selector = _diagram.SelectionSettings;
//Custom command to ungroup the selected items
if (selector.Nodes.Count > 0 && selector.Nodes[0] is NodeGroup)
{
if ((selector.Nodes[0] as NodeGroup).Children.Length > 0)
{
diagram.Ungroup();
_diagram.Ungroup();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Commands/SendToBack.razor
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
Shape = new BasicShape() { Type = NodeShapes.Basic, Shape = NodeBasicShapes.Ellipse },
Style = new ShapeStyle() { Fill = "#6BA5D7", StrokeColor = "#ffff" },
};
_diagramnodes.Add(node3);
_nodes.Add(node3);
}

private void sendToBack()
Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Commands/SetDistributeCommands.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
private SfDiagramComponent _diagram;
private DiagramObjectCollection<Node> _nodes = new DiagramObjectCollection<Node>();
private DiagramObjectCollection<Connector> Connectors = new DiagramObjectCollection<Connector>();
private DiagramObjectCollection<Connector> _connectors = new DiagramObjectCollection<Connector>();

protected override void OnInitialized()
{
Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Export/Export.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@using Syncfusion.Blazor.Diagram
@using Syncfusion.Blazor.Buttons

<SfButton Content="ExportBase64" OnClick="@ExportBase64" />
<SfButton Content="ExportBase64" OnClick="@ExportBase64Async" />
<SfButton Content="ExportPng" OnClick="@ExportPngAsync" />
<SfDiagramComponent Height="600px" @ref="@_diagram" />

Expand Down
3 changes: 1 addition & 2 deletions Diagram/Server/Pages/Export/ExportToPDF.razor
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
@page "/Export"
@page "/ExportToPdf"

@using Syncfusion.PdfExport;
@using Syncfusion.Blazor.Diagram
@using Syncfusion.Blazor.Buttons
@inject IJSRuntime JS;

<SfButton Content="ExportPDF" OnClick="@ExportPDFAsync" />
<SfButton Content="ExportPng" OnClick="@ExportPngAsync" />
<SfDiagramComponent Height="600px" @ref="@_diagram" />

@code
Expand Down
14 changes: 7 additions & 7 deletions Diagram/Server/Pages/Interaction/CloneSelectedItems.razor
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,22 @@
List<string> child = new List<string>();
foreach (string childID in groupNode.Children)
{
for (int i = 0; i < diagram.Nodes.Count; i++)
for (int i = 0; i < _diagram.Nodes.Count; i++)
{
if (childID == diagram.Nodes[i].ID && diagram.Nodes[i] is NodeGroup nodeGroup)
if (childID == _diagram.Nodes[i].ID && _diagram.Nodes[i] is NodeGroup nodeGroup)
{
child.Add(CloneGroup(nodeGroup, true));
}
else if (childID == diagram.Nodes[i].ID)
else if (childID == _diagram.Nodes[i].ID)
{
child.Add(CloneNode(diagram.Nodes[i], true));
child.Add(CloneNode(_diagram.Nodes[i], true));
}
}
for (int i = 0; i < diagram.Connectors.Count; i++)
for (int i = 0; i < _diagram.Connectors.Count; i++)
{
if (childID == diagram.Connectors[i].ID)
if (childID == _diagram.Connectors[i].ID)
{
child.Add(CloneConnector(diagram.Connectors[i], true));
child.Add(CloneConnector(_diagram.Connectors[i], true));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Layout/MindMapWithoutDataSource.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@using Syncfusion.Blazor.Diagram

<SfDiagramComponent Height="600px" Nodes="@_nodes" Connectors="@_connectors" NodeCreating="@OnNodeCreating" ConnectorCreating="@OnConnectorCreating">
<Layout Type="LayoutType.MindMap" Root="@root">
<Layout Type="LayoutType.MindMap" Root="@_root">
<LayoutMargin Top="20" Left="20"></LayoutMargin>
</Layout>
</SfDiagramComponent>
Expand Down
4 changes: 2 additions & 2 deletions Diagram/Server/Pages/Layout/MindmapOrientation.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
new OrientationItem { Text = "Right to Left", Value = LayoutOrientation.RightToLeft }
};

private List<MindMapDetails> DataSource { get; set; } = new()
private List<MindMapDetails> _dataSource { get; set; } = new()
{
new MindMapDetails { Id = "1", Label = "Project Planning", ParentId = "", Branch = "Root" },
new MindMapDetails { Id = "2", Label = "Requirements", ParentId = "1", Branch = "Right" },
Expand All @@ -51,7 +51,7 @@
// Method triggered by button click at runtime to set diagram orientation to vertical.
private void ChangeLayoutOrientation()
{
_diagram?.Layout.Orientation = LayoutOrientation.Vertical;
_diagram!.Layout.Orientation = LayoutOrientation.Vertical;
}

private void OnNodeCreating(IDiagramObject obj)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
// Method triggered by button click at runtime to set diagram orientation to vertical.
private void ChangeLayoutOrientation()
{
_diagram?.Layout.Orientation = LayoutOrientation.Vertical;
_diagram!.Layout.Orientation = LayoutOrientation.Vertical;
}

private void OnNodeCreating(IDiagramObject obj)
Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Layout/OrganizationLayout2.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<VerticalGridLines LineColor="white" LineDashArray="2,2">
</VerticalGridLines>
</SnapSettings>
<Layout Type="LayoutType.OrganizationalChart" @bind-HorizontalSpacing="@HorizontalSpacing" @bind-VerticalSpacing="@VerticalSpacing" GetLayoutInfo="GetLayoutInfo">
<Layout Type="LayoutType.OrganizationalChart" @bind-HorizontalSpacing="@_horizontalSpacing" @bind-VerticalSpacing="@_verticalSpacing" GetLayoutInfo="GetLayoutInfo">
</Layout>
</SfDiagramComponent>

Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/Layout/RadialTreeWithNodes.razor
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
Width = 70,
Height = 70,
};
nodes.Add(node1);
_nodes.Add(node1);
}
Connector connector1 = new Connector() { ID = "connector1", SourceID = "node1", TargetID = "node2" };
_connectors.Add(connector1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
protected override void OnInitialized()
{
//A node is created and stored in nodes array.
nodes = new DiagramObjectCollection<Node>();
_nodes = new DiagramObjectCollection<Node>();
Node node = new Node()
{
//Position of the node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/NodePortConnection"
@using Syncfusion.Blazor.Diagram

<SfDiagramComponent Height="600px" Nodes="@nodes" Connectors="@_connectors">
<SfDiagramComponent Height="600px" Nodes="@_nodes" Connectors="@_connectors">
<SnapSettings Constraints="SnapConstraints.None"></SnapSettings>
</SfDiagramComponent>

Expand Down
4 changes: 2 additions & 2 deletions Diagram/Server/Pages/Serialization/Mermaid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
private LayoutOrientation _oreintation = LayoutOrientation.TopToBottom;
private HorizontalAlignment _horizontalAlignment = HorizontalAlignment.Auto;
private VerticalAlignment _verticalAlignment = VerticalAlignment.Auto;
private int _vorizontalSpacing = 30;
private int _horizontalSpacing = 30;
private int _verticalSpacing = 30;
private string _data = string.Empty;
private bool _isLoading = false;
Expand Down Expand Up @@ -256,7 +256,7 @@
node.Height = 100; node.Width = 100;
node.Style.Fill = "#BB9AB1";

if (!IsLoading)
if (!_isLoading)
{
node.Shape = new BasicShape() { Type = NodeShapes.Basic, Shape = NodeBasicShapes.Ellipse };
node.Annotations = new DiagramObjectCollection<ShapeAnnotation>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/saveAndLoad"

@using Diagram.Server.Pages.Serialization.SaveLoad
@using Syncfusion.Blazor.Diagram
@using Syncfusion.Blazor.Buttons
@using Microsoft.JSInterop
Expand Down
2 changes: 1 addition & 1 deletion Diagram/Server/Pages/SymbolPalette/GroupSample.razor
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
</div>
<div id="diagram-space" class="sb-mobile-diagram">
<div class="content-wrapper" style="border: 1px solid #D7D7D7">
<SfDiagramComponent @ref="@diagram" Height="700px" Connectors="@connectors" Nodes="@nodes">
<SfDiagramComponent @ref="@_diagram" Height="700px" Connectors="@_connectors" Nodes="@_nodes">
</SfDiagramComponent>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
private void InitPaletteModel()
{
CreatePaletteNode(NodeBasicShapes.Rectangle, "Rectangle");
Palettes = new DiagramObjectCollection<Palette>()
_palettes = new DiagramObjectCollection<Palette>()
{
new Palette(){Symbols = PaletteNodes,Title = "Basic Shapes", ID = "Basic Shapes" },
new Palette(){Symbols = _paletteNodes,Title = "Basic Shapes", ID = "Basic Shapes" },
};
}

Expand Down
4 changes: 2 additions & 2 deletions Diagram/Server/Pages/SymbolPalette/SymbolStretch.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<div class="control-section">
<div style="width:20%">
<div id="palette-space" class="sb-mobile-palette" style="border: 2px solid #b200ff">
<SfSymbolPaletteComponent @ref="@symbolpalette" Height="300px" Width="200px" GetSymbolInfo="GetSymbolInfo"
Palettes="@Palettes" SymbolHeight="60" SymbolWidth="120" SymbolMargin="@SymbolMargin">
<SfSymbolPaletteComponent @ref="@_symbolPalette" Height="300px" Width="200px" GetSymbolInfo="GetSymbolInfo"
Palettes="@_palettes" SymbolHeight="60" SymbolWidth="120" SymbolMargin="@_symbolMargin">
</SfSymbolPaletteComponent>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions Diagram/Server/Server_NET9.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Syncfusion.Blazor.CircularGauge" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
</ItemGroup>
Expand Down