A fully customizable and extensible all-purpose diagrams library for Blazor
MouseDoubleClick
(500ms interval) event in Diagram
.GetScreenPoint
in Diagram
in order to get the screen points from a diagram point (e.g. node position).Title
property in NodeModel
, used by the default node widget.ZoomToFit
not triggering ZoomChanged
event.SourceNode
and TargetNode
not being set in BaseLinkModel
when the ports change.ZoomToFit
throwing a NullReferenceException
when one of the nodes doesn't have a size yet (fixes #118).ScaleFactor
zoom option (@joezearing)Constraints
options which gives you more control on what happens in the diagram:
ShouldDeleteNode
: Whether a selected node should be deleted or notShouldDeleteLink
: Whether a selected link should be deleted or notShouldDeleteGroup
: Whether a selected group should be deleted or notDeleteSelectionBehavior
unit testsGroupUngrouped
event (not the greatest name 😄)TouchStart
, TouchMove
and TouchEnd
RemoveGroup
method to delete a group and all its childrenSegmentable
to true
)
Options.Links.DefaultRouter
or by setting Router
in linksRouters.Normal
and Routers.Orthogonal
Router
Options.Links.DefaultPathGenerator
or by setting PathGenerator
in linksPathGenerators.Straight
and PathGenerators.Smooth
PathGenerator
SourceMarker
or TargetMarker
LinkMarker.Arrow
) as well as utility methods to create known shapesMouseClick
event, which only fires if the model (or canvas) in question didn't move, as opposed to MouseUpdata-X-id
HTML attributes to nodes, ports and linksBaseLinkModel
, LinkModel
now inherits from it
BaseLinkModel
instead of LinkModel
(e.g. PortModel.Links)Color
, SelectedColor
and Width
properties to LinkModel
RegisterModelComponent
MarkupString
DiagramOptions.Links
): EnableSnapping
and SnappingRadius
GetBounds
extension method on IEnumerable<NodeModel>
Padding
property in GroupModel
Factory
option to Options.Links
BaseLinkModel LinkFactory(DiagramManager diagram, PortModel sourcePort)
) to let you control how links are createdGroups
(of type DiagramGroupOptions
) option to DiagramOptions
Enabled
option controls whether users are allow to group nodes together or notKeyboardShortcut
(Func<KeyboardEventArgs, bool>
) controls what keys need to be pressed to trigger the behaviorFactory
lets you control how groups are createdGetRelativePoint
method to Diagram
SelectionBoxWidget
Diagram
now also inherits Model
Diagram
by setting Diagram.SuspendRefresh
to true
Refresh
from triggering the event Changed
, which tries to re-render the UIBatch(Action action)
in Diagram
.
FillColor
parameter to NavigatorWidget
ShapeDefiner
in NodeModel
's constructorShapes.Rectangle
DiagramManager
to Diagram
Name
in diagram's CascadingValue
Diagram.Nodes
and Diagram.Links
)Diagram.Nodes.Add
)Diagram.Links.Added
)LinkAttached
event removed (TargetPortChanged
is the alternative)SelectionChanged
event only contains the model now, use Selected
propertySelectedModels
in favor of GetSelectedModels()
, this is because we don't hold a list of selected models anymore (unnecessary)DiagramSubManager
to Behavior
, it makes more senseRegisterBehavior
now takes as an argument the behavior instance to add. No need to use Activator.CreateInstance
for something like this, as it just slows things downLinkType
enumDefaultLinkType
link optionDefaultLinkModel
link optionGetNodesRect
method from DiagramManager (use GetBounds
)GroupModel
(was only using GetNodesRect
)GetRelativePoint
to GetRelativeMousePoint
Widgets
are inside the DiagramCanvas
now
Navigator
widget to NavigatorWidget
80
and 79.9999975
). We fix this by comparing with a tolerance.NodeModel.Ports
is now a IReadOnlyList<PortModel>
BaseLinkModelExtensions
is now obsoleteBlazor.Diagrams.Core.Models.Core
to Blazor.Diagrams.Core.Geometry
Point
, Size
and Rectangle
Geometry
namespace will contain many other things related to itpointer-events
is now set to visiblePainted
instead of all
MouseUp
event bubbles up from PortModel
to NodeModel
Size
not taking into account zoom when nodes become visible againx:stopPropagation
on mousedown
, mousemove
and mouseup
to prevent the node from being movable through inputs.NavigatorWidget
not handling negative node positionsRenderLayer
<g>
elementsContainer
values didn't changeGroupModel
now inherits NodeModel
, it became possible to have nested groups, but there are still problems with the order of links between groups.Class
parameter to GroupContainer
.ResizeObserver
doesn't trigger a rerender anymore.GroupModel
instead of GroupContainer
(UI). This is because the padding is necessary to have accurate size/position in the group model directly.@key
when rendering the list of groups. Not using it caused big/weird render times.