documentationfor yFiles for HTML 2.6

Migrating to 2.1 from 2.0.1

See the change log for a list of all incompatible changes.

Changed Module Dependencies

The module yfiles/view-graphml no longer depends on yfiles/view-table and yfiles/view-editor. If you use the GraphML feature and the table or editor feature, make sure that you explicitly require the corresponding module(s).

Renamed API Members

Type Member name in 2.0.1 Member name in 2.1
Animatordestroystop
CanvasComponentglobalToLocaltoViewFromPage
CanvasComponentlocalToGlobaltoPageFromView
CanvasComponentmouseCaptureEnabledmouseCapture
SvgExportgetClipcreateClip
DiscreteEdgeLabelLayoutModelautoRotationEnabledautoRotation
EdgePathLabelModelautoRotationEnabledautoRotation
EdgeSegmentLabelModelautoRotationEnabledautoRotation
KeyEventTypePRESSEDDOWN
KeyEventTypeTYPEDPRESS
KeyEventTypeRELEASEDUP
KeyEventRecognizersDELETE_PRESSEDDELETE_DOWN
KeyEventRecognizersESCAPE_PRESSEDESCAPE_DOWN
KeyEventRecognizersESCAPE_TYPEDESCAPE_PRESS
KeyEventRecognizersESCAPE_RELEASEDESCAPE_UP
KeyEventRecognizersKEY_PRESSEDKEY_DOWN
KeyEventRecognizersKEY_TYPEDKEY_PRESS
KeyEventRecognizersKEY_RELEASEDKEY_UP
KeyEventRecognizersALT_PRESSEDALT_IS_DOWN
KeyEventRecognizersCONTROL_PRESSEDCTRL_IS_DOWN
KeyEventRecognizersSHIFT_PRESSEDSHIFT_IS_DOWN
KeyEventRecognizersMETA_PRESSEDMETA_IS_DOWN
LabelLayoutTranslatorautoFlippingEnabledautoFlipping
MouseEventRecognizersLEFT_PRESSEDLEFT_DOWN
MouseEventRecognizersRIGHT_PRESSEDRIGHT_DOWN
MouseEventRecognizersPRESSEDDOWN
MouseEventRecognizersLEFT_RELEASEDLEFT_UP
MouseEventRecognizersRIGHT_RELEASEDRIGHT_UP
MouseEventRecognizersRELEASEDUP
MouseEventRecognizersCLICKEDCLICK
MouseEventRecognizersDRAGGEDDRAG
MouseEventRecognizersENTEREDENTER
MouseEventRecognizersEXITEDLEAVE
MouseEventRecognizersLEFT_CLICKEDLEFT_CLICK
MouseEventRecognizersLEFT_DOUBLE_CLICKEDLEFT_DOUBLE_CLICK
MouseEventRecognizersLEFT_DRAGGEDLEFT_DRAG
MouseEventRecognizersMIDDLE_CLICKEDMIDDLE_CLICK
MouseEventRecognizersMIDDLE_DOUBLE_CLICKEDMIDDLE_DOUBLE_CLICK
MouseEventRecognizersMIDDLE_DRAGGEDMIDDLE_DRAG
MouseEventRecognizersMOVEDMOVE
MouseEventRecognizersMOVED_OR_DRAGGEDMOVE_OR_DRAG
MouseEventRecognizersMULTI_CLICKEDMULTI_CLICK
MouseEventRecognizersRIGHT_CLICKEDRIGHT_CLICK
MouseEventRecognizersRIGHT_DOUBLE_CLICKEDRIGHT_DOUBLE_CLICK
MouseEventRecognizersRIGHT_DRAGGEDRIGHT_DRAG
ReparentStripePositionHandlercreateSourceGhostVisualizationcreateSourceGhost
ReparentStripePositionHandlercreateTargetGhostVisualizationcreateTargetGhost
ReparentStripePositionHandlerupdateSourceVisualizationupdateSourceGhost
ReparentStripePositionHandlerupdateTargetVisualizationupdateTargetGhost
ReparentStripePositionHandlerupdateTargetVisualizationBoundsupdateTargetGhostBounds
ShowFocusPolicyWHEN_FOCUSEDONLY_WHEN_FOCUSED
SingleCycleLayoutfromSketchModeEnabledfromSketchMode
SliderEdgeLabelLayoutModelautoRotationEnabledautoRotation
TouchEventRecognizersTOUCH_DOUBLE_TAPPED_PRIMARYTOUCH_DOUBLE_TAP_PRIMARY
TouchEventRecognizersTOUCH_DOUBLE_TAPPED_SECONDARYTOUCH_DOUBLE_TAP_SECONDARY
TouchEventRecognizersTOUCH_ENTERED_PRIMARYTOUCH_ENTER_PRIMARY
TouchEventRecognizersTOUCH_ENTERED_SECONDARYTOUCH_ENTER_SECONDARY
TouchEventRecognizersTOUCH_EXITED_PRIMARYTOUCH_LEAVE_PRIMARY
TouchEventRecognizersTOUCH_EXITED_SECONDARYTOUCH_LEAVE_SECONDARY
TouchEventRecognizersTOUCH_LONG_PRESSED_PRIMARYTOUCH_LONG_PRESS_PRIMARY
TouchEventRecognizersTOUCH_LONG_PRESSED_SECONDARYTOUCH_LONG_PRESS_SECONDARY
TouchEventRecognizersTOUCH_MOVED_PRIMARYTOUCH_MOVE_PRIMARY
TouchEventRecognizersTOUCH_MOVED_SECONDARYTOUCH_MOVE_SECONDARY
TouchEventRecognizersTOUCH_MULTI_TAPPED_PRIMARYTOUCH_MULTI_TAP_PRIMARY
TouchEventRecognizersTOUCH_MULTI_TAPPED_SECONDARYTOUCH_MULTI_TAP_SECONDARY
TouchEventRecognizersTOUCH_TAPPED_PRIMARYTOUCH_TAP_PRIMARY
TouchEventRecognizersTOUCH_TAPPED_SECONDARYTOUCH_TAP_SECONDARY

