Skip to content
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

902137: KBSamples #108

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
902137: GroupNodeCustomization
  • Loading branch information
Kiruthika-3470 committed Aug 26, 2024
commit a79c9032462acd6ff32dce77330e10c8aba032d6
13 changes: 13 additions & 0 deletions KB-Samples/GroupNodeCustomization/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>

14 changes: 14 additions & 0 deletions KB-Samples/GroupNodeCustomization/GroupNodeCustomization.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.Blazor" Version="*" />
<PackageReference Include="Syncfusion.Blazor.Themes" Version="*" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions KB-Samples/GroupNodeCustomization/GroupNodeCustomization.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GroupNodeCustomization", "GroupNodeCustomization.csproj", "{BD607AD5-F5CD-4426-B6CF-BCF6EE5E38A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BD607AD5-F5CD-4426-B6CF-BCF6EE5E38A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD607AD5-F5CD-4426-B6CF-BCF6EE5E38A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD607AD5-F5CD-4426-B6CF-BCF6EE5E38A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD607AD5-F5CD-4426-B6CF-BCF6EE5E38A5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E54284AF-9797-4860-9EED-6ECF085DCDBF}
EndGlobalSection
EndGlobal
103 changes: 103 additions & 0 deletions KB-Samples/GroupNodeCustomization/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
@page "/"

@using Syncfusion.Blazor.Inputs
@using Syncfusion.Blazor.Diagram

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

@code
{
//Reference the diagram
SfDiagramComponent diagram;
//Initialize the diagram's nodes collection
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();


protected override void OnInitialized()
{
Node pathNode = new Node()
{
ID = "pathNode",
//Size of the node
Height = 100,
Width = 100,
OffsetX = 100,
OffsetY = 200,
Constraints = NodeConstraints.Default & ~NodeConstraints.Select,
//Sets the type of the shape as path
Shape = new PathShape()
{
Type = NodeShapes.Path,
Data = "M 355.31 12.07 C 352.11 5.95 345.35 -1.14 331.41 0.15 C 290.33 3.93 209.61 81.48 190.42 111.69 C 189.66 107.76 187.9 101.49 184.12 98.05 C 189.5 87.75 198.01 69.64 201.57 52.48 C 202.4 52.26 203.12 51.68 203.34 50.44 C 203.72 48.34 204 46.22 204.39 44.13 C 205.01 40.62 199.99 39.43 199.42 42.91 C 199.06 45.06 198.69 47.15 198.35 49.31 C 198.16 50.6 198.69 51.62 199.54 52.14 C 196.08 68.87 187.75 86.63 182.43 96.81 C 181.52 96.29 180.53 95.87 179.41 95.7 C 179.09 95.65 178.8 95.72 178.5 95.71 C 178.19 95.72 177.91 95.65 177.59 95.7 C 176.46 95.87 175.48 96.29 174.56 96.81 C 169.24 86.63 160.92 68.87 157.46 52.14 C 158.3 51.62 158.83 50.6 158.65 49.31 C 158.3 47.15 157.93 45.06 157.58 42.91 C 157.01 39.43 151.99 40.62 152.61 44.13 C 152.99 46.22 153.28 48.34 153.66 50.44 C 153.87 51.68 154.6 52.27 155.42 52.48 C 158.98 69.63 167.49 87.75 172.87 98.05 C 169.09 101.49 167.33 107.76 166.57 111.69 C 147.39 81.48 66.67 3.93 25.59 0.15 C 11.65 -1.14 4.89 5.95 1.69 12.07 C -2.05 19.07 0.84 33.48 6.24 58.46 C 8.66 69.55 11.16 80.96 12.94 92.2 C 13.89 98.36 14.79 104.49 15.64 110.36 C 19.39 136.89 22.52 158.97 32.64 166.04 C 35.41 167.98 38.65 168.78 42.61 168.24 C 52.26 165.95 63.79 164.03 75.99 162.67 C 64.03 171.47 49.08 185.81 44.17 204.84 C 40.38 219.72 43.37 234.86 53.01 250.05 C 64.37 267.81 76.02 279.48 86.91 287.09 C 108.68 302.31 127.52 301.24 135.48 300.78 C 136.3 300.77 136.94 300.71 137.56 300.69 C 143.62 300.61 147.76 291.39 156.6 270.51 C 160.94 260.34 167.39 245.19 172.83 237.47 C 173.97 240.31 177.22 242.31 178.92 242.87 C 178.78 242.94 178.62 243.07 178.49 243.12 C 178.65 243.08 178.83 242.97 179 242.91 C 179.1 242.94 179.25 243.02 179.34 243.04 C 179.26 243.01 179.13 242.93 179.04 242.89 C 180.83 242.24 183.05 240.25 184.16 237.48 C 189.6 245.19 196.05 260.34 200.39 270.52 C 209.23 291.4 213.38 300.61 219.43 300.7 C 220.05 300.72 220.69 300.77 221.51 300.78 C 229.47 301.25 248.31 302.31 270.08 287.1 C 280.97 279.49 292.62 267.81 303.98 250.05 C 313.62 234.86 316.6 219.72 312.82 204.84 C 307.91 185.82 292.96 171.48 281 162.67 C 293.2 164.03 304.73 165.95 314.38 168.24 C 318.34 168.78 321.58 167.98 324.35 166.04 C 334.47 158.97 337.6 136.89 341.35 110.37 C 342.19 104.49 343.1 98.37 344.05 92.2 C 345.83 80.96 348.33 69.55 350.75 58.46 C 356.16 33.48 359.05 19.07 355.31 12.07 z M 183.92 237.56 C 182.35 240.3 180.35 242.13 178.97 242.86 C 177.49 242.19 174.7 240.38 173.08 237.56 C 173.08 237.56 166.19 138.22 166.91 113.58 C 166.91 113.58 169.24 97.92 178.5 97.81 C 187.76 97.92 190.09 113.58 190.09 113.58 C 190.81 138.22 183.92 237.56 183.92 237.56 z"
},
Style = new ShapeStyle()
{
Fill = "Orange"
}
};
Node node2 = new Node()
{
ID = "node2",
OffsetX = 300,
OffsetY = 100,
Height = 100,
Width = 100,
Shape = new PathShape()
{
Type = NodeShapes.Path,
Data = "M540.3643,137.9336L546.7973,159.7016L570.3633,159.7296L550.7723,171.9366L558.9053,194.9966L540.3643,179.4996L521.8223,194.9966L529.9553,171.9366L510.3633,159.7296L533.9313,159.7016L540.3643,137.9336z"
},
Constraints = NodeConstraints.Default & ~NodeConstraints.Select,
Style = new ShapeStyle() { Fill = "#6495ED" }
};
NodeGroup groupnode = new NodeGroup();
// Grouping node 1 and node 2 into a single group
groupnode.Children = new string[] { "pathNode", "node2" };
nodes.Add(node2);
nodes.Add(pathNode);
nodes.Add(groupnode);

Node node = new Node()
{
ID = "polygonNode",
OffsetX = 500,
OffsetY = 200,
Style = new ShapeStyle() { Fill = "#6495ED" },
Shape = new BasicShape()
{
Type = NodeShapes.Basic,
Points = new DiagramPoint[]{
new DiagramPoint() { X=35},
new DiagramPoint() { X=65 },
new DiagramPoint() { X = 100, Y=35 },
new DiagramPoint() { X = 100, Y = 65 },
new DiagramPoint() { X = 65, Y=100 },
new DiagramPoint() { X = 35, Y=100 },
new DiagramPoint() { Y=65 },
new DiagramPoint{ Y=35 }
},
Shape = NodeBasicShapes.Polygon
},

};
nodes.Add(node);

Node circleNode = new Node()
{
ID = "circleNode",
OffsetX = 600,
OffsetY = 100,
Height = 100,
Width = 100,
Style = new ShapeStyle() { Fill = "yellow", StrokeWidth = 3, StrokeColor = "Black" },
Shape = new BasicShape()
{
Type = NodeShapes.Basic,

Shape = NodeBasicShapes.Ellipse
},

};
nodes.Add(circleNode);
}
}
8 changes: 8 additions & 0 deletions KB-Samples/GroupNodeCustomization/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@page "/"
@namespace GroupNodeCustomization.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
}

