Skip to content

Commit 1b52de9

Browse files
Merge pull request #12 from BalaVigneshRaviChandran/ES-831935-DiagramCorrection
Story(ES-831935): UG sample testing changes
2 parents 0666780 + 6af5f45 commit 1b52de9

File tree

10 files changed

+74
-34
lines changed

10 files changed

+74
-34
lines changed

DiagramComponent/BlazorServerApp/Diagramsample/Diagramsample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="19.4.0.48" />
11-
<PackageReference Include="Syncfusion.Blazor.Themes" Version="19.4.0.48" />
10+
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="*" />
11+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
1212
</ItemGroup>
1313

1414
</Project>

DiagramComponent/BlazorServerApp/Diagramsample/Pages/Index.razor

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
private void InitDiagramModel()
2020
{
21-
CreateNode("Start", 300, 50, FlowShapeType.Terminator, "Start");
22-
CreateNode("Init", 300, 140, FlowShapeType.Process, "var i = 0");
23-
CreateNode("Condition", 300, 230, FlowShapeType.Decision, "i < 10?");
24-
CreateNode("Print", 300, 320, FlowShapeType.PreDefinedProcess, "print(\'Hello!!\');");
25-
CreateNode("Increment", 300, 410, FlowShapeType.Process, "i++;");
26-
CreateNode("End", 300, 500, FlowShapeType.Terminator, "End");
21+
CreateNode("Start", 300, 50, NodeFlowShapes.Terminator, "Start");
22+
CreateNode("Init", 300, 140, NodeFlowShapes.Process, "var i = 0");
23+
CreateNode("Condition", 300, 230, NodeFlowShapes.Decision, "i < 10?");
24+
CreateNode("Print", 300, 320, NodeFlowShapes.PreDefinedProcess, "print(\'Hello!!\');");
25+
CreateNode("Increment", 300, 410, NodeFlowShapes.Process, "i++;");
26+
CreateNode("End", 300, 500, NodeFlowShapes.Terminator, "End");
2727
// Creates orthogonal connector.
2828
OrthogonalSegment segment1 = new OrthogonalSegment()
2929
{
@@ -87,7 +87,7 @@
8787
}
8888

8989
// Method to create node.
90-
private void CreateNode(string id, double x, double y, FlowShapeType shape, string label)
90+
private void CreateNode(string id, double x, double y, NodeFlowShapes shape, string label)
9191
{
9292
Node diagramNode = new Node()
9393
{
@@ -102,7 +102,7 @@
102102
// Defines the style of the node.
103103
Style = new ShapeStyle { Fill = "#357BD2", StrokeColor = "White" },
104104
// Defines the shape of the node.
105-
Shape = new FlowShape() { Type = Shapes.Flow, Shape = shape },
105+
Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = shape },
106106
// Defines the annotation collection of the node.
107107
Annotations = new DiagramObjectCollection<ShapeAnnotation>
108108
{

DiagramComponent/BlazorServerApp/Diagramsample/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
builder.Services.AddRazorPages();
1111
builder.Services.AddServerSideBlazor();
1212
builder.Services.AddSingleton<WeatherForecastService>();
13-
builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; });
13+
builder.Services.AddSyncfusionBlazor();
1414

1515
var app = builder.Build();
1616

DiagramComponent/BlazorWASMApp/DiagramSample/Client/DiagramSample.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
@@ -9,8 +9,8 @@
99
<ItemGroup>
1010
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.1" />
1111
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.1" PrivateAssets="all" />
12-
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="19.4.0.48" />
13-
<PackageReference Include="Syncfusion.Blazor.Themes" Version="19.4.0.48" />
12+
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="*" />
13+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

DiagramComponent/BlazorWASMApp/DiagramSample/Client/Pages/Index.razor

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
private void InitDiagramModel()
2020
{
21-
CreateNode("Start", 300, 50, FlowShapeType.Terminator, "Start");
22-
CreateNode("Init", 300, 140, FlowShapeType.Process, "var i = 0");
23-
CreateNode("Condition", 300, 230, FlowShapeType.Decision, "i < 10?");
24-
CreateNode("Print", 300, 320, FlowShapeType.PreDefinedProcess, "print(\'Hello!!\');");
25-
CreateNode("Increment", 300, 410, FlowShapeType.Process, "i++;");
26-
CreateNode("End", 300, 500, FlowShapeType.Terminator, "End");
21+
CreateNode("Start", 300, 50, NodeFlowShapes.Terminator, "Start");
22+
CreateNode("Init", 300, 140, NodeFlowShapes.Process, "var i = 0");
23+
CreateNode("Condition", 300, 230, NodeFlowShapes.Decision, "i < 10?");
24+
CreateNode("Print", 300, 320, NodeFlowShapes.PreDefinedProcess, "print(\'Hello!!\');");
25+
CreateNode("Increment", 300, 410, NodeFlowShapes.Process, "i++;");
26+
CreateNode("End", 300, 500, NodeFlowShapes.Terminator, "End");
2727
// Creates orthogonal connector.
2828
OrthogonalSegment segment1 = new OrthogonalSegment()
2929
{
@@ -87,7 +87,7 @@
8787
}
8888

8989
// Method to create node.
90-
private void CreateNode(string id, double x, double y, FlowShapeType shape, string label)
90+
private void CreateNode(string id, double x, double y, NodeFlowShapes shape, string label)
9191
{
9292
Node diagramNode = new Node()
9393
{
@@ -102,7 +102,7 @@
102102
// Defines the style of the node.
103103
Style = new ShapeStyle { Fill = "#357BD2", StrokeColor = "White" },
104104
// Defines the shape of the node.
105-
Shape = new FlowShape() { Type = Shapes.Flow, Shape = shape },
105+
Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = shape },
106106
// Defines the annotation collection of the node.
107107
Annotations = new DiagramObjectCollection<ShapeAnnotation>
108108
{

DiagramComponent/BlazorWASMApp/DiagramSample/Client/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
//Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("your license key");
1010

1111
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
12-
builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; });
12+
builder.Services.AddSyncfusionBlazor();
1313

1414
await builder.Build().RunAsync();
Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,61 @@
11
@page "/"
22

3-
<div>Horizontal Splitter</div>
3+
@using SplitterOrientation = Syncfusion.Blazor.Layouts.Orientation
44

5-
<SfSplitter Height="240px" Width="100%">
5+
<div>Horizontal Splitter</div>
6+
<div style="margin:0;padding:0;height:600px;width:100%;">
7+
<SfSplitter @ref="@Splitter" CssClass="out-splitter" Height="100%" Width="100%" SeparatorSize="4" Orientation="@SplitterOrientation">
8+
<SplitterEvents OnResizeStop="@OnSplitterResizeStopHandler"></SplitterEvents>
69
<SplitterPanes>
7-
<SplitterPane>
10+
<SplitterPane Size="25%" Min="60px">
811
<ContentTemplate>
912
<div> Left Pane </div>
1013
</ContentTemplate>
1114
</SplitterPane>
12-
<SplitterPane>
15+
<SplitterPane Size="50%" Min="60px">
1316
<ContentTemplate>
14-
<div> Middle Pane </div>
17+
<SfDiagramComponent @ref="Diagram" Height=@dHeight Width=@dWidth></SfDiagramComponent>
1518
</ContentTemplate>
1619
</SplitterPane>
17-
<SplitterPane>
20+
<SplitterPane Size="25%" Min="60px">
1821
<ContentTemplate>
1922
<div> Right Pane </div>
2023
</ContentTemplate>
2124
</SplitterPane>
2225
</SplitterPanes>
23-
</SfSplitter>
26+
</SfSplitter>
27+
</div>
28+
29+
30+
@code{
31+
string dHeight = "100%";
32+
string dWidth = "100%";
33+
SfDiagramComponent Diagram;
34+
SfSplitter Splitter;
35+
SplitterOrientation SplitterOrientation = SplitterOrientation.Vertical;
36+
37+
public void OnSplitterResizeStopHandler(ResizingEventArgs args)
38+
{
39+
int index = 0;
40+
if(args.Index != null)
41+
{
42+
for (int i = 0; i < args.Index.Length; i++)
43+
{
44+
if(args.Index[i]== 1)
45+
{
46+
// Index of the diagram pane based on the order of rendering
47+
index = i;
48+
}
49+
}
50+
}
51+
if(SplitterOrientation == SplitterOrientation.Horizontal)
52+
{
53+
dWidth = (args.PaneSize[index]-2).ToString() + "px";
54+
}
55+
else
56+
{
57+
dHeight = (args.PaneSize[index]-2).ToString() + "px";
58+
}
59+
60+
}
61+
}

Splitter/BlazorServerApp/SplitterSample/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
builder.Services.AddRazorPages();
1111
builder.Services.AddServerSideBlazor();
1212
builder.Services.AddSingleton<WeatherForecastService>();
13-
builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; });
13+
builder.Services.AddSyncfusionBlazor();
1414

1515
var app = builder.Build();
1616

Splitter/BlazorServerApp/SplitterSample/SplitterSample.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Syncfusion.Blazor.Layouts" Version="19.4.0.50" />
11-
<PackageReference Include="Syncfusion.Blazor.Themes" Version="19.4.0.50" />
10+
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="21.2.8" />
11+
<PackageReference Include="Syncfusion.Blazor.Layouts" Version="*" />
12+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
1213
</ItemGroup>
1314

1415
</Project>

Splitter/BlazorServerApp/SplitterSample/_Imports.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
@using SplitterSample
1010
@using SplitterSample.Shared
1111
@using Syncfusion.Blazor
12-
@using Syncfusion.Blazor.Layouts
12+
@using Syncfusion.Blazor.Layouts
13+
@using Syncfusion.Blazor.Diagram

0 commit comments

Comments
 (0)