Skip to content

Commit 664c337

Browse files
authored
Merge pull request #119 from Blazor-Diagrams/develop
Version 2.1.3
2 parents 57c600c + af9cec6 commit 664c337

File tree

103 files changed

+4223
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4223
-12
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,3 +353,14 @@ MigrationBackup/
353353
.ionide/
354354
.vscode/symbols.json
355355
.vscode/settings.json
356+
357+
# JetBrains Rider
358+
.idea/
359+
*.sln.iml
360+
361+
# Mono auto generated files
362+
mono_crash.*
363+
364+
# Coverlet code coverage output
365+
**/coverage.json
366+
**/coverage.opencover.xml

Blazor.Diagrams.sln

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CEEAE4C2
2929
EndProject
3030
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Diagrams.Core.Tests", "tests\Blazor.Diagrams.Core.Tests\Blazor.Diagrams.Core.Tests.csproj", "{36B4DCCD-45AB-4338-9224-DDAF386A23A3}"
3131
EndProject
32+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A9FC9B20-A9F1-4066-8B59-83BD26D3B1C8}"
33+
EndProject
34+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Diagram-Demo", "docs\Diagram-Demo\Diagram-Demo.csproj", "{5F423724-5319-4DCE-B9F2-8B2D7E1FDC17}"
35+
EndProject
36+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomNodesLinks", "docs\CustomNodesLinks\CustomNodesLinks.csproj", "{3D104DB4-C7F0-42CA-9D78-AB2C8A8AE3D5}"
37+
EndProject
38+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Layouts", "docs\Layouts\Layouts.csproj", "{78C85C89-B464-4083-8829-78BA52BB4780}"
39+
EndProject
3240
Global
3341
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3442
Debug|Any CPU = Debug|Any CPU
@@ -63,6 +71,18 @@ Global
6371
{36B4DCCD-45AB-4338-9224-DDAF386A23A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
6472
{36B4DCCD-45AB-4338-9224-DDAF386A23A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
6573
{36B4DCCD-45AB-4338-9224-DDAF386A23A3}.Release|Any CPU.Build.0 = Release|Any CPU
74+
{5F423724-5319-4DCE-B9F2-8B2D7E1FDC17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75+
{5F423724-5319-4DCE-B9F2-8B2D7E1FDC17}.Debug|Any CPU.Build.0 = Debug|Any CPU
76+
{5F423724-5319-4DCE-B9F2-8B2D7E1FDC17}.Release|Any CPU.ActiveCfg = Release|Any CPU
77+
{5F423724-5319-4DCE-B9F2-8B2D7E1FDC17}.Release|Any CPU.Build.0 = Release|Any CPU
78+
{3D104DB4-C7F0-42CA-9D78-AB2C8A8AE3D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
79+
{3D104DB4-C7F0-42CA-9D78-AB2C8A8AE3D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
80+
{3D104DB4-C7F0-42CA-9D78-AB2C8A8AE3D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
81+
{3D104DB4-C7F0-42CA-9D78-AB2C8A8AE3D5}.Release|Any CPU.Build.0 = Release|Any CPU
82+
{78C85C89-B464-4083-8829-78BA52BB4780}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
83+
{78C85C89-B464-4083-8829-78BA52BB4780}.Debug|Any CPU.Build.0 = Debug|Any CPU
84+
{78C85C89-B464-4083-8829-78BA52BB4780}.Release|Any CPU.ActiveCfg = Release|Any CPU
85+
{78C85C89-B464-4083-8829-78BA52BB4780}.Release|Any CPU.Build.0 = Release|Any CPU
6686
EndGlobalSection
6787
GlobalSection(SolutionProperties) = preSolution
6888
HideSolutionNode = FALSE
@@ -75,6 +95,9 @@ Global
7595
{B9EE910B-8FE7-490C-B20C-CEC27A2890D6} = {DA819127-3EF6-4EB9-A2DA-BC056B284A50}
7696
{CB3A42B6-3C87-4ECB-B60C-D98275AB1FB6} = {EE32E278-A887-454E-987D-FFE9E37169FE}
7797
{36B4DCCD-45AB-4338-9224-DDAF386A23A3} = {CEEAE4C2-CE68-4FC3-9E0F-D4781B91F7F4}
98+
{5F423724-5319-4DCE-B9F2-8B2D7E1FDC17} = {A9FC9B20-A9F1-4066-8B59-83BD26D3B1C8}
99+
{3D104DB4-C7F0-42CA-9D78-AB2C8A8AE3D5} = {A9FC9B20-A9F1-4066-8B59-83BD26D3B1C8}
100+
{78C85C89-B464-4083-8829-78BA52BB4780} = {A9FC9B20-A9F1-4066-8B59-83BD26D3B1C8}
78101
EndGlobalSection
79102
GlobalSection(ExtensibilityGlobals) = postSolution
80103
SolutionGuid = {969540A2-8162-4063-A4E3-B488F69BD582}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Diagrams (2.1.3) - 2021-07-19
8+
9+
### Added
10+
11+
- Multiple demo projects by [TrevorDArcyEvans](https://github.com/TrevorDArcyEvans) showing:
12+
- Minimal project setup
13+
- Custom nodes & links
14+
- GraphShape layout algorithms
15+
16+
### Fixed
17+
18+
- Link labels not appearing (fixes #109).
19+
- `ZoomToFit` throwing a `NullReferenceException` when one of the nodes doesn't have a size yet (fixes #118).
20+
721
## Diagrams (2.1.2) - 2021-05-31
822

923
### Fixed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ You can get started very easily & quickly using:
4949

5050
- [Documentation](https://blazor-diagrams.zhaytam.com/)
5151
- [Quick Start](https://blazor-diagrams.zhaytam.com/quickstart)
52-
- [Demos](https://blazor-diagrams.zhaytam.com/demos/simple)
52+
- [Samples](https://blazor-diagrams.zhaytam.com/demos/simple)
53+
- [Docs/Demos](https://github.com/Blazor-Diagrams/Blazor.Diagrams/tree/master/docs)
5354

5455
### Sample project
5556

docs/CustomNodesLinks/App.razor

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
4+
</Found>
5+
<NotFound>
6+
<LayoutView Layout="@typeof(MainLayout)">
7+
<p>Sorry, there's nothing at this address.</p>
8+
</LayoutView>
9+
</NotFound>
10+
</Router>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<ProjectReference Include="..\..\src\Blazor.Diagrams.Core\Blazor.Diagrams.Core.csproj" />
9+
<ProjectReference Include="..\..\src\Blazor.Diagrams\Blazor.Diagrams.csproj" />
10+
</ItemGroup>
11+
12+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Blazor.Diagrams.Core.Models;
2+
3+
namespace CustomNodesLinks.Models
4+
{
5+
public sealed class DiagramLink : LinkModel
6+
{
7+
public DiagramLink(string name, NodeModel sourceNode, NodeModel? targetNode) :
8+
base(name, sourceNode, targetNode)
9+
{
10+
Name = name;
11+
Labels.Add(new DiagramLinkLabel(this, Name));
12+
}
13+
14+
public string Name { get; set; }
15+
}
16+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Blazor.Diagrams.Core.Geometry;
2+
using Blazor.Diagrams.Core.Models;
3+
using Blazor.Diagrams.Core.Models.Base;
4+
5+
namespace CustomNodesLinks.Models
6+
{
7+
public sealed class DiagramLinkLabel : LinkLabelModel
8+
{
9+
public DiagramLinkLabel(BaseLinkModel parent, string id, string content, double? distance = null, Point? offset = null) :
10+
base(parent, id, content, distance, offset)
11+
{
12+
}
13+
14+
public DiagramLinkLabel(BaseLinkModel parent, string content, double? distance = null, Point? offset = null) :
15+
base(parent, content, distance, offset)
16+
{
17+
}
18+
19+
public bool ShowLabel { get; set; } = true;
20+
}
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Blazor.Diagrams.Core.Geometry;
2+
using Blazor.Diagrams.Core.Models;
3+
4+
namespace CustomNodesLinks.Models
5+
{
6+
public sealed class DiagramNode : NodeModel
7+
{
8+
public DiagramNode(string name, Point pos) :
9+
base(name, pos)
10+
{
11+
Name = name;
12+
}
13+
14+
public string Name { get; set; }
15+
}
16+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@page
2+
@model CustomNodesLinks.Pages.ErrorModel
3+
4+
<!DOCTYPE html>
5+
<html>
6+
7+
<head>
8+
<meta charset="utf-8"/>
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
10+
<title>Error</title>
11+
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet"/>
12+
<link href="~/css/app.css" rel="stylesheet"/>
13+
</head>
14+
15+
<body>
16+
<div class="main">
17+
<div class="content px-4">
18+
<h1 class="text-danger">Error.</h1>
19+
<h2 class="text-danger">An error occurred while processing your request.</h2>
20+
21+
@if (Model.ShowRequestId)
22+
{
23+
<p>
24+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
25+
</p>
26+
}
27+
28+
<h3>Development Mode</h3>
29+
<p>
30+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
31+
</p>
32+
<p>
33+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
34+
It can result in displaying sensitive information from exceptions to end users.
35+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
36+
and restarting the app.
37+
</p>
38+
</div>
39+
</div>
40+
</body>
41+
42+
</html>

0 commit comments

Comments
 (0)