yfiles-typeinfo.js and Development Mode
The type checks and graph inspection tools at runtime, that were previously provided by the file
ide-support/yfiles-typeinfo.js
, are now included in the development mode of the
yFiles for HTML library. We no longer recommend using the stand-alone yfiles-typeinfo.js
file.
To migrate:
- Don’t load the file
`yfiles-typeinfo.js
anymore, e.g., remove the<script>
tag or the entry in your webpack config, etc. - Use the
dev-lib
library instead of the regular library located in thelib
folder.
See the section about the development mode for more details.
The file can still be found in tools/prepare-package/yfiles-typeinfo.js
.
The New Graph Builder Classes
The GraphBuilder
and TreeBuilder
classes have been replaced in the library with more powerful but incompatible builder classes.
AdjacentNodesGraphBuilder
was replaced with AdjacencyGraphBuilder
.
Drop-in replacement classes that resemble the API of the previous GraphBuilder
, TreeBuilder
, and AdjacentNodesGraphBuilder
,
named SimpleGraphBuilder
, SimpleTreeBuilder
, and SimpleAdjacentNodesGraphBuilder
, are available as demo code in /utils/
.
Changes When using a Projection
The view coordinate system now includes a projection. The projection is an additional transformation that transforms the former view coordinate system by the projection matrix, e.g., to achieve an isometric perspective. For customers who do not use a projection, i.e., an identity matrix as projection, nothing will change. However, when the (former) view coordinate system has been used to render parts of the visualization in a zoom-invariant manner, the equivalent now is called the intermediate coordinate system. The view coordinate system is still necessary when coordinates relative to the component are needed, e.g., for tooltips or a context menu.
When using the new projections feature, the CanvasComponent.contentRect
property no longer has an effect on scrollbars
or the GraphComponent.fitGraphBounds
method.
SvgExport.viewWidth
and SvgExport.viewHeight
are no longer used for the exported image dimensions when using a
projection. If you need to know the size of the resulting image, this can be obtained from the image after export.
Visuals that are rendered in view coordinates relative to the viewport may appear in a different location when exporting an image.
The CanvasComponent
ignores its ViewportLimiter when using projections.
Renamed Types and API Members
- Class
TransitiveClosureEdge
was renamed toTransitiveEdge
. - The overloaded method
IPathGeometry.getTangent(number, number)
with index and ratio was renamed togetTangentForSegment
. The corresponding methodsEdgeStyleBase.getTangent(IEdge, number, number)
andGeneralPath.getTangent(number, number)
were renamed as well. This makes overriding those methods much easier. - Also, to make overriding easier, the overloaded methods
GraphModelManager.getCanvasObjectGroup
now have distinguishable names, namelygetNodeCanvasObjectGroup
,getEdgeCanvasObjectGroup
, etc. - The
ModelManager.unInstall
method has been renamed to the canonical nameuninstall
. - Some methods of the
YList
class have been replaced and are now named consistent with the new methods ofIList
and the corresponding methods of JavaScript arrays. Note thatYList
is a special-purpose list implementation that is typically only used when implementing a layout customization. In detail,pop
has been renamed toshift
,popLast
has been renamed topop
.
Removed API Members
- The
KMeansClusteringDistanceMetric
enum - It should be replaced with the
DistanceMetric
enum which has the same members. - The static methods
createDelegate
anddynamicInvoke
ofdelegate
- They were never intended to be part of the public API and didn’t work as intended in all cases.
- The methods
getPreferredSize
andgetPreferredSizeCore
of(String)TemplateNodeStyle
,(String)TemplatePortStyle
, and the corresponding renderer implementations - They were never used by the library and returned no meaningful value.
Other API Changes
- The
ToolTip
class now has a constructor without parameters to make custom implementations easier. - The
NodeReshapeSnapResultProvider.getSnapLines
method now takesCollectSnapResultsEventArgs
as additional parameter. - The methods
SnapResults.createResizeSnapResult
,NodeReshapeSnapResultProvider.addSnaplineSnapResult
,NodeReshapeSnapResultProvider.addGridLineSnapResult
, andNodeReshapeSnapResultProvider.addSameSizeSnapResult
now take aPoint
instead of anumber
as a delta parameter. Depending on theSnapLineOrientation
,x
ory
of thePoint
needs to be set to0
to get the same results. - The
HierarchicalClusteringResult.dendrogramRoot
property can now returnnull
if the result has been obtained from an empty graph. - The singleton returned by the static
DefaultEdgePathCropper.INSTANCE
property has been moved to theIEdgePathCropper.INSTANCE
property. - The method
CanvasComponent.createInputModeContext
is protected again, after having been made public accidentally previously. - The methods
createNodeMapper
andcreateEdgeMapper
ofYGraphAdapter
are no longer interchanged. Previously,createNodeMapper
created anIMapper
for keys of typeIEdge
instead ofINode
and vice versa. - The
YList.push
method has been changed to be in line withIList.push
. It now returns the length of the list instead of aListCell
.
Changes of Default Behavior
- The
GraphOverviewComponent
is now rendered with HTML Canvas instead of SVG by default. This results in better performance and was always the intended behavior. You can switch to SVG rendering with theGraphOverviewComponent.renderMode
property. - By default, the
NavigationInputMode.adjustContentRect
method doesn’t fit the graph bounds into the viewport anymore. Also,NavigationInputMode
class doesn’t fit the content after expand and collapse operations anymore if anAutoGroupNodeAlignmentPolicy
other thanNONE
is used. To restore this behavior, enableNavigationInputMode.fitContentAfterGroupActions
. - The
ViewportLimiter
no longer jumps to the limited viewports if the current viewport is outside the limited area. This behavior can be restored by setting theViewportLimiter.limitingPolicy
property toLimitingPolicy.STRICT
. - The default value of the
MoveViewportInputMode.pinchZoomThreshold
property has been changed from100
to50
to prevent pinch gestures from stopping periodically. - The
GraphCentrality
andClosenessCentrality
analysis algorithms now calculate the centrality individually per component instead of returning a centrality value of0.0
for nodes in graphs that are not connected. - If the mapper property of
HierarchicLayoutData.edgeDirectedness
is directly accessed (and not explicitly set), its default for unset values is now1.0
instead of0.0
. That means that such edges are now treated as directed instead of undirected. - For the
rootPlacements
,subtreeRoutingPolicies
, andsubtreeAspectRatio
properties of theAspectRatioTreeLayoutData
class, the type of the mapped values has been madenullable
. Fornull
or unset values, the settings on theAspectRatioTreeLayout
will now be taken. This is the documented behavior, though. - The value of the read-only property
EdgeRouter.partition
is now null after applying the routing algorithm. It is only intended to be used during the execution. Previously, it was cached, even though the documentation stated otherwise.
Deprecations
- The
LabelStyleBase.createLayoutTransform
method has a new overload with the render context as first parameter to take non-identity projections of the correspondingCanvasComponent
into consideration. Without this context, this method cannot respect a projection and, consequently, the overload with the previous signature is now deprecated. - The properties
EdgeRouter.polylineRouting
,EdgeRouter.preferredPolylineSegmentLength
andEdgeRouter.maximumPolylineSegmentRatio
are now deprecated. To enable polyline routing, specifyEdgeRouterEdgeRoutingStyle.OCTILINEAR
as routing style viaEdgeLayoutDescriptor.routingStyle
. The other two properties are also replaced by respective properties on theEdgeLayoutDescriptor
class.