Skip to content

Commit

Permalink
Merge branch 'master' into feature/new-blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
miroiu authored Sep 28, 2022
2 parents 1dd5a06 + 6e4fb71 commit 1e7bdfc
Show file tree
Hide file tree
Showing 20 changed files with 170 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1.7.2
uses: actions/setup-dotnet@v2.1.0
with:
dotnet-version: '5.0.x'
dotnet-version: '6.0.x'
- name: Build
run: dotnet build --configuration Release
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ name: "CodeQL"
on:
push:
branches: [ master, release-v* ]
paths:
- Nodify/**
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ jobs:
uses: little-core-labs/[email protected]
id: tagName
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v2.1.0
with:
dotnet-version: '5.0.x'
dotnet-version: '6.0.x'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Create release branch
uses: peterjgrainger/[email protected]
env:
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v2.1.0
with:
dotnet-version: '5.0.x'
dotnet-version: '6.0.x'
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_KEY }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: Publish package
uses: brandedoutcast/[email protected]
with:
PACKAGE_NAME: Nodify
PROJECT_FILE_PATH: Nodify/Nodify.csproj
NUGET_KEY: ${{ secrets.NUGET_KEY }}
TAG_COMMIT: false
- name: Publish the package
run: dotnet nuget push */bin/Release/*.nupkg
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_KEY }}

49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Changelog

#### **In development**
> - Breaking Changes:
> - Features:
> - Bugfixes:
#### **Version 2.0.1**
> - Bugfixes:
> - Fixed pending connection default style
#### **Version 2.0.0**
> - Breaking Changes:
> - Renamed Offset to ViewportLocation in NodifyEditor
> - Renamed Scale to ViewportZoom in NodifyEditor
> - Renamed MinScale to MinViewportZoom in NodifyEditor
> - Renamed MaxScale to MaxViewportZoom in NodifyEditor
> - Renamed AppliedTransform to ViewportTransform in NodifyEditor
> - Renamed DirectionalConnection to LineConnection
> - Removed BringIntoViewAnimationDuration from NodifyEditor
> - Removed Viewport dependency property from NodifyEditor
> - Removed ActualSize dependency property from StateNode
> - Removed Icon dependency property from Node as the icon can *(and should)* be added in the HeaderTemplate if necessary
> - PART_ItemsHost is now required for NodifyEditor to work
> - ItemContainers cannot be used outside a NodifyEditor anymore
> - ZoomAtPosition now requires graph space coordinates instead of screen space coordinates
> - Removed custom value converters
> - Made DependencyObjectExtensions internal
> - Removed the http://miroiu.github.io/winfx/xaml/nodify xaml prefix
> - Features:
> - Added ResizeStartedEvent routed event to GroupingNode
> - Added ViewportSize - **OneWayToSource** dependency property to NodifyEditor
> - Added ActualSize - **OneWayToSource** dependency property to ItemContainer
> - Added DecoratorContainer and DecoratorContainerStyle dependency properties to NodifyEditor
> - Added RemoveConnectionCommand command to NodifyEditor
> - Added DisconnectCommand and SplitCommand commands to BaseConnection
> - Added ContentBrush dependency property to NodifyEditor
> - Added HasFooter dependency property to Node
> - Added FitToScreen command to NodifyEditor and EditorCommands
> - Added onFinish callback to BringIntoView in NodifyEditor
> - Added ArrowSize and Spacing dependency properties to all connections inheriting from BaseConnection
> - Added BringIntoViewMaxDuration dependency property to NodifyEditor
> - Added BringIntoViewSpeed dependency property to NodifyEditor
> - Auto panning speed now scales with the zoom factor.
> - Bugfixes:
> - Every public property or method should work with graph space coordinates
> - Disable auto panning when panning is disabled
> - Min zoom could be set to a very small value
> - Bring into view was not disabling all interfering operations
2 changes: 1 addition & 1 deletion Examples/Nodify.Calculator/Nodify.Calculator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<TargetFrameworks>net6-windows;net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
23 changes: 22 additions & 1 deletion Examples/Nodify.Playground/Editor/NodifyEditorView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,25 @@
Fill="{TemplateBinding Background}"
StrokeThickness="2" />
</ControlTemplate>

<Storyboard x:Key="MarchingAnts">
<DoubleAnimation RepeatBehavior="Forever"
Storyboard.TargetProperty="StrokeDashOffset"
BeginTime="00:00:00"
Duration="0:3:0"
From="1000"
To="0"/>
</Storyboard>

<Style x:Key="SelectionRectangleStyle" TargetType="Rectangle" BasedOn="{StaticResource NodifyEditor.SelectionRectangleStyle}">
<Setter Property="StrokeDashArray" Value="4 4" />
<Setter Property="StrokeThickness" Value="2" />
<Style.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource MarchingAnts}" />
</EventTrigger>
</Style.Triggers>
</Style>
</UserControl.Resources>

<Grid>
Expand All @@ -149,7 +168,9 @@
DisablePanning="{Binding DisablePanning, Source={x:Static local:EditorSettings.Instance}}"
DisableZooming="{Binding DisableZooming, Source={x:Static local:EditorSettings.Instance}}"
DisplayConnectionsOnTop="{Binding DisplayConnectionsOnTop, Source={x:Static local:EditorSettings.Instance}}"
BringIntoViewAnimationDuration="{Binding BringIntoViewAnimationDuration, Source={x:Static local:EditorSettings.Instance}}">
BringIntoViewSpeed="{Binding BringIntoViewSpeed, Source={x:Static local:EditorSettings.Instance}}"
BringIntoViewMaxDuration="{Binding BringIntoViewMaxDuration, Source={x:Static local:EditorSettings.Instance}}"
SelectionRectangleStyle="{StaticResource SelectionRectangleStyle}">
<nodify:NodifyEditor.Style>
<Style TargetType="{x:Type nodify:NodifyEditor}"
BasedOn="{StaticResource {x:Type nodify:NodifyEditor}}">
Expand Down
15 changes: 11 additions & 4 deletions Examples/Nodify.Playground/EditorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,18 @@ public bool DisplayConnectionsOnTop
set => SetProperty(ref _displayConnectionsOnTop, value);
}

private double _bringIntoViewAnimationDuration = 0.5;
public double BringIntoViewAnimationDuration
private double _bringIntoViewSpeed = 1000;
public double BringIntoViewSpeed
{
get => _bringIntoViewAnimationDuration;
set => SetProperty(ref _bringIntoViewAnimationDuration, value);
get => _bringIntoViewSpeed;
set => SetProperty(ref _bringIntoViewSpeed, value);
}

private double _bringIntoViewMaxDuration = 1;
public double BringIntoViewMaxDuration
{
get => _bringIntoViewMaxDuration;
set => SetProperty(ref _bringIntoViewMaxDuration, value);
}

#endregion
Expand Down
18 changes: 14 additions & 4 deletions Examples/Nodify.Playground/EditorSettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock Text="Realtime selection: "
Expand Down Expand Up @@ -238,15 +239,24 @@
Margin="0 5 5 0" />

<TextBlock Grid.Row="22"
Text="Bring into view duration: "
ToolTip="Bring location into view animation duration"
Text="Bring into view speed: "
ToolTip="Bring location into view animation speed in pixels per second"
Margin="0 5 5 0" />
<TextBox Grid.Row="22"
Grid.Column="1"
Text="{Binding BringIntoViewAnimationDuration, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Text="{Binding BringIntoViewSpeed, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />

<TextBlock Grid.Row="23"
Text="Bring into view max duration: "
ToolTip="Bring location into view max animation duration"
Margin="0 5 5 0" />
<TextBox Grid.Row="23"
Grid.Column="1"
Text="{Binding BringIntoViewMaxDuration, Mode=TwoWay, Source={x:Static local:EditorSettings.Instance}}"
Margin="0 5 5 0" />

<Expander Grid.Row="23"
<Expander Grid.Row="24"
Grid.ColumnSpan="2"
Header="Advanced"
Padding="0 5 0 0"
Expand Down
2 changes: 1 addition & 1 deletion Examples/Nodify.Playground/Nodify.Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<TargetFrameworks>net6-windows;net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/Nodify.Shared/Nodify.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<UseWPF>true</UseWPF>
<TargetFrameworks>net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<TargetFrameworks>net6-windows;net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/Nodify.StateMachine/Nodify.StateMachine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<TargetFrameworks>net6-windows;net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Nodify/Connections/Connector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static Connector()
protected NodifyEditor? Editor { get; private set; }

/// <summary>
/// Gets or sets the safe zone outside the <see cref="NodifyEditor.Viewport"/> that will not trigger optimizations.
/// Gets or sets the safe zone outside the editor's viewport that will not trigger optimizations.
/// </summary>
public static double OptimizeSafeZone = 1000d;

Expand All @@ -142,7 +142,7 @@ static Connector()
/// <summary>
/// Gets or sets if <see cref="Connector"/>s should enable optimizations based on <see cref="OptimizeSafeZone"/> and <see cref="OptimizeMinimumSelectedItems"/>.
/// </summary>
public static bool EnableOptimizations = true;
public static bool EnableOptimizations = false;

/// <summary>
/// Gets or sets whether cancelling a pending connection is allowed.
Expand Down
8 changes: 4 additions & 4 deletions Nodify/EditorCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum Alignment
}

/// <summary>
/// Zoom in relative to the <see cref="NodifyEditor.Viewport"/>'s center.
/// Zoom in relative to the editor's viewport center.
/// </summary>
public static RoutedUICommand ZoomIn { get; } = new RoutedUICommand("Zoom in", nameof(ZoomIn), typeof(EditorCommands), new InputGestureCollection
{
Expand All @@ -33,7 +33,7 @@ public enum Alignment
});

/// <summary>
/// Zoom out relative to the <see cref="NodifyEditor.Viewport"/>'s center.
/// Zoom out relative to the editor's viewport center.
/// </summary>
public static RoutedUICommand ZoomOut { get; } = new RoutedUICommand("Zoom out", nameof(ZoomOut), typeof(EditorCommands), new InputGestureCollection
{
Expand All @@ -47,13 +47,13 @@ public enum Alignment
public static RoutedUICommand SelectAll { get; } = ApplicationCommands.SelectAll;

/// <summary>
/// Moves the <see cref="NodifyEditor.Viewport"/> to the specified location.
/// Moves the <see cref="NodifyEditor.ViewportLocation"/> to the specified location.
/// Parameter is a <see cref="Point"/> or a string that can be converted to a point.
/// </summary>
public static RoutedUICommand BringIntoView { get; } = new RoutedUICommand("Bring location into view", nameof(BringIntoView), typeof(EditorCommands));

/// <summary>
/// Scales the <see cref="NodifyEditor.Viewport"/> to fit all the <see cref="ItemContainer"/>s if that's possible.
/// Scales the editor's viewport to fit all the <see cref="ItemContainer"/>s if that's possible.
/// </summary>
public static RoutedUICommand FitToScreen { get; } = new RoutedUICommand("Fit to screen", nameof(FitToScreen), typeof(EditorCommands));

Expand Down
1 change: 1 addition & 0 deletions Nodify/Helpers/BoxValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static class BoxValue
public static readonly object Double1 = 1d;
public static readonly object Double2 = 2d;
public static readonly object Double45 = 45d;
public static readonly object Double1000 = 1000d;
public static readonly object Int0 = 0;
public static readonly object Int1 = 1;
public static readonly object UInt1 = 1u;
Expand Down
3 changes: 1 addition & 2 deletions Nodify/Nodes/Node.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
Expand Down
35 changes: 3 additions & 32 deletions Nodify/Nodify.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFrameworks>net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<TargetFrameworks>net6-windows;net5-windows;netcoreapp3.1;net48;net472</TargetFrameworks>
<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -16,37 +16,8 @@
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>https://github.com/miroiu/nodify</RepositoryUrl>
<PackageTags>wpf mvvm node-editor controls</PackageTags>
<Version>2.0.0</Version>
<PackageReleaseNotes>Added ResizeStartedEvent to GroupingNode
Added ViewportSize dependency property
Added ActualSize - OneWayToSource to ItemContainer
Added DecoratorContainer and DecoratorContainerStyle to NodifyEditor
Added RemoveConnectionCommand to NodifyEditor
Added DisconnectCommand and SplitCommand to BaseConnection
Added ContentBrush to NodifyEditor
Added HasFooter to Node
Added FitToScreen to NodifyEditor and EditorCommands
Added onFinish callback to NodifyEditor.BringIntoView
Added ArrowSize and Spacing to all connections (BaseConnection)
Removed http://miroiu.github.io/winfx/xaml/nodify xaml prefix

Auto panning speed now scales with the zoom factor.

Breaking Changes:
Renamed NodifyEditor.Offset to ViewportLocation
Renamed NodifyEditor.Scale to ViewportZoom
Renamed NodifyEditor.MinScale to MinViewportZoom
Renamed NodifyEditor.MaxScale to MaxViewportZoom
Renamed NodifyEditor.AppliedTransform to ViewportTransform
Renamed DirectionalConnection to LineConnection
Removed NodifyEditor.Viewport dependency property
Removed ActualSize from StateNode
Removed Icon from Node as it can (and should) be added in a custom header template if necessary
PART_ItemsHost is now mandatory for NodifyEditor
ItemContainer cannot be used outside a NodifyEditor
Removed custom converters
NodifyEditor.ZoomAtPosition now requires graph space coordinates instead of screen space coordinates
Made DependencyObjectExtensions internal</PackageReleaseNotes>
<Version>2.0.1</Version>
<PackageReleaseNotes>Fixed pending connection spacing</PackageReleaseNotes>
<AssemblyOriginatorKeyFile>..\build\Nodify.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net472' OR '$(TargetFramework)'=='net48'">
Expand Down
Loading

0 comments on commit 1e7bdfc

Please sign in to comment.