-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from zHaytam/develop
Version 1.5.1
- Loading branch information
Showing
15 changed files
with
262 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Blazor.Diagrams.Core; | ||
using Blazor.Diagrams.Core.Models; | ||
|
||
namespace SharedDemo.Demos.CustomGroup | ||
{ | ||
public class CustomGroupModel : GroupModel | ||
{ | ||
public CustomGroupModel(DiagramManager diagramManager, NodeModel[] children, string title, byte padding = 30) | ||
: base(diagramManager, children, padding) | ||
{ | ||
Title = title; | ||
} | ||
|
||
public string Title { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<GroupContainer Group="Group" Class="custom"> | ||
<span class="title">@Group.Title</span> | ||
<GroupLinks></GroupLinks> | ||
<GroupNodes></GroupNodes> | ||
</GroupContainer> | ||
|
||
@code { | ||
[Parameter] public CustomGroupModel Group { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@page "/demos/custom-group" | ||
@layout DemoLayout | ||
@inject LayoutData LayoutData | ||
|
||
<CascadingValue Name="DiagramManager" Value="_diagramManager"> | ||
<DiagramCanvas></DiagramCanvas> | ||
</CascadingValue> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Blazor.Diagrams.Core; | ||
using Blazor.Diagrams.Core.Models; | ||
using Blazor.Diagrams.Core.Models.Core; | ||
|
||
namespace SharedDemo.Demos.CustomGroup | ||
{ | ||
partial class Demo | ||
{ | ||
private readonly DiagramManager _diagramManager = new DiagramManager(); | ||
|
||
protected override void OnInitialized() | ||
{ | ||
base.OnInitialized(); | ||
|
||
LayoutData.Title = "Custom group"; | ||
LayoutData.Info = "Creating your own custom groups is very easy!"; | ||
LayoutData.DataChanged(); | ||
|
||
_diagramManager.RegisterModelComponent<CustomGroupModel, CustomGroupWidget>(); | ||
|
||
var node1 = NewNode(50, 50); | ||
var node2 = NewNode(300, 300); | ||
var node3 = NewNode(500, 100); | ||
|
||
_diagramManager.AddNode(node1); | ||
_diagramManager.AddGroup(new CustomGroupModel(_diagramManager, new[] { node2, node3 }, "Group 1")); | ||
|
||
_diagramManager.AddLink(node1.GetPort(PortAlignment.Right), node2.GetPort(PortAlignment.Left)); | ||
_diagramManager.AddLink(node2.GetPort(PortAlignment.Right), node3.GetPort(PortAlignment.Bottom)); | ||
} | ||
|
||
private NodeModel NewNode(double x, double y) | ||
{ | ||
var node = new NodeModel(new Point(x, y)); | ||
node.AddPort(PortAlignment.Bottom); | ||
node.AddPort(PortAlignment.Top); | ||
node.AddPort(PortAlignment.Left); | ||
node.AddPort(PortAlignment.Right); | ||
return node; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters