documentationfor yFiles for HTML 2.6

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 PolylineEdgeRouterData was renamed to EdgeRouterData.
  • The CanvasComponent.fitContentViewMargins property has been renamed to contentMargins. Accordingly, the onFitContentViewMarginsChanged method and the FitContentViewMarginsChanged event have been renamed to onContentMarginsChanged and ContentMarginsChanged, respectively.
  • The following properties of the option object parameter of the DelegatingNodePlacer constructor have been renamed:
    • placerUpperLeft renamed to primaryPlacer
    • placerLowerRight renamed to secondaryPlacer

Removed API Members

The protected method HandleInputMode.isHovering
To customize what handle should be used for a certain query location, use the new HandleInputMode.QueryClosestHandle event.
The protected method TextEditorInputMode.getTextBoxBounds
Override TextEditorInputMode.ensureVisible instead and call CanvasComponent.ensureVisible with the desired bounds.
The methods LayoutData.apply, ItemCollection.provideMapper, ItemMapping.provideMapper, and ContextItemMapping.provideMapperForContext
The new GenericLayoutData class is a generic implementation of LayoutData that allows to pass arbitrary data to layout stages.
The options object overloads of ICommand.canExecute, ICommand.execute, constructor of InsetsGroupBoundsCalculator, and constructor of SwimlaneDescriptor
They were ambiguous with the regular invocation and therefore removed.
The static method IComparable.create
The factory method was useless, because a proper IComparable requires state to compare the object passed to its compareTo method with.

Other API Changes

  • The optional projection parameter for the SvgExport.calculateScaleForWidth and calculateScaleForHeight methods has been removed. Instead, there is a projection property on SvgExport, which should be set to the same projection as the exported canvas component.
  • The following methods now return a Promise:
    • The methods MouseHoverInputMode.OnShow and Show now return a Promise that completes when the tooltip content is available and provides whether the tooltip is actually displayed.
    • The HandleInputMode.BeginDragging method now returns a Promise.
    • The GraphEditorInputMode.OnLabelTextEdited method now returns a Promise that completes when the text validation is done and provides whether the validation succeeded or was canceled.
  • The CanvasComponent.fitContent and GraphComponent.fitGraphBounds methods now have an optional parameter that allows changing the viewport in an animated fashion.
  • The constructor of the TreeReductionStage class no longer contains the core property in the extra option object parameter. It is replaced by property coreLayout.
  • 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 Promise has no (meaningful) resulting value, this resulting value is now correctly specified as void instead of any or another object. Namely, this affects the methods LayoutExecutor.start, LayoutExecutor.stop, GraphComponent.morphLayout, GraphComponent.updateVisualAsync, GraphComponent.zoomToAnimated, Animator.animate, and SvgExport.fixViewBoxAttribute.
  • The BusRouter class and the accompanying helper class BusRepresentations are now located in the newly added module yfiles/router-bus.
  • The types for enum values in the typings for Enum.parse and Enum.getName are now number instead of Enum.

Changes of Default Behavior

  • The CanvasComponent.projection property no longer accepts transforms with a non-zero translation component.
  • The FIT_CONTENT and FIT_GRAPH_BOUNDS commands now change the viewport in an animated fashion.
  • Zooming with the mouse wheel to the center of the viewport by using CanvasComponent’s `centerZoomEventRecognizer no longer uses the INCREASE_ZOOM and DECREASE_ZOOM commands.
  • 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.measureText now returns the line height instead of 0.0.
  • The provider returned by IEdgeReconnectionPortCandidateProvider.ALL_NODE_AND_EDGE_CANDIDATES now doesn’t return port candidates of the reconnected edge itself anymore as this led to an unstable reconnection behavior.
  • The OrganicLayout substructure styles StarSubstructureStyle.RADIAL, StarSubstructureStyle.CIRCULAR, ChainSubstructureStyle.RECTANGULAR, ChainSubstructureStyle.STRAIGHT_LINE, and CycleSubstructureStyle.CIRCULAR do 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_LINE and ParallelSubstructureStyle.RECTANGULAR.
  • As the OrganicEdgeRouter.keepExistingBends property 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 HierarchicLayout with polyline edge routing style: the default value of property EdgeLayoutDescriptor.minimumSlope was 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.minimumLayerDistance property was changed from 40.0 to 20.0 and the default value of the ClassicTreeLayout.busAlignment property was changed from 0.3 to 0.5. In addition, the new minimumFirstSegmentLength and minimumLastSegmentLength properties may lead to different results compared to previous versions. Setting both properties to zero will neutralize their influence on the result.
  • For the DefaultNodePlacer class that is used by the TreeLayout, the default values of the horizontalDistance and verticalDistance properties were changed from 40.0 to 20.0, and the default values of the minimumFirstSegmentLength and minimumLastSegmentLength properties were changed from 0.0 to 20.0.
  • The default value of the LayeredNodePlacer.busAlignment property was changed from 0.3 to 0.5.

Deprecations

  • The CanvasComponent.animateScrollCommands property has been deprecated in favor of the new animatedViewportChanges property, which offers more control over viewport animations, not just the scroll commands.
  • The automatically inserted WebGL uniforms viewTransform, worldTransform, and projection have been superseded by u_yf_worldToWebGL, u_yf_viewToWebGL, and u_yf_intermediateToView, respectively.
  • The OrganicLayout.clusterNodes property is now deprecated. It is replaced by the new OrganicLayout.clusteringPolicy property. To disable clustering, specify OrganicLayoutClusteringPolicy.NONE. To enable it and use the same algorithm as before, specify OrganicLayoutClusteringPolicy.EDGE_BETWEENNESS.