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.
0.7.0 - 2024-01-10
- 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
,zoom
orcustom
- Added flag in text components to mark them as draggable (defaults to true)
- Added padding parameter to
zoomToBox
to allow changing or removing the added padding - All relevant interfaces and functions are now (re)exported at top level
- 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}]"
(alsoedges
andclasses
)
Replace with:nodes='[{"id": 1, "x": 0, "y": 0}]'
- 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
style
slot in the default template as it did not work to isolate style anyway - Removed deprecated
rotation
property of edge markers - Partially removed support for deprecated "mode" attribute on the network-graph html node
- Removed event, getter and setter associated with the "mode" attribute
- Removed deprecated
style
slot - Wrapping 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-id
attribute without any prefixes. CSS selectors relying on matching nodes by ID need to be changed (usegetSingleNodeSelection
orgetSingleEdgeSelection
if possible)
0.6.2 - 2021-09-05
- Option to scale text by specifying a scale in the
data-line-wraps
attribute GroupingManager.getAllRegisteredGroups
helper function
- 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
svg-template
attribute to specify a css selector of a html template containing the svg to load - Added isolation of grapheditor styles when loading the svg from an html template
- Added ability to vertically center wrapped text (with
data-text-center-y
attribute) - Added
data-wrap-lines
attribute for wrapping text in lines with different max widths - Added ability to wrap text into more complex shapes (e.g. circles) with the
data-wrap-lines
attribute
- Refactored text wrapping code to cause less dom updates
- Text wrapping only worked if the
text
tag also had atext
css class. Now alltext
tags will be wrapped automatically.
0.6.0 - 2020-7-23
- 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
,getEdgeSelection
andgetDraggedEdgeSelection
to grapheditor - Added utility methods
removeAllChildNodes
andcopyTemplateSelectionIntoNode
n util to help working with static templates - Added public
updateEdgeGroupClasses
to only update the classes of edges
- Fixed removeEdge not working with string ids
- Fixed cancelling 'edgeremove' event leaving the original edge with the
ghost
class untilcompleteRender
was called - Potentially fixed removing edge throwing an error when the edge is removed from the object cache
0.5.4 - 2020-04-30
- 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 complete render flags to some GroupBehaviour callbacks and the node movement information
- Added
typesVersions
field to package.json to get a warning when using this package with an incompatible typescript version
- 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
getNodeBBox
to get the bounding box of a node
- Fixed adding or removing edges or nodes with the api not always triggering an event
- Fixed the result of
calculateBoundingRect
sometimes having negative width or height - Fixed
GroupBehaviour
interface not allowing additional properties - Fixed 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 error when dragging a edge without createdFrom set
- Fixed
updateGraphPositions
not 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
currentViewWindow
to get the currently visible area of the graph - Added
currentViewWindow
to the 'zoomchange' event - Added 'render' event and
onBeforeCompleteRender
callback - Added 'edgetextdragstart' and 'edgetextdragend' events
- Added absolute positioning of elements on an edge path with
absolutePositionOnLine
- Added bidirectional/non-directional edges
- Added explicit
dragHandles
for edges (interfaceEdgeDragHandle
)
- Fixed old node content staying when node type was changed
- Fixed
dragend
event listed asdragstart
in the documentation - Fixed null pointer when multiline textwrapping ends with a single character
- Interface
PathPositionRotationAndScale
has a new attributeabsolutePositionOnLine
(affecting edge markers, text components and LinkDragHandles) - Interface Edge has two new attributes:
dragHandles
andisBidirectional
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
currentZoomTransform
to get the current zoom transform of the graph - Added
zoomToBox
to zoom to a specific area of the graph - Added 'zoomchange' events to the grapheditor
- Added
getGraphPointFromClientCoordinates
as inverse ofgetClientPointFromGraphCoordinates
- Added 'nodedragstart' and 'nodedragend' events
- Added public
updateNodeClasses
to only update the classes of nodes
- 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 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
getNodesFromPoint
andgetClientPointFromGraphCoordinates
to get a list of nodes that overlap a certain point - Added
moveNode
to move a node with all special node movement logic - Added Groups and a GroupingManager
- Added GroupBehaviour for changing how a group interacts with its own and other nodes
- Added
onBeforeNodeMove
NodeMovementInformation used when a node moves - Added NodeDropZones for groups to specify where a dragged node should be placed
- Added util module to collect small interfaces and functions
- Added
Rect
interface to util - Added
calculateBoundingRect
that calculates a bounding box of a bunch of rects
- Changed the type of
Node.type
fromany
tostring
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 'backgroundclick' event
- Added api for node selection (
selectNode
,deselectNode
,changeSelected
andselected
)
- Fixed all possible classes in the
classes
attribute of thenetwork-graph
beeing applied to nodes/edges ifsetNodeClass
/setEdgeClass
was null - Fixed marker for
MarkerStart
not beeing rotated 180° like the line attachement point - Fixed
removeEdge
not 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
Edge.markerStart
- Added
data-line-attachement-point
to marker templates to specify where an edge attaches to the marker if the marker is an end marker - Added 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
EdgePathGenerator
andEdgePathGeneratorRegistry
- Deprecated
Marker.rotate
. UseMarker.absoluteRotation
andMarker.relativeRotation
instead.
- Removed
Marker.lineOffset
. Usedata-line-attachement-point
in 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
- Use slots instead of html templates to load custom styles and templates into grapheditor
- Templating now uses standard svg groups in the
defs
section of the provided svg. - Add ability to template link handles with marker templates
- Add default marker template (used as link handle template)
attributePath
text components not working correctly
- Removed templating using html templates (old template content can be reused)
- All link handles are now rendered using marker templates
- Changed
template-type
attribute of templates todata-template-type
- The
network-graph
tag can no longer be empty it must at least contain asvg
tag for thegraph
slot
0.1.3 - 2019-08-22
originalEdge
in detail of edgedrop for edges that have createdFrom set
- Dragged edge not removed if edge remove event was cancelled
- Click event key not found in newest firefox
- zoom beahviour set every render
getEdgesByTarget
always returning empty set- Fix documentation dependencies to specific versions and add Pipfile for use with pipenv
- Update dependencies
0.1.2 - 2019-07-30
- Changed single d3 dependency to dependencys on d3 modules
- Fixed display bugs when running in Firefox
0.1.1 - 2019-06-22
- 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
edgedrop
event to enable creating nodes where an edge was dropped in the void - Add
eventSource
to all custom events to distinguish events by how they were triggered (possible values:INTERNAL
,API
,USER_INTERACTION
) - Add
clickEventKey
attribute toMarker
class (used to setdata-click
attribute in html) - Click events
edgeclick
andnodeclick
now search the whole path (only inside the specific svg group) for adata-click
attribute to use as key - Add textcomponents to edge to display text in an edge with text wrapping and drag behaviour for manual positioning
- Add
edgetextpositionchange
events used when the user drags a text component - Update d3 to >5.9 to use join
- Add
calculateLinkHandlesForEdge
callback to customise where edges attach to nodes - Allow dynamic propertys with
data-content
,data-fill
,data-stroke
anddata-href
attributes
- 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.
- 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
updateTextElements
function to update and reflow text withforce
parametergetNode
,getEdge
,getEdgesBySource
andgetEdgesByTarget
functions in grapheditor
- First multiline textwrap not rendering the text
scaleRelative
not affectinglineOffset
position ofedge.markerEnd
0.0.2 - 2019-02-25
- LinkHandles for
path
andpolygon
elements - scaleRelative attribute in
Marker
for scaling relative to stroke-width of edge path - markerEnd attribute in
Edge
for better arrowheads - lineOffset attribute in
Marker
for offsetting markerEnd from the end of the edge path
0.0.1 - 2019-02-15
- Initial webcomponent
- Documentation