Migrating to 2.4 from 2.3
Changed Text Clipping Behavior
As a result of the improvements and bugfixes for text measuring, a single line of text is no longer visible if the specified maximum height is smaller than its actual line height. If you don’t see any label text, make sure that the label’s height and line height is large enough to show at least one line of text at the selected font size.
Renamed Types and API Members
-
Class
PolylineEdgeRouterDatawas renamed toEdgeRouterData. -
The
CanvasComponent.fitContentViewMarginsproperty has been renamed tocontentMargins. Accordingly, theonFitContentViewMarginsChangedmethod and theFitContentViewMarginsChangedevent have been renamed toonContentMarginsChangedandContentMarginsChanged, respectively. -
The following properties of the option object parameter of the
DelegatingNodePlacerconstructor have been renamed:-
placerUpperLeftrenamed toprimaryPlacer -
placerLowerRightrenamed tosecondaryPlacer
-
Removed API Members
- The protected method
HandleInputMode.isHovering -
To customize what handle should be used for a certain query location, use the new
HandleInputMode.QueryClosestHandleevent. - The protected method
TextEditorInputMode.getTextBoxBounds -
Override
TextEditorInputMode.ensureVisibleinstead and callCanvasComponent.ensureVisiblewith the desired bounds. - The methods
LayoutData.apply,ItemCollection.provideMapper,ItemMapping.provideMapper, andContextItemMapping.provideMapperForContext -
The new
GenericLayoutDataclass is a generic implementation ofLayoutDatathat allows to pass arbitrary data to layout stages. - The options object overloads of
ICommand.canExecute,ICommand.execute, constructor ofInsetsGroupBoundsCalculator, and constructor ofSwimlaneDescriptor -
They were ambiguous with the regular invocation and therefore removed.
- The static method
IComparable.create -
The factory method was useless, because a proper
IComparablerequires state to compare the object passed to itscompareTomethod with.
Other API Changes
-
The optional
projectionparameter for theSvgExport.calculateScaleForWidthandcalculateScaleForHeightmethods has been removed. Instead, there is aprojectionproperty onSvgExport, which should be set to the same projection as the exported canvas component. -
The following methods now return a
Promise:-
The methods
MouseHoverInputMode.OnShowandShownow return a Promise that completes when the tooltip content is available and provides whether the tooltip is actually displayed. -
The
HandleInputMode.BeginDraggingmethod now returns aPromise. -
The
GraphEditorInputMode.OnLabelTextEditedmethod now returns aPromisethat completes when the text validation is done and provides whether the validation succeeded or was canceled.
-
-
The
CanvasComponent.fitContentandGraphComponent.fitGraphBoundsmethods now have an optional parameter that allows changing the viewport in an animated fashion. -
The constructor of the
TreeReductionStageclass no longer contains thecoreproperty in the extra option object parameter. It is replaced by propertycoreLayout. -
Some callbacks whose parameter types or return types erroneously accepted null now have the proper type. This might result in compile time errors in TypeScript.
-
If a returned
Promisehas no (meaningful) resulting value, this resulting value is now correctly specified asvoidinstead of any or another object. Namely, this affects the methodsLayoutExecutor.start,LayoutExecutor.stop,GraphComponent.morphLayout,GraphComponent.updateVisualAsync,GraphComponent.zoomToAnimated,Animator.animate, andSvgExport.fixViewBoxAttribute. -
The
BusRouterclass and the accompanying helper classBusRepresentationsare now located in the newly added moduleyfiles/router-bus. -
The types for enum values in the typings for
Enum.parseandEnum.getNameare nownumberinstead ofEnum.
Changes of Default Behavior
-
The
CanvasComponent.projectionproperty no longer accepts transforms with a non-zero translation component. -
The
FIT_CONTENTandFIT_GRAPH_BOUNDScommands now change the viewport in an animated fashion. -
Zooming with the mouse wheel to the center of the viewport by using
CanvasComponent’s `centerZoomEventRecognizerno longer uses theINCREASE_ZOOMandDECREASE_ZOOMcommands. -
For performance reasons, mouse events are not redispatched anymore during animated viewport transitions, except for the last frame of the animation.
-
Measuring an empty string with wrapping in
TextRenderSupport.measureTextnow returns the line height instead of 0.0. -
The provider returned by
IEdgeReconnectionPortCandidateProvider.ALL_NODE_AND_EDGE_CANDIDATESnow doesn’t return port candidates of the reconnected edge itself anymore as this led to an unstable reconnection behavior. -
The
OrganicLayoutsubstructure stylesStarSubstructureStyle.RADIAL,StarSubstructureStyle.CIRCULAR,ChainSubstructureStyle.RECTANGULAR,ChainSubstructureStyle.STRAIGHT_LINE, andCycleSubstructureStyle.CIRCULARdo no longer allow that the detected substructures are nested inside other substructures. To get the old behavior and allow nesting, new style values were added (e.g.StarSubstructureStyle.RADIAL_NESTED). -
In organic layout, the way edge grouping influences the layout of certain substructures has changed. Structures are not anymore split-up into several ones when edges of nodes in the structure have different group IDs. Now, the new node types can be used to split-up structures. If a structure contains different edge groups, the grouping is properly considered and may influence the sorting of elements within the structure. Affected substructure styles are
StarSubstructureStyle.SEPARATED_RADIAL,ParallelSubstructureStyle.RADIAL,ParallelSubstructureStyle.STRAIGHT_LINEandParallelSubstructureStyle.RECTANGULAR. -
As the
OrganicEdgeRouter.keepExistingBendsproperty now correctly obeys its definition and actually keeps the absolute coordinates of the existing bends, a new property to get the old behavior was introduced:OrganicEdgeRouter.considerExistingBends. Existing bends are considered, but their absolute coordinates are not kept. -
The following behavior change applies to class
HierarchicLayoutwith polyline edge routing style: the default value of propertyEdgeLayoutDescriptor.minimumSlopewas changed from 0.3 to 0.2 which makes the sloped segments less steep and the overall results more compact. -
The default value of the
ClassicTreeLayout.minimumLayerDistanceproperty was changed from 40.0 to 20.0 and the default value of theClassicTreeLayout.busAlignmentproperty was changed from 0.3 to 0.5. In addition, the newminimumFirstSegmentLengthandminimumLastSegmentLengthproperties may lead to different results compared to previous versions. Setting both properties to zero will neutralize their influence on the result. -
For the
DefaultNodePlacerclass that is used by theTreeLayout, the default values of thehorizontalDistanceandverticalDistanceproperties were changed from 40.0 to 20.0, and the default values of theminimumFirstSegmentLengthandminimumLastSegmentLengthproperties were changed from 0.0 to 20.0. -
The default value of the
LayeredNodePlacer.busAlignmentproperty was changed from 0.3 to 0.5.
Deprecations
-
The
CanvasComponent.animateScrollCommandsproperty has been deprecated in favor of the newanimatedViewportChangesproperty, which offers more control over viewport animations, not just the scroll commands. -
The automatically inserted WebGL uniforms
viewTransform,worldTransform, andprojectionhave been superseded byu_yf_worldToWebGL,u_yf_viewToWebGL, andu_yf_intermediateToView, respectively. -
The
OrganicLayout.clusterNodesproperty is now deprecated. It is replaced by the newOrganicLayout.clusteringPolicyproperty. To disable clustering, specifyOrganicLayoutClusteringPolicy.NONE. To enable it and use the same algorithm as before, specifyOrganicLayoutClusteringPolicy.EDGE_BETWEENNESS.