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.
Incompatible API Changes
-
The
IRenderContexthas a new methodsetConnectedCallback. Wrapping implementations should delegate the call to the wrapped context. -
IEnumerable.concatis 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-changedandGraphComponent.current-item-changednow use plainEventArgsinstead ofPropertyChangedEventArgs, since these events each affect only a single property. -
WebGLGroupNodeStyle.contentAreaPaddingis now of type Insets instead of a plain number. -
The return value of
DropInputMode.adjustEffectmethod 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.acceptDragmethod now determines if the mode will handle drag and drop events. -
The
CanvasComponent.lastInputEventproperty has been renamed tolastPointerEventto better reflect its type. In addition, theCanvasComponent.lastEventLocationhas been removed since thelocationproperty oflastPointerEventprovides the same value. -
The new
LassoRenderTagclass will be passed as render tag for the lasso path renderer of theLassoSelectionInputModeclass. -
The
ContextMenuInputModeinternally now uses thePopoverManagerto display the context-menu popover. ThecontextMenuParentElementproperty has been removed, instead usePopoverManager.ParentElement. -
The
EdgeLabelCandidates.addDiscreteCandidatesmethod usesDiscreteEdgeLabelPositionsenum to specify label positions. The valueCENTEREDwas removed from thisenum; use the existing valueCENTERinstead. -
The new
RadialGradient.radiusproperty replaces the propertiesradiusXandradiusY. This corresponds to the underlying SVG element <radialGradient>, which also has only a singlerattribute for the radius. Previously,radiusXwas used as the single radius and radiusY had no effect. -
The
IncrementalNodeHintmember is now a class and no longer an enum. The available hint values have been changed as follows:-
LAYER_INCREMENTALLYhas been replaced byINCREMENTAL. -
SEQUENCE_INCREMENTALLYhas been replaced byINCREMENTAL_WITH_LAYERS_FROM_SKETCH. -
NONEhas been replaced byKEEP_RELATIVE_ORDER. It is no longer the default value for nodes without a hint.
-
-
The IncrementalEdgeHint values have been changed as follows:
-
NONEhas been replaced byKEEP_RELATIVE_ORDER. -
SEQUENCE_INCREMENTALLYhas been replaced byINCREMENTAL.
-
Renamed API Members
-
Renamed
ToolTipInputMode.showtoToolTipInputMode.open. -
Moved and renamed
ToolTipInputMode.adjustTooltipPositionmethod toPopoverManager.getDocumentLimitedLocation. -
Moved and renamed
ToolTipInputMode.toolTipParentElementmethod toPopoverManager.defaultParentElementor the specificPopoverDescriptor.parentElement. -
Renamed
GroupBoundsCalculatortoLayoutGroupBoundsCalculatorto match the implementingILayoutGroupBoundsCalculatorinterface.
Removed API Members
-
The unused protected constructors of
SerializationNotSupportedExceptionandDeserializationNotSupportedExceptionhave been removed since they were based on an obsolete constructor of the base class. -
The
selection-model-changedevent of theGraphComponenthas been removed. This event is rarely used, and it is raised only when the model instance changes, not when the selected item changes. -
The
EdgeIndicatorBendsRenderTagclass has been removed and replaced by theIListEnumerable, which was previously available in its bends-property. ThezoomPolicyproperty had no effect was therefore removed without replacement. The corresponding, now obsoletezoomPolicyenum has also been removed. -
The
enumvalueMouseWheelBehaviors.ONLY_WHEN_FOCUSEDhas been removed in favor of the newCanvasComponent.preventViewportInteractionproperty. Set it to the valuePreventViewportInteractionPolicy.UNFOCUSEDto 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
IGridConstraintProviderinterface has been removed, its usages have been replaced with the existing item-specific interfacesINodeGridConstraintProvider,IBendGridConstraintProvider, andIPortGridConstraintProvider. In addition, the unusedILabelGridConstraintProviderandILabelOwnerGridConstraintProviderinterfaces have been removed while, theGridConstraintProviderclass is no longer generic and implements all remaining item-specific interfaces. -
The
StripeSelectionclass has been removed. Instead, use the instance returned by theTableEditorInputMode.stripeSelectionproperty. -
Removed
ToolTipInputMode.onShowmethod. It is now part ofToolTipInputMode.open. -
Removed
ToolTipInputMode.onHidemethod. Instead, use the new closed event onPopoverDescriptor. -
Removed
ToolTipInputMode.hidemethod. Instead, use theToolTipInputMode.closemethod orPopoverDescriptor.close. -
Renamed
ToolTipInputMode.ShowingtoToolTipInputMode.isOpenand made it readonly now. -
Removed
ToolTipInputMode.getToolTipLocationmethod. -
Removed
ToolTipInputMode.getToolTipContentmethod. -
Removed
ToolTipInputMode.updateLocationmethod. The new popovers automatically detect resize events and reposition themselves according to their configured positioning properties. -
Removed
ToolTipInputMode.createToolTipmethod. -
Removed the
CoordinateAssigner.exactPlacementproperty. To keep coordinates as fix as possible, use hintIncrementalNodeHint.EXACT_COORDINATESor a hint created with theIncrementalNodeHint.createExactCoordinatesHintmethod. 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.fromSketchLayerAssignmentproperty. 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.bendReductionproperty. The number of bends is always optimized. -
Removed the
CoordinateAssigner.straightenEdgesproperty. The replacement is the newCoordinateAssigner.maximumPortDeviationproperty. To get the old behavior for "true" use a large value on the new property, for "false", use zero. -
Method
MutablePoint.convertToPointDhas been removed. Use theMutablePoint.toPointmethod instead. -
Method
MutableRectangle.convertToRectDhas been removed. Use theMutableRectangle.toRectmethod instead. -
Method
MutableSize.convertToSizeDhas been removed. Use theMutableSize.toSizemethod instead.
Incompatible Behavior Changes
-
The
CanvasComponent.autoScrollPaddingdefaults have been increased from10to20. -
GraphML now uses a sentinel object
GraphMLIOHandler.graphmlRootinstead ofnullif data for the toplevel document needs to be written or read. -
The
GraphComponent.fitGraphBoundsmethod 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.adjustEffectno 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. MethodDropInputMode.acceptDragnow 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.delayto set the previous value. -
The tooltip container is now added to the
CanvasComponent.overlayPanelinstead of the document body. This can be adjusted withPopoverManager.defaultParentElementfor all popovers or specifically through thePopoverDescriptor.parentElementproperty. -
The default behavior when enabling the
HierarchicalLayout.fromSketchModeproperty 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 hintIncrementalNodeHint.KEEP_RELATIVE_ORDERvia layout dataHierarchicalLayoutData.incrementalNodeHintsproperty. -
The
BundledEdgeRouternow uses BundledEdgeRouterStrategy.SPANNER as the default strategy for significantly improved performance. To restore the previous behavior, set theBundledEdgeRouter.strategyproperty toBundledEdgeRouterStrategy.FORCE_DIRECTED. In addition, for strategyBundledEdgeRouterStrategy.FORCE_DIRECTED, the range of theEdgeBundling.bundlingStrengthproperty is now better utilized. Previously, most bundling occurred only at very high values.