Migrating to 3.1 from 3.0

yFiles for HTML 3.1 is an incremental release that builds on the 3.0 API baseline with extended layout configuration options, rendering improvements, and an enhanced modularization.

This release provides a range of new features and improvements, along with bugfixes across the library. However, this also results in incompatible changes for existing projects. This chapter describes of the most significant changes in more detail and helps with the migration. For a complete list of changes, refer to the changelog.

  • The IRenderContext has a new method setConnectedCallback. Wrapping implementations should delegate the call to the wrapped context.

  • IEnumerable.concat is now more strict regarding the types of rest arguments. Add a type parameter when mixed parameter types cannot be inferred, automatically.

  • The events CanvasComponent.viewport-changed and GraphComponent.current-item-changed now use plain EventArgs instead of PropertyChangedEventArgs, since these events each affect only a single property.

  • WebGLGroupNodeStyle.contentAreaPadding is now of type Insets instead of a plain number.

  • The return value of DropInputMode.adjustEffect method has been changed from boolean to void. This method no longer determines if the mode will handle drag or drop events but only changes the drag/drop effect of given event args as its name implies. DropInputMode.acceptDrag method now determines if the mode will handle drag and drop events.

  • The CanvasComponent.lastInputEvent property has been renamed to lastPointerEvent to better reflect its type. In addition, the CanvasComponent.lastEventLocation has been removed since the location property of lastPointerEvent provides the same value.

  • The new LassoRenderTag class will be passed as render tag for the lasso path renderer of the LassoSelectionInputMode class.

  • The ContextMenuInputMode internally now uses the PopoverManager to display the context-menu popover. The contextMenuParentElement property has been removed, instead use PopoverManager.ParentElement.

  • The EdgeLabelCandidates.addDiscreteCandidates method uses DiscreteEdgeLabelPositions enum to specify label positions. The value CENTERED was removed from this enum; use the existing value CENTER instead.

  • The new RadialGradient.radius property replaces the properties radiusX and radiusY. This corresponds to the underlying SVG element <radialGradient>, which also has only a single r attribute for the radius. Previously, radiusX was used as the single radius and radiusY had no effect.

  • The IncrementalNodeHint member is now a class and no longer an enum. The available hint values have been changed as follows:

    • LAYER_INCREMENTALLY has been replaced by INCREMENTAL.

    • SEQUENCE_INCREMENTALLY has been replaced by INCREMENTAL_WITH_LAYERS_FROM_SKETCH.

    • NONE has been replaced by KEEP_RELATIVE_ORDER. It is no longer the default value for nodes without a hint.

  • The IncrementalEdgeHint values have been changed as follows:

    • NONE has been replaced by KEEP_RELATIVE_ORDER.

    • SEQUENCE_INCREMENTALLY has been replaced by INCREMENTAL.

  • Renamed ToolTipInputMode.show to ToolTipInputMode.open.

  • Moved and renamed ToolTipInputMode.adjustTooltipPosition method to PopoverManager.getDocumentLimitedLocation.

  • Moved and renamed ToolTipInputMode.toolTipParentElement method to PopoverManager.defaultParentElement or the specific PopoverDescriptor.parentElement.

  • Renamed GroupBoundsCalculator to LayoutGroupBoundsCalculator to match the implementing ILayoutGroupBoundsCalculator interface.

  • The unused protected constructors of SerializationNotSupportedException and DeserializationNotSupportedException have been removed since they were based on an obsolete constructor of the base class.

  • The selection-model-changed event of the GraphComponent has been removed. This event is rarely used, and it is raised only when the model instance changes, not when the selected item changes.

  • The EdgeIndicatorBendsRenderTag class has been removed and replaced by the IListEnumerable, which was previously available in its bends-property. The zoomPolicy property had no effect was therefore removed without replacement. The corresponding, now obsolete zoomPolicy enum has also been removed.

  • The enum value MouseWheelBehaviors.ONLY_WHEN_FOCUSED has been removed in favor of the new CanvasComponent.preventViewportInteraction property. Set it to the value PreventViewportInteractionPolicy.UNFOCUSED to achieve the old behavior with the additional improvement that it now not only prevents mouse wheel interactions but also touch and pen viewport gestures.

  • The generic IGridConstraintProvider interface has been removed, its usages have been replaced with the existing item-specific interfaces INodeGridConstraintProvider, IBendGridConstraintProvider, and IPortGridConstraintProvider. In addition, the unused ILabelGridConstraintProvider and ILabelOwnerGridConstraintProvider interfaces have been removed while, the GridConstraintProvider class is no longer generic and implements all remaining item-specific interfaces.

  • The StripeSelection class has been removed. Instead, use the instance returned by the TableEditorInputMode.stripeSelection property.

  • Removed ToolTipInputMode.onShow method. It is now part of ToolTipInputMode.open.

  • Removed ToolTipInputMode.onHide method. Instead, use the new closed event on PopoverDescriptor.

  • Removed ToolTipInputMode.hide method. Instead, use the ToolTipInputMode.close method or PopoverDescriptor.close.

  • Renamed ToolTipInputMode.Showing to ToolTipInputMode.isOpen and made it readonly now.

  • Removed ToolTipInputMode.getToolTipLocation method.

  • Removed ToolTipInputMode.getToolTipContent method.

  • Removed ToolTipInputMode.updateLocation method. The new popovers automatically detect resize events and reposition themselves according to their configured positioning properties.

  • Removed ToolTipInputMode.createToolTip method.

  • Removed the CoordinateAssigner.exactPlacement property. To keep coordinates as fix as possible, use hint IncrementalNodeHint.EXACT_COORDINATES or a hint created with the IncrementalNodeHint.createExactCoordinatesHint method. The old behavior forcing exact placement on the existing coordinate while even accepting severe violations of other constraints or illegal group overlaps is no longer available.

  • Removed the CoordinateAssigner.fromSketchLayerAssignment property. If there are nodes with exact-coordinate hints, their layer coordinates in the sketch are now always considered. Otherwise, the property had no effect, and the behavior has not changed.

  • Removed the CoordinateAssigner.bendReduction property. The number of bends is always optimized.

  • Removed the CoordinateAssigner.straightenEdges property. The replacement is the new CoordinateAssigner.maximumPortDeviation property. To get the old behavior for "true" use a large value on the new property, for "false", use zero.

  • Method MutablePoint.convertToPointD has been removed. Use the MutablePoint.toPoint method instead.

  • Method MutableRectangle.convertToRectD has been removed. Use the MutableRectangle.toRect method instead.

  • Method MutableSize.convertToSizeD has been removed. Use the MutableSize.toSize method instead.

  • The CanvasComponent.autoScrollPadding defaults have been increased from 10 to 20.

  • GraphML now uses a sentinel object GraphMLIOHandler.graphmlRoot instead of null if data for the toplevel document needs to be written or read.

  • The GraphComponent.fitGraphBounds method no longer adds an undocumented additional margin of 1 when no margins are specified as arguments.

  • When word-wrap is enabled, trailing and orphaned whitespace is trimmed before wrapping, which may change existing line breaks and reduce label width.

  • Method DropInputMode.adjustEffect no longer determines if the mode will handle drag or drop events but only change the drag/drop effect of given event args as its name implies. Method DropInputMode.acceptDrag now determines if the mode will handle drag and drop events.

  • Lowered the default delay when a tooltip is shown from 1s to 500ms. Use TooltTipInputMode.delay to set the previous value.

  • The tooltip container is now added to the CanvasComponent.overlayPanel instead of the document body. This can be adjusted with PopoverManager.defaultParentElement for all popovers or specifically through the PopoverDescriptor.parentElement property.

  • The default behavior when enabling the HierarchicalLayout.fromSketchMode property has been changed. Now, the given sketch (current coordinates) has a higher impact. Results are often closer to the sketch than previously. To get the old behavior where only the relative order of elements was preserved, specify hint IncrementalNodeHint.KEEP_RELATIVE_ORDER via layout data HierarchicalLayoutData.incrementalNodeHints property.

  • The BundledEdgeRouter now uses BundledEdgeRouterStrategy.SPANNER as the default strategy for significantly improved performance. To restore the previous behavior, set the BundledEdgeRouter.strategy property to BundledEdgeRouterStrategy.FORCE_DIRECTED. In addition, for strategy BundledEdgeRouterStrategy.FORCE_DIRECTED, the range of the EdgeBundling.bundlingStrength property is now better utilized. Previously, most bundling occurred only at very high values.