Skip to content

Commit db8624c

Browse files
Merge pull request #124 from ParameshwaranSF4845/master
892666: UG Sample for annotation Rotation
2 parents 9523308 + b9e8035 commit db8624c

26 files changed

+1147
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@page "/"
2+
3+
@using Syncfusion.Blazor.Diagram
4+
5+
<SfDiagramComponent Height="600px" Nodes="@nodes" />
6+
7+
@code
8+
{
9+
// Defines diagram's node collection.
10+
DiagramObjectCollection<Node> nodes;
11+
12+
protected override void OnInitialized()
13+
{
14+
nodes = new DiagramObjectCollection<Node>();
15+
Node node1 = new Node()
16+
{
17+
ID = "node1",
18+
Width = 100,
19+
Height = 100,
20+
OffsetX = 100,
21+
OffsetY = 100,
22+
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
23+
{
24+
new ShapeAnnotation
25+
{
26+
Content = "Node1",
27+
RotationReference = AnnotationRotationReference.Parent,
28+
}
29+
},
30+
31+
};
32+
Node node2 = new Node()
33+
{
34+
ID = "node2",
35+
Width = 100,
36+
Height = 100,
37+
OffsetX = 100,
38+
OffsetY = 100,
39+
Annotations = new DiagramObjectCollection<ShapeAnnotation>()
40+
{
41+
new ShapeAnnotation
42+
{
43+
Content = "Node2",
44+
RotationReference = AnnotationRotationReference.Page,
45+
}
46+
},
47+
48+
};
49+
nodes.Add(node1);
50+
nodes.Add(node2);
51+
}
52+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@page "/"
2+
@namespace RotationReference.Pages
3+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4+
@{
5+
Layout = "_Layout";
6+
}
7+
8+
<component type="typeof(App)" render-mode="ServerPrerendered" />
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@using Microsoft.AspNetCore.Components.Web
2+
@namespace RotationReference.Pages
3+
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4+
5+
<!DOCTYPE html>
6+
<html lang="en">
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
<base href="~/" />
11+
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
12+
<link href="css/site.css" rel="stylesheet" />
13+
<link href="RotationReference.styles.css" rel="stylesheet" />
14+
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
15+
<script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
16+
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered" />
17+
</head>
18+
<body>
19+
@RenderBody()
20+
21+
<div id="blazor-error-ui">
22+
<environment include="Staging,Production">
23+
An error has occurred. This application may no longer respond until reloaded.
24+
</environment>
25+
<environment include="Development">
26+
An unhandled exception has occurred. See browser dev tools for details.
27+
</environment>
28+
<a href="" class="reload">Reload</a>
29+
<a class="dismiss">🗙</a>
30+
</div>
31+
32+
<script src="_framework/blazor.server.js"></script>
33+
</body>
34+
</html>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Microsoft.AspNetCore.Components;
2+
using Microsoft.AspNetCore.Components.Web;
3+
using Syncfusion.Blazor;
4+
var builder = WebApplication.CreateBuilder(args);
5+
6+
// Add services to the container.
7+
builder.Services.AddRazorPages();
8+
builder.Services.AddServerSideBlazor();
9+
builder.Services.AddSyncfusionBlazor();
10+
11+
var app = builder.Build();
12+
13+
// Configure the HTTP request pipeline.
14+
if (!app.Environment.IsDevelopment())
15+
{
16+
app.UseExceptionHandler("/Error");
17+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
18+
app.UseHsts();
19+
}
20+
21+
app.UseHttpsRedirection();
22+
23+
app.UseStaticFiles();
24+
25+
app.UseRouting();
26+
27+
app.MapBlazorHub();
28+
app.MapFallbackToPage("/_Host");
29+
30+
app.Run();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:8718",
7+
"sslPort": 44326
8+
}
9+
},
10+
"profiles": {
11+
"RotationReference": {
12+
"commandName": "Project",
13+
"dotnetRunMessages": true,
14+
"launchBrowser": true,
15+
"applicationUrl": "https://localhost:7175;http://localhost:5048",
16+
"environmentVariables": {
17+
"ASPNETCORE_ENVIRONMENT": "Development"
18+
}
19+
},
20+
"IIS Express": {
21+
"commandName": "IISExpress",
22+
"launchBrowser": true,
23+
"environmentVariables": {
24+
"ASPNETCORE_ENVIRONMENT": "Development"
25+
}
26+
}
27+
}
28+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="*" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<Folder Include="wwwroot\" />
14+
</ItemGroup>
15+
16+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Syncfusion.Blazor.Diagram" Version="*" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<Folder Include="wwwroot\" />
14+
</ItemGroup>
15+
16+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@inherits LayoutComponentBase
2+
3+
<PageTitle>RotationReference</PageTitle>
4+
5+
<div class="page">
6+
7+
<main>
8+
<div class="top-row px-4">
9+
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
10+
</div>
11+
12+
<article class="content px-4">
13+
@Body
14+
</article>
15+
</main>
16+
</div>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
.page {
2+
position: relative;
3+
display: flex;
4+
flex-direction: column;
5+
}
6+
7+
main {
8+
flex: 1;
9+
}
10+
11+
.sidebar {
12+
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13+
}
14+
15+
.top-row {
16+
background-color: #f7f7f7;
17+
border-bottom: 1px solid #d6d5d5;
18+
justify-content: flex-end;
19+
height: 3.5rem;
20+
display: flex;
21+
align-items: center;
22+
}
23+
24+
.top-row ::deep a, .top-row .btn-link {
25+
white-space: nowrap;
26+
margin-left: 1.5rem;
27+
}
28+
29+
.top-row a:first-child {
30+
overflow: hidden;
31+
text-overflow: ellipsis;
32+
}
33+
34+
@media (max-width: 640.98px) {
35+
.top-row:not(.auth) {
36+
display: none;
37+
}
38+
39+
.top-row.auth {
40+
justify-content: space-between;
41+
}
42+
43+
.top-row a, .top-row .btn-link {
44+
margin-left: 0;
45+
}
46+
}
47+
48+
@media (min-width: 641px) {
49+
.page {
50+
flex-direction: row;
51+
}
52+
53+
.sidebar {
54+
width: 250px;
55+
height: 100vh;
56+
position: sticky;
57+
top: 0;
58+
}
59+
60+
.top-row {
61+
position: sticky;
62+
top: 0;
63+
z-index: 1;
64+
}
65+
66+
.top-row, article {
67+
padding-left: 2rem !important;
68+
padding-right: 1.5rem !important;
69+
}
70+
}

0 commit comments

Comments
 (0)