Migrating to 2.2 from 2.1
The /tools/
directory in the yFiles for HTML package contains helpers that convert
your source code between various ways to import the yFiles library,
e.g., from UMD to ES module imports. We recommend running the umd-to-es-modules
tool after the automatic source code conversion tool for best results.
See the corresponding section for more information.
See the change log for a list of all incompatible changes.
License File Changes
Starting with 2.2, the license file is a simple JSON file instead of a UMD module. The format of the license data is still the same though. The demos also load the license from a new location: /lib/license.json
instead of /demos/resources/license.js
.
If you want to run the 2.2 demos with your 2.1 license, you can follow these steps:
- Open your 2.1 license.js file which should look like this:
(function(r){(function(f){if("function"==typeof define&&define.amd){define(['yfiles/lang'],function(lang){f(lang.yfiles);});}else{f(r.yfiles||(r.yfiles={}));}}(/*@yjs:keep*/ function(yfiles) { yfiles.license = { "company": "MyCompany", // ...[your license data here] } })); }("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this));
- Copy the actual license data (the value assigned to yfiles.license).
- Paste the data into a new file and save it to
[path to your {product} package]/lib/license.json
.
Renamed API Members
Type | Member name in 2.1 | Member name in 2.2 |
---|---|---|
Renamed API Members in ECMAScript Modules
These changes affect only the ES modules variant of the yFiles for HTML library, not the UMD variant.
Name in 2.1 | Name in 2.2 |
---|---|
Classes and enums in the layout part got the complete name of the corresponding layout style as a prefix to make the name both unique and clear.
Name in 2.1 | Name in 2.2 |
---|---|
Removed API Members
clone()
methods of all geometry classes:Size
,Point
,Insets
, andRect
.- Since the classes are immutable, these methods can be dropped without replacement.
- Class
SingleItemCollection
- This class was removed and replaced by the more general
ItemCollection
. YList.subList
- This method was neither implemented nor used by the library.
SnapLine
template keys andSnapLine.resourceKey
property- All
SnapLine
template keys except forSNAP_LINE_STROKE_KEY
were removed since the templates are hardcoded anyway. RadialLayoutData.sourceGroups
andRadialLayoutData.targetGroups
properties- The properties have been removed since edge grouping is not supported by the
RadialLayout
. DynamicObstacleDecomposition.getExistingCells
method- This method is considered private and should not be part of the public API.
SegmentInfoBase.edge
andEdgeCellInfo.edge
properties- Removed due to general automatic layout improvements and refactorings.
OrganicEdgeRouter.checkNodeSize
protected method- Removed due to general automatic layout improvements and refactorings.
PathSearchResult.getEdgeInfo(Path)
method- Removed due to general automatic layout improvements and refactorings.
Other API Changes
- The
GraphOverviewComponent.svgRendering
property is superseded by the newrenderMode
property that allows to choose between three render modes, namelySVG
,WEB_GL
andCANVAS
. - The
LayoutExecutor.improvePortAssignment
andLayoutGraphAdapter.improvePortAssignment
properties are replaced by the newportAdjustmentPolicy
property which allows for a more fine-grained control over the port locations. - The
IGraph.getPortLabels
method is by theportLabels
property to be more inline with the overall API. - The
getAccumulatedInsets
andgetDecorator
methods onITable
are replaced by the propertiesaccumulatedInsets
anddecorator
to be more inline with the overall API.