All occurrences of cleanup have been consistently renamed to cleanUp in any API name.

The overloaded methods with the following signatures have been renamed to make overriding easier. The other overload with the same name is still part of the API.

  • CreateEdgeInputMode.getSourcePortCandidateProvider(IPortOwner) renamed to lookupSourcePortCandidateProvider
  • CreateEdgeInputMode.getTargetPortCandidateProvider(IPortCandidate, IPortOwner, Point) renamed to lookupTargetPortCandidateProvider
  • IPortCandidateProvider.getSourcePortCandidates(IInputModeContext) renamed to getAllSourcePortCandidates
  • IPortCandidateProvider.getTargetPortCandidates(IInputModeContext) renamed to getAllTargetPortCandidates
  • GraphClipboard.paste(IGraph, IGraphSelection) renamed to pasteAndSelect
  • GraphCopier.copyNode(IGraph, IGraph, INode, INode, Point) renamed to copyChildNode

Removed API Members

CanvasComponent.animateScrollTo method
Use the ZoomToAnimated methods instead.
CanvasComponent.GotFocus and LostFocus events
These just duplicated the focus and blur events on the CanvasComponent.div element. Use these events instead.
CanvasComponent.MouseWheelZoomFactorChanged, MouseWheelScrollFactorChanged, AutoDragChanged and HitTestRadiusChanged events
These events are unneeded since library code does not change the corresponding properties.
CollapsibleNodeStyleDecorator.createSelectionInstaller protected method
Use the NodeDecorator.selectionDecorator decorator instead.
GraphEditorInputMode.createMoveUnselectedInputMode method
Use the moveUnselectedInputMode property instead.
GraphEditorInputMode.shouldClickCreateNode protected method
Override the clickCreateNode method instead.
GraphMLSupport.getGraphMLIOHandler protected method
Use the graphMLIOHandler property instead.
GraphModelManager.useHierarchicEdgeNesting property
Use either HierarchicNestingPolicy.NODES_AND_EDGES to enable edge nesting or any other policy to disable it.
GraphModelManager.useHierarchicNodeNesting property
Use HierarchicNestingPolicy.NONE to disable node nesting and either HierarchicNestingPolicy.NODES or HierarchicNestingPolicy.NODES_AND_EDGES depending on your GraphModelManager.useHierarchicEdgeNesting setting to use nesting.
ITable.relativeLocation property
Use the ITable.insets with corresponding left and top values instead.
LayoutGraphAdapter.applyLayout static method
Use the IGraph.applyLayout method instead.
MoveLabelInputMode.createLabelHitTestable protected method
Set the MoveLabelInputMode.hitTestable property instead.
MoveViewportInputMode.inertiaDamping, MoveViewportInputMode.inertiaFactor and MoveViewportInputMode.inertiaThreshold properties
Use the new inertiaDuration property instead.
InteractiveOrganicLayout.workingRatio property
Had no usages.
TextDecorations enum
Was an unused duplicate of TextDecoration.
The overloaded methods with the following signatures have been removed to make overriding easier. The other overload with the same name is still part of the API and should be used instead.
  • CreateEdgeInputMode.createEdge()
  • CreateEdgeInputMode.getSourcePortCandidate(Point)
  • GraphClipboard.paste(IInputModeContext, IGraph, predicate, callback, predicate)
  • GraphClipboard.paste(IGraph, predicate, callback)
  • PortDefaults.getStyleInstance()

