A fully customizable and extensible all-purpose diagrams library for Blazor
Full Changelog: https://github.com/Blazor-Diagrams/Blazor.Diagrams/compare/3.0.1...3.0.2
Route
property to BaseLinkModel
to hold the result of the executed routerRemoveControl
(thanks to @K0369)LinkVertexWidgetTests
failing on cultures that are not using a dot as decimal separator (thanks to @K0369)Finally, the new documentation website is here!
Please don't hesitate to create issues for any problems or improvements.
PS: I suck at design.
AddLabel
method to links to easily create LinkLabelModel
AddVertex
method to links to easily create LinkVertexModel
ControlledSize
property to nodes. If true
, the node will not be registered in the ResizeObserver
(saves a JS call).autoSize
argument to SvgGroupModel
constructorPoint.Substract
to Subtract
(duh)SmoothPathGenerator
not working with LinkAnchor
GroupModel
are now removed(un)oberve
methods when the element doesn't exist anymoreCheck out the other beta version for a complete CHANGELOG !
Fix a dumb issue by me regarding ordering
All NuGet packages have been updated.
Style
parameter to PortRenderer
TargetAttached
to links, which triggers when a dragged link attaches to a target
SuspendSorting
to Diagram
in order to suspend sorting models in each OrderChanged
RefreshOrders
to be called after unsuspending sorting in order to sort the models again and refresh the diagramBaseLayer.Add
now returns the specific type given to it in argumentdiagram-
to avoid clashes with other libraries
diagram-group
, diagram-node
, diagram-link
, diagram-port
, diagram-link-label
, diagram-link-vertex
, diagram-control
GetBounds
not returning a valid boxConsole.WriteLine
from KeyboardShortcutsBehavior
Order
when it's not zero (zero being the default int value, which we now consider as not set)AdditionalSvg
option to DiagramCanvas
in order to render any extra SVG content you wantAdditionalHtml
option to DiagramCanvas
in order to render any extra HTML content you wantDistanceTo
overload method to Point
that takes x and yMoveAlongLine
method to Point
FullPath
to PathGeneratorResult
to represent the full path without cutsOrthogonalRouter
radius
option to StraightPathGenerator
in order to generate rounded bendsAutoSize
option to groups to control whether moving children resizes the groupRouter
PathGenerator
Router
delegatePathGenerator
delegateOrder
property or SendToFront/Back
methodsDiagram.OrderedSelectables
returns the ordered selectables/modelsDiagramCanvas
now uses this new property to render everythingGridSnapToCenter
option in order to snap nodes from their center instead of their top/left position (thanks to @Jeremy Vance)Groups
is not a list of groups anymore, but a layer instead (just like Nodes
and Links
)Diagram
, please use the new layer from now onLinkFactory
to return null in order to not create an ongoing linkPositionAnchor
which reprensents a simple plain position (mutable)ArrowHeadControl
to control a link's Source/Target on the flyattached
css class to attached linksOngoingPosition
with the new PositionAnchor
BaseLinkModel.Target
will never be null anymore. An ongoing link will have a position anchor as the targetLinks.Factory
signature now takes the diagram, source (model) and the target anchorDynamicAnchor
back to Anchors
namespace and seal all Anchor
classesLinkPathPositionProvider
not working with maxlength ratiosPositionProvider
argument from ExecutableControl
for more freedomId
and Refresh
from ILinkable
Offset
from Anchor
and make Model
nullableMoved
event to MovablesVisible
property and VisbilityChanged
event to modelsOptions.Virtualization
(of type [Diagram]VirtualizationOptions
) for virtualization optionsPointerEnter/Leave
events for groups as wellLinkAnchor
)RegisterModelComponent
to RegisterComponent
GetComponentForModel
to GetComponent
EnableVirtualization
option (see added alternative).NET 6!
A lot of things changed in this version, a lot of breaking changes were introduced but I believe it was necessary.
Many changes were required to make everything clearer, customizable and cleaner (code wise).
I'm aiming to completely decouple the Core library from the UI, because I'm thinking of giving MAUI Diagrams a try very soon!
https://www.nuget.org/packages/Z.Blazor.Diagrams.Core/3.0.0-beta.1 https://www.nuget.org/packages/Z.Blazor.Diagrams/3.0.0-beta.1
BlazorDiagram
class (inherits Diagram
) to the blazor package to replace the old Core oneBlazorDiagramOptions
that inherit from the other diagram options to add Blazor (UI) specific optionsBlazor.Diagrams.Models.SvgNodeModel
class to represent a node that needs to be rendered in the SVG layerGetBehavior<T>
method to Diagram
in order to retrieve a registered behaviorKeyboardShortcutsBehavior
class which handles keyboard shortcuts/actions:
SetShortcut
: sets an action (Func<Diagrambase, ValueTask>
) to be executed whenever the specified combination is pressedRemoveShortcut
: removes a defined action (if it exists)KeyboardShortcutsDefaults
containing the default shortcuts that were deleted (DeleteSelection
and Grouping
)Source
and Target
of type Anchor
SinglePortAnchor
: Specifies that the connection point is a specific port (supports shape & alignment)ShapeIntersectionAnchor
: Specifies that the connection point is the intersection of a line with the node's shapeDynamicAnchor
: Specifies that the connection point is one of the given positions (closest)IShape GetShape()
method on nodes (default Rectangle
) and ports (default Circle
)Options.LinksLayerOrder
to indicate the order of the links layer (svg for blazor)Options.NodesLayerOrder
to indicate the order of the nodes layer (html for blazor)SvgGroupModel
)node locked
, the classes selected grouped
IHasBounds
and IHasShape
interfaces to both nodes and portsIPositionProvider
to encapsulate how certain positions are calculated given a model
BoundsBasedPositionProvider
returns the position based on the bounds of the model (e.g. (0.5, 0.5) would be the center)ShapeAnglePositionProvider
returns the position as the point at the angle of the shapeLinkPathPositionProvider
returns the position based on the link's path (getPointAtLength
)Diagram
nowPointerEnter
and PointerLeave
events for nodes and links for nowGeneratedPathResult
and Paths
to BaseLinkModel
to always have access to the actual pathsControls
feature (beta):
Control
designates a control that has a position and will be rendered if visibleExecutableControl
designates a control that has a position and will be executed when pressed (PointerDown event)BoundaryControl
shows the model's boundaryRemoveControl
shows a button that when clicked, removes the model from the diagramDragNewLink
shows a button that when clicked, starts a new link dragging from that nodeGridWidget
a background grid that moves with the diagram instead of being fixed like in the Snap to grid exampleDiagram
is now abstractDiagram.GetComponentForModel
now accepts a checkSubclasses
argument (default true
)ValueTask<bool>
instead of a simple bool
AllLinks
to PortLinks
for more clarity on which links, since Links
contains the othersGroupRenderer
will take care of rendering the group with the appropriate style and classesGroupNodes
is required, GroupLinks
was deleted because all links are shown in the svg layer (with appropriate order)Diagram.AddGroup
will now return the added groupMouse
events have been converted to Pointer
eventsPathGenerator
now return SvgPath
instead of just stringsNavigatorWidget
was rewritten to be faster, lighter, WORKING and customizable
@key
(#220)DefaultNodeComponent
and DefaultLinkComponent
options (see GetComponentForModel
changes)RenderLayer
from the Core package and all its usageDeleteSelectionBehavior
since there is a new keyboard shortcuts systemGroupingBehavior
since there is a new keyboard shortcuts systemBaseLinkModelExtensions
since it was ObseleteShapeDefiner
delegate and constructor arguments on nodes since delegates can't be serializedTouchX
events