Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
0.7.0 - 2024-01-10
Added
Added more fine grained options for controlling how the user can interact with the grapheditor
“select” attribute to control the default selection behaviour (default:
multiple; other:none,single)“node-click” attribute to control the default node click behaviour (default:
select; other:none,link)“node-drag” attribute to control the default node drag behaviour (default:
move; other:none,link)“edge-drag” attribute to control the default edge drag behaviour (default:
link; other:none)“background-drag” attribute to control the default node drag behaviour (default:
move; other:none,select,zoom,custom)“brushdrag” and “brush” events. Used when “background-drag” is set to
select,zoomorcustomAdded flag in text components to mark them as draggable (defaults to true)
Added padding parameter to
zoomToBoxto allow changing or removing the added paddingAll relevant interfaces and functions are now (re)exported at top level
Deprecated
Deprecated “mode” attribute on the network-graph html node. See the list of added attributes that allow more fine grained control
Passing JSON via HTML attributes with nonstandard
'as quote is deprecated.
Deprecated:nodes="[{'id': 1, 'x': 0, 'y': 0}]"(alsoedgesandclasses)
Replace with:nodes='[{"id": 1, "x": 0, "y": 0}]'
Incompatible changes
Updated to TypeScript 4.6 compiler
Updated D3 dependecies to version 7. Please carfeully read about the changes in version 6 and 7 (changelog) if your code uses D3 functions.
Removed the
styleslot in the default template as it did not work to isolate style anywayRemoved deprecated
rotationproperty of edge markersPartially removed support for deprecated “mode” attribute on the network-graph html node
Removed event, getter and setter associated with the “mode” attribute
Removed deprecated
styleslotWrapping text now generates less data-* attributes in the dom and is faster when the text does not need to be wrapped again
Wrapping text now re-wraps text when (some) style attributes change
Node and edge IDs now use a
data-idattribute without any prefixes. CSS selectors relying on matching nodes by ID need to be changed (usegetSingleNodeSelectionorgetSingleEdgeSelectionif possible)
0.6.2 - 2021-09-05
Added
Option to scale text by specifying a scale in the
data-line-wrapsattributeGroupingManager.getAllRegisteredGroupshelper function
Incompatible changes
All wrapped text elements will now have a transform origin set that allows scaling them to be more intuitive. This may break some css layouts. See “Api > Text Wrapping >
resetTextTransform” for more information on how this is calculated.Specified text height is now always interpreted as maximum allowed text height in all wrapping modes
0.6.1 - 2020-11-08
Added
Added
svg-templateattribute to specify a css selector of a html template containing the svg to loadAdded isolation of grapheditor styles when loading the svg from an html template
Added ability to vertically center wrapped text (with
data-text-center-yattribute)Added
data-wrap-linesattribute for wrapping text in lines with different max widthsAdded ability to wrap text into more complex shapes (e.g. circles) with the
data-wrap-linesattribute
Refactored
Refactored text wrapping code to cause less dom updates
Fixed
Text wrapping only worked if the
texttag also had atextcss class. Now alltexttags will be wrapped automatically.
0.6.0 - 2020-7-23
Added
Added ResizeManager that allows node resizing via api and drag and drop
Added ‘noderesize’ event fired when resizing a node with the resize manager
Added ‘svginitialized’ event when the grapheditor initializes a new svg
Added methods
getSVG,getGraphGroup,getNodesGroup,getEdgesGroup,getEdgeSelectionandgetDraggedEdgeSelectionto grapheditorAdded utility methods
removeAllChildNodesandcopyTemplateSelectionIntoNoden util to help working with static templatesAdded public
updateEdgeGroupClassesto only update the classes of edges
Fixed
Fixed removeEdge not working with string ids
Fixed cancelling ‘edgeremove’ event leaving the original edge with the
ghostclass untilcompleteRenderwas calledPotentially fixed removing edge throwing an error when the edge is removed from the object cache
0.5.4 - 2020-04-30
Fixed
Fixed build errors when using the package in a typescript project
0.5.3 - 2020-04-30
Known Issue: this version was compiled using typescript 3.8!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
This will be the last release to include this warning in the changelog!
Added
Added complete render flags to some GroupBehaviour callbacks and the node movement information
Added
typesVersionsfield to package.json to get a warning when using this package with an incompatible typescript version
Fixed
Fixed loading templates sometimes crashing on firefox
Fixed target detection for dragged edges sometimes not working correctly
Fixed group drag and drop checking join conditions for the wrong node
0.5.2 - 2020-03-08
Known Issue: this version was compiled using typescript 3.7!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
Added
Added
getNodeBBoxto get the bounding box of a node
Fixed
Fixed adding or removing edges or nodes with the api not always triggering an event
Fixed the result of
calculateBoundingRectsometimes having negative width or heightFixed
GroupBehaviourinterface not allowing additional propertiesFixed LinkHandles of a circle not taking the circle center into account
0.5.1 - 2020-02-26
Known Issue: this version was compiled using typescript 3.7!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
Fixed
Fixed error when dragging a edge without createdFrom set
Fixed
updateGraphPositionsnot declared as public
0.5.0 - 2020-02-25
Known Issue: this version was compiled using typescript 3.7!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
Added
Added
currentViewWindowto get the currently visible area of the graphAdded
currentViewWindowto the ‘zoomchange’ eventAdded ‘render’ event and
onBeforeCompleteRendercallbackAdded ‘edgetextdragstart’ and ‘edgetextdragend’ events
Added absolute positioning of elements on an edge path with
absolutePositionOnLineAdded bidirectional/non-directional edges
Added explicit
dragHandlesfor edges (interfaceEdgeDragHandle)
Fixed
Fixed old node content staying when node type was changed
Fixed
dragendevent listed asdragstartin the documentationFixed null pointer when multiline textwrapping ends with a single character
Incompatible changes
Interface
PathPositionRotationAndScalehas a new attributeabsolutePositionOnLine(affecting edge markers, text components and LinkDragHandles)Interface Edge has two new attributes:
dragHandlesandisBidirectional
0.4.1 - 2020-02-11
Known Issue: this version was compiled using typescript 3.7!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
Added
Added
currentZoomTransformto get the current zoom transform of the graphAdded
zoomToBoxto zoom to a specific area of the graphAdded ‘zoomchange’ events to the grapheditor
Added
getGraphPointFromClientCoordinatesas inverse ofgetClientPointFromGraphCoordinatesAdded ‘nodedragstart’ and ‘nodedragend’ events
Added public
updateNodeClassesto only update the classes of nodes
Fixed
Fixed wrong imports depending on ‘d3’ instead of ‘d3-selection’
0.4.0 - 2020-01-28
Known Issue: this version was compiled using typescript 3.7!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
Added
Added more specific typing information
The order of nodes and edges in the dom is now the same as the order in the node or edge list
Added
getNodesFromPointandgetClientPointFromGraphCoordinatesto get a list of nodes that overlap a certain pointAdded
moveNodeto move a node with all special node movement logicAdded Groups and a GroupingManager
Added GroupBehaviour for changing how a group interacts with its own and other nodes
Added
onBeforeNodeMoveNodeMovementInformation used when a node movesAdded NodeDropZones for groups to specify where a dragged node should be placed
Added util module to collect small interfaces and functions
Added
Rectinterface to utilAdded
calculateBoundingRectthat calculates a bounding box of a bunch of rects
Incompatible changes
Changed the type of
Node.typefromanytostring
0.3.1 - 2019-12-02
Known Issue: this version was compiled using typescript 3.7!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
Added
Added ‘backgroundclick’ event
Added api for node selection (
selectNode,deselectNode,changeSelectedandselected)
Fixed
Fixed all possible classes in the
classesattribute of thenetwork-graphbeeing applied to nodes/edges ifsetNodeClass/setEdgeClasswas nullFixed marker for
MarkerStartnot beeing rotated 180° like the line attachement pointFixed
removeEdgenot working correctly with edges with explicit id
0.3.0 - 2019-11-22
Known Issue: this version was compiled using typescript 3.7!
The resulting .d.ts are only compatible with typescript versions >= 3.6. See typescript 3.7 release notes for more information.
Added
Added
Edge.markerStartAdded
data-line-attachement-pointto marker templates to specify where an edge attaches to the marker if the marker is an end markerAdded dynamic templates for Nodes, Markers,TextComponents and LinkHandles
Added dynamic template registry
Added static template registry
Consolidated positioning for all objects placed along an edge (markers and text components)
Added rotation to text components
Added rotation to link handles
Added
EdgePathGeneratorandEdgePathGeneratorRegistry
Deprecated
Deprecated
Marker.rotate. UseMarker.absoluteRotationandMarker.relativeRotationinstead.
Incompatible changes
Removed
Marker.lineOffset. Usedata-line-attachement-pointin marker template instead.Removed
TextComponent.class. Use custom dynamic templates instead.All text components are wrapped in a
<g>element. This will break some css styles!
0.2.0 - 2019-10-27
Added
Use slots instead of html templates to load custom styles and templates into grapheditor
Templating now uses standard svg groups in the
defssection of the provided svg.Add ability to template link handles with marker templates
Add default marker template (used as link handle template)
Fixed
attributePathtext components not working correctly
Incompatible changes
Removed templating using html templates (old template content can be reused)
All link handles are now rendered using marker templates
Changed
template-typeattribute of templates todata-template-typeThe
network-graphtag can no longer be empty it must at least contain asvgtag for thegraphslot
0.1.3 - 2019-08-22
Added
originalEdgein detail of edgedrop for edges that have createdFrom set
Fixed
Dragged edge not removed if edge remove event was cancelled
Click event key not found in newest firefox
zoom beahviour set every render
getEdgesByTargetalways returning empty setFix documentation dependencies to specific versions and add Pipfile for use with pipenv
Update dependencies
0.1.2 - 2019-07-30
Added
Changed single d3 dependency to dependencys on d3 modules
Fixed
Fixed display bugs when running in Firefox
0.1.1 - 2019-06-22
Added
Use regex to determine word boundarys when wrapping text (before only spaces were valid word boundarys for texwrapping)
Use ResizeObserver to detect resizes if available (if unavailable calculate current size before zooming to bounding box)
New
edgedropevent to enable creating nodes where an edge was dropped in the voidAdd
eventSourceto all custom events to distinguish events by how they were triggered (possible values:INTERNAL,API,USER_INTERACTION)Add
clickEventKeyattribute toMarkerclass (used to setdata-clickattribute in html)Click events
edgeclickandnodeclicknow search the whole path (only inside the specific svg group) for adata-clickattribute to use as keyAdd textcomponents to edge to display text in an edge with text wrapping and drag behaviour for manual positioning
Add
edgetextpositionchangeevents used when the user drags a text componentUpdate d3 to >5.9 to use join
Add
calculateLinkHandlesForEdgecallback to customise where edges attach to nodesAllow dynamic propertys with
data-content,data-fill,data-strokeanddata-hrefattributes
Fixed
Grapheditor fails updating graph if an edge with a source or target pointing to a nonexisting node is present
0.1.0 - 2019-04-11
First beta version.
Fixed
Wrapping multiline text failing in firefox browser (stackoverflow “How to get the width of an SVG tspan element”)
Textwrapping sometimes producing infinite loops.
0.0.3 - 2019-03-04
Added
updateTextElementsfunction to update and reflow text withforceparametergetNode,getEdge,getEdgesBySourceandgetEdgesByTargetfunctions in grapheditor
Fixed
First multiline textwrap not rendering the text
scaleRelativenot affectinglineOffsetposition ofedge.markerEnd
0.0.2 - 2019-02-25
Added
LinkHandles for
pathandpolygonelementsscaleRelative attribute in
Markerfor scaling relative to stroke-width of edge pathmarkerEnd attribute in
Edgefor better arrowheadslineOffset attribute in
Markerfor offsetting markerEnd from the end of the edge path
0.0.1 - 2019-02-15
Added
Initial webcomponent
Documentation