|
| 1 | + |
1 | 2 | # Changelog |
2 | 3 | All notable changes to this project will be documented in this file. |
3 | 4 |
|
4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
5 | 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
6 | 7 |
|
| 8 | +## Diagrams (3.0.0) - 2023-08-14 |
| 9 | + |
| 10 | +Finally, the new documentation website is here! |
| 11 | +Please don't hesitate to create issues for any problems or improvements. |
| 12 | +PS: I suck at design. |
| 13 | + |
| 14 | +### Added |
| 15 | + |
| 16 | +- `AddLabel` method to links to easily create `LinkLabelModel` |
| 17 | +- `AddVertex` method to links to easily create `LinkVertexModel` |
| 18 | +- `ControlledSize` property to nodes. If `true`, the node will not be registered in the `ResizeObserver` (saves a JS call). |
| 19 | +- `autoSize` argument to `SvgGroupModel` constructor |
| 20 | + |
| 21 | +### Changed |
| 22 | + |
| 23 | +- Renamed `Point.Substract` to `Subtract` (duh) |
| 24 | +- Avoid rendering link selection helper on dragged link |
| 25 | + |
| 26 | +### Fixed |
| 27 | + |
| 28 | +- `SmoothPathGenerator` not working with `LinkAnchor` |
| 29 | +- Mouse overlapping dragged link |
| 30 | +- Useless Console Logs from `GroupModel` are now removed |
| 31 | +- JS exception in `(un)oberve` methods when the element doesn't exist anymore |
| 32 | + |
| 33 | +## Diagrams (3.0.0-beta.6) - 2023-05-09 |
| 34 | + |
| 35 | +### Added |
| 36 | + |
| 37 | +- `Style` parameter to `PortRenderer` |
| 38 | +- `TargetAttached` to links, which triggers when a dragged link attaches to a target |
| 39 | + - If port snapping is enabled, it will trigger only once when you let go of the mouse |
| 40 | +- `SuspendSorting` to `Diagram` in order to suspend sorting models in each `OrderChanged` |
| 41 | + - If you know what you're doing, you could save some processing and avoid sorting everytime |
| 42 | +- `RefreshOrders` to be called after unsuspending sorting in order to sort the models again and refresh the diagram |
| 43 | + |
| 44 | +### Changed |
| 45 | + |
| 46 | +- `BaseLayer.Add` now returns the specific type given to it in argument |
| 47 | +- **[BREAKING]** CSS classes are now prefixed with `diagram-` to avoid clashes with other libraries |
| 48 | + - `diagram-group`, `diagram-node`, `diagram-link`, `diagram-port`, `diagram-link-label`, `diagram-link-vertex`, `diagram-control` |
| 49 | + |
| 50 | +### Fixed |
| 51 | + |
| 52 | +- Portless links in children not refreshing when moving the parent group |
| 53 | +- Link's `GetBounds` not returning a valid box |
| 54 | +- Port snapping choosing the first port in radius rather than the closest one |
| 55 | +- Remove `Console.WriteLine` from `KeyboardShortcutsBehavior` |
| 56 | +- Diagram overwriting `Order` when it's not zero (zero being the default int value, which we now consider as not set) |
| 57 | + |
| 58 | +## Diagrams (3.0.0-beta.5) - 2022-11-23 |
| 59 | + |
| 60 | +### Added |
| 61 | + |
| 62 | +- `AdditionalSvg` option to `DiagramCanvas` in order to render any exatra SVG content you want |
| 63 | +- `AdditionalHtml` option to `DiagramCanvas` in order to render any exatra SVG content you want |
| 64 | +- `DistanceTo` overload method to `Point` that takes x and y |
| 65 | +- `MoveAlongLine` method to `Point` |
| 66 | +- `FullPath` to `PathGeneratorResult` to represent the full path without cuts |
| 67 | +- Fallback router to Orthogonal router |
| 68 | +- Margin options to `OrthogonalRouter` |
| 69 | +- `radius` option to `StraightPathGenerator` in order to generate rounded bends |
| 70 | +- Support for custom vertices |
| 71 | +- `AutoSize` option to groups to control whether moving children resizes the group |
| 72 | + |
| 73 | +### Changed |
| 74 | + |
| 75 | +- All routers are now classes instead of functions, they inherit from the new abstract class `Router` |
| 76 | +- All path generators are now classes instead of functions, they inherit from the new abstract class `PathGenerator` |
| 77 | +- Optimize Orthogonal router by using custom A* (x5 improvement) |
| 78 | + |
| 79 | +### Removed |
| 80 | + |
| 81 | +- `Router` delegate |
| 82 | +- `PathGenerator` delegate |
| 83 | + |
| 84 | +## Diagrams (3.0.0-beta.4) - 2022-10-16 |
| 85 | + |
| 86 | +### Added |
| 87 | + |
| 88 | +- Initial version of Ordering! |
| 89 | + - Nodes, groups and links can now be ordered using the new `Order` property or `SendToFront/Back` methods |
| 90 | + - `Diagram.OrderedSelectables` returns the ordered selectables/models |
| 91 | + - `DiagramCanvas` now uses this new property to render everything |
| 92 | +- `GridSnapToCenter` option in order to snap nodes from their center instead of their top/left position (thanks to @[Jeremy Vance](https://github.com/240026763)) |
| 93 | +- More unit tests |
| 94 | + |
| 95 | +### Changed |
| 96 | + |
| 97 | +- `Groups` is not a list of groups anymore, but a layer instead (just like `Nodes` and `Links`) |
| 98 | + |
| 99 | +### Fixed |
| 100 | + |
| 101 | +- Deleting a group doesn't delete links attached to it |
| 102 | +- Deleting a group inside of a group doesn't refresh the parent group |
| 103 | +- Links not refreshing when a group's dimensions are updated directly (e.g. deleting a child) |
| 104 | +- Layers causing more refreshes than intended |
| 105 | + |
| 106 | +### Removed |
| 107 | + |
| 108 | +- All group-related methods and events from `Diagram`, please use the new layer from now on |
| 109 | + |
| 110 | +## Diagrams (3.0.0-beta.3) - 2022-09-18 |
| 111 | + |
| 112 | +### Added |
| 113 | + |
| 114 | +- Support for `LinkFactory` to return null in order to not create an ongoing link |
| 115 | +- Support for free links (no source/target required) |
| 116 | +- `PositionAnchor` which reprensents a simple plain position (mutable) |
| 117 | +- `ArrowHeadControl` to control a link's Source/Target on the fly |
| 118 | +- `attached` css class to attached links |
| 119 | + |
| 120 | +### Changed |
| 121 | + |
| 122 | +- Replace `OngoingPosition` with the new `PositionAnchor` |
| 123 | + - `BaseLinkModel.Target` will never be null anymore. An ongoing link will have a position anchor as the target |
| 124 | +- `Links.Factory` signature now takes the diagram, source (model) and the target anchor |
| 125 | +- Move `DynamicAnchor` back to `Anchors` namespace and seal all `Anchor` classes |
| 126 | + |
| 127 | +### Fixed |
| 128 | + |
| 129 | +- Links attached to links not refreshing when the others are |
| 130 | +- `LinkPathPositionProvider` not working with maxlength ratios |
| 131 | +- Deleting a link not deleting the links attached to it |
| 132 | + |
| 133 | +### Removed |
| 134 | + |
| 135 | +- `PositionProvider` argument from `ExecutableControl` for more freedom |
| 136 | +- `Id` and `Refresh` from `ILinkable` |
| 137 | +- Unused `Offset` from `Anchor` and make `Model` nullable |
| 138 | + |
| 139 | +## Diagrams (3.0.0-beta.2) - 2022-09-11 |
| 140 | + |
| 141 | +### Added |
| 142 | + |
| 143 | +- `Moved` event to Movables |
| 144 | +- `Visible` property and `VisbilityChanged` event to models |
| 145 | +- `Options.Virtualization` (of type `[Diagram]VirtualizationOptions`) for virtualization options |
| 146 | +- `PointerEnter/Leave` events for groups as well |
| 147 | +- **Experimental Link to Link** (using `LinkAnchor`) |
| 148 | + |
| 149 | +### Changed |
| 150 | + |
| 151 | +- Rename `RegisterModelComponent` to `RegisterComponent` |
| 152 | +- Rename `GetComponentForModel` to `GetComponent` |
| 153 | +- Virtualization is now handled by a behavior instead of NodeRender |
| 154 | + - This means that it works for almost all models (nodes, groups and links) |
| 155 | +- Render link labels without foreignObject in widget nor MarkupString (Thank you .NET 6) |
| 156 | +- Custom link labels only need to contain relevant content, they don't need to handle positioning anymore |
| 157 | + |
| 158 | +### Removed |
| 159 | + |
| 160 | +- `EnableVirtualization` option (see added alternative) |
| 161 | + |
| 162 | +## Diagrams (3.0.0-beta.1) - 2022-09-04 |
| 163 | + |
| 164 | +.NET 6! |
| 165 | + |
| 166 | +A lot of things changed in this version, a lot of breaking changes were introduced but I believe it was necessary. |
| 167 | +Many changes were required to make everything clearer, customizable and cleaner (code wise). |
| 168 | +I'm aiming to completely decouple the Core library from the UI, because I'm thinking of giving MAUI Diagrams a try very soon! |
| 169 | + |
| 170 | +### Added |
| 171 | + |
| 172 | +- `BlazorDiagram` class (inherits `Diagram`) to the blazor package to replace the old Core one |
| 173 | +- `BlazorDiagramOptions` that inherit from the other diagram options to add Blazor (UI) specific options |
| 174 | +- `Blazor.Diagrams.Models.SvgNodeModel` class to represent a node that needs to be rendered in the SVG layer |
| 175 | +- `GetBehavior<T>` method to `Diagram` in order to retrieve a registered behavior |
| 176 | +- `KeyboardShortcutsBehavior` class which handles keyboard shortcuts/actions: |
| 177 | + - `SetShortcut`: sets an action (`Func<Diagrambase, ValueTask>`) to be executed whenever the specified combination is pressed |
| 178 | + - `RemoveShortcut`: removes a defined action (if it exists) |
| 179 | +- `KeyboardShortcutsDefaults` containing the default shortcuts that were deleted (`DeleteSelection` and `Grouping`) |
| 180 | +- Anchors functionality: |
| 181 | + - An Anchor determines where on an element the link will connect |
| 182 | + - Instead of links requiring the source and target to be either both nodes or both ports, there is now only one `Source` and `Target` of type `Anchor` |
| 183 | + - This lets the link not worry about the details of from/to where its going, as long as the anchor provides it with its position when asked for |
| 184 | + - Current implementations: |
| 185 | + - `SinglePortAnchor`: Specifies that the connection point is a specific port (supports shape & alignment) |
| 186 | + - `ShapeIntersectionAnchor`: Specifies that the connection point is the intersection of a line with the node's shape |
| 187 | + - `DynamicAnchor`: Specifies that the connection point is one of the given positions (closest) |
| 188 | +- Virtual `IShape GetShape()` method on nodes (default `Rectangle`) and ports (default `Circle`) |
| 189 | +- `Options.LinksLayerOrder` to indicate the order of the links layer (svg for blazor) |
| 190 | +- `Options.NodesLayerOrder` to indicate the order of the nodes layer (html for blazor) |
| 191 | +- Support for SVG groups that also represent children as a hierarchy (`SvgGroupModel`) |
| 192 | +- Node renderer will now append, in addition to `node locked`, the classes `selected grouped` |
| 193 | +- `IHasBounds` and `IHasShape` interfaces to both nodes and ports |
| 194 | +- `IPositionProvider` to encapsulate how certain positions are calculated given a model |
| 195 | + - They are used for dynamic anchors and controls for now |
| 196 | + - `BoundsBasedPositionProvider` returns the position based on the bounds of the model (e.g. (0.5, 0.5) would be the center) |
| 197 | + - `ShapeAnglePositionProvider` returns the position as the point at the angle of the shape |
| 198 | + - `LinkPathPositionProvider` returns the position based on the link's path (`getPointAtLength`) |
| 199 | +- Links have a reference to `Diagram` now |
| 200 | +- `PointerEnter` and `PointerLeave` events for nodes and links for now |
| 201 | +- `GeneratedPathResult` and `Paths` to `BaseLinkModel` to always have access to the actual paths |
| 202 | +- `Controls` feature (beta): |
| 203 | + - They are things that can show up on top of nodes/links and can even be clicked to be executed |
| 204 | + - Their UI is also picked up from the registered components |
| 205 | + - `Control` designates a control that has a position and will be rendered if visible |
| 206 | + - `ExecutableControl` designates a control that has a position and will be executed when pressed (PointerDown event) |
| 207 | + - Default controls for now are: |
| 208 | + - `BoundaryControl` shows the model's boundary |
| 209 | + - `RemoveControl` shows a button that when clicked, removes the model from the diagram |
| 210 | + - `DragNewLink` shows a button that when clicked, starts a new link dragging from that node |
| 211 | +- `GridWidget` a background grid that moves with the diagram instead of being fixed like in the Snap to grid example |
| 212 | +- More unit tests |
| 213 | + |
| 214 | +### Changed |
| 215 | + |
| 216 | +- Core package changes: |
| 217 | + - Web dependency was removed from the Core package |
| 218 | + - `Diagram` is now abstract |
| 219 | + - These changes were done to decouple the core from the rendering, in the future we might have a MAUI renderer |
| 220 | +- `Diagram.GetComponentForModel` now accepts a `checkSubclasses` argument (default `true`) |
| 221 | +- Constraints now must return a `ValueTask<bool>` instead of a simple `bool` |
| 222 | +- Renamed `AllLinks` to `PortLinks` for more clarity on which links, since `Links` contains the others |
| 223 | +- Dragging links from ports will now follow the mouse at the same pace minus 5 pixels so that it doesn't go on top of the link it self or other ports |
| 224 | +- How groups are rendered |
| 225 | + - `GroupRenderer` will take care of rendering the group with the appropriate style and classes |
| 226 | + - Only `GroupNodes` is required, `GroupLinks` was deleted because all links are shown in the svg layer (with appropriate order) |
| 227 | +- `Diagram.AddGroup` will now return the added group |
| 228 | +- All `Mouse` events have been converted to `Pointer` events |
| 229 | +- `PathGenerator` now return `SvgPath` instead of just strings |
| 230 | +- `NavigatorWidget` was rewritten to be faster, lighter, WORKING and customizable |
| 231 | + - It now can also take the shape of the nodes into account (rect and ellipse for now) |
| 232 | + |
| 233 | +### Fixed |
| 234 | + |
| 235 | +- Virtualization throwing a JSException (#155) |
| 236 | +- Ports not rendering correctly because of the missing `@key` (#220) |
| 237 | +- Link not refreshing when a new vertex is created, which was showing out of link |
| 238 | + |
| 239 | +### Removed |
| 240 | + |
| 241 | +- `DefaultNodeComponent` and `DefaultLinkComponent` options (see `GetComponentForModel` changes) |
| 242 | +- `RenderLayer` from the Core package and all its usage |
| 243 | +- `DeleteSelectionBehavior` since there is a new keyboard shortcuts system |
| 244 | +- `GroupingBehavior` since there is a new keyboard shortcuts system |
| 245 | +- `BaseLinkModelExtensions` since it was Obselete |
| 246 | +- Unnecessary port refreshes when dragging a link ends or when link snapping |
| 247 | +- `ShapeDefiner` delegate and constructor arguments on nodes since delegates can't be serialized |
| 248 | +- `TouchX` events |
| 249 | + |
7 | 250 | ## Diagrams (2.1.6) - 2021-10-31 |
8 | 251 |
|
9 | 252 | ### Fixed |
|
0 commit comments