Deprecated API Members

HierarchicLayoutData.layerConstraintFactory property and method HierarchicLayout.createLayerConstraintFactory(IGraph)

Use the new layerConstraints property instead.

HierarchicLayoutData.sequenceConstraintFactory property and method HierarchicLayout.createSequenceConstraintFactory(IGraph)

Use the new sequenceConstraints property instead.

Other API Changes

  • The IEnumerable.reduce method now uses the same argument order and semantics as the default Array.prototype.reduce method. This means the initialValue parameter is now the (optional) last parameter, and the first element of the enumerable becomes the initialValue if that is undefined. Previously, these two parameters were reversed.
  • The return type of the TextRenderSupport.measureText method is now Rect instead of Size.
  • The CanvasComponent.sizeChangedTimerInterval property in now is a proper yfiles.lang.TimeSpan instead of a simple number.
  • CanvasComponent.dragSize no longer applies to touch input. Use the new property dragSizeTouch for controlling the drag size for touch input.
  • The CanvasComponent.hitTestRadius no longer applies to touch input. Use the new property hitTestRadiusTouch for controlling the hit test radius for touch input.
  • ClickInputMode now dispatches the more specific events LeftClicked, RightClicked, LeftDoubleClicked and RightDoubleClicked before the general Clicked and DoubleClicked events.
  • The stroke thickness is now considered for calculation of the origin of the default arrow renderings. This can result in a slightly different rendering of the arrows.
  • Moved AnchoredPortLocationModelExtension to the GraphML compatibility demo where it was really needed.
  • The CanvasClicked event now provides the GraphEditorInputMode or the GraphViewerInputMode as parent input mode in the Context property of its ClickEventArgs.
  • ItemClickedEventArgs now extends ClickEventArgs.
  • CreateEdgeInputMode’s `EdgeCreator might receive null as targetPortCandidate parameter. Callbacks must handle this case by either creating a target port of their own or canceling the edge creation by returning null.
  • The StripeSubregion.targetTableNode property is now read-only.
  • MoveLabelInputMode: the moved label now is visualized as a preview instead of a symbolic rectangle. Set the Visualization property to Visualization.Ghost to restore the old mode.
  • The CreateEdgeInputMode.ShowPortCandidates property has now the enum type ShowPortCandidates instead of boolean and allows for a more specific setting.
  • The OverviewInputMode.autoMouseWheelZoom property is superseded by the new mouseWheelBehavior property.
  • The following static methods were available in two different types, one intended and documented and one unintended and undocumented. The undocumented methods have been removed:
    • yfiles.graph.TableAnimation.createTableAnimation, use yfiles.view.IAnimation.createTableAnimation instead.
    • yfiles.graph.Table.getCellBounds, use yfiles.graph.ITable.getCellBounds instead.
    • yfiles.graph.Table.placeNodeInCell, use yfiles.graph.ITable.placeNodeInCell instead.
    • yfiles.layout.PartitionLayout.createPolylineInterEdgeRouter, use yfiles.layout.IPartitionInterEdgeRouter.createPolylineInterEdgeRouter instead.

TypeScript Definition File Changes

The TypeScript definition file now declares the modules of the ES module variant of the library instead of the UMD module variant. The ES Modules section of the Developer’s Guide gives an overview of the available modules.