<component type="typeof(App)" render-mode="ServerPrerendered" />
26 changes: 26 additions & 0 deletions KB-Samples/GroupNodeCustomization/Pages/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@using Microsoft.AspNetCore.Components.Web
@namespace GroupNodeCustomization.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
<link href="GroupNodeCustomization.styles.css" rel="stylesheet" />
<script src="~/javascript.js"></script>
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
</head>
<body>
@RenderBody()



<script src="_framework/blazor.server.js"></script>
</body>
</html>
32 changes: 32 additions & 0 deletions KB-Samples/GroupNodeCustomization/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Syncfusion.Blazor;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSyncfusionBlazor();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}

app.UseHttpsRedirection();

app.UseStaticFiles();

app.UseRouting();

app.MapBlazorHub();
app.MapFallbackToPage("/_Host");

app.Run();
28 changes: 28 additions & 0 deletions KB-Samples/GroupNodeCustomization/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:11920",
"sslPort": 44341
}
},
"profiles": {
"GroupNodeCustomization": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7204;http://localhost:5236",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
17 changes: 17 additions & 0 deletions KB-Samples/GroupNodeCustomization/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@inherits LayoutComponentBase

<PageTitle>GroupNodeCustomization</PageTitle>

<div class="page">
<div class="sidebar">
<NavMenu />
</div>


<main>

<article class="content px-4">
@Body
</article>
</main>
</div>
70 changes: 70 additions & 0 deletions KB-Samples/GroupNodeCustomization/Shared/MainLayout.razor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}

main {
flex: 1;
}

.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}

.top-row ::deep a, .top-row .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
}

.top-row a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}

.top-row.auth {
justify-content: space-between;
}

.top-row a, .top-row .btn-link {
margin-left: 0;
}
}

@media (min-width: 641px) {
.page {
flex-direction: row;
}

.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}

.top-row {
position: sticky;
top: 0;
z-index: 1;
}

.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
10 changes: 10 additions & 0 deletions KB-Samples/GroupNodeCustomization/_Imports.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using GroupNodeCustomization
@using GroupNodeCustomization.Shared
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions KB-Samples/GroupNodeCustomization/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
4 changes: 4 additions & 0 deletions KB-Samples/GroupNodeCustomization/wwwroot/JavaScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function getViewportBounds() {
var bounds = document.getElementsByClassName('e-control e-diagram e-lib e-droppable e-tooltip');
return bounds[0].getBoundingClientRect();
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading